diff --git a/www/caddy/Makefile b/www/caddy/Makefile index a2694d60a..2623a7479 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= caddy PLUGIN_VERSION= 1.5.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 843e60d75..af002c9ea 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -1,7 +1,7 @@ //Pischem/caddy A GUI model for configuring a reverse proxy in the Caddy web server. - 1.1.7 + 1.1.8 diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php new file mode 100644 index 000000000..0687d49ab --- /dev/null +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php @@ -0,0 +1,71 @@ +object(); + + // Read and migrate TlsAutoHttps setting if necessary + if (!empty($config->Pischem->caddy->general->TlsAutoHttps)) { + $tlsAutoHttpsValue = (string)$config->Pischem->caddy->general->TlsAutoHttps; + // Check if the current value is 'on' and needs to be migrated + if ($tlsAutoHttpsValue === 'on') { + // Locate the corresponding node in the model + $modelNode = $model->getNodeByReference('general.TlsAutoHttps'); + if ($modelNode != null) { + // Set to empty value in the model, migration from 'on' to '' + $modelNode->setValue(''); + } + } + } + + // Read and migrate TlsDnsProvider setting if necessary + if (!empty($config->Pischem->caddy->general->TlsDnsProvider)) { + $tlsDnsProviderValue = (string)$config->Pischem->caddy->general->TlsDnsProvider; + // Check if the current value is 'none' and needs to be migrated + if ($tlsDnsProviderValue === 'none') { + // Locate the corresponding node in the model + $modelNode = $model->getNodeByReference('general.TlsDnsProvider'); + if ($modelNode != null) { + // Set to empty value in the model, migration from 'none' to '' + $modelNode->setValue(''); + } + } + } + + // Model is saved by 'run_migrations.php' + } +}