Update binary name, DB path, session cookie, deploy scripts, systemd service, Docker config, CI workflow, and .dockerignore. Remove stale Claude command and settings files.
30 lines
880 B
Bash
Executable File
30 lines
880 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# One-time setup: create the games user, install directory, and systemd unit.
|
|
# Run as root (or with sudo).
|
|
set -euo pipefail
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Run as root: sudo $0" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Create system user if it doesn't exist
|
|
if ! id -u games &>/dev/null; then
|
|
useradd --system --shell /usr/sbin/nologin --home-dir /opt/games --create-home games
|
|
echo "Created system user: games"
|
|
else
|
|
echo "User 'games' already exists"
|
|
fi
|
|
|
|
# Ensure install directory exists with correct ownership
|
|
install -d -o games -g games -m 755 /opt/games
|
|
install -d -o games -g games -m 755 /opt/games/data
|
|
|
|
# Install systemd unit
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
cp "$SCRIPT_DIR/games.service" /etc/systemd/system/games.service
|
|
systemctl daemon-reload
|
|
systemctl enable games.service
|
|
|
|
echo "Setup complete. Run deploy.sh to build and start the service."
|