mirror of
https://github.com/dongdigua/dongdigua.github.io
synced 2024-11-27 21:30:53 +08:00
top-level Makefile, stat.cgi: memory, collections
This commit is contained in:
parent
480a29ce98
commit
3e19d8cc31
14
Makefile
Normal file
14
Makefile
Normal 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
|
@ -50,3 +50,5 @@ undergoes frequent maintenance, PDA?
|
||||
=> gemini://warmedal.se/~bjorn + bjorn
|
||||
=> gemini://ploum.net/index_en.gmi + Ploum
|
||||
author of offpunk
|
||||
=> gemini://gemini.thegonz.net + Things
|
||||
=> gemini://cdg.thegonz.net/ ++ Collaborative Directory of Geminispace
|
||||
|
@ -12,12 +12,4 @@ alpine linux
|
||||
* gmid.conf reload
|
||||
|
||||
## TODO
|
||||
I want to write CGI script to:
|
||||
* 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.
|
||||
execute as normal user?
|
||||
|
@ -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")
|
@ -1,4 +1,9 @@
|
||||
#! /bin/sh
|
||||
|
||||
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"
|
||||
|
@ -180,7 +180,7 @@ Welcome to the darkest dungeon of kernal
|
||||
*** [[https://kernal.eu/posts/linuxfx/][Dumping Linuxfx customers]] :fun:
|
||||
A Windows-like distro including the spyware and activation
|
||||
** [[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
|
||||
*** [[https://vimacs.wehack.space/Mail-vs-IM.htm][谈电子邮件和即时通讯]]
|
||||
**** [[https://citizenlab.ca/2016/11/wechat-china-censorship-one-app-two-systems/][微信一app两制]]
|
||||
|
Loading…
Reference in New Issue
Block a user