Crates.io | agis |
lib.rs | agis |
version | 0.4.0 |
source | src |
created_at | 2022-06-03 15:13:36.45566 |
updated_at | 2022-11-23 01:21:18.356978 |
description | A Spartan protocol server |
homepage | |
repository | https://codeberg.org/jeang3nie/agis |
max_upload_size | |
id | 599302 |
size | 111,049 |
Agis will be a Spartan protocol server written in Rust. It is currently under active development but is not yet functional.
Agis is written in Rust and requires the Cargo build tool.
# Build a release binary
cargo build --release
The configuration file is in Ron format, which
should be very simple to grasp if you are used to any programming languages with
braces (such as C). There is an example config file with plenty of comments in
conf/config.ron
. This file can be copied to /etc/agis/config.ron
and edited
to match your actual desired configuration.
None
, access will be logged to stdout. If it
is set to Some(path)
access will be logged to that file.Each vhost is looked up by a key, which is the domain name it will serve.
Each directive is looked up via a key, which is the path which it applies to.
/srv/spartan
and the CGI program resides at /srv/spartan/cgi-bin/hello
,
then /cgi-bin/hello
.The default configuration runs the server as user 'agis' and group 'agis'. You will need to create that user and group on your system or Agis will not run.
useradd -r -s /sbin/nologin agis
If you are running Linux with Systemd init, there is a unit file included in the conf/ subdirectory. It can be copied into /etc/systemd/system and then started and stopped like any other service.
If you are on a Linux system that does not use systemd, or bsd, it should be
straitforward to write your own init script. The default location for the
configuration file is /etc/agis/config.ron
but can be overridden on the command
line with the -c
or --config
flag. This is currently the only command line
option which is supported, making startup quite straightforward.
A CGI program can be written in any language and receives it's input via environment variables. The program's output should present it's mime type in plain text, followed by a carriage return and newline, and then any data which is representable via a sequence of u8 bytes. This can be plain text but does not have to be.
Var | Meaning |
---|---|
DOCUMENT_ROOT | The root directory of your server |
QUERY_STRING | The query string |
REMOTE_ADDR | The IP address of the client |
REQUEST_URI | The interpreted pathname of the requested document or CGI (relative to the document root) |
SCRIPT_FILENAME | The full pathname of the current CGI |
SCRIPT_NAME | The interpreted pathname of the current CGI (relative to the document root) |
SERVER_NAME | Your server's fully qualified domain name (e.g. www.cgi101.com) |
SERVER_PORT | The port number your server is listening on |
SERVER_SOFTWARE | The server software you're using |
REQUEST_BODY | The path to a temporary file containing any content uploaded to the server |
The ScriptAlias directive allows passing requests to a CGI program without the cgi-bin directory or program name appearing in the url. In this way, dynamic content can be served without revealing to the client that a CGI program is being run or what the nature of that program is. This might be desireable if, for instance, one is using php scripting and doesn't wish to make that readily known to potential attackers.