imgk / caddy-trojan

Caddy module for trojan proxy
GNU General Public License v3.0
204 stars 46 forks source link

Error when compiling caddy #57

Open houmie opened 1 year ago

houmie commented 1 year ago

Hello,

When I tried to compile caddy today this your plugin, it failed:

xcaddy build --with github.com/mastercactapus/caddy2-proxyprotocol --with github.com/imgk/caddy-trojan --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/caddy-dns/cloudflare --output /usr/bin/caddy

Error:

github.com/imgk/caddy-trojan imports
    github.com/imgk/caddy-trojan/app imports
    github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile imports
    github.com/caddyserver/caddy/v2/modules/caddypki imports
    github.com/smallstep/certificates/authority imports
    github.com/smallstep/nosql imports
    github.com/smallstep/nosql/badger/v2 imports
    github.com/dgraph-io/badger/v2 imports
    github.com/dgraph-io/badger/v2/y imports
    github.com/klauspost/compress/zstd: github.com/klauspost/compress@v1.15.15: reading https://proxy.golang.org/github.com/klauspost/compress/@v/v1.15.15.zip: 403 Forbidden
2023/06/06 10:44:30 [FATAL] exit status 1

Thanks

ArcCal commented 1 year ago

github.com/WeidiDeng/caddy-cloudflare-ip 请教 这个插件是干啥用的

arenekosreal commented 1 year ago

github.com/WeidiDeng/caddy-cloudflare-ip 请叫 这个插件是干啥用的

信任来自 cloudflare IP 的连接请求中带有的 X-Forwarded-For 头部,默认 caddy 会忽略这个 用处就是让你的应用能显示真正的来源 IP

ArcCal commented 1 year ago

嗯嗯 感谢

cattyhouse commented 1 year ago

https://github.com/imgk/caddy-trojan/issues/54#issuecomment-1506269271

lxhao61 commented 1 year ago

@imgk Caddy 正式版 2.7.2 已发布,希望大佬同步更新及修复main分支。

imgk commented 1 year ago

@imgk Caddy 正式版 2.7.2 已发布,希望大佬同步更新及修复main分支。

OK 了

lxhao61 commented 1 year ago

@imgk Caddy 正式版 2.7.2 已发布,希望大佬同步更新及修复main分支。

OK 了

已测试无问题。谢谢!

ArcCal commented 1 year ago

2.7.2版本编译成功但是无法运行(配置文件没有trojan相关配置) --with github.com/imgk/caddy-trojan@master

错误信息如下: Aug 04 16:41:26 pi caddy[22760]: Error: loading initial config: loading new config: loading trojan app module: provision trojan: unexpected end of JSON input

配置文件如下: pi.xxxxx.com {

    reverse_proxy localhost:8080

}

ArcCal commented 1 year ago

一模一样的caddyfile,在v2.6.4下一切正常(编译时带有trojan模块,但配置文件没有trojan相关配置)

ArcCal commented 1 year ago

一模一样的caddyfile,在v2.7.1下也一切正常(编译时带有trojan模块,但配置文件没有trojan相关配置)

imgk commented 1 year ago

caddy-trojan 是同一个嘛?

ArcCal commented 1 year ago

caddy-trojan 是同一个嘛?

直接--with github.com/imgk/caddy-trojan@master编译出来的。没太看懂您的问题

ArcCal commented 1 year ago

刚发布的caddy2.7.3症状一模一样 Aug 06 10:11:20 pi caddy[44804]: Error: loading initial config: loading new config: loading trojan app module: provision trojan: unexpected end of JSON input

ir1ka commented 1 year ago

刚发布的caddy2.7.3症状一模一样 Aug 06 10:11:20 pi caddy[44804]: Error: loading initial config: loading new config: loading trojan app module: provision trojan: unexpected end of JSON input

我这儿有相同的问题,临时方案就是在不使用 trojan 的服务器上用 build arg 控制移除该行。