Skip to content

Instantly share code, notes, and snippets.

@Neodevils
Last active June 8, 2025 15:40

Revisions

  1. Neodevils revised this gist Jun 8, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion startup.sh
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ if [ -d "/home/container/kaeru" ]; then

    else
    echo "Kaeru dizini bulunamadı, repo'yu çekiyoruz..."
    git clone https://github.com/minesa-time/kaeru /home/container/kaeru
    git clone https://github.com/minesa-org/kaeru /home/container/kaeru
    fi

    # Bağımlılıkları yükle (package.json dosyası /home/container/kaeru içinde bulunuyor)
  2. Neodevils revised this gist Mar 23, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions startup.sh
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,8 @@ if [ -d "/home/container/kaeru" ]; then
    fi

    # Reset yapıp güncellemeleri çek
    git reset --hard origin/main
    git pull origin main --force
    git reset --hard origin/master
    git pull origin master --force

    # Eğer yedek .env dosyası varsa, geri yükle
    if [ -f "../.env_backup" ]; then
  3. Neodevils revised this gist Mar 18, 2025. 2 changed files with 48 additions and 35 deletions.
    35 changes: 0 additions & 35 deletions file-from-daki-messages.md
    Original file line number Diff line number Diff line change
    @@ -1,35 +0,0 @@
    *Step 0. If you have a private repository*

    > First create a personal access token as instructed on https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
    >
    > Skip step 1, go to 2, remove `#` from all the lines except first one and fill your details.
    *Step 1. Cloning your repository.*

    > Set your startup command 1 to `git clone https://github.com/awesumperson/bot` (change the URL to the URL of your repo) in Daki panel settings, then run the bot. This should clone your repository into a folder inside your Daki container, which you should be then able to see inside Daki file manager.
    >
    > Make sure to remove the `git clone` from your startup command 1 once you have successfully cloned your repository into a folder on daki, one clone should suffice forever. To update your repository, read part 2.
    *Step 2. Updating your repository.*

    > To update your repository, you need to fetch and pull inside it's folder.
    >
    > You can add to your startup script/create a startup script at `/home/container/startup.sh`, so that every time you start your bot it fetches and pulls.
    >
    > Inside `/home/container/startup.sh`:
    > ```sh
    > #! /bin/bash
    > #git config --global user.name "usename"
    > #git config --global user.password "access token"
    > #git clone https://github.com/awesumperson/bot
    > cd bot
    > git fetch
    > git pull
    > node run_bot.js
    > ```
    >
    > Replace `bot` with whatever your bot repo folder is named (the one you got from git cloning) and `node run_bot.js` with whatever command you use to start your bot.
    >
    > If your script is named `startup.sh` and it is in `/home/container`, simply specify `sh startup.sh` in startup command 1 to execute it when your bot is started.
    >
    > If you adjust this script according to your requirements while keeping the fetch and pull lines, your copy of the repo on daki will be updated every restart.
    48 changes: 48 additions & 0 deletions startup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    #!/bin/bash
    # Hata alırsa durdur
    set -e

    # Eğer kaeru dizini varsa, .env dosyasını yedekle ve güncelle; yoksa, repo'yu klonla
    if [ -d "/home/container/kaeru" ]; then
    echo "Kaeru dizini bulundu, güncellemeleri çekiyoruz..."
    cd /home/container/kaeru

    # .env dosyası varsa yedekle
    if [ -f ".env" ]; then
    echo ".env dosyası bulundu, yedekliyoruz..."
    cp .env ../.env_backup
    fi

    # Reset yapıp güncellemeleri çek
    git reset --hard origin/main
    git pull origin main --force

    # Eğer yedek .env dosyası varsa, geri yükle
    if [ -f "../.env_backup" ]; then
    echo ".env dosyası yedekten geri yükleniyor..."
    mv ../.env_backup .env
    fi

    else
    echo "Kaeru dizini bulunamadı, repo'yu çekiyoruz..."
    git clone https://github.com/minesa-time/kaeru /home/container/kaeru
    fi

    # Bağımlılıkları yükle (package.json dosyası /home/container/kaeru içinde bulunuyor)
    cd /home/container/kaeru
    npm install --force

    # Çalışan eski instance varsa öldür
    pkill -f "npm run dev" || true

    # node_modules dizini varsa dev modunda, yoksa start modunda başlat
    if [ -d "/home/container/kaeru/node_modules" ]; then
    echo "node_modules dizini bulundu, dev modunda başlatıyoruz..."
    cd /home/container/kaeru/src && npm run dev || echo "Bot çalıştırılamadı!"
    else
    echo "node_modules dizini bulunamadı, start modunda başlatıyoruz..."
    cd /home/container/kaeru/src && npm run start || echo "Bot çalıştırılamadı!"
    fi

    # Konsolu açık tut
    tail -f /dev/null
  4. İbrahim revised this gist Nov 13, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion file-from-daki-messages.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@
    > You can add to your startup script/create a startup script at `/home/container/startup.sh`, so that every time you start your bot it fetches and pulls.
    >
    > Inside `/home/container/startup.sh`:
    > ```
    > ```sh
    > #! /bin/bash
    > #git config --global user.name "usename"
    > #git config --global user.password "access token"
  5. İbrahim created this gist Nov 13, 2023.
    35 changes: 35 additions & 0 deletions file-from-daki-messages.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    *Step 0. If you have a private repository*

    > First create a personal access token as instructed on https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
    >
    > Skip step 1, go to 2, remove `#` from all the lines except first one and fill your details.
    *Step 1. Cloning your repository.*

    > Set your startup command 1 to `git clone https://github.com/awesumperson/bot` (change the URL to the URL of your repo) in Daki panel settings, then run the bot. This should clone your repository into a folder inside your Daki container, which you should be then able to see inside Daki file manager.
    >
    > Make sure to remove the `git clone` from your startup command 1 once you have successfully cloned your repository into a folder on daki, one clone should suffice forever. To update your repository, read part 2.
    *Step 2. Updating your repository.*

    > To update your repository, you need to fetch and pull inside it's folder.
    >
    > You can add to your startup script/create a startup script at `/home/container/startup.sh`, so that every time you start your bot it fetches and pulls.
    >
    > Inside `/home/container/startup.sh`:
    > ```
    > #! /bin/bash
    > #git config --global user.name "usename"
    > #git config --global user.password "access token"
    > #git clone https://github.com/awesumperson/bot
    > cd bot
    > git fetch
    > git pull
    > node run_bot.js
    > ```
    > ‎
    > Replace `bot` with whatever your bot repo folder is named (the one you got from git cloning) and `node run_bot.js` with whatever command you use to start your bot.
    > ‎
    > If your script is named `startup.sh` and it is in `/home/container`, simply specify `sh startup.sh` in startup command 1 to execute it when your bot is started.
    > ‎
    > If you adjust this script according to your requirements while keeping the fetch and pull lines, your copy of the repo on daki will be updated every restart.