logo

gemini-space

Unnamed repository; edit this file 'description' to name the repository.
commit: 304c9c80cd5cc9d88e5e7bf30f38720395c8ecda
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  4 Nov 2020 08:04:35 +0100

Initial Commit

Diffstat:

Abookmarks.gmi7+++++++
Aindex.gmi15+++++++++++++++
Aserver.sh36++++++++++++++++++++++++++++++++++++
3 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/bookmarks.gmi b/bookmarks.gmi @@ -0,0 +1,7 @@ +# Bookmarks: Links to other gemini spaces + +=> gemini://drewdevault.com Drew DeVault's geminispace +=> gemini://gemini.circumlunar.space/ Project Gemini + +=> https://hacktivis.me/bookmarks The HTTP conterpart of this page +=> / home diff --git a/index.gmi b/index.gmi @@ -0,0 +1,15 @@ +```ASCII Art logo of "hacktivism" in a stylized font +╻ ╻┏━┓┏━╸╻┏ ╺┳╸╻╻ ╻╻┏━┓┏┳┓ +┣━┫┣━┫┃ ┣┻┓ ┃ ┃┃┏┛┃┗━┓┃┃┃ +╹ ╹╹ ╹┗━╸╹ ╹ ╹ ╹┗┛ ╹┗━┛╹ ╹ +``` + +Hello, Haelwenn (lanodan) Monnier here :) + +=> bookmarks.gmi Links to other gemini spaces +=> server.sh Shell script used with stunnel to serve this + +=> mailto:contact+gemini@hacktivis.me +=> xmpp:contact@hacktivis.me +=> https://queer.hacktivis.me/users/lanodan fediverse profile (HTTPS link) +=> gopher://queer.hacktivis.me:9999/1/users/lanodan fediverse profile (gopher link) diff --git a/server.sh b/server.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Copyright 2020 Haelwenn (lanodan) Monnier <contact+gemini@hacktivis.me> +# Distributed under the terms of the GNU Affero General Public License version 3 + +# AGPL-3 because it's a service on the internet, screw permissive licences for these + +export GEMDIR="/srv/gemini" + +IFS=#' +' read -r line +# ' hack for vis editor to reset hightlighting… + +path="${line#gemini://*/}" +path="${path%%../*}" +path="$GEMDIR/${path:-index.gmi}" +status="--" + +if echo $path | egrep -q '.gmi$' +then + mime="text/gemini" +else + mime=$(file --mime -b "$path" 2>/dev/null) +fi + +if [ -r "$path" ] +then + status="20" + printf '20 %s\r\n' "$mime" + cat "$path" 2>/dev/null +else + status="50" + printf '50 File not readable or non-existent\r\n' +fi + +# I know… blame France data rentention policy +logger -p local0.notice "${REMOTE_HOST:-?host?} ${REMOTE_PORT:-?port?} ${line} ${status}" 2>/dev/null 1>/dev/null