crazypeace / naive

NaïveProxy极简一键脚本。自动申请证书。可自定义端口。可与CaddyV2前置的VLESS/Vmess梯子并存。
https://zelikk.blogspot.com/2022/11/naiveproxy-caddy-v2-vless-vmess-cdn.html
GNU Affero General Public License v3.0
232 stars 48 forks source link

hax 可以安装并运行,但是Woiden报错 #2

Open biozzl opened 1 year ago

biozzl commented 1 year ago

hax 可以安装并运行,但是Woiden报错 原因不明

crazypeace commented 1 year ago

你要描述你操作了什么,得到什么结果。把你的日志放出来。 不然,排错的人需要搞一台和你一样的woiden,然后还要猜测你做了哪些操作,而且还不清楚遇到的问题是不是你看到的。 请学习 https://zelikk.blogspot.com/2022/04/how-to-ask-question-and-bad-case.html

说回到woiden上面报错。 我现在就在woiden上面跑着一个naive 正常的 image

biozzl commented 1 year ago

你要描述你操作了什么,得到什么结果。把你的日志放出来。 不然,排错的人需要搞一台和你一样的woiden,然后还要猜测你做了哪些操作,而且还不清楚遇到的问题是不是你看到的。 请学习 https://zelikk.blogspot.com/2022/04/how-to-ask-question-and-bad-case.html

说回到woiden上面报错。 我现在就在woiden上面跑着一个naive 正常的 image

不好意思,是我没有说清楚 我按照您的V2ray脚本在Woiden先安装了V2ray(Vless) 然后测试运行正常,然后运行了这个naive脚本,把IPv6 地址绑定到另外一个域名(为了防止和V2ray的CDN域名冲突),选择了8443端口,但是naive无法接通 我查看了Var/log/Caddy 里面没有相应的日志,V2ray日志一切正常,也可以连通 使用Https://V2ray 域名/path 可以看到bad request, 使用Https://naive 域名:8443 提示“此网站无法提供安全连接” 使用Http://naive 域名:8443 提示“Client sent an HTTP request to an HTTPS server."

按照上述同样的方法配置了Hax服务器,V2ray(Vless) 和 Naive 都能正常运行,没有任何问题

crazypeace commented 1 year ago

你的描述很清楚,思路也是对的。 我自己的woiden上面搭的naive的过程和你是一样的。

使用https://naive域名:8443 提示“此网站无法提供安全连接”

这个现象我建议你查一下你的naive域名有没有获取到证书。 image https://zelikk.blogspot.com/2022/04/setup-v2ray-websocket-tls-troubleshoot.html

biozzl commented 1 year ago

你的描述很清楚,思路也是对的。 我自己的woiden上面搭的naive的过程和你是一样的。

使用https://naive域名:8443 提示“此网站无法提供安全连接”

这个现象我建议你查一下你的naive域名有没有获取到证书。 image https://zelikk.blogspot.com/2022/04/setup-v2ray-websocket-tls-troubleshoot.html

运行了查找命令显示了这个结果: root@xxxxwoiden:~# find / -name "naive域名" find: '/proc/1/map_files': Operation not permitted find: '/proc/2/map_files': Operation not permitted find: '/proc/3/map_files': Operation not permitted find: '/proc/73/map_files': Operation not permitted find: '/proc/107/map_files': Operation not permitted find: '/proc/120/map_files': Operation not permitted find: '/proc/121/map_files': Operation not permitted find: '/proc/127/map_files': Operation not permitted find: '/proc/131/map_files': Operation not permitted find: '/proc/132/map_files': Operation not permitted find: '/proc/184/map_files': Operation not permitted find: '/proc/185/map_files': Operation not permitted find: '/proc/259/map_files': Operation not permitted find: '/proc/270/map_files': Operation not permitted find: '/proc/275/map_files': Operation not permitted find: '/proc/406/map_files': Operation not permitted find: '/proc/643/map_files': Operation not permitted find: '/proc/1818/map_files': Operation not permitted find: '/proc/1939/map_files': Operation not permitted find: '/proc/2703/map_files': Operation not permitted find: '/proc/4449/map_files': Operation not permitted find: '/proc/6336/map_files': Operation not permitted find: '/proc/6552/map_files': Operation not permitted find: '/proc/6586/map_files': Operation not permitted find: '/proc/6592/map_files': Operation not permitted find: '/proc/6597/map_files': Operation not permitted /var/lib/caddy/.local/share/caddy/locks/issue_cert_naive域名.lock

这是说明没有证书么? 如何让caddy 自己申请

crazypeace commented 1 year ago

find 命令查找的时候要加上前后*号才能模糊匹配。

biozzl commented 1 year ago

find 命令查找的时候要加上前后*号才能模糊匹配。

两头加过*号了,上面就是输出结果

crazypeace commented 1 year ago

那么,这个结果就是没有正确申请到证书。 你可以再查一下caddy的日志。看显示哪里有问题。

另外,caddy正确申请证书需要正确监听 80 端口和 https 端口(按你之前的描述,你选择的是 8443)

woiden上面一般自带apache,它会监听/占用 80,你需要停止它。

biozzl commented 1 year ago

那么,这个结果就是没有正确申请到证书。 你可以再查一下caddy的日志。看显示哪里有问题。

另外,caddy正确申请证书需要正确监听 80 端口和 https 端口(按你之前的描述,你选择的是 8443)

woiden上面一般自带apache,它会监听/占用 80,你需要停止它。

怎么查看Caddy的日志,我查看了Var/log/Caddy 里面没有相应的日志 apache已经停止了,用的是service apache2 stop命令 然后使用systemctl disable apache2 返回如下 root@xxxxwoiden:~# systemctl disable apache2 Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install disable apache2 insserv: warning: current start runlevel(s) (empty) of script apache2' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of scriptapache2' overrides LSB defaults (0 1 6). insserv: script bind9: service bind9 already provided! insserv: warning: current start runlevel(s) (empty) of script apache2' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of scriptapache2' overrides LSB defaults (0 1 6). insserv: script bind9: service bind9 already provided!

另外,我vless成功运行,是不是说明caddy已经给vless的域名申请了证书了?

crazypeace commented 1 year ago

你的分析有道理,既然可以把vless搭成功,说明caddy获得证书应该没有问题。 而且应该apache也是停止的,不然vless同样不会成功。

你把Caddyfile脱敏了放出来看看?

biozzl commented 1 year ago
# _naive_config_begin_
{
  order forward_proxy before file_server
}
:8443, naive的域名:8443 {
  tls e16d9cxxx@gmail.com
  forward_proxy {
    basic_auth 用户名 密码
    hide_ip
    hide_via
    probe_resistance
  }
  file_server {
    root /var/www/xkcdpw-html
  }
}
# _naive_config_end_
vless的域名
{
    tls Y3Jhenlxxx@gmail.com
    encode gzip

#    多用户 多path
#    import Caddyfile.multiuser

    handle_path /路径path {
        reverse_proxy localhost:61844
    }
    handle {
        reverse_proxy https://zelikk.blogspot.com {
            trusted_proxies 0.0.0.0/0
            header_up Host {upstream_hostport}
        }
    }
}
crazypeace commented 1 year ago

你这文件没问题啊。 我刚在 woiden-eu3 上面搭的

https://ZDU5MjM1ZjA4YmM5ZThiYTo4MTg2Y2NlNmE3NmZiZmQxQG5wd2RuLnR6emh1LmdxOjg0NDM=

配置文件:

# _naive_config_begin_
{
  order forward_proxy before file_server
}
:8443, npwdn.tzzhu.gq:8443 {
  tls e16d9cb045d7@gmail.com
  forward_proxy {
    basic_auth d59235f08bc9e8ba 8186cce6a76fbfd1
    hide_ip
    hide_via
    probe_resistance
  }
  file_server {
    root /var/www/xkcdpw-html
  }
}
# _naive_config_end_
wdn.tzzhu.gq
{
    tls Y3JhenlwZWFjZQ@gmail.com
    encode gzip

#    多用户 多path
#    import Caddyfile.multiuser

    handle_path /ad2e9cf6843f {
        reverse_proxy localhost:26243
    }
    handle {
        reverse_proxy https://zelikk.blogspot.com {
            trusted_proxies 0.0.0.0/0
            header_up Host {upstream_hostport}
        }
    }
}
crazypeace commented 1 year ago

你看我的证书是刚刚搭建过程中申请的 image

biozzl commented 1 year ago

你看我的证书是刚刚搭建过程中申请的 image

我是在EU-1的, 怎么能看到caddy 日志或者手动让caddy申请证书呢?

crazypeace commented 1 year ago

service caddy status 就能看到日志了。

你也可以通过 journalctl -f -u caddy.service 来看日志

caddy启动的时候就会自己尝试去申请 证书的。你把caddy重启一下。

biozzl commented 1 year ago

Dec 12 16:12:23 12xxxxxwoiden.localdomain caddy[12956]: {"level":"error","ts":1670890343.0531104,"logger":"tls.obtain","msg":"will retry","error":"[_..tk] Obtain: [..tk] creating new order: attempt 1: https://acme.zerossl.com/v2/DV90/newOrder: HTTP 400 urn:ietf:params:acme:error:rejectedIdentifier - Invalid DNS identifier [xxxx.xxxx.tk] (ca=https://acme.zerossl.com/v2/DV90)","attempt":13,"retrying_in":21600,"elapsed":43368.756257539,"max_duration":2592000} xxxx.xxxx.tk

这是什么原因呢? 申请不了么? 域名解析没问题,我在woiden 上ping过了 root@12429xxxwoiden:~# ping ..tk PING xxx.xxxx.tk(1242xxxx_woiden.localdomain (2001:xxxx:203:xxx:1234:1234:5f4c:1)) 56 data bytes 64 bytes from 12429xxxx_woiden.localdomain (2001:xxxxx:203:xxxx:xxxx:1234:5f4c:1): icmp_seq=1 ttl=64 time=0.138 ms 64 bytes from 124293xxxx_woiden.localdomain (2001:xxxxx:203:xxxx:xxxx:1234:5f4c:1): icmp_seq=2 ttl=64 time=0.266 ms 64 bytes from 1242932902_woiden.localdomain (2001:41d0:203:698:1234:1234:5f4c:1): icmp_seq=3 ttl=64 time=0.262 ms

crazypeace commented 1 year ago

google了一圈,确实不知道是什么原因。 不如,你换个母鸡申请 woiden 再试试。