GithubHelp home page GithubHelp logo

gemserv's Introduction

# Gemserv

A gemini server written in rust.

## Features

 - Vhosts
 - CGI
 - User directories
 - Reverse proxy
 - Redirect
 - SCGI
 - Reload config on SIGHUP

## Installation and running

To run either run "cargo run /path/to/config" or if no configuration is
specified it will look for "/usr/local/etc/gemserv.conf"

### Prebuilt binaries

You can download prebuilt binaries for linux on the release page.

### Install from crates.io:

cargo install gemserv

### Install from docker

docker pull 080h/gemserv

### Build from source:

 - Clone the repo
 - If you want to use all features run 'cargo build --release' or if you only
   want to serve static files run 'cargo build --release --no-default-features'
 - Modify the config.toml to your needs
 - Run './target/release/gemserv config.toml'

## Init scripts

In the init-scripts directory there's OpenRC(Courtesy of Tastytea) and systemd
service files.

## CGI and SCGI

There's example SCGI scripts for python and perl in the cgi-scripts directory.

In the configuration file there's "cgi" which is an optional bool to turn cgi
on. If it's true it'll run scripts from any directory. To limit it to only one
directory set "cgipath"

If "cgi" is false or not set the server will respond "Not Found" to any
executable file.

Scripts have 5 seconds to complete or they will be terminated.

### CGI Environments

These variables are preset for you. If you need more you can define them in the
config file under "cgienv"

 - GEMINI_URL
 - SERVER_NAME
 - SERVER_PROTOCOL
 - SERVER_SOFTWARE
 - SCRIPT_NAME
 - REMOTE_ADDR
 - REMOTE_HOST
 - REMOTE_PORT
 - QUERY_STRING
 - PATH_INFO

TLS variables
 - AUTH_TYPE
 - TLS_CLIENT_HASH
 - REMOTE_USER

### Auth Location

This features adds an access control to a directory path.
You can create multiple secured location.
It checks the TLS_CLIENT_HASH of the client certificat to hashkeys saved in a plain text file.
Check out the config.toml for configuration example.
Also there is an example how user can subscribe to the auth location in the cgi-scripts directory. 
Examples is called subscribe.sh

In your toml file you can set this up as :
[[server.authlocation]]
root = "/path/to/serv/private"
path = "/private"
index = "index.gmi"
# you can place the keys anywhere you want. best not to place them inside your capsule
auth_basic = "/path/to/private/.hashkeys"


## Changelog

### [0.6.9] - 20240610

Changed the cgipath into a toml array, so you can define more than one CGI directory.
there is an example in the config.toml file

### [0.6.8] - 20240610

Added a few cgi-script examples

### [0.6.8] - 20240608

Added a new feature: AuthLocation

### [0.6.6] - 20220217

Bug fix: File path is checked to make sure it's in the root directory or in ~/public_gemini

### [0.6.5] - 20220209

Bug fix: Another traversal bug.

### [0.6.4] - 20220202

Fixed a file system traversal bug. All previous versions are unsafe.

gemserv's People

Contributors

080h avatar boringcactus avatar dancek avatar kstrauser avatar remvee avatar ticky avatar wimstockman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.