2020-11-10 06:06:38 +01:00
|
|
|
# Changing the systemd config can be done like this:
|
2021-01-25 13:08:34 +01:00
|
|
|
# 1) Edit the config file: systemctl edit --full miniflux
|
|
|
|
# 2) Restart the process: systemctl restart miniflux
|
|
|
|
# All your changes can be reverted with `systemctl revert miniflux.service`.
|
|
|
|
# See https://wiki.archlinux.org/index.php/Systemd#Editing_provided_units.
|
2021-12-16 13:00:49 +01:00
|
|
|
# Also see https://www.freedesktop.org/software/systemd/man/systemd.service.html
|
|
|
|
# for available configuration options in this file.
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2020-10-19 01:12:00 +02:00
|
|
|
[Unit]
|
2021-05-23 03:36:32 +02:00
|
|
|
Description=Miniflux
|
2022-01-17 01:37:56 +01:00
|
|
|
Documentation=man:miniflux(1) https://miniflux.app/docs/index.html
|
2020-10-19 01:12:00 +02:00
|
|
|
After=network.target postgresql.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart=/usr/bin/miniflux
|
2021-03-11 00:10:17 +01:00
|
|
|
User=miniflux
|
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Load environment variables from /etc/miniflux.conf.
|
|
|
|
EnvironmentFile=/etc/miniflux.conf
|
|
|
|
|
|
|
|
# Miniflux uses sd-notify protocol to notify about it's readiness.
|
2021-05-23 03:36:32 +02:00
|
|
|
Type=notify
|
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Enable watchdog.
|
2021-05-23 05:25:38 +02:00
|
|
|
WatchdogSec=60s
|
2021-05-23 03:36:32 +02:00
|
|
|
WatchdogSignal=SIGKILL
|
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Automatically restart Miniflux if it crashes.
|
2021-05-23 03:36:32 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=5
|
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Allocate a directory at /run/miniflux for Unix sockets.
|
|
|
|
RuntimeDirectory=miniflux
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Allow Miniflux to bind to privileged ports.
|
|
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Make the system tree read-only.
|
|
|
|
ProtectSystem=strict
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Allocate a separate /tmp.
|
|
|
|
PrivateTmp=yes
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Ensure the service can never gain new privileges.
|
|
|
|
NoNewPrivileges=yes
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Prohibit access to any kind of namespacing.
|
|
|
|
RestrictNamespaces=yes
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Make home directories inaccessible.
|
|
|
|
ProtectHome=yes
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Make device nodes except for /dev/null, /dev/zero, /dev/full,
|
|
|
|
# /dev/random and /dev/urandom inaccessible.
|
|
|
|
PrivateDevices=yes
|
2020-10-19 01:12:00 +02:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Make cgroup file system hierarchy inaccessible.
|
|
|
|
ProtectControlGroups=yes
|
2020-11-10 06:06:38 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Deny kernel module loading.
|
|
|
|
ProtectKernelModules=yes
|
2021-12-16 05:49:02 +01:00
|
|
|
|
2021-12-16 13:00:49 +01:00
|
|
|
# Make kernel variables (e.g. /proc/sys) read-only.
|
|
|
|
ProtectKernelTunables=yes
|
|
|
|
|
|
|
|
# Deny hostname changing.
|
|
|
|
ProtectHostname=yes
|
|
|
|
|
|
|
|
# Deny realtime scheduling.
|
|
|
|
RestrictRealtime=yes
|
|
|
|
|
|
|
|
# Deny access to the kernel log ring buffer.
|
|
|
|
ProtectKernelLogs=yes
|
|
|
|
|
|
|
|
# Deny setting the hardware or system clock.
|
|
|
|
ProtectClock=yes
|
|
|
|
|
|
|
|
# Filter dangerous system calls. The following is listed as safe basic
|
|
|
|
# choice in systemd.exec(5).
|
|
|
|
SystemCallArchitectures=native
|
|
|
|
|
|
|
|
# Deny kernel execution domain changing.
|
|
|
|
LockPersonality=yes
|
|
|
|
|
|
|
|
# Deny memory mappings that are writable and executable.
|
|
|
|
MemoryDenyWriteExecute=yes
|
2020-12-29 11:47:27 +01:00
|
|
|
|
2020-10-19 01:12:00 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|