/zserv

A simple http file server with zip download option.

Primary LanguageC#MIT LicenseMIT

zserv

A lightweight, threaded file server in C# for serving files and directories.

current version: 0.0.1-dev

This server is not fully implemented yet.

As of 5.1.2016, the server is not being developed further due to lacking time and need on my site. Open an issue in case you want to use zserv or help developing it further.

Features

  • lightweight The server is aimed to run even on old and low end hardware.
  • dead simple A config file is optional and its syntax is learned in less than a minute.
  • zip download What is every simple file server missing? The option to download whole directories! zserv can serve files as well as directories as zips.

Installation

yet to come

Configuration

zserv uses a directive-based configuration system. You can either specify them globally via the -o command line option or with a config file (specify it via -c file). A directive usually looks like this:

<path>	[prefix]<option>,[prefix]<option> [comment ...]
/	nozip 	some very useful comment
/mydata	!priv
/store	nodot,+nosym

In this example, zip downloading is disabled for / and /mydata is not accesible. /store will forbid all folders starting with a dot and symlinks in it and all of its subdirectories will be ignored. Note that wildcars * are possible at the end of a string, but every directory specification must start with a / (relative paths to the above one may be implemented at a later time).

Paths and directives may be space- or tab-separated; anything after a second tab or space is treated as a comment (= ignored). Paths which contain a slash must be quoted, quoting for paths without spaces is optional. Directives must not contain spaces.

Valid prefixes are:

  • [none] The directive will be valid for the specified directory.
  • + Set directive for this and all of its subdirectories.
  • - Unset directive for this directory and all of its subdirectories. Can't overwrite !.
  • ! Enforce this directive. Same as +, but this cannot be overwritten by -.

Valid directives are:

  • nozip disable zip download.
  • nozipi if a parent directory is downloaded, exclude this directory from the archive. The directory may still be downloaded as zip.
  • priv do not allow access to this directory. Will also exclude it from zip downloads of parent directories.
  • nodot hide (not forbid) all directories starting with a dot.
  • nosym don't follow symlinks. Implementation delayed.

Planned features

  • permission system
  • logging