Skip to content

Commit 5ce9fa6

Browse files
committed
Detector code is still refering to postgres, yet it needs to stay until we land #651
1 parent 9ae773d commit 5ce9fa6

19 files changed

+1762
-0
lines changed

detector/debian/changelog

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
detector (0.2) unstable; urgency=medium
2+
3+
* run webapp as a dedicated service
4+
5+
-- Federico Ceratto <[email protected]> Tue, 26 Nov 2019 18:58:45 +0000
6+
7+
detector (0.1) unstable; urgency=medium
8+
9+
* event detector
10+
11+
-- Federico Ceratto <[email protected]> Tue, 26 Nov 2019 18:58:23 +0000

detector/debian/control

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Source: detector
2+
Section: python
3+
Priority: optional
4+
Maintainer: Federico Ceratto <[email protected]>
5+
Build-Depends: debhelper-compat (= 12),
6+
python3,
7+
dh-systemd (>= 1.5),
8+
dh-python,
9+
python3-boto3,
10+
python3-lz4,
11+
python3-paramiko,
12+
python3-psycopg2,
13+
python3-setuptools,
14+
python3-statsd,
15+
python3-systemd,
16+
python3-ujson
17+
Standards-Version: 4.1.3
18+
19+
Package: detector
20+
Architecture: all
21+
Depends: ${misc:Depends},
22+
${python3:Depends},
23+
python3-boto3,
24+
python3-lz4,
25+
python3-paramiko,
26+
python3-psycopg2,
27+
python3-setuptools,
28+
python3-statsd,
29+
python3-systemd,
30+
python3-ujson,
31+
nginx
32+
Suggests:
33+
bpython3,
34+
python3-pytest,
35+
python3-pytest-benchmark
36+
Description: OONI Event Detector
37+
OONI Event Detector
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[Unit]
2+
Description=OONI Detector Webapp
3+
Wants=network-online.target
4+
After=network-online.target
5+
6+
[Service]
7+
ExecStart=/usr/bin/detector --webapp
8+
Restart=on-abort
9+
Type=simple
10+
RestartSec=2s
11+
WorkingDirectory=/var/lib/detector
12+
13+
User=fastpath
14+
Group=fastpath
15+
ReadOnlyDirectories=/
16+
ReadWriteDirectories=/proc/self
17+
18+
StandardOutput=syslog+console
19+
StandardError=syslog+console
20+
21+
PermissionsStartOnly=true
22+
LimitNOFILE=65536
23+
24+
# Hardening
25+
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
26+
SystemCallFilter=~@clock @debug @cpu-emulation @keyring @module @mount @obsolete @raw-io @reboot @swap
27+
NoNewPrivileges=yes
28+
PrivateDevices=yes
29+
PrivateTmp=yes
30+
ProtectHome=yes
31+
ProtectSystem=full
32+
ProtectKernelModules=yes
33+
ProtectKernelTunables=yes
34+
35+
[Install]
36+
WantedBy=multi-user.target

detector/debian/detector.service

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[Unit]
2+
Description=OONI Event Detector
3+
Wants=network-online.target
4+
After=network-online.target
5+
6+
[Service]
7+
ExecStart=/usr/bin/detector
8+
Restart=on-abort
9+
Type=simple
10+
RestartSec=2s
11+
WorkingDirectory=/var/lib/detector
12+
13+
User=fastpath
14+
Group=fastpath
15+
ReadOnlyDirectories=/
16+
ReadWriteDirectories=/proc/self
17+
ReadWriteDirectories=/var/lib/detector
18+
19+
StandardOutput=syslog+console
20+
StandardError=syslog+console
21+
22+
PermissionsStartOnly=true
23+
LimitNOFILE=65536
24+
25+
# Hardening
26+
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
27+
SystemCallFilter=~@clock @debug @cpu-emulation @keyring @module @mount @obsolete @raw-io @reboot @swap
28+
NoNewPrivileges=yes
29+
PrivateDevices=yes
30+
PrivateTmp=yes
31+
ProtectHome=yes
32+
ProtectSystem=full
33+
ProtectKernelModules=yes
34+
ProtectKernelTunables=yes
35+
36+
[Install]
37+
WantedBy=multi-user.target

detector/debian/rules

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/make -f
2+
export DH_VERBOSE = 1
3+
4+
%:
5+
dh $@ --buildsystem=pybuild
6+
7+
override_dh_installsystemd:
8+
dh_installsystemd --no-restart-on-upgrade --name detector
9+
dh_installsystemd --no-restart-on-upgrade --name detector-webapp

detector/debian/source/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0 (quilt)

detector/detector/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#

detector/detector/data/README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The country-list.json file is generated by https://github.com/ooni/country-util

detector/detector/data/country-list.json

+1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)