NetEase / tango

A code driven low-code builder, develop low-code app on your codebase.
https://netease.github.io/tango-site/
MIT License
2.07k stars 175 forks source link

本地沙箱docker启动,修改了domain,无法链接 #32

Open kotlef opened 12 months ago

kotlef commented 12 months ago

host做了修改

1、替换了:8080为local.netease.com

2、7f9beb0b21f9 docker.io/library/tango-codesandbox:latest "caddy run --config …" 3 minutes ago Up 0.0.0.0:8443->8443/tcp tango-codesandbox-7f9be

3、镜像启动日志 {"level":"info","ts":1695257316.437854,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"} {"level":"warn","ts":1695257316.4388368,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":3} {"level":"info","ts":1695257316.4394667,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]} {"level":"info","ts":1695257316.4397707,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x400009f180"} {"level":"info","ts":1695257316.4407623,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":8443} {"level":"warn","ts":1695257316.4407756,"logger":"http.auto_https","msg":"automatic HTTP->HTTPS redirects are disabled","server_name":"srv0"} {"level":"info","ts":1695257316.4409783,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/data/caddy"} {"level":"info","ts":1695257316.4410226,"logger":"tls","msg":"finished cleaning storage units"} {"level":"info","ts":1695257316.440989,"logger":"http","msg":"enabling HTTP/3 listener","addr":":8443"} {"level":"info","ts":1695257316.44109,"msg":"failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details."} {"level":"info","ts":1695257316.4412634,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"level":"info","ts":1695257316.4412718,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["local.netease.com"]} {"level":"info","ts":1695257316.441771,"logger":"tls.obtain","msg":"acquiring lock","identifier":"local.netease.com"} {"level":"info","ts":1695257316.4428742,"logger":"tls.obtain","msg":"lock acquired","identifier":"local.netease.com"} {"level":"info","ts":1695257316.4429135,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"local.netease.com"} {"level":"info","ts":1695257316.4434357,"logger":"tls.obtain","msg":"certificate obtained successfully","identifier":"local.netease.com"} {"level":"info","ts":1695257316.443454,"logger":"tls.obtain","msg":"releasing lock","identifier":"local.netease.com"} {"level":"warn","ts":1695257316.4435532,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [local.netease.com]: no OCSP server specified in certificate","identifiers":["local.netease.com"]} {"level":"warn","ts":1695257316.4476962,"logger":"pki.ca.local","msg":"installing root certificate (you might be prompted for password)","path":"storage:pki/authorities/local/root.crt"} {"level":"info","ts":1695257316.447804,"msg":"warning: \"certutil\" is not available, install \"certutil\" with \"apt install libnss3-tools\" or \"yum install nss-tools\" and try again"} {"level":"info","ts":1695257316.4478083,"msg":"define JAVA_HOME environment variable to use the Java trust"} {"level":"info","ts":1695257316.4613037,"msg":"certificate installed properly in linux trusts"} {"level":"info","ts":1695257316.4615793,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"} {"level":"info","ts":1695257316.4615903,"msg":"serving initial configuration"}

ccloli commented 12 months ago

看起来启动是没有问题的,是否能通过 https://local.netease.com:8443 访问?你可能需要先手动允许自签证书才能打开

如果上面的地址能正常打开(理论上是一个白屏页面),请确认下 playground 中 <Sandbox> 正确设置了 bundlerURL 为上述地址

如果还是无法正常加载,辛苦提供下浏览器 Console 的日志

kotlef commented 12 months ago

看起来启动是没有问题的,是否能通过 https://local.netease.com:8443 访问?你可能需要先手动允许自签证书才能打开

如果上面的地址能正常打开(理论上是一个白屏页面),请确认下 playground 中 <Sandbox> 正确设置了 bundlerURL 为上述地址

如果还是无法正常加载,辛苦提供下浏览器 Console 的日志

https://local.netease.com:8443 这个访问时一个空白页。

image

这个页面有console错误和警告,这是不是打包未成功?

bundlerURL我已经配置成 https://local.netease.com:8443了

kotlef commented 12 months ago

使用本地docker启动的同学们,记得查看docker container etc/hosts 如果出现多个沙箱IP分配,需要手动删除rm containerID。 最好后台启动,固定命名 docker run -d -p 8443:8443 --name=tango-codesandbox tango-codesandbox

ccloli commented 12 months ago

这个页面有console错误和警告,这是不是打包未成功?

这个报错是正常的,因为没有和 Tango 的设计器打通,所以会提示没有注入 sandbox id

使用本地docker启动的同学们,记得查看docker container etc/hosts 如果出现多个沙箱IP分配,需要手动删除rm containerID。 最好后台启动,固定命名 docker run -d -p 8443:8443 --name=tango-codesandbox tango-codesandbox

有可能是因为 host 上有多个网卡,所以有多个 ip?修改 hosts 后问题是解决了吗?

Thea1211 commented 6 months ago

这个页面有console错误和警告,这是不是打包未成功?

这个报错是正常的,因为没有和 Tango 的设计器打通,所以会提示没有注入 sandbox id

使用本地docker启动的同学们,记得查看docker container etc/hosts 如果出现多个沙箱IP分配,需要手动删除rm containerID。 最好后台启动,固定命名 docker run -d -p 8443:8443 --name=tango-codesandbox tango-codesandbox

有可能是因为 host 上有多个网卡,所以有多个 ip?修改 hosts 后问题是解决了吗?

windows caddy启动同样有这个错 帮忙看下的 image image

ccloli commented 6 months ago

windows caddy启动同样有这个错 帮忙看下的

该错误是预期的,可忽略,只需确认可和 Tango 配合使用即可

Thea1211 commented 6 months ago

windows caddy启动同样有这个错 帮忙看下的

该错误是预期的,可忽略,只需确认可和 Tango 配合使用即可

image 有这个错呢 貌似资源加载有问题

ccloli commented 6 months ago

有这个错呢 貌似资源加载有问题

这些错误应该只是 chrome devtools 无法加载开发资源而已,如果使用没有问题可以忽略

不过第一个错误看起来是无法从 cdn 上获取资源,错误信息是连接被重置,可以检查下网络情况再试试看