updated docs formatting and windows from source update guide

This commit is contained in:
Kwoth
2021-09-17 19:02:18 +02:00
parent 4a50c30c56
commit 76ebb87fb5
3 changed files with 88 additions and 41 deletions

View File

@@ -1,3 +1,35 @@
# Setting up NadekoBot with Docker # Setting up NadekoBot with Docker
Soon:tm: # DO NOT USE YET - WORK IN PROGRESS
Upgrade from 2.x to v3 does not work because the file is mount readonly
### Docker Compose
```yml
version: "3.7"
services:
nadeko:
image: registry.gitlab.com/veovis/nadekobot:v3-docker
depends_on:
- redis
environment:
TZ: Europe/Paris
#NadekoBot_RedisOptions: redis,name=nadeko
#NadekoBot_ShardRunCommand: dotnet
#NadekoBot_ShardRunArguments: /app/NadekoBot.dll {0} {1}
volumes:
- /srv/nadeko/conf/creds.yml:/app/creds.yml:ro
- /srv/nadeko/data:/app/data
redis:
image: redis:4-alpine
sysctls:
- net.core.somaxconn=511
command: redis-server --maxmemory 32M --maxmemory-policy volatile-lru
volumes:
- /srv/nadeko/redis-data:/data
```
### Updating
- `cd /srv/nadeko`
- `docker-compose pull`
- `docker-compose up -d`

View File

@@ -16,12 +16,12 @@ Open Terminal (if you're on an installation with a window manager) and navigate
4. Exit the installer in order to set up your `creds.yml` 4. Exit the installer in order to set up your `creds.yml`
5. Copy the creds.yml template `cp nadekobot/output/creds_example.yml nadekobot/output/creds.yml` 5. Copy the creds.yml template `cp nadekobot/output/creds_example.yml nadekobot/output/creds.yml`
6. Open `nadekobot/output/creds.yml` with your favorite text editor. We will use nano here 6. Open `nadekobot/output/creds.yml` with your favorite text editor. We will use nano here
- `nano nadekobot/output/creds.yml` - `nano nadekobot/output/creds.yml`
7. [Enter your bot's token](../../creds-guide) 7. [Enter your bot's token](../../creds-guide)
- After you're done, you can close nano (and save the file) by inputting, in order - After you're done, you can close nano (and save the file) by inputting, in order
- `CTRL` + `X` - `CTRL` + `X`
- `Y` - `Y`
- `Enter` - `Enter`
8. Run the bot (type `3` and press enter) 8. Run the bot (type `3` and press enter)
##### Update Instructions ##### Update Instructions
@@ -37,51 +37,51 @@ Open Terminal (if you're on an installation with a window manager) and navigate
##### Installation Instructions ##### Installation Instructions
1. Download the latest release from <https://gitlab.com/Kwoth/nadekobot/-/releases> 1. Download the latest release from <https://gitlab.com/Kwoth/nadekobot/-/releases>
- Look for the file called "X.XX.X-linux-x64-build.tar" (where X.XX.X is a series of numbers) and download it - Look for the file called "X.XX.X-linux-x64-build.tar" (where X.XX.X is a series of numbers) and download it
2. Untar it 2. Untar it
- ⚠ Make sure that you change X.XX.X to the same series of numbers as in step 1! - ⚠ Make sure that you change X.XX.X to the same series of numbers as in step 1!
- `tar xf X.XX.X-linux-x64-build.tar` - `tar xf X.XX.X-linux-x64-build.tar`
3. Rename the `nadekobot-linux-x64` to `nadekobot` 3. Rename the `nadekobot-linux-x64` to `nadekobot`
- `mv nadekobot-linux-x64 nadekobot` - `mv nadekobot-linux-x64 nadekobot`
4. Move into nadekobot directory and make NadekoBot executable 4. Move into nadekobot directory and make NadekoBot executable
- `cd nadekobot && chmod +x NadekoBot` - `cd nadekobot && chmod +x NadekoBot`
5. Copy the creds.yml template 5. Copy the creds.yml template
- `cp creds_example.yml creds.yml` - `cp creds_example.yml creds.yml`
6. Open `creds.yml` with your favorite text editor. We will use nano here 6. Open `creds.yml` with your favorite text editor. We will use nano here
- `nano nadekobot/output/creds.yml` - `nano nadekobot/output/creds.yml`
8. [Enter your bot's token](#creds-guide) 8. [Enter your bot's token](#creds-guide)
- After you're done, you can close nano (and save the file) by inputting, in order - After you're done, you can close nano (and save the file) by inputting, in order
- `CTRL` + `X` - `CTRL` + `X`
- `Y` - `Y`
- `Enter` - `Enter`
9. Run the bot 9. Run the bot
- `./NadekoBot` - `./NadekoBot`
##### Update Instructions ##### Update Instructions
1. Stop the bot 1. Stop the bot
2. Download the latest release from <https://gitlab.com/Kwoth/nadekobot/-/releases> 2. Download the latest release from <https://gitlab.com/Kwoth/nadekobot/-/releases>
- Look for the file called "X.XX.X-linux-x64-build.tar" (where X.XX.X is a series of numbers) and download it - Look for the file called "x.x.x-linux-x64-build.tar" (where `X.X.X` is a version, for example 3.0.4) and download it
3. Untar it 3. Untar it
- ⚠ Make sure that you change X.XX.X to the same series of numbers as in step 2! - ⚠ Make sure that you change `X.X.X` to the same series of numbers as in step 2!
- `tar xf 2.99.8-linux-x64-build.tar` - `tar xf x.x.x-linux-x64-build.tar`
4. Rename the old nadekobot directory to nadekobot-old (remove your old backup first if you have one, or back it up under a different name) 4. Rename the old nadekobot directory to nadekobot-old (remove your old backup first if you have one, or back it up under a different name)
- `rm -rf nadekobot-old 2>/dev/null` - `rm -rf nadekobot-old 2>/dev/null`
- `mv nadekobot nadekobot-old` - `mv nadekobot nadekobot-old`
5. Rename the new nadekobot directory to nadekobot 5. Rename the new nadekobot directory to nadekobot
- `mv nadekobot-linux-x64 nadekobot` - `mv nadekobot-linux-x64 nadekobot`
6. Remove old strings and aliases to avoid overwriting the updated versions of those files 6. Remove old strings and aliases to avoid overwriting the updated versions of those files
- ⚠ If you've modified said files, back them up instead - ⚠ If you've modified said files, back them up instead
- `rm nadekobot-old/data/aliases.yml` - `rm nadekobot-old/data/aliases.yml`
- `rm -r nadekobot-old/data/strings` - `rm -r nadekobot-old/data/strings`
7. Copy old data 7. Copy old data
- `cp -RT nadekobot-old/data/ nadekobot/data/` - `cp -RT nadekobot-old/data/ nadekobot/data`
8. Copy creds.yml 8. Copy creds.yml
- `cp nadekobot-old/creds.yml nadekobot/` - `cp nadekobot-old/creds.yml nadekobot/`
9. Move into nadekobot directory and make the NadekoBot executable 9. Move into nadekobot directory and make the NadekoBot executable
- `cd nadekobot && chmod +x NadekoBot` - `cd nadekobot && chmod +x NadekoBot`
10. Run the bot 10. Run the bot
- `./NadekoBot` - `./NadekoBot`
🎉 Enjoy 🎉 Enjoy
@@ -95,7 +95,7 @@ mv nadekobot nadekobot-old && \
mv nadekobot-linux-x64 nadekobot && \ mv nadekobot-linux-x64 nadekobot && \
rm nadekobot-old/data/aliases.yml && \ rm nadekobot-old/data/aliases.yml && \
rm -r nadekobot-old/data/strings && \ rm -r nadekobot-old/data/strings && \
cp -RT nadekobot-old/data/ nadekobot/data/ && \ cp -RT nadekobot-old/data/ nadekobot/data && \
cp nadekobot-old/creds.yml nadekobot/ && \ cp nadekobot-old/creds.yml nadekobot/ && \
cd nadekobot && chmod +x NadekoBot cd nadekobot && chmod +x NadekoBot
``` ```

View File

@@ -80,6 +80,7 @@ You can still install them manually:
Open PowerShell (press windows button on your keyboard and type powershell, it should show up; alternatively, right click the start menu and select Windows PowerShell), and navigate to the location where you want to install the bot (for example `cd ~/Desktop/`) Open PowerShell (press windows button on your keyboard and type powershell, it should show up; alternatively, right click the start menu and select Windows PowerShell), and navigate to the location where you want to install the bot (for example `cd ~/Desktop/`)
1. `git clone https://gitlab.com/kwoth/nadekobot -b v3 --depth 1` 1. `git clone https://gitlab.com/kwoth/nadekobot -b v3 --depth 1`
2. `cd nadekobot`
3. `dotnet publish -c Release -o output/ src/NadekoBot/` 3. `dotnet publish -c Release -o output/ src/NadekoBot/`
4. `cd output && cp creds_example.yml creds.yml` 4. `cd output && cp creds_example.yml creds.yml`
5. Open `creds.yml` with your favorite text editor (Please don't use Notepad or WordPad. You can use Notepad++, VSCode, Atom, Sublime, or something similar) 5. Open `creds.yml` with your favorite text editor (Please don't use Notepad or WordPad. You can use Notepad++, VSCode, Atom, Sublime, or something similar)
@@ -91,16 +92,30 @@ Open PowerShell (press windows button on your keyboard and type powershell, it s
Open PowerShell as described above and run the following commands: Open PowerShell as described above and run the following commands:
1. Navigate to your bot's folder, for example `cd ~/Desktop/nadekobot/src/NadekoBot` 1. Stop the bot
2. Pull the latest updates (this will fail if you have custom code changes). - ⚠️ Make sure you don't have your database, credentials or any other nadekobot folder open in some application, this might prevent some of the steps from executing succesfully
- If you don't have custom code changes, just run `git pull` 2. Navigate to your bot's folder, example:
- If you do have custom code changes, You have 3 options - `cd ~/Desktop/nadekobot`
- Undo all changes with `git checkout -- * && git pull` 3. Pull the new version
- Stash changes and try to re-apply them `git stash && git pull && git stash apply` - `git pull`
- Commit your changes and resolve merge conflicts `git add . && git commit -m "My commit message" && git pull` - ⚠️ If this fails, you may want to stash or remove your code changes if you don't know how to resolve merge conflicts
3. Re-run the bot `dotnet run -c Release` 4. **Backup** old output in case your data is overwritten
- `cp -r -fo output/ output-old`
5. Build the bot again
- `dotnet publish -c Release -o output/ src/NadekoBot/`
6. Remove old strings and aliases to avoid overwriting the updated versions of those files
- ⚠ If you've modified said files, back them up instead
- `rm output-old/data/aliases.yml`
- `rm -r output-old/data/strings`
7. Copy old data
- `cp -Recurse .\output-old\data\ .\output\ -Force`
8. Copy creds.yml
- `cp output-old/creds.yml output/`
9. Run the bot
- `cd output`
- `dotnet NadekoBot.dll`
⚠ You're expected to understand that your database will be in `bin/Release/<framework>/data/`, and if `<framework>` gets changed in the future, you will have to move your database manually. 🎉 Enjoy
#### Music prerequisites #### Music prerequisites
In order to use music commands, you need ffmpeg and youtube-dl installed. In order to use music commands, you need ffmpeg and youtube-dl installed.