netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
11.01k stars 504 forks source link

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

Closed xcstatus closed 10 months ago

xcstatus commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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 commented 11 months ago

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

MrChenhtlss commented 11 months ago

xcstatus @.***>于2023年11月13日 周一13:00写道:

Not solved yet, no way to deal with this problem, can only wait for the solution given by the @mlsmaycon https://github.com/mlsmaycon

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1807480407, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SEJROTICPNK7WHDOCDYEGSOBAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGQ4DANBQG4 . You are receiving this because you commented.Message ID: @.***>

If you have a solution please let me know thank you very much

mlsmaycon commented 11 months ago

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 commented 11 months ago

Besides the docker-compose file, what else do I need to modify? Maycon Santos @.***>于2023年11月14日 周二16:34写道:

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 https://docs.netbird.io/selfhosted/selfhosted-guide#advanced-running-net-bird-behind-an-existing-reverse-proxy 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 https://github.com/netbirdio/netbird/blob/d1d01a0611771b5604bf5806f385ebb9d70c58df/infrastructure_files/nginx.tmpl.conf docker-compose.yml.tmpl.traefik https://github.com/netbirdio/netbird/blob/d1d01a0611771b5604bf5806f385ebb9d70c58df/infrastructure_files/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

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1809749979, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SBWGHSG2RDRD22YYG3YEMUINAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZG42DSOJXHE . You are receiving this because you commented.Message ID: @.***>

mlsmaycon commented 11 months ago

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

MrChenhtlss commented 11 months ago

Sorry I'm not a professional IT worker

Maycon Santos @.***>于2023年11月14日 周二16:43写道:

It depends on the scenario you are building. Can you share more about it @MrChenhtlss https://github.com/MrChenhtlss?

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1809763181, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SAQT7QLQIPIIUQVAQLYEMVMPAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZG43DGMJYGE . You are receiving this because you were mentioned.Message ID: @.***>

MrChenhtlss commented 11 months ago

Or I would just use express install. Doc provides an advanced installation method, but I can't understand it.

T oy @.***>于2023年11月14日 周二16:49写道:

Sorry I'm not a professional IT worker

Maycon Santos @.***>于2023年11月14日 周二16:43写道:

It depends on the scenario you are building. Can you share more about it @MrChenhtlss https://github.com/MrChenhtlss?

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1809763181, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SAQT7QLQIPIIUQVAQLYEMVMPAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZG43DGMJYGE . You are receiving this because you were mentioned.Message ID: @.***>

mlsmaycon commented 11 months ago

@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 commented 11 months ago

80,443 running nginx

Maycon Santos @.***>于2023年11月14日 周二16:58写道:

@MrChenhtlss https://github.com/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?

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1809788372, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SH3YIWLPXNGOUOP2L3YEMXC3AVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZG44DQMZXGI . You are receiving this because you were mentioned.Message ID: @.***>

MrChenhtlss commented 11 months ago

I have another server but my service provider disabled my ports 80 and 443 other ports are accessible from the internet

T oy @.***>于2023年11月14日 周二16:59写道:

80,443 running nginx

Maycon Santos @.***>于2023年11月14日 周二16:58写道:

@MrChenhtlss https://github.com/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?

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1809788372, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SH3YIWLPXNGOUOP2L3YEMXC3AVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZG44DQMZXGI . You are receiving this because you were mentioned.Message ID: @.***>

xcstatus commented 11 months ago

Any progress so far?

xcstatus commented 10 months ago

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.

  1. Change the redirect Settings in zitdel.
  2. Modify the address of the HttpConfig node in the renderManagementJson method, and add the port.

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

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

非常感谢,方便给我更详细的操作方法么

xcstatus @.***>于2023年12月18日 周一14:45写道:

image.png (view on web) https://github.com/netbirdio/netbird/assets/40375067/0391245a-a212-4a40-9d59-8721b77c4071 @MrChenhtlss https://github.com/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.

  1. Change the redirect Settings in zitdel.
  2. Modify the address of the HttpConfig node in the renderManagementJson method, and add the port.

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

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

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1859645794, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SGW23IFWUIDM72P7WDYJ7RALAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGY2DKNZZGQ . You are receiving this because you were mentioned.Message ID: @.***>

xcstatus commented 10 months ago

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

MrChenhtlss commented 10 months ago

好的,非常感谢,但是官方似乎有通过nginx的部署方法,但是由于能力有限,无法完全理解官方doc的内容

status @.***>于2023年12月18日 周一15:34写道:

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

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1859694734, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SFJJZ7LL2J43KD4ZWDYJ7WYZAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGY4TINZTGQ . You are receiving this because you were mentioned.Message ID: @.***>

xcstatus commented 10 months ago

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

MrChenhtlss commented 10 months ago

OK,这真的太棒了 xcstatus @.***>于2023年12月18日 周一23:30写道:

Netbird安装.md https://github.com/netbirdio/netbird/files/13705518/Netbird.md getting-started-with-zitadel-xc.zip https://github.com/netbirdio/netbird/files/13705521/getting-started-with-zitadel-xc.zip @MrChenhtlss https://github.com/MrChenhtlss 这是我修改后的脚本和修改、安装说明。 @mlsmaycon https://github.com/mlsmaycon Problem solved. I closed the problem. Thank you very much

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1860820332, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SHRY6PUDQQQAMXG44TYKBOSHAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRQHAZDAMZTGI . You are receiving this because you were mentioned.Message ID: @.***>

jiangslee commented 10 months ago

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
  3. export NETBIRD_DOMAIN=netbird.my-domain.com
  4. bash getting-started-with-zitadel-xc.sh
  5. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

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

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

xcstatus commented 10 months ago

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

MrChenhtlss commented 10 months ago

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
    1. bash getting-started-with-zitadel-xc.sh
    2. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

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

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

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

xcstatus commented 10 months ago

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

jiangslee commented 10 months ago

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

MrChenhtlss commented 10 months ago

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
    1. bash getting-started-with-zitadel-xc.sh
    2. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的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 commented 10 months ago

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
    1. bash getting-started-with-zitadel-xc.sh
    2. 按提示输入好端口号(请提前进行域名解释和及安全组端口放行:你自定义的端口号,比如我上图的TCP:8088,8443; UDP ports: 3478, 49152-65535

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

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

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

jiangslee commented 10 months ago

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 commented 10 months ago

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 你试试看。

MrChenhtlss commented 10 months ago

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 你试试看。

我的老天爷 爱死你了!!!

jiangslee commented 10 months ago

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 你试试看。

我的老天爷 爱死你了!!!

前面脚本有问题,稍等1分钟

jiangslee commented 10 months ago

image

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

可以跑了

MrChenhtlss commented 10 months ago

image

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

可以跑了

image

完美!!! Perfect!!!

xcstatus commented 10 months ago

现在阿里云提供的免费证书,有效期已经改为90天,不知道其他的云服务厂商是否会跟进这项改动。90天的有效期下,手动去维护证书过于繁琐。 caddy签发证书的验证ACME challenges共有三种方式,当前使用的是第二种方式TLS-ALPN challenge,它必须使用443端口. 第一种方式必须使用80端口。而第三种方式就没有端口的要求。而且第三种方式dns质询,我们其实是经常使用,云服务商中申请免费证书使用的就是这种方式

caddy修改为第三种方式也是很便捷的,只需要修改一下caddy的镜像即可。当前dockerhub中带有dns质询的caddy镜像都太老了,不太想去使用,需要重新构建一个.

修改的步骤分为以下 1.根据你域名解析所使用的服务商选择对应的dns质询插件去构建一个docker镜像 2.替换脚本中的caddy镜像 3.到云服务商申请api调用token 4.在启动脚本中增加dns质询配置

这样就可以使用caddy来自动签发、迭代域名证书了

MrChenhtlss commented 10 months ago

现在阿里云提供的免费证书,有效期已经改为90天,不知道其他的云服务厂商是否会跟进这项改动。90天的有效期下,手动去维护证书过于繁琐。 caddy签发证书的验证ACME challenges共有三种方式,当前使用的是第二种方式TLS-ALPN challenge,它必须使用443端口. 第一种方式必须使用80端口。而第三种方式就没有端口的要求。而且第三种方式dns质询,我们其实是经常使用,云服务商中申请免费证书使用的就是这种方式

caddy修改为第三种方式也是很便捷的,只需要修改一下caddy的镜像即可。当前dockerhub中带有dns质询的caddy镜像都太老了,不太想去使用,需要重新构建一个.

修改的步骤分为以下 1.根据你域名解析所使用的服务商选择对应的dns质询插件去构建一个docker镜像 2.替换脚本中的caddy镜像 3.到云服务商申请api调用token 4.在启动脚本中增加dns质询配置

这样就可以使用caddy来自动签发、迭代域名证书了

在没有更好的解决方法前,我决定使用手动更新证书,您可以尝试腾讯云free证书有效期为一年,需要注意的是谨防滥用,阿里云先前有效期同为一年不知道因何故变成三个月这可能和滥用有关 image

xcstatus commented 10 months ago

阿里云发布的公告是证书厂商做的变更,所以大概率其余云服务商也会变更有效期。

MrChenhtlss commented 10 months ago

阿里云发布的公告是证书厂商做的变更,所以大概率其余云服务商也会变更有效期。

其他厂商跟着实行的话那真的非常遗憾,到时应该会有其他的处理方法!!!

xcstatus commented 10 months ago

@jiangslee 请问有兴趣做下dns质询的适配吗? 我对运维相关技术了解的不太多,看一些镜像构建脚本比较头疼。

jiangslee commented 10 months ago

现在阿里云提供的免费证书,有效期已经改为90天,不知道其他的云服务厂商是否会跟进这项改动。90天的有效期下,手动去维护证书过于繁琐。 caddy签发证书的验证ACME challenges共有三种方式,当前使用的是第二种方式TLS-ALPN challenge,它必须使用443端口. 第一种方式必须使用80端口。而第三种方式就没有端口的要求。而且第三种方式dns质询,我们其实是经常使用,云服务商中申请免费证书使用的就是这种方式

caddy修改为第三种方式也是很便捷的,只需要修改一下caddy的镜像即可。当前dockerhub中带有dns质询的caddy镜像都太老了,不太想去使用,需要重新构建一个.

修改的步骤分为以下 1.根据你域名解析所使用的服务商选择对应的dns质询插件去构建一个docker镜像 2.替换脚本中的caddy镜像 3.到云服务商申请api调用token 4.在启动脚本中增加dns质询配置

这样就可以使用caddy来自动签发、迭代域名证书了

DNS质询是不是要配置云厂商的ak/sk?

jiangslee commented 10 months ago

image http://www.taodudu.cc/news/show-4300117.html https://blog.51cto.com/u_11908275/6953390

貌似用定时任务能解决证书问题

xcstatus commented 10 months ago

在构建caddy镜像时引入对应厂商的插件即可 可以参考https://github.com/fjc0k/docker-caddy-dnspod

腾讯 DnsPod 插件 https://github.com/caddy-dns/dnspod

MrChenhtlss commented 10 months ago

如果可以将caddy替换为nginx证书问题就迎刃而解 xcstatus @.***>于2023年12月22日 周五18:06写道:

在构建caddy镜像时引入对应厂商的插件即可 可以参考https://github.com/fjc0k/docker-caddy-dnspod

腾讯 DnsPod 插件 https://github.com/caddy-dns/dnspod

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1867491839, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SG3VKRDX52K5IFNVZLYKVLRRAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGQ4TCOBTHE . You are receiving this because you were mentioned.Message ID: @.***>

xcstatus commented 10 months ago
image

手动部署的方式搞定了, 但是自动化部署脚本不知道怎么编写

Beatirce commented 10 months ago

image

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

可以跑了

脚本提示找不到文件或目录,但对应的目录和pem都创建过了。$NETBIRD_DOMAIN {下的tls也更改了。能麻烦分析一下是什么问题么?

xcstatus commented 10 months ago

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

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

Beatirce commented 10 months ago

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

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

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

xcstatus commented 10 months ago

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

Beatirce commented 10 months ago

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

感谢,我看看这个服务。

jiangslee commented 10 months ago

看不出来有什么问题, 怀疑是 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)

MrChenhtlss commented 10 months ago

如果在国内服务器上部署的话 需要注释掉脚本中的 h1 h2,另外 再把所需的docker镜像手动pull一下

jiangslee @.***>于2023年12月25日 周一17:54写道:

看不出来有什么问题, 怀疑是 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)

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/1267#issuecomment-1868898029, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC6T5SDZSR4OK4Z2QFPE3R3YLFENNAVCNFSM6AAAAAA6VQ3QOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYHA4TQMBSHE . You are receiving this because you were mentioned.Message ID: @.***>