Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add systemd timer to run "manage.py remove-pending-sources" daily #6826

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=job to remove pending SecureDrop sources daily

[Service]
ExecStart=/var/www/securedrop/manage.py remove-pending-sources
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=full
ReadOnlyDirectories=/
ReadWriteDirectories=/var/lib/securedrop
User=www-data
WorkingDirectory=/var/www/securedrop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=remove pending SecureDrop sources daily

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target
8 changes: 5 additions & 3 deletions securedrop/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,19 @@ override_dh_gencontrol:
override_dh_installinit:
dh_installinit --noscripts

# We want to enable all systemd units except the two that are run by timers,
# so we have to mark those two as --no-enable first, then the final
# `dh_systemd_enable` invocation will enable the rest
# We want to enable all systemd units except those that are run by timers, so
# we have to mark those as --no-enable first, then the final
# `dh_systemd_enable` invocation will enable the rest.
override_dh_systemd_enable:
cfm marked this conversation as resolved.
Show resolved Hide resolved
dh_systemd_enable --no-enable securedrop-submissions-today.service
dh_systemd_enable --no-enable securedrop-clean-tmp.service
dh_systemd_enable --no-enable securedrop-remove-pending-sources.service
dh_systemd_enable

# This is basically the same as the enable stanza above, just whether the
# unit should be started after installation.
override_dh_systemd_start:
dh_systemd_start --no-start securedrop-submissions-today.service
dh_systemd_start --no-start securedrop-clean-tmp.service
dh_systemd_start --no-start securedrop-remove-pending-sources.service
dh_systemd_start