From 362edb68ad7fcb1c7c83741b868e997f774623dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Kellerer?= Date: Sat, 11 Apr 2020 17:36:09 +0200 Subject: [PATCH] security/acme-client: Added fullchain.pem filename-template to model & dialog --- .../OPNsense/AcmeClient/forms/dialogAction.xml | 9 +++++++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 6 ++++++ .../opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php | 1 - 3 files changed, 15 insertions(+), 1 deletion(-) 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 5d89e439f..db41ea648 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 @@ -133,6 +133,15 @@ Leave blank to use default "{{name}}/ca.pem". true + + action.sftp_filename_fullchain + + text + Name template for the public certificate fullchain file (cert + ca). + Placeholders "{{name}}" and "%s" are replaced by the name of the certificate being uploaded. + Leave blank to use default "{{name}}/fullchain.pem". + true + header 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 5cd40331c..052bdd530 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 @@ -959,6 +959,12 @@ Should be a string between 1 and 255 characters. Characters are limited to [a-z], [0-9] and [{}@./-_%] and the string must neither begin nor end with '/'. + + N + /^(?![\/\\])[\w\d_\-@.\/{}%]{1,255}(?<![\/\\])$/ui + Should be a string between 1 and 255 characters. + Characters are limited to [a-z], [0-9] and [{}@./-_%] and the string must neither begin nor end with '/'. + /^(?!.*(Let\'s\ Encrypt|acme|[fF]irmware))([\S\s]{1,255})/ diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php index b18596edc..ede285981 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php @@ -120,7 +120,6 @@ const UPLOAD_NAME_TEMPLATES = [ "key" => ["default" => "{{name}}/key.pem", "option" => "key-name"], "ca" => ["default" => "{{name}}/ca.pem", "option" => "ca-name"], "fullchain" => ["default" => "{{name}}/fullchain.pem", "option" => "fullchain-name"], - ]; // Exit codes