Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "unrecognized arguments" issue in DirectAdmin DNS plugin #412

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

Platzii
Copy link

@Platzii Platzii commented Oct 1, 2023

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Since v1.0.3 of the certbot-dns-directadmin plugin the parameter prefix was changed to dns-directadmin- in stead of directadmin-.
This PR addresses this change as the current logic is broken.
Example:

root@37e5913fddc8:/# certbot plugins --authenticators
usage:
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: unrecognized arguments: --directadmin-credentials=/config/dns-conf/directadmin.ini

Benefits of this PR and context:

Closes #404.

How Has This Been Tested?

Built the container, pushed to Docker Hub (simonlepla/swag:directadmin-fix) and tested it on my setup.
Had to manually remove /config/etc/letsencrypt/cli.ini (as this was mounted/persisted on disk) in order for it to be regenerated with the new parameters.

Source / References:

@Platzii Platzii mentioned this pull request Oct 1, 2023
1 task
@LinuxServer-CI
Copy link
Contributor

I am a bot, here are the test results for this PR:
https://ci-tests.linuxserver.io/lspipepr/swag/2.6.0-pkg-75ebae18-dev-dae223ca0f3bab4b2527fa7df11c4cd787ea0563-pr-412/index.html
https://ci-tests.linuxserver.io/lspipepr/swag/2.6.0-pkg-75ebae18-dev-dae223ca0f3bab4b2527fa7df11c4cd787ea0563-pr-412/shellcheck-result.xml

Tag Passed
amd64-2.6.0-pkg-75ebae18-dev-dae223ca0f3bab4b2527fa7df11c4cd787ea0563-pr-412
arm64v8-2.6.0-pkg-75ebae18-dev-dae223ca0f3bab4b2527fa7df11c4cd787ea0563-pr-412

@nemchik
Copy link
Member

nemchik commented Oct 1, 2023

I don't have directadmin to test, and their documentation doesn't really seem to indicate this change. Noting that as of writing https://certbot-dns-directadmin.readthedocs.io/en/latest/# still shows examples such as

certbot certonly \
  --authenticator directadmin \
  --directadmin-credentials ~/.secrets/certbot/directadmin.ini \
  --directadmin-propagation-seconds 120 \
  -d example.com

This change would effectively result in swag using the equivalent of

certbot certonly \
  --authenticator dns-directadmin \
  --dns-directadmin-credentials ~/.secrets/certbot/directadmin.ini \
  --dns-directadmin-propagation-seconds 120 \
  -d example.com

That being said, it does appear that d57dffe (me) added directadmin to

if [[ "${DNSPLUGIN}" =~ ^(cpanel|directadmin)$ ]]; then
and we did not previously have logic in place for this, and actually have logic here
if [[ "${ORIGDNSPLUGIN}" =~ ^(directadmin)$ ]]; then
sed -i 's|^authenticator = directadmin|authenticator = dns-directadmin|g' "/config/etc/letsencrypt/renewal/${ORIGDOMAIN}.conf"
sed -i 's|^directadmin[-_]|dns_directadmin_|g' "/config/etc/letsencrypt/renewal/${ORIGDOMAIN}.conf"
fi
that contradicts directadmin being included in 307, so definitely a bug on our part.

I was going to mention that the renewal ini (not the cli.ini) needed to be accounted for, but the logic on lines 107-110 actually cover that already, so this LGMT. Good catch!

@nemchik nemchik merged commit eb8f12b into linuxserver:master Oct 1, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] 2.6.0-ls232 not starting
3 participants