nomadro/apps/ebook/dymini/deploy/remote-setup-dymini.sh
eric d93a355fd5 Migrate navmini/ebook/nomadweb into apps/ as same-origin portal subpaths.
Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 03:30:34 -05:00

39 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
REMOTE=/opt/dymini
cd "$REMOTE"
sed -i 's/\r$//' deploy/*.sh 2>/dev/null || true
python3 -m venv backend/.venv
backend/.venv/bin/pip install -U pip
backend/.venv/bin/pip install -r backend/requirements.txt
sudo mkdir -p /www/wwwroot/dyapi.nomadro.cn /www/wwwroot/dyadmin.nomadro.cn
sudo mkdir -p /www/wwwlogs
sudo rsync -a --delete admin/dist/ /www/wwwroot/dyadmin.nomadro.cn/
echo ok | sudo tee /www/wwwroot/dyapi.nomadro.cn/index.html >/dev/null
if id www >/dev/null 2>&1; then
sudo chown -R www:www /www/wwwroot/dyapi.nomadro.cn /www/wwwroot/dyadmin.nomadro.cn || true
elif id www-data >/dev/null 2>&1; then
sudo chown -R www-data:www-data /www/wwwroot/dyapi.nomadro.cn /www/wwwroot/dyadmin.nomadro.cn || true
fi
PANEL_DIR="/www/server/panel/vhost/nginx"
# 只部署 dyapi / dyadmin,绝不覆盖已有 dy.nomadro.cn
for f in dyapi.nomadro.cn.conf dyadmin.nomadro.cn.conf; do
if sudo test -f "$PANEL_DIR/$f"; then
sudo cp "$PANEL_DIR/$f" "$PANEL_DIR/${f}.bak.dymini.$(date +%s)"
fi
sudo cp "deploy/$f" "$PANEL_DIR/$f"
done
sudo cp deploy/dymini-api.service /etc/systemd/system/dymini-api.service
sudo systemctl daemon-reload
sudo systemctl enable dymini-api
sudo systemctl restart dymini-api
sleep 2
curl -s http://127.0.0.1:8011/health || true
echo
echo "dymini remote-setup done"