nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Can't modify certbot-dns-plugins.js manually - what am I doing wrong?

Open DFS-90 opened this issue 2 years ago • 1 comments

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug I wanted to include support for a letsencrypt dns-challenge for domainoffensive.de for myself until the corresponding plugin has been integrated into NPM (see https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2055).

I did the following:

  • modified docker-compose.yml by adding the following line unter the "volumes:" section:

    • ./app/global/certbot-dns-plugins.js:/app/global/certbot-dns-plugins.js
  • created a folder app/global

  • created a file certbot-dns-plugins.js

  • took the original file from https://raw.githubusercontent.com/NginxProxyManager/nginx-proxy-manager/develop/global/certbot-dns-plugins.js and added the following lines:

    //####################################################// domainoffensive: { display_name: 'DomainOffensive', package_name: 'certbot-dns-do', version_requirement: '~=0.3.0', dependencies: '', credentials: 'dns_do_api_token = YOUR_TOKEN', full_plugin_name: 'dns-do', },

  • restarted via docker-compose down && docker-compose up -d

  • checked the certbot-dns-plugins.js file via docker exec -it <ID> bash - the added content was visible here

Nginx Proxy Manager Version 2.9.18

Expected behavior I expected to find a new "DomainOffensive" selection when trying to get a Let's Encrypt SSL certificate via dns challenge. This didn't happen.

Operating System Debian 11 with latest docker and docker-compose

What am I doing wrong? Any help is appreciated! :-)

Thanks in advance, David

DFS-90 avatar Jun 01 '22 10:06 DFS-90

I think you have to build the frontend from scratch because certbot-dns-plugins.js gets bundled by webpack.

wingi11 avatar Jul 19 '22 09:07 wingi11

Hey @DFS-90, I just integrated certbot-dns-namecheap into npm.

PyPi Package

I'll be reverencing your other issue #2055 here. You published the georgeto/certbot-dns-do plugin to PyPi (same username), right?

I think it would be great if you'd also link the pypi package to that repository (or maybe even fork it and link it to your fork, because you are now the maintainer of the pypi package). This way people looking on pypi/pip as well as the npm maintainers know where to look if something breaks.

I don't know if this the right way, it is the way I did it the last few days for namecheap https://github.com/knoxell/certbot-dns-namecheap.

Pull Request

Now to the most relevant part for you, you can just make a pull request for npm, where you only edit certbot-dns-plugins.js, as you described above already.

Than it will be automagically be publish to docker hub, even before the merge.

I made this pull request #2312 and it is available on Docker Hub under tag jc21/nginx-proxy-manager:github-pr-2312.

Building NPM yourself (No I didn't spend a lot of time with this!!!!)

If you clone the repository and edit certbot-dns-plugins.js as described, you can just run

git clone https://github.com/NginxProxyManager/nginx-proxy-manager.git
cd nginx-proxy-manager
nano global/certbot-dns-plugins.js # or any other editor vim, vi, etc.
sudo ./scripts/frontend-build

Option 1 (Build NPM youself - not hard)

Build it:

# You should still be in the nginx-proxy-manager folder 
sudo docker build --pull --no-cache \
    -t name-of-your-docker-image:tag.of.your.image \
    -f docker/Dockerfile .

Run it:

docker run -p 80:80 -p 433:433 -p 127.0.0.1:81:81 \
    -v ./data:/data \
    -v ./letsencrypt:/etc/letsencrypt \
    -of-your-docker-image:tag.of.your.image

Option 2 (I did not test this)

now you can replace /app/frontend/ in the docker container with nginx-proxy-manager/frontend/dist/ by just mounting dist in to frontend :

docker run -p 80:80 -p 433:433 -p 127.0.0.1:81:81 \
    -v ./data:/data \
    -v ./letsencrypt:/etc/letsencrypt \
    -v path/to/frontend/dist:/app/frontend \
    jc21/nginx-proxy-manager

I hope this is helpful to you or anybody else trying the same thing as you and I, that might stumble across this post.

Note NPM does not install your plugin right way but only when you try to use your provider in the admin ui.

DNS Provider not showing up?

It's probably Browser Cache #2314

knoxell avatar Oct 09 '22 19:10 knoxell

Hey @knoxell ,

you're right, I also published the PyPi package - the link to georgeto's original project has already been there. I've just forked the npm develop branch and also generated a Pull request ( #2327 ) for the modified file. At the moment, I'm waiting for the package to appear on Docker Hub.

Thanks a lot for your great manual and your help publishing the do.de plugin! 👍

DFS-90 avatar Oct 15 '22 22:10 DFS-90

Hey @knoxell ,

Than it will be automagically be publish to docker hub, even before the merge.

I made this https://github.com/NginxProxyManager/nginx-proxy-manager/pull/2312 and it is available on [Docker Hub](https://hub.docker.com/r/jc21/nginx-proxy-manager/tags) under tag jc21/nginx-proxy-manager:github-pr-2312.

What do I have to do in order to make this happen?

Thanks and best regards, David

DFS-90 avatar Oct 18 '22 22:10 DFS-90

Hey @DFS-90,

I'm sorry for the late and disappointing answer, I don't know. I just observed the behavior and thought it would always be like that. Sorry for that!

knoxell avatar Oct 26 '22 13:10 knoxell

Hey @knoxell, thanks for your feedback! I'll close this issue then.

DFS-90 avatar Oct 26 '22 20:10 DFS-90

Having the same problem here. wouldn't it be a lot easier to keep certbot-dns-plugins.js editable and not build it into the frontend? Having scoped many github issues regarding DNS challenge, i guess most problems could be solved by editing certbot-dns-plugins.js APIs from dns providers change and certbot plugins get updated faster than the latest Tag.

h00bi avatar Dec 06 '22 08:12 h00bi