forge
Explore
Log in

Don't you dare go Hollow

im

Clone
★ 0

0 watching0 forksRustAGPL-3.0542.8 KiBb9f0726Tahinli27 days ago34 commits

im.service40 lines, 1.7 KiBHistoryRawDownload
1[Unit]
2Description=im: the family's sign-in provider (OpenID Connect), as a user service
3# No network-online.target: it is a system unit that a user manager cannot see, and im binds 127.0.0.1.
4StartLimitIntervalSec=60
5StartLimitBurst=5
6
7[Service]
8Type=simple
9# Runs as the account that owns this unit (for example `apps`), under its user manager. No User= or Group=.
10# The binary is installed by kur into ~/bin/im. The config must use absolute paths: im does not expand "~"
11# (its paths are used as given, and relative ones resolve against the working directory below). Point
12# database, data_dir and [backup] dir under ~/.local/state/im, for example /home/apps/.local/state/im/data/im.db.
13Environment=IM_CONFIG=%h/.config/im/im.toml
14ExecStart=%h/bin/im serve
15# StateDirectory creates ~/.local/state/im (mode 0700) before start; the working directory is that directory.
16StateDirectory=im
17StateDirectoryMode=0700
18WorkingDirectory=%S/im
19Restart=on-failure
20RestartSec=2
21LimitNOFILE=65536
22# A photo decode may use up to 96 MiB and two run at once; this leaves room for that and the rest.
23MemoryMax=1G
24UMask=0077
25
26# Hardening. Only the options a user manager applies without special privileges. The namespace-based options
27# of the system unit (ProtectSystem, PrivateTmp, ProtectHome, PrivateDevices, and the rest) are left out:
28# a user manager can apply them only where unprivileged user namespaces are available.
29NoNewPrivileges=yes
30LockPersonality=yes
31RestrictRealtime=yes
32RestrictSUIDSGID=yes
33MemoryDenyWriteExecute=yes
34SystemCallArchitectures=native
35SystemCallFilter=@system-service
36SystemCallFilter=~@privileged
37RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
38
39[Install]
40WantedBy=default.target