]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: acme: rename "uri" into "directory"
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 24 Apr 2025 08:51:41 +0000 (10:51 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 24 Apr 2025 08:52:46 +0000 (10:52 +0200)
Rename the "uri" option of the acme section into "directory".

doc/configuration.txt
include/haproxy/acme-t.h
src/acme.c

index 80577890f75c676ecfe823cdf14dfd8f3b68239f..d50f9c83d32bdee54659faccc5b1ed048240e10f 100644 (file)
@@ -5919,17 +5919,18 @@ contact <string>
 curves <string>
   When using the ECDSA keytype, configure the curves. The default is P-384.
 
+directory <string>
+  This keyword configures the directory URL for the CA used by this acme
+  section. This keyword is mandatory as there is no default URL.
+
+  Example:
+    directory https://acme-staging-v02.api.letsencrypt.org/directory
+
 keytype <string>
   Configure the type of key that will be generated. Value can be either "RSA"
   or "ECDSA". You can also configure the "curves" for ECDSA and the number of
   "bits" for RSA. By default EC384 keys are generated.
 
-uri <string>
-  This keyword configures the directory URL for the CA used by this acme
-  section. This keyword is mandatory as there is no default uri.
-
-  Example:
-    uri https://acme-staging-v02.api.letsencrypt.org/directory
 
 Example:
 
@@ -5945,7 +5946,7 @@ Example:
       ssl-f-use crt "foo.example.com.pem.ecdsa" acme LE2 domains "foo.example.com.pem,bar.example.com"
 
   acme LE1
-      uri https://acme-staging-v02.api.letsencrypt.org/directory
+      directory https://acme-staging-v02.api.letsencrypt.org/directory
       account /etc/haproxy/account.key
       contact john.doe@example.com
       challenge HTTP-01
@@ -5953,7 +5954,7 @@ Example:
       bits 2048
 
   acme LE2
-      uri https://acme-staging-v02.api.letsencrypt.org/directory
+      directory https://acme-staging-v02.api.letsencrypt.org/directory
       account /etc/haproxy/account.key
       contact john.doe@example.com
       challenge HTTP-01
index 7addd65e4e14d4983ada929a3b63586fd1c7fedc..585728ef0798698fabed4e5e6817b47f2c736fd3 100644 (file)
@@ -12,7 +12,7 @@ struct acme_cfg {
        char *filename;             /* config filename */
        int linenum;                /* config linenum */
        char *name;                 /* section name */
-       char *uri;                  /* directory URL */
+       char *directory;            /* directory URL */
        struct {
                char *contact;      /* email associated to account */
                char *file;         /* account key filename */
index 7bb3fc1cd0b9b4723b98a49bbc84a65082c6a147..8675877b590ca3cbe96a2f87b7ede3ae94ab2d4d 100644 (file)
@@ -243,7 +243,7 @@ static int cfg_parse_acme_kws(char **args, int section_type, struct proxy *curpx
        int err_code = 0;
        char *errmsg = NULL;
 
-       if (strcmp(args[0], "uri") == 0) {
+       if (strcmp(args[0], "directory") == 0) {
                if (!*args[1]) {
                        ha_alert("parsing [%s:%d]: keyword '%s' in '%s' section requires an argument\n", file, linenum, args[0], cursection);
                        err_code |= ERR_ALERT | ERR_FATAL;
@@ -251,8 +251,8 @@ static int cfg_parse_acme_kws(char **args, int section_type, struct proxy *curpx
                }
                if (alertif_too_many_args(1, file, linenum, args, &err_code))
                        goto out;
-               cur_acme->uri = strdup(args[1]);
-               if (!cur_acme->uri) {
+               cur_acme->directory = strdup(args[1]);
+               if (!cur_acme->directory) {
                        err_code |= ERR_ALERT | ERR_FATAL;
                        ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
                        goto out;
@@ -486,7 +486,7 @@ void deinit_acme()
 
                next = acme_cfgs->next;
                ha_free(&acme_cfgs->name);
-               ha_free(&acme_cfgs->uri);
+               ha_free(&acme_cfgs->directory);
                ha_free(&acme_cfgs->account.contact);
                ha_free(&acme_cfgs->account.file);
                ha_free(&acme_cfgs->account.thumbprint);
@@ -497,7 +497,7 @@ void deinit_acme()
 }
 
 static struct cfg_kw_list cfg_kws_acme = {ILH, {
-       { CFG_ACME, "uri",  cfg_parse_acme_kws },
+       { CFG_ACME, "directory",  cfg_parse_acme_kws },
        { CFG_ACME, "contact",  cfg_parse_acme_kws },
        { CFG_ACME, "account",  cfg_parse_acme_kws },
        { CFG_ACME, "challenge",  cfg_parse_acme_kws },
@@ -1540,7 +1540,7 @@ struct task *acme_process(struct task *task, void *context, unsigned int state)
        switch (st) {
                case ACME_RESSOURCES:
                        if (http_st == ACME_HTTP_REQ) {
-                               if (acme_http_req(task, ctx, ist(ctx->cfg->uri), HTTP_METH_GET, NULL, IST_NULL) != 0)
+                               if (acme_http_req(task, ctx, ist(ctx->cfg->directory), HTTP_METH_GET, NULL, IST_NULL) != 0)
                                        goto retry;
                        }