Skip to content

Commit 201bb29

Browse files
committed
etc: add systemd units and nginx config
Provide default systemd service files for pw-http and pw-ingress with basic security hardening (DynamicUser, ProtectSystem, NoNewPrivileges) and a minimal nginx reverse proxy configuration. Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent 960c254 commit 201bb29

3 files changed

Lines changed: 62 additions & 0 deletions

File tree

‎etc/nginx.conf‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# patchwork - automated patch tracking system
2+
# copyright (c) the patchwork contributors (see contributors)
3+
#
4+
# spdx-license-identifier: gpl-2.0-or-later
5+
6+
server {
7+
listen 80;
8+
server_name patchwork.example.com;
9+
10+
location / {
11+
proxy_pass http://127.0.0.1:8080;
12+
proxy_set_header Host $host;
13+
proxy_set_header X-Real-IP $remote_addr;
14+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
15+
proxy_set_header X-Forwarded-Proto $scheme;
16+
}
17+
}

‎etc/pw-http.service‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patchwork - automated patch tracking system
2+
# Copyright (C) The Patchwork Contributors (see CONTRIBUTORS)
3+
#
4+
# SPDX-License-Identifier: GPL-2.0-or-later
5+
6+
[Unit]
7+
Description=Patchwork HTTP server
8+
After=network.target postgresql.service
9+
Documentation=https://patchwork.readthedocs.io/
10+
11+
[Service]
12+
Type=simple
13+
ExecStart=/usr/bin/pw http
14+
Restart=on-failure
15+
RestartSec=5
16+
DynamicUser=yes
17+
StateDirectory=patchwork
18+
ProtectSystem=strict
19+
ProtectHome=yes
20+
NoNewPrivileges=yes
21+
22+
[Install]
23+
WantedBy=multi-user.target

‎etc/pw-ingress.service‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patchwork - automated patch tracking system
2+
# Copyright (C) The Patchwork Contributors (see CONTRIBUTORS)
3+
#
4+
# SPDX-License-Identifier: GPL-2.0-or-later
5+
6+
[Unit]
7+
Description=Patchwork SMTP ingress daemon
8+
After=network.target postgresql.service
9+
Documentation=https://patchwork.readthedocs.io/
10+
11+
[Service]
12+
Type=simple
13+
ExecStart=/usr/bin/pw ingress
14+
Restart=on-failure
15+
RestartSec=5
16+
DynamicUser=yes
17+
ProtectSystem=strict
18+
ProtectHome=yes
19+
NoNewPrivileges=yes
20+
21+
[Install]
22+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)