Skip to content

Need help concerning adding custom Caddy modules #10

@FDF1337

Description

@FDF1337

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions