mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
running: mention systemd's EnvironmentFile
directive (#362)
* running: mention systemd's `EnvironmentFile` directive * mention real path example
This commit is contained in:
parent
839ec63c38
commit
519e744daf
1 changed files with 6 additions and 0 deletions
|
@ -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=/etc/caddy/.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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue