From c1c845e8ce34b263f0be5f91b20719def3777fed Mon Sep 17 00:00:00 2001 From: Ahmed Date: Sun, 14 Jun 2026 20:31:27 +0300 Subject: fix: 404 page, pgp cgi script, and other varios vibed fixes --- _shared/404.html | 46 ++++++++++++++ hooks/post-receive | 5 ++ mail.gumx.cc/list/index.html | 2 + pgp.gumx.cc/body.html | 10 ++- pgp.gumx.cc/cgi-bin/pgp-hkp.sh | 138 +++++++++++++++++++++++++++++++++++++++++ pgp.gumx.cc/extra.css | 2 + pgp.gumx.cc/index.html | 13 +++- 7 files changed, 210 insertions(+), 6 deletions(-) create mode 100644 _shared/404.html create mode 100755 pgp.gumx.cc/cgi-bin/pgp-hkp.sh create mode 100644 pgp.gumx.cc/extra.css diff --git a/_shared/404.html b/_shared/404.html new file mode 100644 index 0000000..38f064f --- /dev/null +++ b/_shared/404.html @@ -0,0 +1,46 @@ + + + + + + +404 not found + + + +
+

gumx

+
+
+

404 not found.

+
+ + + diff --git a/hooks/post-receive b/hooks/post-receive index 13e562e..3ecfd11 100644 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -29,7 +29,12 @@ for SITE in irc.gumx.cc vpn.gumx.cc mail.gumx.cc pgp.gumx.cc wk.fo twt.gumx.cc f esac mkdir -p "$WEBROOT/fonts" rsync -rlptD fonts/ "$WEBROOT/fonts/" + cp _shared/404.html "$WEBROOT/404.html" fi done +# 404 page for sites outside this hook +cp _shared/404.html /var/www/gumx.cc/404.html +cp _shared/404.html /usr/share/webapps/cgit/404.html + echo "sites deployed" diff --git a/mail.gumx.cc/list/index.html b/mail.gumx.cc/list/index.html index 8048fe9..1b47b93 100644 --- a/mail.gumx.cc/list/index.html +++ b/mail.gumx.cc/list/index.html @@ -2,6 +2,7 @@ + mail.gumx.cc / list \n' "$CSS" + printf '\n\n' + printf '
\n

gumx / pgp / keys

\n
\n' + printf '
\n\n\n' + found=0 + for f in "$KEYS_DIR"/*.asc; do + [[ -f "$f" ]] || continue + found=1 + FP=$(basename "$f" .asc) + KEY_UID=$(gpg --with-colons --import-options show-only --import < "$f" 2>/dev/null \ + | awk -F: '/^uid/{print $10; exit}') + printf '\n' \ + "$FP" "$FP" "$KEY_UID" + done + [[ $found -eq 0 ]] && printf '\n' + printf '
fingerprintuid
%s%s
no keys
\n
\n' + printf '%s\n' "$FOOTER" + printf '\n\n' + ;; + *) + printf "Content-Type: text/plain\r\n\r\n" + echo "Error: unknown op" + ;; + esac + ;; + + POST) + printf "Content-Type: text/plain\r\n\r\n" + read -r -d '' -n "${CONTENT_LENGTH:-4096}" SUBMITTED_KEY + + TMPDIR_GPG=$(mktemp -d) + FINGERPRINT=$(echo "$SUBMITTED_KEY" \ + | gpg --homedir "$TMPDIR_GPG" \ + --with-colons --import-options show-only \ + --import 2>/dev/null \ + | awk -F: '/^fpr/{print $10; exit}') + rm -rf "$TMPDIR_GPG" + + if [[ -z "$FINGERPRINT" ]]; then + echo "Error: Could not parse submitted key" + exit 0 + fi + + KEYFILE="$KEYS_DIR/${FINGERPRINT^^}.asc" + if [[ -f "$KEYFILE" ]]; then + echo "$SUBMITTED_KEY" > "$KEYFILE" + echo "Key updated successfully" + else + echo "Error: Fingerprint not registered." + echo "Contact ahmed@gumx.cc to arrange a key signing meeting." + fi + ;; +esac diff --git a/pgp.gumx.cc/extra.css b/pgp.gumx.cc/extra.css new file mode 100644 index 0000000..a235969 --- /dev/null +++ b/pgp.gumx.cc/extra.css @@ -0,0 +1,2 @@ +input[type="text"], button { font-family: inherit; font-size: inherit; border: thin solid; padding: 0.3em 0.6em; background: transparent; color: inherit; } +button { cursor: pointer; } diff --git a/pgp.gumx.cc/index.html b/pgp.gumx.cc/index.html index 96e7623..fcc8bcc 100644 --- a/pgp.gumx.cc/index.html +++ b/pgp.gumx.cc/index.html @@ -29,6 +29,9 @@ a { color: inherit; } @media (max-width: 400px) { body { font-size: 0.8em; } h1 { font-size: 1.6em; } } @media (prefers-color-scheme: dark) { html { filter: invert(1); } img { filter: invert(1); } } +input[type="text"], button { font-family: inherit; font-size: inherit; border: thin solid; padding: 0.3em 0.6em; background: transparent; color: inherit; } +button { cursor: pointer; } + @@ -37,10 +40,14 @@ a { color: inherit; }

Curated HKP keyserver. Keys are added after in-person verification only.

-

lookup

+

search

+
+ +

+
+

browse all keys

+

via gpg

gpg --keyserver hkps://pgp.gumx.cc --recv-keys <fingerprint>
-

Or via HTTPS:

-
curl "https://pgp.gumx.cc/pks/lookup?op=get&search=0x<fingerprint>"

submit

Keys are not accepted without prior arrangement. Contact hi@gumx.cc.

-- cgit v1.2.3