aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index 122d67e..80648b9 100644
--- a/README.md
+++ b/README.md
@@ -205,6 +205,29 @@ few examples with common paths are provided below:
# For fish
miniserve --print-completions fish > ~/.config/fish/completions/miniserve.fish
+## systemd
+
+A hardened systemd-compatible unit file can be found in `packaging/miniserve@.service`. You could
+install this to `/etc/systemd/system/miniserve@.service` and start and enable `miniserve` as a
+daemon on a specific serve path `/my/serve/path` like this:
+
+ systemctl enable --now miniserve@-my-serve-path
+
+Keep in mind that you'll have to use `systemd-escape` to properly escape a path for this usage.
+
+In case you want to customize the particular flags that miniserve launches with, you can use
+
+ systemctl edit miniserve@-my-serve-path
+
+and set the `[Service]` part in the resulting `override.conf` file. For instance:
+
+ [Service]
+ ExecStart=/usr/bin/miniserve --enable-tar --enable-zip --no-symlinks --verbose -i ::1 -p 1234 --title Saugeland --color-scheme monokai --color-scheme-dark monokai -- %I
+
+Make sure to leave the `%I` at the very end in place or the wrong path might be served. You
+might additionally have to override `IPAddressAllow` and `IPAddressDeny` if you plan on making
+miniserve directly available on a public interface.
+
## Binding behavior
For convenience reasons, miniserve will try to bind on all interfaces by default (if no `-i` is provided).