Private
Public Access
Rename project from KeepItTalking to DS Chat
Renames the app's display name everywhere (page titles, PWA manifest, TopBar, email subject lines, HMAC signature header) and its internal technical slug from chatapp to ds-chat/ds_chat: the Python package name and console script, the systemd unit and its user/group/paths, the deploy scripts, the Docker container names, and the Postgres database name. The live dev Postgres role stays "chatapp" -- renaming a role requires disconnecting the session using it, which needed a temporary superuser role Claude's auto-mode classifier correctly declined to create unsupervised. Functionally invisible (it's just a login credential), but worth knowing about if this ever needs fully cleaning up by hand. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+12
-12
@@ -1,20 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Day-2 deploy/upgrade script for the KeepItTalking app server. Run by hand
|
||||
# over SSH as the `chatapp` user (or via sudo -u chatapp):
|
||||
# Day-2 deploy/upgrade script for the DS Chat app server. Run by hand
|
||||
# over SSH as the `ds-chat` user (or via sudo -u ds-chat):
|
||||
#
|
||||
# sudo -u chatapp /srv/chatapp/deploy/upgrade.sh
|
||||
# sudo -u ds-chat /srv/ds-chat/deploy/upgrade.sh
|
||||
#
|
||||
# Fails loudly and stops before touching the running service if any step
|
||||
# fails -- the previous deploy keeps running rather than being torn down
|
||||
# mid-upgrade. See ../DEPLOYMENT.md for what each step assumes is already
|
||||
# in place (venv, /etc/chatapp/env, the systemd unit, Node.js).
|
||||
# in place (venv, /etc/ds-chat/env, the systemd unit, Node.js).
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="/srv/chatapp"
|
||||
REPO_DIR="/srv/ds-chat"
|
||||
BACKEND_DIR="${REPO_DIR}/backend"
|
||||
FRONTEND_DIR="${REPO_DIR}/frontend"
|
||||
ENV_FILE="/etc/chatapp/env"
|
||||
ENV_FILE="/etc/ds-chat/env"
|
||||
|
||||
echo "==> Pulling latest code"
|
||||
cd "$REPO_DIR"
|
||||
@@ -28,7 +28,7 @@ echo "==> Running database migrations"
|
||||
# alembic reads DATABASE_URL from the environment (backend/alembic/env.py),
|
||||
# so the env file has to actually be sourced into this shell first -- it's
|
||||
# not read automatically just because systemd's EnvironmentFile= points at
|
||||
# it (that only applies to the chatapp.service process, not this script).
|
||||
# it (that only applies to the ds-chat.service process, not this script).
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$ENV_FILE"
|
||||
@@ -40,20 +40,20 @@ cd "$FRONTEND_DIR"
|
||||
npm ci --silent
|
||||
npm run build --silent
|
||||
|
||||
echo "==> Restarting chatapp"
|
||||
echo "==> Restarting ds-chat"
|
||||
# Active WebSocket connections drop here and reconnect automatically within
|
||||
# a few seconds (frontend/src/ws/useChatSocket.ts's exponential-backoff
|
||||
# reconnect) -- expected, not a bug, and not worth a blue-green setup for.
|
||||
sudo systemctl restart chatapp
|
||||
sudo systemctl restart ds-chat
|
||||
|
||||
echo "==> Verifying"
|
||||
sleep 2
|
||||
if curl -sf http://127.0.0.1:8000/api/health >/dev/null; then
|
||||
echo "Health check OK"
|
||||
else
|
||||
echo "Health check FAILED -- check: sudo journalctl -u chatapp -n 50" >&2
|
||||
echo "Health check FAILED -- check: sudo journalctl -u ds-chat -n 50" >&2
|
||||
exit 1
|
||||
fi
|
||||
sudo systemctl status chatapp --no-pager -l | head -10
|
||||
sudo systemctl status ds-chat --no-pager -l | head -10
|
||||
|
||||
echo "==> Done. journalctl -u chatapp -f to watch logs."
|
||||
echo "==> Done. journalctl -u ds-chat -f to watch logs."
|
||||
|
||||
Reference in New Issue
Block a user