Files
gniza4linux/web/__main__.py
shuki cf00ecdd4b Add web dashboard with systemd service support
- Flask web dashboard with dark theme matching TUI
- Login with API key authentication
- Dashboard shows targets, remotes, schedules, last backup status
- Trigger backups from web UI per target
- View logs via /api/logs endpoint
- systemd service: gniza web install-service / remove-service / status
- CLI: gniza web start [--port=PORT] [--host=HOST]
- TUI settings: web enabled, port, host, API key fields
- Install script: optional web dashboard setup with auto-generated API key
- Uninstall script: removes systemd service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:34:02 +02:00

29 lines
663 B
Python

import os
import sys
from pathlib import Path
from web.app import create_app, parse_conf
CONFIG_DIR = Path(os.environ.get("GNIZA_CONFIG_DIR", "/usr/local/gniza/etc"))
def main():
# Read defaults from config
conf = parse_conf(CONFIG_DIR / "gniza.conf")
host = conf.get("WEB_HOST", "0.0.0.0")
port = int(conf.get("WEB_PORT", "8080"))
# CLI overrides
for arg in sys.argv[1:]:
if arg.startswith("--port="):
port = int(arg.split("=", 1)[1])
elif arg.startswith("--host="):
host = arg.split("=", 1)[1]
app = create_app()
app.run(host=host, port=port)
if __name__ == "__main__":
main()