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

Add Github Discussions to post non caddy-file-proxy GitHub "issues" with the caddy-l4 plugin integration #687

Open
shoutmarble opened this issue Jan 11, 2025 · 0 comments

Comments

@shoutmarble
Copy link

shoutmarble commented Jan 11, 2025

Request to enable Github Discussions in using the caddy-l4 plugin in caddy-docker-proxy and other topics.

I'm using a proxy-protocol in Haproxy, I would like to use caddy-docker-proxy as a "Proxy-Protocol Server." (Is this really possible now?)

May you add a Discussion feature to this repository to share non issue related problems with caddy-docker-proxy.

Caddyfile support is now in caddy-l4
Caddyfile support #217
layer4 configuration block

Discussion features I would like to have with caddy-docker-proxy using the caddy-l4 plugin

Also, making a integration with caddy-docker-proxy and caddy-l4 documentation with copilot or llama so only have to ask the "AI" for a CaddyFile "Label" for such and such caddy-l4 feature.

caddy-l4 matchers
Current matchers:

layer4.matchers.clock - matches connections on the time they are wrapped/matched.
layer4.matchers.http - matches connections that start with HTTP requests. In addition, any [http.matchers modules](https://caddyserver.com/docs/modules/) can be used for matching on HTTP-specific properties of requests, such as header or path. Note that only the first request of each connection can be used for matching.
layer4.matchers.local_ip - matches connections based on local IP (or CIDR range).
layer4.matchers.not - matches connections that aren't matched by inner matcher sets.
layer4.matchers.openvpn - matches connections that look like [OpenVPN](https://openvpn.net/community-resources/openvpn-protocol/) connections.
layer4.matchers.postgres - matches connections that look like Postgres connections.
layer4.matchers.proxy_protocol - matches connections that start with [HAPROXY proxy protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt).
layer4.matchers.quic - matches connections that look like [QUIC](https://quic.xargs.org/). In addition, any [tls.handshake_match modules](https://caddyserver.com/docs/modules/) can be used for matching on TLS-specific properties of the ClientHello, such as ServerName (SNI).
layer4.matchers.rdp - matches connections that look like [RDP](https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-RDPBCGR/%5BMS-RDPBCGR%5D.pdf).
layer4.matchers.regexp - matches connections that have the first packet bytes matching a regular expression.
layer4.matchers.remote_ip - matches connections based on remote IP (or CIDR range).
layer4.matchers.socks4 - matches connections that look like [SOCKSv4](https://www.openssh.com/txt/socks4.protocol).
layer4.matchers.socks5 - matches connections that look like [SOCKSv5](https://www.rfc-editor.org/rfc/rfc1928.html).
layer4.matchers.ssh - matches connections that look like SSH connections.
layer4.matchers.tls - matches connections that start with TLS handshakes. In addition, any [tls.handshake_match modules](https://caddyserver.com/docs/modules/) can be used for matching on TLS-specific properties of the ClientHello, such as ServerName (SNI).
layer4.matchers.winbox - matches connections that look like those initiated by [Winbox](https://help.mikrotik.com/docs/display/ROS/WinBox), a graphical tool for MikroTik hardware and software routers management.
layer4.matchers.wireguard - matches connections the look like [WireGuard](https://www.wireguard.com/protocol/) connections.
layer4.matchers.xmpp - matches connections that look like [XMPP](https://xmpp.org/about/technology-overview/).
caddy-l4 handlers
layer4.handlers.echo - An echo server.
layer4.handlers.proxy - Powerful layer 4 proxy, capable of multiple upstreams (with load balancing and health checks) and establishing new TLS connections to backends. Optionally supports sending the [HAProxy proxy protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt).
layer4.handlers.proxy_protocol - Accepts the [HAPROXY proxy protocol](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt) on the receiving side.
layer4.handlers.socks5 - Handles [SOCKSv5](https://www.rfc-editor.org/rfc/rfc1928.html) proxy protocol connections.
layer4.handlers.subroute - Implements recursion logic, i.e. allows to match and handle already matched connections.
layer4.handlers.tee - Branches the handling of a connection into a concurrent handler chain.
layer4.handlers.throttle - Throttle connections to simulate slowness and latency.
layer4.handlers.tls - TLS termination.

My build to soon test caddy-l4 labels in caddy-docker-proxy

caddy-docker-proxy with caddy-l4

caddy.yml

networks:
  caddy:
    external: true

volumes:
  caddy_data: {}

# INSTALL a staging "intermediate" STAGING LE certificate for windows
# https://github.com/letsencrypt/website/blob/main/static/certs/staging/2024/e5.pem
#
# WINDOWS 
# certutil -addstore -f "Root" e5.pem
#
# certmgr (to veiw certificate)

services:
    caddy:
        build:
            context: .
            dockerfile_inline: |
                FROM golang:alpine

                RUN apk add git

                WORKDIR /opt

                RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

                RUN xcaddy build \
                    --with github.com/mholt/caddy-l4 \
                    --with github.com/lucaslorentz/caddy-docker-proxy/v2 \
                    --with github.com/abiosoft/caddy-yaml \
                    --with github.com/abiosoft/caddy-json-schema

                ENTRYPOINT ["/opt/caddy"]

                CMD ["docker-proxy"]
        ports:
            - 80:80
            - 443:443
        environment:
            - CADDY_INGRESS_NETWORKS=caddy
        labels:
            - caddy.acme_ca=https://acme-staging-v02.api.letsencrypt.org/directory
        networks:
            - caddy
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - caddy_data:/data
        restart: unless-stopped
`whoami.yml`

whoami.yml

networks:
    caddy:
        external: true
        
services:
    whoami:
        image: traefik/whoami
        networks:
            - caddy
        labels:
            caddy: who.landingdev.xyz
            caddy.reverse_proxy: "{{upstreams 80}}"
            # caddy.respond: / "Hello World" 200
            # caddy.layer4.0_: TBD
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

1 participant