From 815804b948a015c70afd2d6d764317fe63935239 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 24 Feb 2021 14:22:04 +0100 Subject: [PATCH] Exmapnd docs --- gmnd/docs/configure.gmi | 23 +++++++++++++++++------ gmnd/docs/index.gmi | 1 + gmnd/docs/installing.gmi | 38 ++++++++++++++++++++++++++++++++++++++ gmnd/docs/running.gmi | 25 +++++++++++-------------- 4 files changed, 67 insertions(+), 20 deletions(-) create mode 100644 gmnd/docs/installing.gmi diff --git a/gmnd/docs/configure.gmi b/gmnd/docs/configure.gmi index e49a0d7..001f188 100644 --- a/gmnd/docs/configure.gmi +++ b/gmnd/docs/configure.gmi @@ -5,15 +5,26 @@ gMNd has a config file in yaml format that you can supply on the command line wi 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 +# Uncomment below line to allow automtic directory indexing +#allow_dir_list: true +# Below is default bas path for your content +base_path: /var/gemini/gemtext +# To allow connectiond from the outside, set listen address below +#listen_addr: '0.0.0.0' +# To set debug logging, uncomment below line +#logg_level: 'DEBUG' +# To enable cgi functionality, configure something like below +#cgi_registry: +# /envtest.*: +# - /var/gemini/cgi-bin/envtest.sh +server_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem +server_key: /etc/ssl/private/ssl-cert-snakeoil.key ``` This enables directory indexing, sets the listen address to 0.0.0.0 (all interfaces), the log level to DEBUG and registers the script ./cgi-bin/envtest.sh to serve content for any path that matches the regex /envtest.*. +Notice that snakeoil certs won't actually work, you should generate your own certificates. This is a guide that should wortkll for you: +=> gemini://republic.circumlunar.space/users/andybalaam/blogmirror/2019-05-02_creating_a_self_signed_certificate_for_apache_and_connecting_to_i.gmi + A full list of options are here: ``` allow_dir_list = true/false, default false (global option for now!) diff --git a/gmnd/docs/index.gmi b/gmnd/docs/index.gmi index 4ffb0da..1c5931b 100644 --- a/gmnd/docs/index.gmi +++ b/gmnd/docs/index.gmi @@ -1,5 +1,6 @@ # gMNd Documentation +=> gemini://mic.ke/gmnd/docs/installing.gmi How to install gMNd => 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 diff --git a/gmnd/docs/installing.gmi b/gmnd/docs/installing.gmi new file mode 100644 index 0000000..44357b9 --- /dev/null +++ b/gmnd/docs/installing.gmi @@ -0,0 +1,38 @@ +# Installation +Please use supplied debian and rpm repos. Packages are signed with gpg. + +# DEB +``` +curl https://repo.mic.ke/PUBLIC.KEY | sudo apt-key add - +curl https://repo.mic.ke/debian/debian-micke-unstable.list | sudo tee /etc/apt/sources.list.d/debian-micke-unstable.list +sudo apt update && sudo apt install gmnd +``` + +# RPM +``` +wget https://repo.mic.ke/PUBLIC.KEY +sudo rpm --import PUBLIC.KEY +sudo dnf config-manager --add-repo https://repo.mic.ke/rpm/rpm-micke.repo +sudo dnf install gmnd +``` + +# Docker + +You can build and run it from the supplied Dockerfile if you so whish: +``` +docker build -t gmnd:latest . +``` +By just running it, it will create self signed certs and serve example content from this repo: +``` +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 and cgi-scripts from /tmp/cgi-bin: +``` +docker run --mount type=bind,source="/tmp/content,target=/app/content" --mount type=bind,source="/tmp/cgi-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 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 +``` +.. +=> gemini://mic.ke/gmnd/docs/index.gmi back to gmnd/docs/ diff --git a/gmnd/docs/running.gmi b/gmnd/docs/running.gmi index f6e5833..9c75487 100644 --- a/gmnd/docs/running.gmi +++ b/gmnd/docs/running.gmi @@ -1,19 +1,16 @@ - You can build and run it from the supplied Dockerfile if you so whish: -``` -docker build -t gmnd:latest . -``` -By just running it, it will create self signed certs and serve example content from this repo: -``` -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 and dynamic content from /tmp/cgi-bin on your host machine: -``` -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 with static content from /tmp/content: +# Run gMNd + +The simplest thing is to install using the deb or rpm: +=> gemnini://mic.ke/gmnd/docs/installing.gmi + +After that you can run it like this: ``` -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 +# systemctl start gmnd ``` +Running in docker is covered in the install docs above. + +See information here about configuration options: +=> gemini://mic.ke/gmnd/docs/configure.gmi .. => gemini://mic.ke/gmnd/docs/index.gmi back to gmnd/docs/