This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/comdev-people.git
The following commit(s) were added to refs/heads/main by this push:
new 5f203c6 Allow base to be overridden
5f203c6 is described below
commit 5f203c684446f987123c7110df2d2610a53c4015
Author: Sebb <[email protected]>
AuthorDate: Tue Jul 1 22:25:30 2025 +0100
Allow base to be overridden
---
tools/pgp.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/pgp.py b/tools/pgp.py
index 7f7d72c..1acb28c 100644
--- a/tools/pgp.py
+++ b/tools/pgp.py
@@ -27,8 +27,9 @@ def fremove(file):
if os.path.isfile(file):
os.remove(file)
+BASE = '/var/www' # default base (overrideable for local testing)
DOW = math.floor(time.time()/86400)%7 # generate rolling logs over 7 days
-LOG = f"/var/www/html/keys/pgp{DOW}.log"
+LOG = f"{BASE}/html/keys/pgp{DOW}.log"
fremove(LOG)
print(f"Log file {LOG}")
log = open(LOG, "w")
@@ -37,7 +38,7 @@ log.write(time.asctime()+"\n")
#PGP interface
# using --batch causes gpg to write some output to log-file instead of stderr
-GPG_ARGS = "gpg --keyring /var/www/tools/pgpkeys --no-default-keyring --no-tty
--quiet --batch --no-secmem-warning --display-charset utf-8 --keyserver-options
no-honor-keyserver-url "
+GPG_ARGS = f"gpg --keyring {BASE}/tools/pgpkeys --no-default-keyring --no-tty
--quiet --batch --no-secmem-warning --display-charset utf-8 --keyserver-options
no-honor-keyserver-url "
GPG_SERVER_1 = "keyserver.ubuntu.com"
GPG_SERVER_2 = "keys.openpgp.org"
@@ -79,8 +80,8 @@ def pgpfunc_one(gpg_server, func, *args):
return success, grv.decode('utf-8')
-PUBLIC_JSON = "/var/www/html/public/"
-COMMITTER_KEYS = "/var/www/html/keys/committer"
+PUBLIC_JSON = f"{BASE}/html/public/"
+COMMITTER_KEYS = f"{BASE}/html/keys/committer"
def readJSON(file):
with open(os.path.join(PUBLIC_JSON, file), 'r') as r: