Skip to content

Commit

Permalink
Detector code is still refering to postgres, yet it needs to stay unt…
Browse files Browse the repository at this point in the history
…il we land #651
  • Loading branch information
hellais committed Feb 2, 2024
1 parent 9ae773d commit 5ce9fa6
Show file tree
Hide file tree
Showing 19 changed files with 1,762 additions and 0 deletions.
11 changes: 11 additions & 0 deletions detector/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
detector (0.2) unstable; urgency=medium

* run webapp as a dedicated service

-- Federico Ceratto <[email protected]> Tue, 26 Nov 2019 18:58:45 +0000

detector (0.1) unstable; urgency=medium

* event detector

-- Federico Ceratto <[email protected]> Tue, 26 Nov 2019 18:58:23 +0000
37 changes: 37 additions & 0 deletions detector/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Source: detector
Section: python
Priority: optional
Maintainer: Federico Ceratto <[email protected]>
Build-Depends: debhelper-compat (= 12),
python3,
dh-systemd (>= 1.5),
dh-python,
python3-boto3,
python3-lz4,
python3-paramiko,
python3-psycopg2,
python3-setuptools,
python3-statsd,
python3-systemd,
python3-ujson
Standards-Version: 4.1.3

Package: detector
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
python3-boto3,
python3-lz4,
python3-paramiko,
python3-psycopg2,
python3-setuptools,
python3-statsd,
python3-systemd,
python3-ujson,
nginx
Suggests:
bpython3,
python3-pytest,
python3-pytest-benchmark
Description: OONI Event Detector
OONI Event Detector
36 changes: 36 additions & 0 deletions detector/debian/detector-webapp.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[Unit]
Description=OONI Detector Webapp
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/detector --webapp
Restart=on-abort
Type=simple
RestartSec=2s
WorkingDirectory=/var/lib/detector

User=fastpath
Group=fastpath
ReadOnlyDirectories=/
ReadWriteDirectories=/proc/self

StandardOutput=syslog+console
StandardError=syslog+console

PermissionsStartOnly=true
LimitNOFILE=65536

# Hardening
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
SystemCallFilter=~@clock @debug @cpu-emulation @keyring @module @mount @obsolete @raw-io @reboot @swap
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
ProtectKernelModules=yes
ProtectKernelTunables=yes

[Install]
WantedBy=multi-user.target
37 changes: 37 additions & 0 deletions detector/debian/detector.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[Unit]
Description=OONI Event Detector
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/detector
Restart=on-abort
Type=simple
RestartSec=2s
WorkingDirectory=/var/lib/detector

User=fastpath
Group=fastpath
ReadOnlyDirectories=/
ReadWriteDirectories=/proc/self
ReadWriteDirectories=/var/lib/detector

StandardOutput=syslog+console
StandardError=syslog+console

PermissionsStartOnly=true
LimitNOFILE=65536

# Hardening
CapabilityBoundingSet=CAP_SETUID CAP_SETGID
SystemCallFilter=~@clock @debug @cpu-emulation @keyring @module @mount @obsolete @raw-io @reboot @swap
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
ProtectHome=yes
ProtectSystem=full
ProtectKernelModules=yes
ProtectKernelTunables=yes

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions detector/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1

%:
dh $@ --buildsystem=pybuild

override_dh_installsystemd:
dh_installsystemd --no-restart-on-upgrade --name detector
dh_installsystemd --no-restart-on-upgrade --name detector-webapp
1 change: 1 addition & 0 deletions detector/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions detector/detector/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
1 change: 1 addition & 0 deletions detector/detector/data/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The country-list.json file is generated by https://github.com/ooni/country-util
1 change: 1 addition & 0 deletions detector/detector/data/country-list.json

Large diffs are not rendered by default.

Loading

0 comments on commit 5ce9fa6

Please sign in to comment.