fs - simple file server

Fs
Login

Fs

(Note: If you are reading this on Github, you can find the original Fossil repository here).

Fs is a simple static file server for HTTP and HTTPS.

Prerequisites

Fs requires the C library for yaml. it can be installed on Debian or Ubuntu using:

sudo apt install libyaml-dev

Build

To clone this repository:

fossil clone https://www.bloovis.com/fossil/home/marka/fossils/fs

To build Fs, use this:

shards install
crystal build src/fs.cr

This will create a binary fs in the current directory. This executable file and the configuration file (see the next section) are all that you need for an fs installation.

Configuration

Fs keeps its configuration information in a YAML file. To create an initial configuration, copy the file fs.yml.sample to fs.yml and edit as needed. The configuration file contains these required fields:

The configuration file contains these optional fields:

Running

To run Fs as a server, use this:

./fs [config-option]

The server will run until terminated by a Control-C or other signal.

Fs supports a single option: --config=FILENAME, which you can use to specify to the path to the configuration YAML file. The default value is ./fs.yml.

System Service

It is more convenient to start the Fs server as a system service than to run it from the command line. To do this, copy the file fs.service.sample to /etc/systemd/system/fs.service and edit it as necessary. The values most likely to need editing are WorkingDirectory and ExecStart.

Start the fs service and check its status:

systemctl daemon-reload
systemctl enable fs
systemctl start fs
systemctl status fs