docker: test_auth.cgi

so client certificate seems good compared to PGP
This commit is contained in:
dongdigua 2023-06-27 15:27:08 +08:00
parent 0e465ce9b8
commit 4ff4cabbcc
4 changed files with 12 additions and 3 deletions

View File

@ -13,8 +13,8 @@ RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1 \
COPY run-wrapper.sh .
COPY gmid.conf /dongdigua.github.io/gmi/docker/
COPY cgi/* /dongdigua.github.io/cgi/
COPY update-git.sh /etc/periodic/hourly/
COPY cgi/* /dongdigua.github.io/cgi/
# for testing purpose only
# RUN mkdir /etc/periodic/1min \

View File

@ -20,6 +20,7 @@ both need authentication, idea:
* 6x (CLIENT CERTIFICATE REQUIRED)
=> gemini://gemini.circumlunar.space/docs/tls-tutorial.gmi doc: TLS
=> https://adnano.co/2021/03/06/gemini-tls/ TLS recommendations for Gemini
=> gemini://caseyrichins.online/logs/2023-06-09_gemini-client-certificates.gmi Client Certificates in Gemini
* GPG in 1x (INPUT)
client: date -u +%Y%m%dT%H | gpg -as

View File

@ -1,4 +1,4 @@
#! /bin/sh
printf "20 text/gemini\r\n";
printf "OS: $(uname -rv)\r\nuptime: $(uptime)\r\nserver: $SERVER_SOFTWARE\r\nauth: $AUTH\r\n";
printf "20 text/gemini\r\n"
printf "OS: $(uname -rv)\r\nuptime: $(uptime)\r\nserver: $SERVER_SOFTWARE\r\n"

8
gmi/docker/cgi/test_auth.cgi Executable file
View File

@ -0,0 +1,8 @@
#! /bin/sh
if [ -z $AUTH_TYPE ]; then
printf "60 \r\n"
else
printf "20 text/plain\r\n"
printf "auth: $AUTH_TYPE\r\nhash: $TLS_CLIENT_HASH\r\n"
fi