#! /bin/sh if [ -z "$MASTODON_BASE_URL" ] then echo "You must set the MASTODON_BASE_URL variable" exit 1 fi if [ ! -f /cert.pem ] then echo "You must bind a certificate at /cert.pem" exit 1 fi if [ ! -f /key.rsa ] then echo "You must bind a private key at /key.rsa" fi if [ -z "$TITLE" ] then TITLE=MastoGem fi if [ -z "$HOME_MESSAGE" ] then HOME_MESSAGE="Welcome on MastoGem, a Mastodon proxy for Gemini !" fi cat << EOF > /config.json { "listen": "0.0.0.0:1965", "cert_path": "/cert.pem", "key_path": "/key.rsa", "base_url": "$MASTODON_BASE_URL", "title": "$TITLE", "home_message": "$HOME_MESSAGE" } EOF MASTOGEM_CONFIG_PATH=/config.json /mastogem