From 91f92aaa53d2408a90820720c735aaf21b6662ab Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Tue, 19 Dec 2023 10:45:10 +0300 Subject: [PATCH] running: mention systemd's `EnvironmentFile` directive --- src/docs/markdown/running.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/docs/markdown/running.md b/src/docs/markdown/running.md index 80d2a0c..2e1aa5b 100644 --- a/src/docs/markdown/running.md +++ b/src/docs/markdown/running.md @@ -144,6 +144,12 @@ For example, if you need to define environment variables for use in your config, Environment="CF_API_TOKEN=super-secret-cloudflare-tokenvalue" ``` +Similarly, if you prefer to maintain a separate file to maintain the environment variables (envfile), you may use the [`EnvironmentFile`](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=) directive as such: +```systemd +[Service] +EnvironmentFile=/path/to/envfile.env +``` + Or, for example if you need to change the config file from the default of the Caddyfile, to instead using a JSON file (note that `Exec*` directives [must be reset with empty strings](https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStart=) before setting a new value): ```systemd [Service]