From cdee67e203d86911164f495a8e09e9b37088fcf1 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Thu, 25 Sep 2025 12:43:28 +0200 Subject: [PATCH] Update webhook server code and requirements files --- require_server.txt | 3 ++- webhook_endpoint.py | 34 ++-------------------------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/require_server.txt b/require_server.txt index eec6f8c..cc2f646 100644 --- a/require_server.txt +++ b/require_server.txt @@ -1,4 +1,5 @@ fastapi>=0.111.0 uvicorn>=0.23.2 httpx>=0.27.0 -PyGithub>=2.3.0 \ No newline at end of file +PyGithub>=2.3.0 +python-dotenv>=1.0.1 \ No newline at end of file diff --git a/webhook_endpoint.py b/webhook_endpoint.py index cd1b85f..9aa7b82 100644 --- a/webhook_endpoint.py +++ b/webhook_endpoint.py @@ -1,3 +1,5 @@ + + #!/usr/bin/env python3 import os import json @@ -13,39 +15,7 @@ import httpx from fastapi import FastAPI, Header, HTTPException, Request from fastapi.responses import JSONResponse, PlainTextResponse from github import Github, Auth -# -# .env contents (with keys obscured)) -# -# WEBHOOK_SECRET=xxxxxxxxxxxxxxxxxxx -# LOG_LEVEL=INFO -# # GitHub (set GITHUB_DRY_RUN=true during early tests to avoid PR writes) -# GITHUB_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -# GITHUB_DRY_RUN=false - -# # Bugzilla base -# BUGZILLA_BASE_URL=https://bugs.koozali.org -# BUGZILLA_PRODUCT=SME Server 11.x -# BUGZILLA_VERSION=11.beta1 -# BUGZILLA_COMPONENT_DEFAULT=Github PR - -# # Auth: prefer API key -# BUGZILLA_AUTH_MODE=api_key -# BUGZILLA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - -# # (or JSON-RPC login if no API key) -# # BUGZILLA_AUTH_MODE=basic -# BUGZILLA_USER=githubpr -# # BUGZILLA_PASSWORD=your_password - -# # Behavior -# BUGZILLA_ATTACH_DIFF=true -# STATE_PATH=/home/githubpr/app/webhook/state/webhook_state.sqlite -# GITEA_BASE_URL=https://src.koozali.org -# GITEA_ORG=smeserver -# BUGZILLA_CC_ENABLE=true -# BUGZILLA_CC_ALLOW_NOREPLY=false -# # ---------------- Logging (UTC) ---------------- class UTCFormatter(logging.Formatter):