Skip to content

Certbot command in /captain/data/config-override.json needs escaping when used with star #2222

Open
@raisercostin

Description

While trying to configure a wildcard certificate:

{
    "skipVerifyingDomains": "false",
    "certbotImageName": "raisercostin/certbot-dns-cloudflare:v2.11.0-daemon",
    "certbotCertCommandRules": [
             "domain": "*",
             "command":  "certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/captain-cloudflare.token -d ${domainName} -d *.${domainName}"
          }
    ]
}

I get the error:

Error: Invalid command: certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/captain-cloudflare.token -d ${domainName} -d *.${domainName}
at CertCommandGenerator.getCertbotCertCommand (/usr/src/app/built/user/system/CertbotManager.js:340:19)
at /usr/src/app/built/user/system/CertbotManager.js:67:51

The solution

Is to escape the parameter from -d *.${domainName} to -d \"*.${domainName}\"

{
    "skipVerifyingDomains": "false",
    "certbotImageName": "raisercostin/certbot-dns-cloudflare:v2.11.0-daemon",
    "certbotCertCommandRules": [
             "domain": "*",
             "command":  "certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/captain-cloudflare.token -d ${domainName} -d \"*.${domainName}\""
          }
    ]
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions