Add account auth with websocket login/register and sessions
This commit is contained in:
@@ -37,6 +37,7 @@ Notes:
|
||||
This creates:
|
||||
- `/home/bestmidi/chgrid/server/.venv`
|
||||
- `/home/bestmidi/chgrid/server/config.toml` (if missing)
|
||||
- `/home/bestmidi/chgrid/server/.env` with `CHGRID_AUTH_SECRET` (if missing)
|
||||
|
||||
Edit `/home/bestmidi/chgrid/server/config.toml`:
|
||||
- `server.bind_ip = "127.0.0.1"`
|
||||
@@ -45,6 +46,7 @@ Edit `/home/bestmidi/chgrid/server/config.toml`:
|
||||
- `tls.cert_file = ""`
|
||||
- `tls.key_file = ""`
|
||||
- `storage.state_file = "runtime/items.json"`
|
||||
- `auth.db_file = "runtime/chatgrid.db"`
|
||||
|
||||
## 4) Build and publish client
|
||||
|
||||
|
||||
@@ -49,5 +49,17 @@ fi
|
||||
|
||||
mkdir -p runtime
|
||||
|
||||
if [[ ! -f .env ]]; then
|
||||
AUTH_SECRET="$(
|
||||
python3 - <<'PY'
|
||||
import secrets
|
||||
print(secrets.token_urlsafe(64))
|
||||
PY
|
||||
)"
|
||||
printf "CHGRID_AUTH_SECRET=%s\n" "$AUTH_SECRET" > .env
|
||||
chmod 600 .env
|
||||
echo "created $SERVER_DIR/.env with CHGRID_AUTH_SECRET"
|
||||
fi
|
||||
|
||||
echo "server install complete"
|
||||
echo "next: edit $SERVER_DIR/config.toml (TLS, bind_ip, port)"
|
||||
|
||||
@@ -8,6 +8,7 @@ User=bestmidi
|
||||
Group=bestmidi
|
||||
WorkingDirectory=/home/bestmidi/chgrid/server
|
||||
Environment=PATH=/home/bestmidi/chgrid/server/.venv/bin:/usr/bin:/bin
|
||||
EnvironmentFile=-/home/bestmidi/chgrid/server/.env
|
||||
ExecStartPre=/usr/bin/mkdir -p /home/bestmidi/chgrid/server/runtime
|
||||
ExecStart=/home/bestmidi/chgrid/server/.venv/bin/python main.py --config /home/bestmidi/chgrid/server/config.toml
|
||||
StandardOutput=append:/home/bestmidi/chgrid/server/runtime/server.log
|
||||
|
||||
Reference in New Issue
Block a user