Skip to content
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
5 changes: 3 additions & 2 deletions images/openwisp_openvpn/openvpn.crontab
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*/1 * * * * sh /openvpn.sh
*/5 * * * * sh /revokelist.sh
# Forward cron output to PID 1 so it is collected by Docker's logging driver.
*/1 * * * * sh /openvpn.sh >>/proc/1/fd/1 2>>/proc/1/fd/2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please clarify the redirections?

*/5 * * * * sh /revokelist.sh >>/proc/1/fd/1 2>>/proc/1/fd/2
10 changes: 8 additions & 2 deletions images/openwisp_openvpn/openvpn_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ crl_download_to() {
curl_download --silent --fail --retry 10 --retry-delay 5 --retry-max-time 300 \
--output "$output_path" \
"${DASHBOARD_INTERNAL}/admin/pki/ca/x509/ca/${CA_UUID}.crl"
test -s "$output_path"
test -s "$output_path" || return 1
# The CRL is public data (revoked certificate serial numbers), and OpenVPN
# re-reads it from disk on every TLS session after dropping privileges to
# the unprivileged "user"/"group" from openvpn.conf, so it must stay
# world-readable regardless of mktemp's default 0600 mode.
chmod 644 -- "$output_path"
}

crl_download() {
Expand Down Expand Up @@ -209,6 +214,7 @@ init_send_network_topology() {
fi
(
crontab -l
echo "*/$TOPOLOGY_UPDATE_INTERVAL * * * * TOPOLOGY_UUID=$TOPOLOGY_UUID TOPOLOGY_KEY=$TOPOLOGY_KEY sh /send-topology.sh"
# Forward the generated job's output to PID 1 so Docker can collect it.
echo "*/$TOPOLOGY_UPDATE_INTERVAL * * * * TOPOLOGY_UUID=$TOPOLOGY_UUID TOPOLOGY_KEY=$TOPOLOGY_KEY sh /send-topology.sh >>/proc/1/fd/1 2>>/proc/1/fd/2"
) | crontab -
}