mastercactapus / caddy2-proxyprotocol

Apache License 2.0
59 stars 11 forks source link

Project still maintained? #16

Open houmie opened 1 year ago

houmie commented 1 year ago

Hi,

I'm getting this error:

2023/06/06 11:55:13.948 INFO    using provided configuration    {"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'servers': /etc/caddy/Caddyfile:11 - Error during parsing: getting module named 'caddy.listeners.proxy_protocol': module not registered: caddy.listeners.proxy_protocol

Cadyfile:

"/etc/caddy/Caddyfile" 30L, 483B                                                                                                                                                                                                                                                                                                                        27,0-1        All
{
    log {
        output file /var/log/caddy/caddy.log {
            roll_size 1gb
            roll_keep 5
            roll_keep_for 720h
        }
    }
    servers 127.0.0.1:5001 {
        listener_wrappers {
            proxy_protocol
        }
        protocols h2c h1
    }
}

:5001 {
    root * /srv/http/default
    file_server
    bind 127.0.0.1
}

:80 {
    redir https://{host}{uri} permanent
}

It compiles as seen below, but when running, I get the error above.

sudo curl -o /usr/bin/caddy "https://caddyserver.com/api/download?os=linux&arch=amd64&package=github.com%2Fcaddy-dns%2Fcloudflare&package=github.com%2FWeidiDeng%2Fcaddy-cloudflare-ip&package=github.com%2Fmastercactapus%2Fcaddy2-proxyprotocol&package=github.com%2Fimgk%2Fcaddy-trojan"

What gives? Not sure if this project is still maintained though. Thanks

francislavoie commented 1 year ago

Yes the project is still maintained. Are you sure you're actually using the binary you downloaded with the plugin added? Run caddy list-modules to check that it's actually there.

But anyway, the plugin will no longer be needed as of Caddy v2.7.0 because it's being included as a built-in listener wrapper, so you'll simply need to stop building with this plugin.