From fb966d73bbea844663a4eff736f63b0253e6be5e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 24 Apr 2020 12:13:14 +0100 Subject: [PATCH] Add systemd file for crab --- files/crab.service | 22 ++++++++++++++++++++++ tasks/dabapps.yml | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 files/crab.service diff --git a/files/crab.service b/files/crab.service new file mode 100644 index 0000000..e5ff77f --- /dev/null +++ b/files/crab.service @@ -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 diff --git a/tasks/dabapps.yml b/tasks/dabapps.yml index 53c13a3..f826a74 100644 --- a/tasks/dabapps.yml +++ b/tasks/dabapps.yml @@ -43,3 +43,11 @@ option: ignore value: "{{ home }}/.config/.gitignore" mode: 0644 + +- name: Install Crab service + template: + src: ./files/crab.service + dest: /etc/systemd/system/crab.service + mode: 0644 + owner: root + group: root