http://127.0.0.1:43110/Talk.ZeroNetwork.bit/?Topic:1572919722_14g2gXnsZdEPShFJkGdh5W3eGXmKzqW6F8
http://127.0.0.1:43110/Talk.ZeroNetwork.bit/?Topic:1572919722_14g2gXnsZdEPShFJkGdh5W3eGXmKzqW6F8
It to just work as it used to work prior
Add zero.example.com to config to ui_host, like this:
[global]
...
ui_host =
zero.example.com
@imachug
[zeronet@archlinux ZeroNet]$ ./ZeroNet.sh
- Starting ZeroNet...
[07:40:56] - Libsecpk256k1 loaded: CompiledLib in 0.040s
[07:40:56] - Version: 0.7.1 r4206, Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0], Gevent: 1.4.0
[07:40:56] - Creating FileServer....
[07:40:56] - Creating UiServer....
[07:40:56] - Removing old SSL certs...
[07:40:56] - Starting servers....
[07:40:56] Ui.UiServer --------------------------------------
[07:40:56] Ui.UiServer Web interface: http://192.168.0.115:43110/
[07:40:56] Ui.UiServer --------------------------------------
[07:40:56] TorManager Disabling Tor, because error while accessing Tor proxy at port 127.0.0.1:9050: No connection
[07:40:57] PeerPortchecker Checking port 12521 (ipv4) using checkPortchecker result: {'ip': <my ip>', 'opened': False} in 0.580s
[07:40:57] PeerPortchecker Trying to open port using UpnpPunch...
[07:40:57] PeerPortchecker Checking port 12521 (ipv6) using checkMyaddr result: {'ip': <my ip>', 'opened': False} in 0.905s
[07:40:58] PeerPortchecker Checking port 12521 (ipv4) using checkPortchecker result: {'ip': <my ip>', 'opened': False} in 0.469s
[07:40:58] ConnServer Server port opened ipv4: False, ipv6: False
[07:41:10] Ui.UiServer Added 192.168.0.115:43110 as allowed host
[07:41:11] Ui.UiServer Error 403: Invalid origin: https://zero.example.com
[07:41:22] Ui.UiServer Error 403: Invalid origin: https://zero.example.com
^C[07:41:24] - Shutting down (reason: Keyboard interrupt)...
[07:41:24] ConnServer Closed port via upnp.
[07:41:24] - All server stopped
[global]
fileserver_port = 12521
ui_ip = 192.168.0.115
ui_host =
zero.example.com
Still fails to work
I think that the check for origin happens here. Maybe the problem could be that proxy is accessed from port 80, but ZeroNet expects the different port so origins are not the same.
@imachug What do you think? What should be the value of HTTP_HOST env var and self.server.allowed_ws_origins?
@Merith-TK Can you (temporary) add few lines after this line to your ZeroNet source code that prints content of variabled origin_host, origin, host and self.server.allowed_ws_origins? That part should then look something like this:
if origin:
origin_host = origin.split("://", 1)[-1]
if origin_host != host and origin_host not in self.server.allowed_ws_origins:
print("Origin host:", origin_host)
print("Origin:", origin)
print("Host:", host)
print("Allowed WS origins:", self.server.allowed_ws_origins)
ws.send(json.dumps({"error": "Invalid origin: %s" % origin}))
return self.error403("Invalid origin: %s" % origin)
Then paste log output here. This lines should be only for troubleshooting and you can remove them later.
My best guess is that ZeroNet doesn't like port change, hostname change and (possibly) protocol change happening at the same time. I would make CaddyServer set Host and Origin headers to http://127.0.0.1:43110.
that could be it, but i dont know how to modify headers in caddy yet, you got any ideas @imachug ?
They say proxy_header Origin "127.0.0.1:43110" (and the same for Host as well) would work.
alright, let me try it in a few hours (because i goofed this morning and didnt realize it so i cant work in it at the moment)
@imachug setting headers myself, failed (probably did it wrong)
@filips123
Origin host: zero.example.com
Origin: https://zero.example.com
Host: 192.168.0.115:43110
Allowed WS origins: set()
[16:07:33] Ui.UiServer Error 403: Invalid origin: https://zero.example.com
if you want the actual URL, zmail me @ [email protected] with proof of github ID
Can you show me your config please? I haven't worked with caddyserver before but I can help you to google, lol.
A)i think we have a reaction spammer
B)
```
zero.example.com { # set url, and then auto obtain tls cert
basicauth / user pass # applies a auth popup to / with user and pass
proxy / 192.168.0.115:43110 { # proxies that ip to /
websocket # proxies websockets
}
log /opt/caddy/log/zero.log
}```
i think we have a reaction spammer
We know... at least he doesn't spam with comments.
B)
Have you tried adding proxy_header Origin "127.0.0.1:43110" after proxy line? Also add the same with Host instead of Origin.
@imachug that is not a valid config for Caddy and therefore caddy errs out and crashes
but that was not a bad idea and i got it to work!
https://caddyserver.com/v1/docs/proxy
i looked in the proxy setting docs, and found header_upstream name value
Most helpful comment
alright, let me try it in a few hours (because i goofed this morning and didnt realize it so i cant work in it at the moment)