trigger rebuild after activities upload

This commit is contained in:
Davide Scaini
2026-04-11 08:47:27 +02:00
parent 82830222ba
commit ef5b06c5b3
3 changed files with 64 additions and 14 deletions
+7 -1
View File
@@ -20,9 +20,11 @@ console = Console()
@click.option("--strava-client-secret", default=None, envvar="STRAVA_CLIENT_SECRET", help="Strava OAuth client secret")
@click.option("--max-users", default=None, type=int, help="Override max users for this instance (0 = unlimited; updates the DB setting)")
@click.option("--public-url", default=None, envvar="PUBLIC_URL", help="Public base URL (e.g. https://yourdomain.com). Required for Strava OAuth to work behind a reverse proxy.")
@click.option("--webroot", default=None, type=click.Path(), help="Nginx webroot (e.g. /var/www/bincio). When set, uploads trigger a full Astro build + rsync so new activity pages are immediately accessible without a git push.")
def serve(data_dir: str, site_dir: Optional[str], host: str, port: int,
strava_client_id: Optional[str], strava_client_secret: Optional[str],
max_users: Optional[int], public_url: Optional[str]) -> None:
max_users: Optional[int], public_url: Optional[str],
webroot: Optional[str]) -> None:
"""Start the bincio multi-user application server.
Handles auth, user management, and write operations.
@@ -54,6 +56,8 @@ def serve(data_dir: str, site_dir: Optional[str], host: str, port: int,
srv.strava_client_secret = strava_client_secret
if public_url:
srv.public_url = public_url
if webroot and site_dir:
srv.webroot = Path(webroot).expanduser().resolve()
db = open_db(dd)
current_limit = get_setting(db, "max_users")
@@ -63,6 +67,8 @@ def serve(data_dir: str, site_dir: Optional[str], host: str, port: int,
console.print(f" Data: [cyan]{dd}[/cyan]")
if srv.site_dir:
console.print(f" Site: [cyan]{srv.site_dir}[/cyan]")
if srv.webroot:
console.print(f" Web: [cyan]{srv.webroot}[/cyan] (auto-rebuild on upload)")
console.print(f" URL: [cyan]http://{host}:{port}[/cyan]")
if current_limit and int(current_limit) > 0:
console.print(f" Users: [yellow]max {current_limit}[/yellow]")