mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	updated docs formatting and windows from source update guide
This commit is contained in:
		@@ -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`
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,10 +61,10 @@ Open Terminal (if you're on an installation with a window manager) and navigate
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
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`
 | 
				
			||||||
@@ -75,7 +75,7 @@ Open Terminal (if you're on an installation with a window manager) and navigate
 | 
				
			|||||||
    - `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
 | 
				
			||||||
@@ -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
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user