1.3 KiB · text History d82bd83
[Unit]
Description=GitGud forge
Documentation=https://github.com/gmorell/gitgud
After=network-online.target postgresql.service
Wants=network-online.target

[Service]
Type=exec
User=gitgud
Group=gitgud
# Configuration lives here, not in the unit: an upgrade replaces the
# unit and must not replace the operator's settings.
EnvironmentFile=/etc/gitgud/gitgud.env
WorkingDirectory=/var/lib/gitgud
ExecStart=/opt/gitgud/bin/server
Restart=on-failure
RestartSec=5s

# The release unpacks its own boot scripts under RELEASE_TMP; point it
# somewhere writable, since /opt/gitgud is root-owned and read-only to
# the service user.
Environment=RELEASE_TMP=/var/lib/gitgud/tmp

# systemd starts services with no locale at all, and the BEAM then comes
# up with native name encoding latin1 — which Elixir warns about on
# every boot and which mangles non-ASCII filenames. C.UTF-8 is built
# into glibc, so unlike en_US.UTF-8 it needs no locale-gen and is
# guaranteed present on a minimal install.
Environment=LANG=C.UTF-8
Environment=LC_ALL=C.UTF-8

# The BEAM opens a lot of ports/files: one per connection, plus a git
# process per SSH session.
LimitNOFILE=65536

NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=full
ProtectHome=yes
ReadWritePaths=/var/lib/gitgud

[Install]
WantedBy=multi-user.target