#gemini #proxy #rust

app september

A simple and efficient Gemini-to-HTTP proxy

16 releases

0.2.10 Jun 20, 2023
0.2.8 May 30, 2023
0.2.4 Mar 12, 2023
0.2.1 Jul 17, 2022

#38 in HTTP server

Download history 11/week @ 2024-02-22 9/week @ 2024-02-29 114/week @ 2024-03-07 29/week @ 2024-03-14

162 downloads per month

GPL-3.0-only

37KB
425 lines

September

github.com

A simple and efficient Gemini-to-HTTP proxy written in Rust.

Usage

Docker

$ docker run -d [ -e ROOT="gemini://fuwn.me" ] [ -e PORT="8080"] [ -e CSS_EXTERNAL="https://example.com/style.css"] fuwn/september:latest

Docker Compose

Edit the docker-compose.yaml file to your liking, and then

$ docker-compose up -d

Executable

$ [ ROOT="gemini://fuwn.me" ] [ PORT="8080"] [ CSS_EXTERNAL="https://example.com/style.css"] ./september

or use a .env file

# .env

ROOT=gemini://fuwn.me
PORT=8080
CSS_EXTERNAL=https://example.com/style.css

and then

$ ./september

Configuration

Configuration for September is done solely via environment variables, for simplicity, and Docker support.

PORT

Bind September to a custom port.

Generally, you shouldn't touch this if you are deploying using Docker.

If no PORT is provided or the PORT could not be properly parsed as a u16; port 80 will be assumed.

PORT=8080

ROOT

The root Gemini capsule to proxy when not visiting a "/proxy" route.

If no ROOT is provided, "gemini://fuwn.me" will be assumed.

ROOT=gemini://fuwn.me

CSS_EXTERNAL

A comma-seperated list of external CSS files to apply to the HTML response.

If no CSS_EXTERNAL is provided, there will be no styling done to the HTML response.

CSS_EXTERNAL=https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css

KEEP_GEMINI_EXACT

Keeps exactly matching URLs as a Gemini URL.

Examples

If KEEP_GEMINI_EXACT is equal to KEEP_GEMINI_EXACT=gemini://fuwn.me/gemini, all routes will be proxied their "/proxy" equivalent (e.g., "https://fuwn.me/proxy/fuwn.me/gopher"), except occurrences of "gemini://fuwn.me/skills" will be kept as is.

KEEP_GEMINI_EXACT=gemini://fuwn.me/skills

KEEP_GEMINI_DOMAIN

Similar to KEEP_GEMINI_EXACT, except proxies based on entire domains instead of exact matches.

KEEP_GEMINI_DOMAIN=fuwn.me

PROXY_BY_DEFAULT

Control weather or not all Gemini URLs will be proxied.

Similar to KEEP_GEMINI_EXACT and KEEP_GEMINI_DOMAIN but global.

Defaults to true.

PROXY_BY_DEFAULT=false

FAVICON_EXTERNAL

An external favicon file to apply to the HTML response.

FAVICON_EXTERNAL=https://host.fuwn.me/8te8lw0lxm03.webp

PLAIN_TEXT_ROUTE

A comma-seperated list of paths to treat as plain text routes.

PLAIN_TEXT_ROUTE=/robots.txt,/license.txt

MATHJAX

Enable MathJax support for rendering LaTeX.

Defaults to false.

MATHJAX=true

HEADER

Adds a large header to the top of a proxy page. Only available in styled routes.

Defaults to off.

HEADER="This will show up at the top of my proxied capsule."

Styling

Want to give your website a shiny new look? Try using one of sources to find a stylish and minimal (!!) CSS theme/ framework!

Capsules using September

Add yours!

License

This project is licensed with the GNU General Public License v3.0.

Dependencies

~18–33MB
~568K SLoC