Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/ops/systemd/progmaweb-api.service
blob: e2ff8e7d83fae902584b2afc531c1ee86f574784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
# SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1

[Unit]
Description=Progmaweb account API
After=network-online.target postgresql.service
Wants=network-online.target postgresql.service

[Service]
Type=exec
User=progmaweb
Group=progmaweb
WorkingDirectory=/srv/progmaweb/current/api
# Invoke the framework-dependent deployment through the installed runtime. This
# avoids relying on the copied apphost inode being executable under the host's
# SELinux policy while preserving the same immutable application payload.
ExecStart=/usr/bin/dotnet /srv/progmaweb/current/api/Progmaweb.Api.dll
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=ASPNETCORE_URLS=http://127.0.0.1:5085
EnvironmentFile=-/etc/progmaweb/account.env
Restart=on-failure
RestartSec=5s
TimeoutStopSec=30s

# The API has no writable application files. Its state is in PostgreSQL, reached through the local Unix socket; the
# connection string is in the environment file above.
UMask=0077
AmbientCapabilities=
CapabilityBoundingSet=
NoNewPrivileges=true
PrivateDevices=true
PrivateTmp=true
ProtectClock=true
ProtectHome=true
ProtectHostname=true
ProtectSystem=strict
ProtectKernelLogs=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RemoveIPC=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
LockPersonality=true
# MemoryDenyWriteExecute is intentionally omitted: CoreCLR's JIT requires managed executable mappings at runtime.
SystemCallArchitectures=native

[Install]
WantedBy=multi-user.target