Browse Source

Modify systemd service file to allow Rocket.toml

Add enough pointers to the systemd service file, so a user can deploy it by changing a configuration file
rather than having to configure everything as environment variables in the central service file. This
makes changing settings (e.g. allowing registration) much easier.
master
Sebastian Spaeth 2 months ago
parent
commit
4d0f273319
1 changed files with 12 additions and 5 deletions
  1. +12
    -5
      Deploy.md

+ 12
- 5
Deploy.md View File

@@ -38,10 +38,10 @@ Description=Conduit
After=network.target
[Service]
# YOU NEED TO EDIT THESE THREE:
Environment="ROCKET_SERVER_NAME=conduit.koesters.xyz"
Environment="ROCKET_TLS={certs=\"/etc/letsencrypt/live/conduit.koesters.xyz/fullchain.pem\",key=\"/etc/letsencrypt/live/conduit.koesters.xyz/privkey.pem\"}"
Environment="ROCKET_PORT=14004"
# YOU NEED TO EDIT THESE THREE, OR configure a Rocket.toml in the WorkingDirectory set below:
#Environment="ROCKET_SERVER_NAME=conduit.koesters.xyz"
#Environment="ROCKET_TLS={certs=\"/etc/letsencrypt/live/conduit.koesters.xyz/fullchain.pem\",key=\"/etc/letsencrypt/live/conduit.koesters.xyz/privkey.pem\"}"
#Environment="ROCKET_PORT=14004"
#Environment="ROCKET_REGISTRATION_DISABLED=true"
#Environment="ROCKET_LOG=normal" # Detailed logging
@@ -52,6 +52,8 @@ Group=conduit
Type=simple
Restart=always
ExecStart=/home/conduit/conduit/target/release/conduit
# The working dir is where the configuration file Rocket.toml should be
WorkingDirectory=/home/conduit
[Install]
WantedBy=multi-user.target
@@ -62,6 +64,11 @@ Finally, run
sudo systemctl daemon-reload
```
#### Configuration
The file rocket.toml can be used to configure things instead of using
environment variables. See the rocket-example.toml file in the repository
for inspiration.
#### You're done!
@@ -73,4 +80,4 @@ $ sudo systemctl start conduit
and set it to start automatically when your system boots with
```bash
$ sudo systemctl enable conduit
```
```

Loading…
Cancel
Save