Browse Source

pass recipients in first line of request

Fabian Peter Hammerle 4 years ago
parent
commit
8fb5404118
3 changed files with 12 additions and 4 deletions
  1. 2 3
      Dockerfile
  2. 9 0
      invoke-gpgit.sh
  3. 1 1
      serve-gpgit.sh

+ 2 - 3
Dockerfile

@@ -48,9 +48,8 @@ RUN apk add --no-cache $PERL_MAIL_GNUPG_BUILD_PKGS \
 ARG GPGIT_PATH=/usr/local/bin/gpgit
 COPY --from=download /tmp/gpgit/gpgit $GPGIT_PATH
 ENV GNUPG_IMPORT=""
-ENV RECIPIENTS="gpgit@dev.null"
-COPY serve-gpgit.sh /
-RUN chmod a+rx /serve-gpgit.sh
+COPY serve-gpgit.sh invoke-gpgit.sh /
+RUN chmod -c a+rx /serve-gpgit.sh /invoke-gpgit.sh
 USER gpgit
 # [string.ascii_lowercase.index(c) for c in 'gpgit']
 ENTRYPOINT ["tini", "--"]

+ 9 - 0
invoke-gpgit.sh

@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -ex
+
+# ash does not support `-a`:
+# > read: line 5: illegal option -a
+read RECIPIENTS
+set -- $RECIPIENTS
+exec gpgit "$@"

+ 1 - 1
serve-gpgit.sh

@@ -9,4 +9,4 @@ for fingerprint in $(gpg --list-keys --with-colons | grep '^fpr:' | cut -d ':' -
 done
 
 # log level: notice
-exec socat -d -d -T4 tcp-l:6156,fork "exec:gpgit $RECIPIENTS"
+exec socat -v -d -d -T4 tcp-l:6156,fork exec:/invoke-gpgit.sh