Implement error handling in app.py, update deployment instructions in README_DASHBOARD.md, and modify deploy.sh for rsync-based deployment. Adjust base.html to safely access session variables.

This commit is contained in:
2026-02-18 08:30:38 +02:00
parent ff44ea4927
commit 9193f2a7b1
5 changed files with 70 additions and 42 deletions

View File

@@ -35,22 +35,23 @@ Web dashboard to view and edit the `portal_auth` database. **Only users with rol
## Deployment to Auth LXC (10.110.60.210)
From your machine (with SSH access to the server):
The LXC has no direct access to Git. Deploy by **uploading the project from your PC** via SSH/rsync.
From your PC (with SSH and rsync):
```bash
./deploy/deploy.sh
```
Or explicitly from the project dir:
```bash
./deploy/deploy-from-pc.sh
```
This will:
- **First time:** Clone the repo from Git to `/opt/portal-auth-dashboard` on `root@10.110.60.210`, create venv, install dependencies, create `.env` from `deploy/.env.server` if missing, install and start the systemd unit.
- **Later runs:** Pull latest from `origin/main`, reinstall dependencies, restart the service.
If the Git server is not reachable from the deploy target (e.g. private repo), set `GIT_REPO_URL` with credentials before running:
```bash
export GIT_REPO_URL="http://nearxos:YOUR_TOKEN@10.20.30.250:3000/nearxos/portal-auth-dashboard.git"
./deploy/deploy.sh
```
- **Rsync** the project to `root@10.110.60.210:/opt/portal-auth-dashboard` (excluding `.env`, `.git`, `venv`).
- **On the server:** create/update venv, install dependencies, create `.env` from `deploy/.env.server` if missing, install and restart the systemd unit.
**After first deploy**, on the server set the real credentials: