top-level Makefile, stat.cgi: memory, collections

This commit is contained in:
dongdigua 2023-07-02 15:39:43 +08:00
parent 480a29ce98
commit 3e19d8cc31
6 changed files with 24 additions and 45 deletions

14
Makefile Normal file
View File

@ -0,0 +1,14 @@
all: org posts gmi
org:
cd org && make
posts:
pandoc posts.md --css=css/everforest.css -s -o posts.html
gmi:
misc/mdlist2gmi.py > posts.gmi
clean:
rm posts.html
rm posts.gmi

View File

@ -50,3 +50,5 @@ undergoes frequent maintenance, PDA?
=> gemini://warmedal.se/~bjorn + bjorn => gemini://warmedal.se/~bjorn + bjorn
=> gemini://ploum.net/index_en.gmi + Ploum => gemini://ploum.net/index_en.gmi + Ploum
author of offpunk author of offpunk
=> gemini://gemini.thegonz.net + Things
=> gemini://cdg.thegonz.net/ ++ Collaborative Directory of Geminispace

View File

@ -12,12 +12,4 @@ alpine linux
* gmid.conf reload * gmid.conf reload
## TODO ## TODO
I want to write CGI script to: execute as normal user?
* check the log
* upload dynamic file
First I need to get my client cert hash uploaded, so I came up an idea:
upload a pgp-signed message contains: HOSTNAME:CERTHASH, then use that client cert hash
But later I thought it makes my server too complicated.
I just need a static site server, these are bloated.

View File

@ -1,34 +0,0 @@
#! /usr/bin/python
# nobody write perl right?
from os import environ
import sys
import subprocess
import re
if "GEMINI_SEARCH_STRING" not in environ:
print("11 signed message",end="\r\n")
sys.exit()
query = environ["GEMINI_SEARCH_STRING"]
host = environ["SERVER_NAME"]
p = subprocess.Popen(["gpgv", "--keyring", "./keyring"], stdin=subprocess.PIPE)
p.communicate(input=query.encode())
if p.returncode != 0:
print("gpg failed")
sys.exit()
pattern = "^{}:([0-9a-z]+)$".format(host)
line = query.splitlines()[3]
match = re.match(pattern, line)
if match == None:
print("bad hash")
sys.exit()
print("20 text/gemini",end="\r\n")
print(match.group(1),end="\r\n")

View File

@ -1,4 +1,9 @@
#! /bin/sh #! /bin/sh
printf "20 text/gemini\r\n" printf "20 text/gemini\r\n"
printf "server: $SERVER_SOFTWARE\r\nOS: $(uname -or)\r\nuptime: $(uptime)\r\n" printf "Domain: $SERVER_NAME\r\n"
printf "Server: $SERVER_SOFTWARE\r\n"
printf "OS: $(uname -or)\r\n"
printf "Up: $(uptime)\r\n"
printf "\n"
printf "$(free -h)\r\n"

View File

@ -180,7 +180,7 @@ Welcome to the darkest dungeon of kernal
*** [[https://kernal.eu/posts/linuxfx/][Dumping Linuxfx customers]] :fun: *** [[https://kernal.eu/posts/linuxfx/][Dumping Linuxfx customers]] :fun:
A Windows-like distro including the spyware and activation A Windows-like distro including the spyware and activation
** [[https://vimacs.wehack.space/laptop/][vimacs]] ** [[https://vimacs.wehack.space/laptop/][vimacs]]
Written with Vim and Emacs. A member of Linux Club of Peking University. Written with Vim and Emacs. A member of Linux Club of Peking University. [[https://beijinglug.club/wiki/doku.php?id=blug-canary-3][blug]] signer
with cat-v-like sidebar style with cat-v-like sidebar style
*** [[https://vimacs.wehack.space/Mail-vs-IM.htm][谈电子邮件和即时通讯]] *** [[https://vimacs.wehack.space/Mail-vs-IM.htm][谈电子邮件和即时通讯]]
**** [[https://citizenlab.ca/2016/11/wechat-china-censorship-one-app-two-systems/][微信一app两制]] **** [[https://citizenlab.ca/2016/11/wechat-china-censorship-one-app-two-systems/][微信一app两制]]