-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(systemd): add systemd service files (#22)
Add systemd files to serve files from /var/lib/rustypaste, automatic user creation via systemd-sysusers and AUTH_TOKEN configuration via rustypaste.env in /etc/rustypaste/rustypaste.env. implements #16
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# To enable basic HTTP auth, set the AUTH_TOKEN | ||
AUTH_TOKEN="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[Unit] | ||
Description=Rustypaste server | ||
After=network-online.target | ||
Wants=network-online.target systemd-networkd-wait-online.service | ||
|
||
[Service] | ||
User=rustypaste | ||
Group=rustypaste | ||
ExecStart=/usr/bin/rustypaste | ||
ReadWritePaths=/var/lib/rustypaste | ||
ReadOnlyPaths=/etc/rustypaste | ||
|
||
WorkingDirectory=/var/lib/rustypaste | ||
Environment="CONFIG=/etc/rustypaste/config.toml" | ||
EnvironmentFile=/etc/rustypaste/rustypaste.env | ||
|
||
# Hardening options | ||
CapabilityBoundingSet= | ||
AmbientCapabilities= | ||
NoNewPrivileges=true | ||
ProtectHome=true | ||
ProtectSystem=strict | ||
ProtectKernelTunables=true | ||
ProtectKernelModules=true | ||
ProtectControlGroups=true | ||
PrivateTmp=true | ||
PrivateDevices=true | ||
LockPersonality=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
u rustypaste - "Minimal file upload/pastebin service" /var/lib/rustypaste |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d /var/lib/rustypaste 0750 rustypaste rustypaste |