Add systemd file for crab

This commit is contained in:
Jake Howard 2020-04-24 12:13:14 +01:00
parent a2d8ae96b9
commit fb966d73bb
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 30 additions and 0 deletions

22
files/crab.service Normal file
View file

@ -0,0 +1,22 @@
[Unit]
Description=Crab Router
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=nobody
ExecStart=/usr/bin/crab router
Environment="CRAB_ROUTER_HOST=0.0.0.0"
# Allow port 80 bind
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=yes
# More protections, because why not
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=full
[Install]
RequiredBy=multi-user.target

View file

@ -43,3 +43,11 @@
option: ignore option: ignore
value: "{{ home }}/.config/.gitignore" value: "{{ home }}/.config/.gitignore"
mode: 0644 mode: 0644
- name: Install Crab service
template:
src: ./files/crab.service
dest: /etc/systemd/system/crab.service
mode: 0644
owner: root
group: root