Merge pull request #232 from Biyoni/patch-1

Add systemd unit and guide
This commit is contained in:
Kana 2021-01-05 11:44:32 +09:00 committed by GitHub
commit 5e274c58ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

14
chibisafe-sample.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=chibisafe, easy to use file uploader
After=network.target
[Service]
Type=simple
User=yourusername
WorkingDirectory=/path/to/chibisafe
EnvironmentFile=/path/to/chibisafe/.env
ExecStart=/usr/bin/npm run start
Restart=always
[Install]
WantedBy=multi-user.target

24
docs/systemd.md Normal file
View File

@ -0,0 +1,24 @@
### Service config for systemd
The file chibisafe-example.service is to be moved to `/etc/systemd/system/chibisafe.service`
You will need to edit the parameters:
- `User` to be the username/uid of your chibisafe instance
- `WorkingDirectory` to the **FULL** path to your chibisafe, `/home/chibisafe/chibisafe` for example.
- `EnvironmentFile` the same as the above, with the addition of `/.env`, `/home/chibisafe/chibisafe/.env`
Example below.
```[Unit]
Description=chibisafe, easy to use file uploader
After=network.target
[Service]
Type=simple
User=chibisafe
WorkingDirectory=/home/chibisafe/chibisafe
EnvironmentFile=/home/chibisafe/chibisafe/.env
ExecStart=/usr/bin/npm run start
Restart=always
[Install]
WantedBy=multi-user.target```