Add Synology NAS setup instructions to README

This commit is contained in:
Khoa.vo 2026-04-19 08:37:11 +07:00
parent 4f57e42d26
commit a5a0d4e929

127
README.md
View file

@ -117,12 +117,137 @@ We had to heavily customize the authentication system and write several custom s
```bash ```bash
git clone https://github.com/monochrome-music/monochrome.git git clone https://github.com/monochrome-music/monochrome.git
cd monochrome cd monochrome/docker
cp .env.example .env # or copy from .env.local
docker compose up -d docker compose up -d
``` ```
Visit `http://localhost:3000` Visit `http://localhost:3000`
---
### Synology NAS Setup
This guide covers running Monochrome on a Synology NAS using Docker.
#### Prerequisites
- Docker Package installed on your Synology
- SSH access to your NAS (optional, for troubleshooting)
#### Step 1: Prepare Directories
1. Create a shared folder for Monochrome (e.g., `docker/monochrome`)
2. Upload the project files to this folder, or clone directly via SSH:
```bash
cd /volume1/docker/monochrome
git clone https://github.com/monochrome-music/monochrome.git .
```
#### Step 2: Configure Environment
1. Navigate to the `docker` folder
2. Copy the `.env` file (or create from `.env.local`):
```bash
cd docker
cp .env.local .env
```
3. Edit `.env` with your settings:
```bash
# Port for the web interface
MONOCHROME_PORT=3000
# Enable authentication (set to true to require login)
AUTH_ENABLED=false
# Secret key - generate with: openssl rand -base64 32
AUTH_SECRET=your-random-secret-key-here
# PocketBase URL (internal Docker network)
POCKETBASE_URL=http://pocketbase:8090
# Session duration (7 days in milliseconds)
SESSION_MAX_AGE=604800000
# PocketBase Admin credentials
PB_ADMIN_EMAIL=admin@monochrome.local
PB_ADMIN_PASSWORD=your-secure-password
TZ=Asia/Ho_Chi_Minh # Adjust to your timezone
POCKETBASE_PORT=8090
```
#### Step 3: Start the Container
Using SSH or the Docker UI:
```bash
cd /volume1/docker/monochrome/docker
docker compose up -d
```
Or in Docker Desktop / Container Manager:
1. Navigate to your project folder
2. Select `docker-compose.yml`
3. Click "Run"
#### Step 4: Access the Application
- **Local:** `http://<your-nas-ip>:3000`
- **External:** Set up Synology Reverse Proxy (see below)
#### Optional: Set Up Reverse Proxy (HTTPS)
1. Go to **Control Panel > Application Portal > Reverse Proxy**
2. Click **Create**
3. Configure:
- **Source:**
- Protocol: HTTPS
- Hostname: `monochrome.yourdomain.com` (your domain)
- Port: 443
- **Destination:**
- Protocol: HTTP
- Hostname: `localhost`
- Port: 3000
4. Save and access via `https://monochrome.yourdomain.com`
#### Optional: Enable User Authentication
1. Edit `.env`:
```bash
AUTH_ENABLED=true
```
2. Restart the container:
```bash
docker compose down && docker compose up -d
```
#### Common Commands
```bash
# View logs
docker compose logs -f
# Restart
docker compose restart
# Update & rebuild
docker compose pull && docker compose up -d --build
# Stop
docker compose down
# Stop and remove data (WARNING: loses all user data)
docker compose down -v
# Backup PocketBase data
docker compose exec pocketbase tar czf - /pb_data > ../backup_monochrome.tar.gz
# Restore PocketBase data
docker compose exec pocketbase tar xzf - -C / < ../backup_monochrome.tar.gz
```
### Tailscale Access ### Tailscale Access
Visit `http://<tailscale_server_hostname_or_ip>:3000` Visit `http://<tailscale_server_hostname_or_ip>:3000`