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

Need help concerning adding custom Caddy modules #10

Open
FDF1337 opened this issue Dec 17, 2021 · 2 comments
Open

Need help concerning adding custom Caddy modules #10

FDF1337 opened this issue Dec 17, 2021 · 2 comments

Comments

@FDF1337
Copy link

FDF1337 commented Dec 17, 2021

After reading the section "Adding custom Caddy modules" on https://hub.docker.com/_/caddy i still don't know how i can build a new caddy binary with the plugin caddy2-proxyprotocol inside.

As i understood the documentation i should do the following:

FROM caddy:<version>-builder AS builder

RUN xcaddy build \
    --with github.com/mastercactapus/caddy2-proxyprotocol.git

FROM caddy:<version>

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

But i dont know where and how.

My Caddy environment is running in a docker container and managed by a docker-compose.yml file. The docker components (vaultwarden, caddy) are working well. With the component fail2ban i've still difficulties (registering but not banning the ip address) but this is offtopic here.

My motivation to include the "caddy2-proxyprotocol" plugin is to protect my vaultwarden vault from potentially brute force attackers. If i understand well this plugin is able to provide the real ip address to fail2ban (which is also included in a docker container) so it can ban the right ip address. At this moment fail2ban is getting a private ip address (172.x.x.x) from the container instead which will cause a DOS for the "normal" user.

How can i build a new caddy binary inside a docker container? Please help, i'm new in docker and i also don't have any "go" know-how. Thank you.

@jpbaril
Copy link

jpbaril commented Feb 27, 2022

@FDF1337 Did you figure it by now ? If not, you put that in a "Dockerfile" file. And then you use the "build" docker command to create your custom Caddy docker image.
And if you finally figured it, how did it go? I'm trying to do same as you. I thought the plugin from https://github.com/kirsch33/realip was what I needed but now it seems it's more likely that I need plugin from here.

@gc-ss
Copy link

gc-ss commented Mar 28, 2022

@FDF1337 @jpbaril are either/both of you still blocked on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants