Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use the standard ports 80 and 443 on my network #1267

Closed
xcstatus opened this issue Oct 30, 2023 · 71 comments
Closed

can't use the standard ports 80 and 443 on my network #1267

xcstatus opened this issue Oct 30, 2023 · 71 comments

Comments

@xcstatus
Copy link

hi all,

I can't use the standard ports 80 and 443 on my network. How do I change the configuration for deployment? Since standard ports are not available, the reverse proxy cannot be deployed either.

@mlsmaycon
Copy link
Collaborator

Hey @xcstatus are you able to deploy the reverse proxy without the public access in these two ports? If so, there is a way to deploy it, but you will need to manage the SSL certificates.

@xcstatus
Copy link
Author

Thank you for your reply.
All but the standard ports on my network are accessible via the Internet. SSL certificates can also be obtained in other ways.
Please tell me how I should operate.

@MrChenhtlss
Copy link

Thank you for your reply. All but the standard ports on my network are accessible via the Internet. SSL certificates can also be obtained in other ways. Please tell me how I should operate.

I have the same problem. Did you solve it? If so, can you help me?

@xcstatus
Copy link
Author

Not solved yet, no way to deal with this problem, can only wait for the solution given by the @mlsmaycon

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 13, 2023 via email

@mlsmaycon
Copy link
Collaborator

Hello folks, we have a guide for running NetBird that you can use to configure NetBird to run behind a reverse-proxy like Nginx, Traefik or Caddyserver. See this link for more details. It covers the advanced guide setup, then you need to configure your reverse proxy.

For traefik and nginx you have some example templates:
Nginx.conf
docker-compose.yml.tmpl.traefik

For Caddyserver you can use the following example:

{
  debug
	servers :80,:443 {
    protocols h1 h2c
  }
}

:80,mydomain.example.com:443 {
    import security_headers
    # Signal
    reverse_proxy /signalexchange.SignalExchange/* h2c://signal:10000
    # Management
    reverse_proxy /api/* management:80
    reverse_proxy /management.ManagementService/* h2c://management:80
    # Dashboard
    reverse_proxy /* dashboard:80
}

You need to replace the references to the internal services according to your local environment. e.g., if your management is running on IP 192.168.0.100, replace h2c://management:80 with h2c://192.168.0.100:80

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 14, 2023 via email

@mlsmaycon
Copy link
Collaborator

It depends on the scenario you are building. Can you share more about it @MrChenhtlss?

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 14, 2023 via email

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 14, 2023 via email

@mlsmaycon
Copy link
Collaborator

@MrChenhtlss Maybe you can share more about your current server setup, like what is running on ports 80 and 443, do you have a proxy like nginx or others?

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 14, 2023 via email

@MrChenhtlss
Copy link

MrChenhtlss commented Nov 14, 2023 via email

@xcstatus
Copy link
Author

Any progress so far?

@xcstatus
Copy link
Author

image
@MrChenhtlss

The deployment script was modified and the deployment was successful over a non-standard port. But you will need to get your own domain certificate.
Change the port number in the script.
Add the domain certificate configuration to the caddy configuration file.
3. Change the redirect Settings in zitdel.
4. Modify the address of the HttpConfig node in the renderManagementJson method, and add the port.

修改了部署脚本,通过非标准端口部署成功了。 但是需要自己申请域名证书。

  1. 修改脚本中的端口号。
  2. 在caddy配置文件中增加域名证书配置。
  3. 修改zitdel中的重定向设置。
  4. 修改renderManagementJson方法中HttpConfig节点下地址,需要增加端口。

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 18, 2023 via email

@xcstatus
Copy link
Author

晚点我整理下, 现在发现了一个问题 通过pre-shard key 无法在客户端登录

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 18, 2023 via email

@xcstatus
Copy link
Author

Netbird安装.md
getting-started-with-zitadel-xc.zip
@MrChenhtlss 这是我修改后的脚本和修改、安装说明。
@mlsmaycon Problem solved. I closed the problem. Thank you very much

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 18, 2023 via email

@jiangslee
Copy link

jiangslee commented Dec 19, 2023

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!

我迭代下,端口号改成交互输入,域名证书改成自动匹配。
image
image

操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip

目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

@xcstatus
Copy link
Author

👍。我一直想要这样做,但是我不太懂shell语法,所以不敢对脚本做太大的修改。这个对脚本的修改是否有必要提个pr给官方? 但是需要兼容下不需要修改端口号的情况。

@MrChenhtlss
Copy link

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!

我迭代下,端口号改成交互输入,域名证书改成自动匹配。 image image

操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip

目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

这个真的非常棒,ssl可以申请腾讯云各大云厂商为期一年的free证书

@xcstatus
Copy link
Author

证书自动维护可以考虑下caddy的dns质询组件。https://caddy.community/t/how-to-use-dns-provider-modules-in-caddy-2/8148

@jiangslee
Copy link

官方的脚本默认就是caddy自动获取证书的,不过你改的手动证书方案更适合我 😋

@MrChenhtlss
Copy link

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!

我迭代下,端口号改成交互输入,域名证书改成自动匹配。 image image

操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip

目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

据说“acme.sh” 基于acme可以自动续签SSL证书,但是由于我不是从事IT运维的能提供的参考非常有限,希望您可以参考下是否可行
It is said that "acme.sh" can automatically update acme-based SSL certificates. Since I have no ability to engage in IT operation and maintenance, the reference provided is very limited. I hope everyone can refer to it to see if it is feasible.

@MrChenhtlss
Copy link

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!

我迭代下,端口号改成交互输入,域名证书改成自动匹配。 image image

操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip

目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

请问是否将8080端口写入到脚本可以支持交互式输入,因为我的8080端口已经被其他进程占用,可以的话那就太棒了!!!!

@jiangslee
Copy link

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!
我迭代下,端口号改成交互输入,域名证书改成自动匹配。 image image
操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip
目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

请问是否将8080端口写入到脚本可以支持交互式输入,因为我的8080端口已经被其他进程占用,可以的话那就太棒了!!!!

好像那个8080没有实际用途,等会给你改一个交互输入修改8080的脚本

@jiangslee
Copy link

jiangslee commented Dec 21, 2023

Netbird安装.md getting-started-with-zitadel-xc.zip @MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon Problem solved. I closed the problem. Thank you very much

真香!
我迭代下,端口号改成交互输入,域名证书改成自动匹配。 image image
操作步骤:

  1. mkdir certs
  2. certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pemnetbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh
  3. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

getting-started-with-zitadel-xc-prompt.sh.zip
目前证书需要手动维护,要是有大佬能改成自动获取及更新证书就更好了。

请问是否将8080端口写入到脚本可以支持交互式输入,因为我的8080端口已经被其他进程占用,可以的话那就太棒了!!!!

image

getting-started-with-zitadel-xc.sh.zip

@MrChenhtlss 你试试看。

@Beatirce
Copy link

image
改回来了,然后我按照md文件中说明修改后执行时提示的错误,麻烦帮忙看看是哪里的问题…

如果没有必要,不需要修改$NETBIRD_DOMAIN节点下的配置,修改配置的前提是你知道自己在做什么。

certs文件夹是需要在脚本执行的目录中创建的。

@xcstatus
Copy link
Author

看不出来有什么问题, 怀疑是 crdb这个服务没有启动起来。

@Beatirce
Copy link

看不出来有什么问题, 怀疑是 crdb这个服务没有启动起来。

感谢,我看看这个服务。

@jiangslee
Copy link

看不出来有什么问题, 怀疑是 crdb这个服务没有启动起来。

感谢,我看看这个服务。

操作步骤:

  1. mkdir certs
  2. 在certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pem,netbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
  1. export NETBIRD_DOMAIN=netbird.my-domain.com
  2. bash getting-started-with-zitadel-xc.sh

按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号; UDP ports: 3478, 49152-65535)

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 25, 2023 via email

@jiangslee
Copy link

@MrChenhtlss 我也是国内服务器部署,没有注释h1 h2也能跑,关键是需要提前解释好域名提前放行端口

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 25, 2023 via email

@xcstatus
Copy link
Author

xcstatus commented Dec 25, 2023

caddy.zip
可以试试这个,构建caddy-dnspod,支持腾讯云dns质询。可以自动签名。
其余云服务上可以在Dockerfile中替换对应的插件就行
098eefea0dba9c1d1ab4be23fecea62f

@jiangslee
Copy link

caddy.zip 可以试试这个,构建caddy-dnspod,支持腾讯云dns质询。可以自动签名。 其余云服务上可以在Dockerfile中替换对应的插件就行 098eefea0dba9c1d1ab4be23fecea62f

这是要自己构建caddy的docker镜像吗?

@xcstatus
Copy link
Author

xcstatus commented Dec 26, 2023 via email

@xcstatus
Copy link
Author

xcstatus commented Dec 26, 2023 via email

@MrChenhtlss
Copy link

MrChenhtlss commented Dec 27, 2023 via email

@xhwwstudio
Copy link

看不出来有什么问题, 怀疑是 crdb这个服务没有启动起来。

感谢,我看看这个服务。

操作步骤:

1. mkdir certs

2. 在certs目录放好与域名一致的证书文件,如netbird.my-domain.com.pem,netbird.my-domain.com.key
~/docker-netbird# tree certs
certs
├── netbird.my-domain.com.key
└── netbird.my-domain.com.pem
3. export NETBIRD_DOMAIN=netbird.my-domain.com

4. bash getting-started-with-zitadel-xc.sh

按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号; UDP ports: 3478, 49152-65535)

请问大佬,下载的这个文件和certs放在一个文件夹下边么?还是放里CERTS里边?

@xcstatus
Copy link
Author

docker-netbird
├── certs
└── getting-started-with-zitadel-xc-prompt.sh
同一个文件夹下

@liuyishengaaa
Copy link

使用构建的caddy-dnspod镜像可以正常运行。证书也可以自动获取。但是我不太清楚怎么把构建过程编写成脚本,通过脚本指定caddy版本、dns质询插件发自我的 iPhone在 2023年12月26日,17:03,jiangslee @.> 写道: caddy.zip 可以试试这个,构建caddy-dnspod,支持腾讯云dns质询。可以自动签名。其余云服务上可以在Dockerfile中替换对应的插件就行 这是要自己构建caddy的docker镜像吗? - 直接回复此电子邮件,在 GitHub 上查看或取消订阅。您收到此消息是因为您修改了打开/关闭状态。邮件 ID:@.>

可以使用cloudflare申请的免费15年证书,上面您提到的自动续签能有个详细操作流程就完美了。

@xcstatus
Copy link
Author

使用构建的caddy-dnspod镜像可以正常运行。证书也可以自动获取。但是我不太清楚怎么把构建过程编写成脚本,通过脚本指定caddy版本、dns质询插件发自我的 iPhone在 2023年12月26日,17:03,jiangslee @.> 写道: caddy.zip 可以试试这个,构建caddy-dnspod,支持腾讯云dns质询。可以自动签名。其余云服务上可以在Dockerfile中替换对应的插件就行 这是要自己构建caddy的docker镜像吗? - 直接回复此电子邮件,在 GitHub 上查看或取消订阅。您收到此消息是因为您修改了打开/关闭状态。邮件 ID:@.>

可以使用cloudflare申请的免费15年证书,上面您提到的自动续签能有个详细操作流程就完美了。

这里有配置的方法。
#1464
这是我使用的构建caddy-dnspod的脚本,但是我不知道如何改造成一个通用的脚本。
caddy-builder.tar.gz

@shangkouyou
Copy link

image

getting-started-with-zitadel-xc.sh.zip

可以跑了

这个好棒啊 我也跑起来了 很完美 现在唯一不足的就是 我想改这个默认的100.xx.xx.xx这个网段 可以 自定义吗 大佬

@shangkouyou
Copy link

有办法修改默认的网段嘛 100.91.0.0/24.这个

使用构建的caddy-dnspod镜像可以正常运行。证书也可以自动获取。但是我不太清楚怎么把构建过程编写成脚本,通过脚本指定caddy版本、dns质询插件发自我的 iPhone在 2023年12月26日,17:03,jiangslee @.> 写道: caddy.zip 可以试试这个,构建caddy-dnspod,支持腾讯云dns质询。可以自动签名。其余云服务上可以在Dockerfile中替换对应的插件就行 这是要自己构建caddy的docker镜像吗? - 直接回复此电子邮件,在 GitHub 上查看或取消订阅。您收到此消息是因为您修改了打开/关闭状态。邮件 ID:@.>

可以使用cloudflare申请的免费15年证书,上面您提到的自动续签能有个详细操作流程就完美了。

这里有配置的方法。
#1464
这是我使用的构建caddy-dnspod的脚本,但是我不知道如何改造成一个通用的脚本。
caddy-builder.tar.gz

@jiangslee
Copy link

@shangkouyou 默认给的好像是100.x.x.x/16网段,一般不会冲突,为什么要改为/24?

@shangkouyou
Copy link

@shangkouyou* 默认给的好像是100.x.x.x/16网段,一般不会冲突,为什么要改为/24?

我主要是想改100.xxx.xxx.xxx 想改成自己喜欢的内网网段

@jiangslee
Copy link

jiangslee commented Aug 5, 2024

@shangkouyou #1633

真不建议你改。

@shangkouyou
Copy link

@shangkouyou* #1633*

真不建议你改。

好的吧 谢谢你

@shangkouyou
Copy link

@shangkouyou* #1633*

真不建议你改。

佬我还行问哦 你上面的脚本执行后安装的是老的版本 可以升级最新的吗

@1350962574
Copy link

1350962574 commented Sep 16, 2024

证书自动维护可以考虑下caddy的dns质询组件。https://caddy.community/t/how-to-use-dns-provider-modules-in-caddy-2/8148

@xcstatus @jiangslee
这是我认为最好的方式,以Cloudflare举例可以使用iarekylew00t/caddy-cloudflare:latest镜像通过 CF 的 API 自动签发并续期,当然网上也有构建好并支持 dnspod,aliyun的docker镜像,配合上方大佬改进的安装脚本实现非 80,443完美SSL。
image

image image

@liuyishengaaa
Copy link

证书自动维护可以考虑下caddy的dns质询组件。https://caddy.community/t/how-to-use-dns-provider-modules-in-caddy-2/8148

@xcstatus @jiangslee 这是我认为最好的方式,以Cloudflare举例可以使用iarekylew00t/caddy-cloudflare:latest镜像通过 CF 的 API 自动签发并续期,当然网上也有构建好并支持 dnspod,aliyun的docker镜像,配合上方大佬改进的安装脚本实现非 80,443完美SSL。 image

image image

你能提供详细的部署流程?

@MrChenhtlss
Copy link

MrChenhtlss commented Oct 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants