diff --git a/stack/resilient/buildout.cfg b/stack/resilient/buildout.cfg index 60d991d60d3486af9b5cf8aa2aa02d439ec3de58..f60c87a911fc4d9592cf41fdd025a532e90c999b 100644 --- a/stack/resilient/buildout.cfg +++ b/stack/resilient/buildout.cfg @@ -50,7 +50,7 @@ mode = 0644 recipe = slapos.recipe.template url = ${:_profile_base_location_}/pbsready-import.cfg.in output = ${buildout:directory}/pbsready-import.cfg -md5sum = f4e6831110ad5fcf29e3463f49556eee +md5sum = cdebc491a50a61fecc3391a5eb311bdb mode = 0644 [pbsready-export] @@ -95,7 +95,7 @@ output = ${buildout:directory}/instance-frozen.cfg [resilient-web-takeover-cgi-script-download] recipe = slapos.recipe.build:download url = ${:_profile_base_location_}/resilient-web-takeover-cgi-script.py.in -md5sum = b3b47dd6e499ac2ea36aa32dbbdfd5f5 +md5sum = c46c8e3e4ce4376c98ad2fc0e2ff0fe4 mode = 0644 destination = ${buildout:directory}/resilient-web-takeover-cgi-script.py.in diff --git a/stack/resilient/pbsready-import.cfg.in b/stack/resilient/pbsready-import.cfg.in index 12108fe7ef8339a88aa6483cf242fcc3fa098896..54b3c1fe82d70326e94b9f3dacfc789a2d01784c 100644 --- a/stack/resilient/pbsready-import.cfg.in +++ b/stack/resilient/pbsready-import.cfg.in @@ -62,12 +62,13 @@ callback = $${importer:wrapper} [post-notification-run] recipe = collective.recipe.template -diff-file-name = $${basedirectory:backup}/backup.diff +diff-file = $${basedirectory:backup}/backup.diff +proof-signature-file = $${basedirectory:backup}/proof.signature input = inline: #!/${bash:location}/bin/bash cd $${directory:backup} - find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature - diff -ruw backup.signature $${basedirectory:backup}/proof.signature > $${:diff-file-name} + find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > $${:proof-signature-file} + diff -ruw backup.signature $${:proof-signature-file} > $${:diff-file} output = $${rootdirectory:bin}/post-notification-run mode = 0700 @@ -81,7 +82,7 @@ callback = $${post-notification-run:output} recipe = slapos.recipe.template:jinja2 template = inline: #!/${bash:location}/bin/bash - if [ "$(wc -l $${post-notification-run:diff-file-name} | cut -d \ -f1)" -eq 0 ]; then exit 0; else exit 1; fi + if [ "$(wc -l $${post-notification-run:diff-file} | cut -d \ -f1)" -eq 0 ]; then exit 0; else exit 1; fi rendered = $${basedirectory:promises}/backup-transfer-integrity-promise mode = 700 @@ -113,6 +114,7 @@ input = ${resilient-web-takeover-cgi-script-download:destination} output = $${directory:cgi-bin}/web-takeover.cgi password = $${resilient-web-takeover-password:passwd} mode = 700 +proof-signature-url = $${publish:monitor-base-url}/private/resilient/backup.signature # XXX could it be something lighter? # XXX Add SSL @@ -167,4 +169,4 @@ curl_path = ${curl:location}/bin/curl ########### [backup-signature-link] recipe = cns.recipe.symlink -symlink = $${basedirectory:backup}/proof.signature = $${directory:monitor-resilient}/backup.signature \ No newline at end of file +symlink = $${post-notification-run:proof-signature-file} = $${directory:monitor-resilient}/backup.signature \ No newline at end of file diff --git a/stack/resilient/resilient-web-takeover-cgi-script.py.in b/stack/resilient/resilient-web-takeover-cgi-script.py.in index 8f009931ac459b20e4840a7989debbe7f93caffc..afcff235abbe5224cf977bf20c58908d7be99159 100644 --- a/stack/resilient/resilient-web-takeover-cgi-script.py.in +++ b/stack/resilient/resilient-web-takeover-cgi-script.py.in @@ -87,6 +87,7 @@ if "password" not in form: <hr /> <p><b>Last valid backup:</b> %s</p> <p><b>Importer script(s) of backup in progress:</b> %s</p> + <p><b>Backup Signature:</b> <a href='${resilient-web-takeover-cgi-script:proof-signature-url}'>${resilient-web-takeover-cgi-script:proof-signature-url}</a></b></p> %s <form action="/"> Password: <input type="text" name="password">