Replaces LICENSE (GPLv3 -> AGPLv3) and prepends `SPDX-License-Identifier: AGPL-3.0-or-later` to every source file across decnet/, decnet_web/, tests/, scripts/, and tools/. Rationale: closes the GPLv3 ASP loophole so any party operating a modified DECNET as a network service must offer their modified source. Personal copyright (Samuel Paschuan) + inbound=outbound contributions make a future unilateral relicense infeasible. - LICENSE: full AGPL-3.0 text (gnu.org/licenses/agpl-3.0.txt) - COPYRIGHT: project copyright notice - tools/add_spdx_headers.py: idempotent header injector (shebang- and PEP 263-aware) Touches 1565 source files (.py, .ts, .tsx, .js, .jsx, .css, .sh). No behavior change; comments only.
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
from __future__ import annotations
|
|
|
|
import typer
|
|
|
|
from . import utils as _utils
|
|
from .utils import console, log
|
|
|
|
|
|
def register(app: typer.Typer) -> None:
|
|
@app.command(name="webhook")
|
|
def webhook_cmd(
|
|
daemon: bool = typer.Option(
|
|
False, "--daemon", "-d", help="Detach to background as a daemon process"
|
|
),
|
|
) -> None:
|
|
"""Run the webhook dispatcher — bus consumer → external HTTP egress."""
|
|
import asyncio
|
|
from decnet.web.dependencies import repo
|
|
from decnet.webhook import webhook_worker
|
|
|
|
if daemon:
|
|
log.info("webhook daemonizing")
|
|
_utils._daemonize()
|
|
|
|
log.info("webhook starting")
|
|
console.print("[bold cyan]Webhook dispatcher starting[/]")
|
|
|
|
async def _run() -> None:
|
|
await repo.initialize()
|
|
await webhook_worker(repo)
|
|
|
|
try:
|
|
asyncio.run(_run())
|
|
except KeyboardInterrupt:
|
|
console.print("\n[yellow]Webhook worker stopped.[/]")
|