This folder contains everything needed to deploy MSK Paste on a Debian / Ubuntu server with Apache2 as the reverse proxy.
| File | Purpose |
|---|---|
scripts/install.sh |
One-shot server setup (run once) |
scripts/update.sh |
Manual update fallback (info only) |
scripts/backup.sh |
gzip MariaDB dump with 14-day retention |
apache/msk-paste.conf |
Reference vhost (generated by install.sh) |
../msk-paste.service |
systemd unit (deployed via SCP) |
curl -fsSL https://raw.githubusercontent.com/MSK-Scripts/msk-paste/main/deployment/scripts/install.sh \
| sudo bashThe script will ask for:
- the domain (default
paste.msk-scripts.de) - your Let's Encrypt email
- whether to request the certificate now
…and produces:
- a
musiker15-owned/opt/msk-paste/directory - a chmod-600
/opt/msk-paste/.envwith randomDB_PASSWORDandIP_HASH_SECRET - an Apache vhost at
/etc/apache2/sites-available/msk-paste.conf - an SSL certificate (if you confirmed Certbot)
Pushes to main trigger .github/workflows/deploy.yml:
- Build the Next.js app in CI
- SCP
.next/,public/,src/,migrations/,messages/,scripts/,package.json,package-lock.json,next.config.ts,tsconfig.json,msk-paste.serviceto/opt/msk-paste/ systemctl stop msk-pastenpm ci --omit=dev && npm install --no-save tsxnpm run migratesystemctl daemon-reload && systemctl restart msk-paste
Required GitHub Secrets:
| Secret | Value |
|---|---|
FTP_SERVER |
server IP or hostname |
FTP_USERNAME |
root |
FTP_PORT |
22 (or your custom SSH port) |
SSH_PRIVATE_KEY |
private key matching ~/.ssh/authorized_keys |
NEXT_PUBLIC_BASE_URL |
https://paste.msk-scripts.de |
# Service status
systemctl status msk-paste
journalctl -u msk-paste -f
# Database backup (kept for 14 days)
sudo bash /opt/msk-paste/deployment/scripts/backup.sh
# Cron: backup + cleanup
0 3 * * * /opt/msk-paste/deployment/scripts/backup.sh
30 3 * * * cd /opt/msk-paste && /usr/bin/npx tsx scripts/cleanup.ts >> /var/log/msk-paste-cleanup.log 2>&1- App returns 502 → check
journalctl -u msk-paste -e. Most often this isDB_HOST/credentials in/opt/msk-paste/.env. - CSS missing → ensure
chown -R musiker15:musiker15 /opt/msk-paste/and that.next/is writable. - Migration failed in deploy → run
npm run migrateon the server manually as the deploy user (or as root with the right env loaded).