From d1907f96135343a5fc3fa8f4f12aaecfdf7fbfa1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 12 Nov 2021 23:35:00 +0100 Subject: [PATCH] security/acme-client: add support for acme.sh deploy hook "fritzbox" --- security/acme-client/pkg-descr | 3 +- .../AcmeClient/forms/dialogAction.xml | 21 +++++++++ .../AcmeClient/LeAutomation/AcmeFritzbox.php | 47 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 16 +++++++ 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeFritzbox.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 0777c8d51..d81b18e4a 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -11,7 +11,8 @@ Plugin Changelog 3.5 Added: -* add support for Synology DSM deploy hook (#2236) +* new automation: cert upload to Synology DSM (#2236) +* new automation: cert upload to FRITZ!Box router Changed: * refactor code to support acme.sh deploy hooks diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index 2c875b786..15dbabc9f 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -199,4 +199,25 @@ checkbox This option ensures that a new certificate is created in Synology DSM if it does not exist yet. If unchecked only existing certificates will be updated. + + + header + + + + action.acme_fritzbox_url + + text + URL of the router, i.e. https://fritzbox.example.com. + + + action.acme_fritzbox_username + + text + + + action.acme_fritzbox_password + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeFritzbox.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeFritzbox.php new file mode 100644 index 000000000..ed60880aa --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeFritzbox.php @@ -0,0 +1,47 @@ +acme_env['DEPLOY_FRITZBOX_URL'] = (string)$this->config->acme_fritzbox_url; + $this->acme_env['DEPLOY_FRITZBOX_USERNAME'] = (string)$this->config->acme_fritzbox_username; + $this->acme_env['DEPLOY_FRITZBOX_PASSWORD'] = (string)$this->config->acme_fritzbox_password; + $this->acme_args[] = '--deploy-hook fritzbox'; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index c514f31c4..362bb2017 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1047,6 +1047,7 @@ Restart Nginx (OPNsense plugin) Upload certificate to Highwinds CDN Upload certificate via SFTP + Upload certificate to FRITZ!Box router Upload certificate to Synology DSM System or Plugin Command @@ -1186,6 +1187,21 @@ /^.{1,1024}$/u Should be a string between 1 and 1024 characters. + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. +