Added documentation and certificate fingerprint display

This commit is contained in:
Mark Wane 2022-12-24 13:35:32 +00:00
parent 6df8bfba35
commit 7c4ce95714
Signed by: mark
GPG Key ID: 406607E3C6A78C73
4 changed files with 41 additions and 0 deletions

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2022 Mark Wane
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# Simple gemini messages
A simple single user Gemini based message system written in Python. Messages are saved in a flat gemtext file along with the sender's hostname/IP and client cert CN if provided. Reading messages requires the cert specified in the config to be used.
Tested with the [stargazer](https://git.sr.ht/~zethra/stargazer) server
# Configuration
Copy the sample.env file to .env and update the variables to point to the location of the message file and your client cert fingerprint.
To find the fingerprint for your client cert visit the cert.cgi page
Make sure that gemini server has execute permissions for the the .cgi files and write permisson on the message file.

18
cert.cgi Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
import os, sys, cgitb
# Log errors to disk only
cgitb.enable(display=0, logdir="/var/log/gemini", format="plain")
# Load CGI vars
cert_fp = os.getenv("TLS_CLIENT_HASH")
if None == cert_fp :
# Prompt for client cert
print("60 Cert required\r")
else :
print("20 text/plain\r")
print( cert_fp )

2
sample.env Normal file
View File

@ -0,0 +1,2 @@
MESSAGE_FILE="/tmp/gemini-msg.gmi"
ADMIN_CERT=""