From 3a1c3e960d3507ceb4327d43b6dbf7cc62d3edab Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Wed, 22 Apr 2026 15:29:39 +0200 Subject: [PATCH] feat(ns-plug): dual-send backup to my-new proxy Adds a second upload to https://my.nethesis.it/proxy/backup after remote-backup finishes its upload to backupd.nethesis.it. Same transitional pattern already used by send-heartbeat and send-inventory: the proxy accepts the existing system_id:secret Basic Auth pair and translates it into the my-new system_key:system_secret on its way to the new collect endpoint, so no UCI or registration change is needed on the appliance. Gated to enterprise subscriptions via `TYPE = enterprise` to stay in sync with the other dual-send scripts. Best-effort (`|| :`): a proxy outage does not block the primary upload that already completed against backupd, and the md5 marker is still updated so the same backup is not re-uploaded the next night. X-Filename is propagated so the user-facing filename ends up as S3 object metadata on my-new. Refs: NethServer/my#82 NethServer/my#83 --- packages/ns-plug/files/remote-backup | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ns-plug/files/remote-backup b/packages/ns-plug/files/remote-backup index d3e283e0d..6acad8298 100755 --- a/packages/ns-plug/files/remote-backup +++ b/packages/ns-plug/files/remote-backup @@ -54,6 +54,17 @@ case "$cmd" in exit_error "No file specified" fi curl $curl_args $base_url --upload-file $file + rc=$? + # Temporary dual-send to new my.nethesis.it via the translation + # proxy, same pattern used by send-heartbeat / send-inventory. + # To be removed once the migration is complete. + if [ "$TYPE" = "enterprise" ]; then + curl $curl_args -X POST \ + -H "Content-Type: application/octet-stream" \ + -H "X-Filename: $(basename "$file")" \ + --data-binary "@$file" https://my.nethesis.it/proxy/backup >/dev/null || : + fi + exit $rc ;; delete) file=$2