im
Clone
https://git.tahinli.com/Tahinli/im.git
0 watching0 forksRustAGPL-3.0542.8 KiBb9f0726Tahinli27 days ago34 commits
| 1 | [Unit] |
| 2 | Description=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. |
| 4 | StartLimitIntervalSec=60 |
| 5 | StartLimitBurst=5 |
| 6 | |
| 7 | [Service] |
| 8 | Type=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. |
| 13 | Environment=IM_CONFIG=%h/.config/im/im.toml |
| 14 | ExecStart=%h/bin/im serve |
| 15 | # StateDirectory creates ~/.local/state/im (mode 0700) before start; the working directory is that directory. |
| 16 | StateDirectory=im |
| 17 | StateDirectoryMode=0700 |
| 18 | WorkingDirectory=%S/im |
| 19 | Restart=on-failure |
| 20 | RestartSec=2 |
| 21 | LimitNOFILE=65536 |
| 22 | # A photo decode may use up to 96 MiB and two run at once; this leaves room for that and the rest. |
| 23 | MemoryMax=1G |
| 24 | UMask=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. |
| 29 | NoNewPrivileges=yes |
| 30 | LockPersonality=yes |
| 31 | RestrictRealtime=yes |
| 32 | RestrictSUIDSGID=yes |
| 33 | MemoryDenyWriteExecute=yes |
| 34 | SystemCallArchitectures=native |
| 35 | SystemCallFilter=@system-service |
| 36 | SystemCallFilter=~@privileged |
| 37 | RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 |
| 38 | |
| 39 | [Install] |
| 40 | WantedBy=default.target |