acme-common: migrate uacme config paramaters
authorSeo Suchan <redacted>
Wed, 25 Feb 2026 19:39:13 +0000 (04:39 +0900)
committerAlexandru Ardelean <redacted>
Tue, 14 Apr 2026 07:38:06 +0000 (10:38 +0300)
migrate old uacme specific config parameters into acme-common format.

Signed-off-by: Seo Suchan <redacted>
net/acme-common/files/acme.uci-defaults

index 326f1e8c14444e670c7b9b0a9112b9fa56b84d42..d6aa068ad48e3db6c82b4358c646db7e6aa76bf1 100644 (file)
@@ -36,17 +36,41 @@ handle_cert() {
        local standalone=$(uci_get acme "$section" standalone)
        [ -n "$standalone" ] && uci_remove acme "$section" standalone
        local dns=$(uci_get acme "$section" dns)
+       local tls=$(uci_get acme "$section" tls)
        local validation_method=$(uci_get acme "$section" validation_method)
        if [ -z "$validation_method" ]; then
                if [ -n "$dns" ]; then
                        validation_method="dns"
                elif [ "$standalone" = 1 ]; then
                        validation_method="standalone"
+               elif [ "$tls" = 1 ]; then
+                       validation_method="alpn"
                else
                        validation_method="webroot"
                fi
                uci_set acme "$section" validation_method "$validation_method"
        fi
+
+       #uacme migration
+       local ACME_URL=$(uci_get acme "$section" acme_uri)
+       local ACME_SERVER=$(uci_get acme "$section" acme_server)
+
+       if [ -n "$ACME_URL" ]; then
+               if [ -n "$ACME_SERVER" ]; then
+                       if [ "$ACME_URL" = "$ACME_SERVER" ]; then
+                               uci_remove acme "$section" acme_uri
+                       else
+                               log warn "Both acme_uri and acme_server set in $section, need manual cleanup. client will use acme_server in current state"
+                       fi
+               else
+                       uci_set acme "$section" acme_server "$ACME_URL"
+                       uci_remove acme "$section" acme_uri
+               fi
+       fi
+       local ACME_STAGING_URL=$(uci_get acme "$section" acme_staging_url)
+       if [ -n "$ACME_STAGING_URL" ]; then
+               uci_remove acme "$section" acme_staging_url
+       fi
 }
 
 config_load acme
git clone https://git.99rst.org/PROJECT