gemttp

command module
v0.0.0-...-594af07 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

README

gemttp

This is an HTTP to Gemini proxy designed to provide service for a single domain, i.e. to make your Gemini site available over HTTP(S). It can proxy to any domain in order to facilitate linking to the rest of Geminispace, but it defaults to a specific domain.

About

Gemttp is a is a fork of kineto (by Drew Devault). Several changes have been made from the original:

  • Some changes in the styles
  • Reduce page width on larger screens.
  • Allow custom background color through options.
  • Make robots.txt disallowing optional
  • Render emoji instead of the normal link prefix, when there is an emoji
  • Include commit of current build in footer

Installation

$ make build 
$ ./gemttp [-b 127.0.0.1:8080] [-s style.css] [-e style.css] [-t ffffff] [-d] gemini://example.org

The -b argument is optional and allows you to bind to an arbitrary address; by default gemttp will bind to :8080. You should set up some external reverse proxy like nginx to forward traffic to this port and add TLS.

The -s argument is optional and allows you to specify a custom CSS filename. The given file will be loaded from the local disk and placed in a <style> block. By default gemttp will serve its built-in style.

The -e argument is optional and allows you to specify a custom CSS URL. If provided, the style.css given will be treated as a link to be put in the href of a <link rel="stylesheet"...> instead of being placed inline with the body in a <style> block like with the -s flag. The given stylesheet can be a relative link, for instance -e /main.css will serve main.css from the root of the proxied Gemini capsule.

The -t argument is optional and allows you to specify a custom background color for the pages. If you're using the default stylesheet, the background color will be used. If you specify a custom CSS filename (-s) or a custom CSS URL (-e), the background color will be set, but can be overriden from the custom stylesheet.

The -d option adds a robots.txt policy to block all search engines. This command does not enforce deindexing, only asks search engines to do so in the robots.txt.

Usage

Gemttp can be ran interactively, but it's better to run it as a system service. If you're using a systemd-based distribution, you can install and customize the gemttp.service file located under extras/ in this repository.

You have to customize that file to set the absolute path to the gemttp binary and configure the options (extra CSS stylesheets, gemini base URL...). After it's modified to your liking, copy it to the systemd service folder and start it.

# cp /path/to/gemttp/extras/gemttp.service /etc/systemd/system/gemttp.service
# systemctl daemon-reload
# systemctl enable --now gemttp.service

If you were to run multiple instances of gemttp (for different domains), you should specify a different file name, like gemttp-examplecom.service.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL