From 0adb3400bb0461030ff3e1e98f07cee1bbe18cf9 Mon Sep 17 00:00:00 2001 From: Jason Kossis Date: Fri, 1 Mar 2024 12:56:00 -0500 Subject: [PATCH] Mapping the master secrets to config --- readme-vars.yml | 1 + root/defaults/smokeping_secrets | 3 +++ root/etc/s6-overlay/s6-rc.d/init-smokeping-config/run | 8 ++++++++ 3 files changed, 12 insertions(+) create mode 100755 root/defaults/smokeping_secrets diff --git a/readme-vars.yml b/readme-vars.yml index eecd71c..d7b7721 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -39,6 +39,7 @@ app_setup_block: | * To reload the configuration without restarting the container, run `docker exec smokeping pkill -f -HUP '/usr/bin/perl /usr/s?bin/smokeping(_cgi)?'`, where `smokeping` is the container ID. * To restart the container, run `docker restart smokeping`, where `smokeping` is the container ID. * Note that the default `Targets` file includes items that may or may not work. These are simply to provide examples of configuration. + * Slave setup: modify the `Targets`, `Slaves`, and `smokeping_secrets` files on the master host, per [the documentation](https://manpages.ubuntu.com/manpages/trusty/en/man7/smokeping_master_slave.7.html). # changelog changelogs: diff --git a/root/defaults/smokeping_secrets b/root/defaults/smokeping_secrets new file mode 100755 index 0000000..6cf6a43 --- /dev/null +++ b/root/defaults/smokeping_secrets @@ -0,0 +1,3 @@ +host1:mysecret +host2:yoursecret +boomer:lkasdf93uhhfdfddf diff --git a/root/etc/s6-overlay/s6-rc.d/init-smokeping-config/run b/root/etc/s6-overlay/s6-rc.d/init-smokeping-config/run index fb75c84..ae00e60 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-smokeping-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-smokeping-config/run @@ -43,6 +43,14 @@ if [[ ! -L /etc/apache2/httpd.conf ]]; then ln -sf /config/httpd.conf /etc/apache2/httpd.conf fi +if [[ ! -e /config/smokeping_secrets ]]; then + cp /defaults/smokeping_secrets /config/smokeping_secrets +fi + +if [[ ! -L /etc/smokeping/smokeping_secrets ]]; then + ln -sf /config/smokeping_secrets /etc/smokeping/smokeping_secrets +fi + if [[ -e /config/ssmtp.conf ]]; then cp /config/ssmtp.conf /etc/ssmtp/ssmtp.conf fi