From dbd51570420946b9d0af2197227fd42e5781aba1 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sun, 21 Feb 2021 18:16:11 +0100 Subject: [PATCH] Add docs about configuration and cgi-support --- gmnd/docs/configure.gmi | 30 ++++++++++++++++++++++++++++++ gmnd/docs/index.gmi | 1 + gmnd/docs/running.gmi | 6 +++--- gmnd/index.gmi | 2 +- 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 gmnd/docs/configure.gmi diff --git a/gmnd/docs/configure.gmi b/gmnd/docs/configure.gmi new file mode 100644 index 0000000..7a9a61a --- /dev/null +++ b/gmnd/docs/configure.gmi @@ -0,0 +1,30 @@ +gMNd has a config file in yaml format that you can supply on the command line with either of these options + -f + --file + +This is the example config, supplied with the server +``` +--- +allow_dir_list: true +listen_addr: '0.0.0.0' +logg_level: 'DEBUG' +cgi_registry: + /envtest.*: + - ./cgi-bin/envtest.sh +``` +This enables directory indexing, sets the listen address to 0.0.0.0 (all interfaces), the log level to DEBUG and registres the scrip ./cgi-bin/envtest.sh to serv content for any path that matches the regex /envtest.*. + +A full list of options are here: +``` +allow_dir_list = true/false, default false +base_path = the server root where you serve content from, default ./content +cgi_registry = you can set different cgi scripts to server content for different paths, no default +listen_addr = the ip address to listen to, default 127.0.0.1 +listen_port = the port to listen to, default 1965 +logg_level = any of "CRITICAL", "DEBUG", "ERROR", "INFO", "NOTSET", "WARNING", defult is INFO +server_cert = the path to the TLS cert, default ./certs/cert.pem +server_key = the path to the TLS key, default ./certs/cert.key +``` + +.. +=> gemini://mic.ke/gmnd/docs/index.gmi back to gmnd/docs/ diff --git a/gmnd/docs/index.gmi b/gmnd/docs/index.gmi index ff87e44..4ffb0da 100644 --- a/gmnd/docs/index.gmi +++ b/gmnd/docs/index.gmi @@ -1,6 +1,7 @@ # gMNd Documentation => gemini://mic.ke/gmnd/docs/running.gmi How to run gMNd +=> gemini://mic.ke/gmnd/docs/configure.gmi How to configure gMNd => gemini://mic.ke/gmnd/docs/contributing.gmi How to contribute to gMNd => gemini://mic.ke/gmnd/docs/licensing.gmi gMNd is free software! diff --git a/gmnd/docs/running.gmi b/gmnd/docs/running.gmi index d4652b8..f6e5833 100644 --- a/gmnd/docs/running.gmi +++ b/gmnd/docs/running.gmi @@ -6,11 +6,11 @@ By just running it, it will create self signed certs and serve example content f ``` docker run -p 1965:1965 gmnd ``` -A slightly more interesting thing it can do is serve your own content, in this example from /tmp/content on your host machine: +A slightly more interesting thing it can do is serve your own content, in this example from /tmp/content and dynamic content from /tmp/cgi-bin on your host machine: ``` -docker run --mount type=bind,source="/tmp/content,target=/app/content" -p 1965:1965 gmnd +docker run --mount type=bind,source="/tmp/content,target=/app/content" --mount type=bind,source="/tmp/ccgi-bin,target=/app/cgi-bin"-p 1965:1965 gmnd ``` -Or even supply your own certificates from the outside, in this example in /usr/local/certs: +Or even supply your own certificates from the outside, in this example in /usr/local/certs with static content from /tmp/content: ``` docker run --mount type=bind,source="/tmp/content,target=/app/content" --mount type=bind,source="/usr/local/certs,target=/app/certs" -p 1965:1965 gmnd ``` diff --git a/gmnd/index.gmi b/gmnd/index.gmi index f505dee..1c2d0d7 100644 --- a/gmnd/index.gmi +++ b/gmnd/index.gmi @@ -1,7 +1,7 @@ # gMNd gMNd is my gemini server. It is written in python, with the primary purpose to serve this content. You are very welcome to try it out however. -Currently it only serves static files. +Currently it can both serves static files, or at your option generate dynamic content using cgi-scripts. # Docs Some documention is available here: