Co-authored-by: Cursor <cursoragent@cursor.com>
6.3 KiB
Deploying Stoat Role Bot on a UGREEN DXP4800 Plus NAS
The DXP4800 Plus runs UGOS Pro and supports Docker. Below are two ways to run the bot.
Option A: SSH + Docker Compose (recommended if SSH is enabled)
If your NAS has SSH and Docker (and optionally Docker Compose) enabled:
-
Copy the project to the NAS
- Use SMB/CIFS: copy the whole
Role Botfolder to a share (e.g.DockerorContainers). - Or from your PC with SSH:
scp -r "/path/to/Role Bot" admin@<NAS_IP>:~/stoat-role-bot
- Use SMB/CIFS: copy the whole
-
SSH into the NAS
ssh admin@<NAS_IP> cd ~/stoat-role-bot # or the path where you copied the project -
Ensure
.envand config exist.envwithSTOAT_BOT_TOKEN=...(and optionalPREFIX=!)config/roles.json(copy fromconfig/roles.json.exampleand edit server ID / message ID)
-
Run with Docker
- If Docker Compose is installed:
docker compose up -d - If only Docker is available, build and run manually:
docker build -t stoat-role-bot . docker run -d --name stoat-role-bot --restart unless-stopped \ -e STOAT_BOT_TOKEN="$(grep STOAT_BOT_TOKEN .env | cut -d= -f2)" \ -e PREFIX=! \ -v "$(pwd)/config:/app/config:rw" \ stoat-role-bot
- If Docker Compose is installed:
-
Check logs
docker logs -f stoat-role-bot
Option B: NAS App Center / Docker UI (no SSH)
If you manage containers only through the UGREEN web UI (App Center / Docker):
Step 1: Build the image on your PC, then transfer
On your PC (where you have the project):
cd "/path/to/Role Bot"
docker build -t stoat-role-bot:latest .
docker save stoat-role-bot:latest -o stoat-role-bot.tar
Copy stoat-role-bot.tar to a shared folder on the NAS (e.g. via SMB).
Step 2: Load image and create container on the NAS
-
In UGOS Pro, open App Center (or Container / Docker).
-
Load the image:
- Look for “Import image” / “Load image” and select
stoat-role-bot.tarfrom the share.
- Look for “Import image” / “Load image” and select
-
Create a container from that image:
- Name: e.g.
stoat-role-bot - Restart policy: “Unless stopped” or “Always”
- Environment variables (add each):
STOAT_BOT_TOKEN=your_bot_token_from_env_filePREFIX=!CONFIG_PATH=/app/config
- Volume / bind mount:
- Host path: a folder where you will put
roles.json(e.g./share/Containers/stoat-role-bot/configor a path shown in the UI). - Container path:
/app/config
- Host path: a folder where you will put
- No port mapping is needed (bot only makes outbound connections).
- Name: e.g.
-
Put your config on the NAS:
- In that host path, create
roles.json(copy fromroles.json.exampleand set your server ID and message ID).
- In that host path, create
-
Start the container.
Option C: Use a pre-built image (if you publish to Docker Hub)
If you push the image to Docker Hub (or another registry the NAS can use):
- On your PC:
docker build -t YOUR_USERNAME/stoat-role-bot:latest . docker push YOUR_USERNAME/stoat-role-bot:latest - On the NAS (SSH or App Center): create a container from image
YOUR_USERNAME/stoat-role-bot:latestwith the same env vars and volume as in Option B.
Then the NAS only needs to pull the image; no build on the NAS.
Option D: Pull from Gitea Container Registry (recommended)
The repo’s Gitea Actions build the image and push it to the Gitea registry. Use this image on your NAS so you always run the latest build.
Image: brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest
(Registry image names are lowercase; use dawnsorrow.)
On the NAS (so the image appears in your Docker app)
-
Add the registry as insecure (HTTP)
If your Gitea is HTTP (no HTTPS), Docker must allow this registry:- In UGOS Pro: find Docker/Container settings (sometimes under “Registry” or “Docker daemon”) and add
brassnet.ddns.net:33983to insecure registries. - Or via SSH, edit Docker daemon config to include:
"insecure-registries": ["brassnet.ddns.net:33983"] - Restart Docker (or the NAS) if required.
- In UGOS Pro: find Docker/Container settings (sometimes under “Registry” or “Docker daemon”) and add
-
Log in to the registry (so pull works)
- In the Docker / App Center UI: look for “Registry” or “Login” and add:
- Registry:
brassnet.ddns.net:33983 - Username: your Gitea username (e.g.
Dawnsorrow) - Password: your Gitea password (or a token with package read)
- Registry:
- Or via SSH:
Use your Gitea username and password when prompted.
docker login brassnet.ddns.net:33983
- In the Docker / App Center UI: look for “Registry” or “Login” and add:
-
Pull the image
- In the UI: use “Pull image” (or similar) and enter:
brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest - Or via SSH:
docker pull brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latest
- In the UI: use “Pull image” (or similar) and enter:
-
Create and run the container
Same as Option B: create a container from the image above with:- Name: e.g.
stoat-role-bot - Restart: Unless stopped
- Environment:
STOAT_BOT_TOKEN,PREFIX=!,CONFIG_PATH=/app/config - Volume: host folder with
roles.json→/app/config
- Name: e.g.
-
Updates
To get the newest version: pull again (docker pull brassnet.ddns.net:33983/dawnsorrow/stoat-role-bot:latestor “Pull” in the UI), then recreate or restart the container.
Notes for UGREEN NAS
- Networking: This bot only needs outbound HTTPS/WebSocket to Stoat/Revolt. No inbound ports or port mapping are required.
- Reboots: Use restart policy “Unless stopped” so the bot starts again after a NAS reboot.
- Config backup: Back up the
configfolder (and.envif you keep it on the NAS) so you don’t lose roles configuration. - UGOS / Docker issues: If the NAS Docker stack has known issues, prefer building and running via SSH (Option A) or using a pre-built image (Option C) so the NAS doesn’t have to build the image.
Quick checklist
- Project (or image) on the NAS
.envwithSTOAT_BOT_TOKEN(or env vars set in the container)config/roles.jsonwith your server ID and reaction-role message ID- Volume mapping: host
config→/app/config - Container set to restart unless stopped
- Logs show “Logged in as …” and no errors