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

quickstart script support custom ports and ssl certificates #1410

Closed

Conversation

jiangslee
Copy link

@jiangslee jiangslee commented Dec 26, 2023

Describe your changes

Ports 80, 8080, and 443 of our self-host server have been occupied, and deployment cannot be completed through the quickstart script.

This modification enables the script to support custom ports and SSL certificates, which solves the issue of #1408 #1267, but it feels not elegant enough.

Hope other developers can participate and continue to improve it.

I'm very sorry, my English is poor, so I used Google Translate.

Issue ticket number and link

#1408
#1267

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@CLAassistant
Copy link

CLAassistant commented Dec 26, 2023

CLA assistant check
All committers have signed the CLA.

@pappz pappz self-requested a review December 27, 2023 09:20
@mlsmaycon
Copy link
Collaborator

Hello @jiangslee, thank you so much for the contribution; we really appreciate the work you are doing for the community.

Regarding the required custom port input, we should keep them optional for now; perhaps we can use a flag like NETBIRD_INTERATIVE_MODE=true to make the script ask for domain and ports.

This is causing the issue with github workflow:

2023-12-27T19:23:11.1641432Z ++ echo -n 'Enter the http port you want to use for NetBird (e.g. 80): '
2023-12-27T19:23:11.1642880Z Enter the http port you want to use for NetBird (e.g. 80): ++ read -r READ_NETBIRD_HTTP_PORT
2023-12-27T19:23:11.1644452Z infrastructure_files/getting-started-with-zitadel.sh: line 437: /dev/tty: No such device or address
2023-12-27T19:23:11.1645629Z ++ check_nb_http_port ''
2023-12-27T19:23:11.1646239Z ++ HTTP_PORT=
2023-12-27T19:23:11.1646735Z ++ '[' -x == -x ']'
2023-12-27T19:23:11.1647448Z ++ echo 'The NETBIRD_HTTP_PORT variable cannot be empty.'
2023-12-27T19:23:11.1648369Z The NETBIRD_HTTP_PORT variable cannot be empty.
2023-12-27T19:23:11.1649359Z ++ return 1
2023-12-27T19:23:11.1649833Z ++ read_nb_http_port
2023-12-27T19:23:11.1650447Z ++ READ_NETBIRD_HTTP_PORT=
2023-12-27T19:23:11.1651328Z ++ echo -n 'Enter the http port you want to use for NetBird (e.g. 80): '
2023-12-27T19:23:11.1653023Z Enter the http port you want to use for NetBird (e.g. 80): ++ read -r READ_NETBIRD_HTTP_PORT
2023-12-27T19:23:11.1654770Z infrastructure_files/getting-started-with-zitadel.sh: line 437: /dev/tty: No such device or address
2023-12-27T19:23:11.1655867Z ++ check_nb_http_port ''
2023-12-27T19:23:11.1656403Z ++ HTTP_PORT=
2023-12-27T19:23:11.1657027Z ++ '[' -x == -x ']'
2023-12-27T19:23:11.1657701Z ++ echo 'The NETBIRD_HTTP_PORT variable cannot be empty.'
2023-12-27T19:23:11.1658644Z The NETBIRD_HTTP_PORT variable cannot be empty.
2023-12-27T19:23:11.1659361Z ++ return 1

@jiangslee
Copy link
Author

@mlsmaycon Thanks for taking the time to review and reply, NETBIRD_INTERATIVE_MODE=true, that's a good idea, I think I'll improve it.

@jiangslee
Copy link
Author

Steps:

  1. mkdir certs
  2. Place the certificate file consistent with the domain name in the certs directory, such as 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.sh
  3. Enter the port number as prompted (please explain the domain name and security group port release in advance: your customized port number, such as the TCP in the picture above: 8088, 8443; UDP ports: 3478, 49152-65535)

操作步骤:

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

@jiangslee
Copy link
Author

~/docker-netbird# export NETBIRD_DOMAIN=netbird-demo.domain.com
~/docker-netbird# bash getting-started-with-zitadel.sh 
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


[+] Running 7/7
 ✔ Network docker-netbird_netbird                 Created                                                                                                                                  0.1s 
 ✔ Volume "docker-netbird_netbird_caddy_data"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_management"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_zitadel_certs"  Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_data"      Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_certs"     Created                                                                                                                                  0.0s 
 ✔ Container docker-netbird-crdb-1                Started                                                                                                                                  0.1s 

Waiting cockroachDB  to become ready  . done

Starting Zidatel IDP for user management


[+] Running 3/3
 ✔ Container docker-netbird-caddy-1    Started                                                                                                                                             0.2s 
 ✔ Container docker-netbird-crdb-1     Healthy                                                                                                                                             0.0s 
 ✔ Container docker-netbird-zitadel-1  Started                                                                                                                                             0.2s 

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created  . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready  . . . . . . . . . . . . . done
Creating new zitadel project
Creating new Zitadel SPA Dashboard application
Creating new Zitadel SPA Cli application

Rendering NetBird files...


Starting NetBird services

[+] Running 7/7
 ✔ Container docker-netbird-coturn-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-crdb-1        Healthy                                                                                                                                          0.0s 
 ✔ Container docker-netbird-zitadel-1     Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-caddy-1       Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-dashboard-1   Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-signal-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-management-1  Started                                                                                                                                          0.2s 

Done!

You can access the NetBird dashboard at https://netbird-demo.domain.com:8443
Login with the following credentials:
Username: [email protected]
Password: VBkLImAnyPasswordgdZt6quUsR/kjMH9IrhpO7Tikg@

image

Copy link
Collaborator

@mlsmaycon mlsmaycon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jiangslee for the changes and the time you are investing on this.

I've make some suggestions and requests. The main point is that these changes should be optional and only requested if the user wants to by setting the NETBIRD_INTERACTIVE_MODE.

Regarding port 8080, it was a left over from the initial setup and can be removed.

infrastructure_files/getting-started-with-zitadel.sh Outdated Show resolved Hide resolved
initEnvironment() {
CADDY_SECURE_DOMAIN=""
ZITADEL_EXTERNALSECURE="false"
ZITADEL_TLS_MODE="disabled"
ZITADEL_MASTERKEY="$(openssl rand -base64 32 | head -c 32)"
NETBIRD_PORT=80
NETBIRD_HTTP_PROTOCOL="http"
TURN_USER="self"
TURN_PASSWORD=$(openssl rand -base64 32 | sed 's/=//g')
TURN_MIN_PORT=49152
TURN_MAX_PORT=65535

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's set default ports to be used when the user is not using the interactive mode.

@@ -527,6 +624,10 @@ renderCaddyfile() {
}
}

$NETBIRD_DOMAIN {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the effect of this setting? Does caddy will look for the certificates if none is provided? Does it fail? I think this block should be optional.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be optional. I will see how to change it to optional. Thanks.

- '8080:8080'
- '$NETBIRD_PORT:443'
- '$NETBIRD_HTTP_PORT:80'
- '$NETBIRD_8080_PORT:8080'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed, it is probably a leftover

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will remove it.

@jiangslee
Copy link
Author

I feel this PR is not a good solution for custom ports and custom ssl certificates. I hope other developers can provide better solutions.

@liuyishengaaa
Copy link

Dear jiangslee:
可以安装在公司内网服务器上?根据您的脚本,使用自签名ssl证书,修改服务器hosts文件里的ip与自定义域名对应

[+] Running 3/3
✔ Container docker-netbird-caddy-1 Started 0.2s
✔ Container docker-netbird-crdb-1 Healthy 0.0s
✔ Container docker-netbird-zitadel-1 Started 0.2s

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready . . . . . . . . . ............... #每次都是这一步一直等待,Zitadel容器是需要连接互联网?

@jiangslee
Copy link
Author

Dear jiangslee: 可以安装在公司内网服务器上?根据您的脚本,使用自签名ssl证书,修改服务器hosts文件里的ip与自定义域名对应

[+] Running 3/3 ✔ Container docker-netbird-caddy-1 Started 0.2s ✔ Container docker-netbird-crdb-1 Healthy 0.0s ✔ Container docker-netbird-zitadel-1 Started 0.2s

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created . . . . done Reading Zitadel PAT Waiting for Zitadel to become ready . . . . . . . . . ............... #每次都是这一步一直等待,Zitadel容器是需要连接互联网?

貌似需要公网服务器,公网机构签发的ssl证书和公网能访问的域名哦。

@liuyishengaaa
Copy link

~/docker-netbird# export NETBIRD_DOMAIN=netbird-demo.domain.com
~/docker-netbird# bash getting-started-with-zitadel.sh 
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


[+] Running 7/7
 ✔ Network docker-netbird_netbird                 Created                                                                                                                                  0.1s 
 ✔ Volume "docker-netbird_netbird_caddy_data"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_management"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_zitadel_certs"  Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_data"      Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_certs"     Created                                                                                                                                  0.0s 
 ✔ Container docker-netbird-crdb-1                Started                                                                                                                                  0.1s 

Waiting cockroachDB  to become ready  . done

Starting Zidatel IDP for user management


[+] Running 3/3
 ✔ Container docker-netbird-caddy-1    Started                                                                                                                                             0.2s 
 ✔ Container docker-netbird-crdb-1     Healthy                                                                                                                                             0.0s 
 ✔ Container docker-netbird-zitadel-1  Started                                                                                                                                             0.2s 

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created  . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready  . . . . . . . . . . . . . done
Creating new zitadel project
Creating new Zitadel SPA Dashboard application
Creating new Zitadel SPA Cli application

Rendering NetBird files...


Starting NetBird services

[+] Running 7/7
 ✔ Container docker-netbird-coturn-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-crdb-1        Healthy                                                                                                                                          0.0s 
 ✔ Container docker-netbird-zitadel-1     Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-caddy-1       Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-dashboard-1   Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-signal-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-management-1  Started                                                                                                                                          0.2s 

Done!

You can access the NetBird dashboard at https://netbird-demo.domain.com:8443
Login with the following credentials:
Username: [email protected]
Password: VBkLImAnyPasswordgdZt6quUsR/kjMH9IrhpO7Tikg@

image

Dear jiangslee:
您用的哪一个脚本,为啥自定义端口安装后,下图我的没有显示“域名+端口”,只显示了域名呢
image

~/docker-netbird# export NETBIRD_DOMAIN=netbird-demo.domain.com
~/docker-netbird# bash getting-started-with-zitadel.sh 
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


[+] Running 7/7
 ✔ Network docker-netbird_netbird                 Created                                                                                                                                  0.1s 
 ✔ Volume "docker-netbird_netbird_caddy_data"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_management"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_zitadel_certs"  Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_data"      Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_certs"     Created                                                                                                                                  0.0s 
 ✔ Container docker-netbird-crdb-1                Started                                                                                                                                  0.1s 

Waiting cockroachDB  to become ready  . done

Starting Zidatel IDP for user management


[+] Running 3/3
 ✔ Container docker-netbird-caddy-1    Started                                                                                                                                             0.2s 
 ✔ Container docker-netbird-crdb-1     Healthy                                                                                                                                             0.0s 
 ✔ Container docker-netbird-zitadel-1  Started                                                                                                                                             0.2s 

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created  . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready  . . . . . . . . . . . . . done
Creating new zitadel project
Creating new Zitadel SPA Dashboard application
Creating new Zitadel SPA Cli application

Rendering NetBird files...


Starting NetBird services

[+] Running 7/7
 ✔ Container docker-netbird-coturn-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-crdb-1        Healthy                                                                                                                                          0.0s 
 ✔ Container docker-netbird-zitadel-1     Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-caddy-1       Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-dashboard-1   Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-signal-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-management-1  Started                                                                                                                                          0.2s 

Done!

You can access the NetBird dashboard at https://netbird-demo.domain.com:8443
Login with the following credentials:
Username: [email protected]
Password: VBkLImAnyPasswordgdZt6quUsR/kjMH9IrhpO7Tikg@

image

Dear jiangslee:
您上面使用的是最新版本?自定义端口安装完成后如下图只有域名,没有域名+端口的形式
image

另一个,访问域名显示如下图登录错误
image

@jiangslee
Copy link
Author

~/docker-netbird# export NETBIRD_DOMAIN=netbird-demo.domain.com
~/docker-netbird# bash getting-started-with-zitadel.sh 
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


[+] Running 7/7
 ✔ Network docker-netbird_netbird                 Created                                                                                                                                  0.1s 
 ✔ Volume "docker-netbird_netbird_caddy_data"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_management"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_zitadel_certs"  Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_data"      Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_certs"     Created                                                                                                                                  0.0s 
 ✔ Container docker-netbird-crdb-1                Started                                                                                                                                  0.1s 

Waiting cockroachDB  to become ready  . done

Starting Zidatel IDP for user management


[+] Running 3/3
 ✔ Container docker-netbird-caddy-1    Started                                                                                                                                             0.2s 
 ✔ Container docker-netbird-crdb-1     Healthy                                                                                                                                             0.0s 
 ✔ Container docker-netbird-zitadel-1  Started                                                                                                                                             0.2s 

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created  . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready  . . . . . . . . . . . . . done
Creating new zitadel project
Creating new Zitadel SPA Dashboard application
Creating new Zitadel SPA Cli application

Rendering NetBird files...


Starting NetBird services

[+] Running 7/7
 ✔ Container docker-netbird-coturn-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-crdb-1        Healthy                                                                                                                                          0.0s 
 ✔ Container docker-netbird-zitadel-1     Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-caddy-1       Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-dashboard-1   Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-signal-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-management-1  Started                                                                                                                                          0.2s 

Done!

You can access the NetBird dashboard at https://netbird-demo.domain.com:8443
Login with the following credentials:
Username: [email protected]
Password: VBkLImAnyPasswordgdZt6quUsR/kjMH9IrhpO7Tikg@

image

Dear jiangslee: 您用的哪一个脚本,为啥自定义端口安装后,下图我的没有显示“域名+端口”,只显示了域名呢 image

~/docker-netbird# export NETBIRD_DOMAIN=netbird-demo.domain.com
~/docker-netbird# bash getting-started-with-zitadel.sh 
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


[+] Running 7/7
 ✔ Network docker-netbird_netbird                 Created                                                                                                                                  0.1s 
 ✔ Volume "docker-netbird_netbird_caddy_data"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_management"     Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_zitadel_certs"  Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_data"      Created                                                                                                                                  0.0s 
 ✔ Volume "docker-netbird_netbird_crdb_certs"     Created                                                                                                                                  0.0s 
 ✔ Container docker-netbird-crdb-1                Started                                                                                                                                  0.1s 

Waiting cockroachDB  to become ready  . done

Starting Zidatel IDP for user management


[+] Running 3/3
 ✔ Container docker-netbird-caddy-1    Started                                                                                                                                             0.2s 
 ✔ Container docker-netbird-crdb-1     Healthy                                                                                                                                             0.0s 
 ✔ Container docker-netbird-zitadel-1  Started                                                                                                                                             0.2s 

Initializing Zitadel with NetBird's applications

Waiting for Zitadel's PAT to be created  . . . . done
Reading Zitadel PAT
Waiting for Zitadel to become ready  . . . . . . . . . . . . . done
Creating new zitadel project
Creating new Zitadel SPA Dashboard application
Creating new Zitadel SPA Cli application

Rendering NetBird files...


Starting NetBird services

[+] Running 7/7
 ✔ Container docker-netbird-coturn-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-crdb-1        Healthy                                                                                                                                          0.0s 
 ✔ Container docker-netbird-zitadel-1     Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-caddy-1       Running                                                                                                                                          0.0s 
 ✔ Container docker-netbird-dashboard-1   Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-signal-1      Started                                                                                                                                          0.2s 
 ✔ Container docker-netbird-management-1  Started                                                                                                                                          0.2s 

Done!

You can access the NetBird dashboard at https://netbird-demo.domain.com:8443
Login with the following credentials:
Username: [email protected]
Password: VBkLImAnyPasswordgdZt6quUsR/kjMH9IrhpO7Tikg@

image

Dear jiangslee: 您上面使用的是最新版本?自定义端口安装完成后如下图只有域名,没有域名+端口的形式 image

另一个,访问域名显示如下图登录错误 image

https://github.com/jiangslee/netbird/raw/6b603e7b28bf1fbc69ce9870666fbb520d480eaa/infrastructure_files/getting-started-with-zitadel.sh
commit 6b603e7 这个版本

最新的commit官方给了个加参数的建议,我还没时间折腾,另一个小伙伴也有个自定义端口号的PR,你也可以试试 #1464

@jiangslee jiangslee closed this Feb 14, 2024
@liuyishengaaa
Copy link

According to the program you provided, the installation can be successful, but only the management container keeps restarting and reporting errors:


2024-03-20T07:49:46Z INFO management/cmd/management.go:407: loading OIDC configuration from the provided IDP configuration endpoint https://netbird1.test.buzz:33443/.well-known/openid-configuration
Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://netbird1.test.buzz:33443/.well-known/openid-configuration Get "https://netbird1.test.buzz:33443/.well-known/openid-configuration": dial tcp [2403:7c51:553:fe82:cc36:12ef:ceca:5bcf]:33443: connect: cannot assign requested address”

netbird

@jiangslee
Copy link
Author

jiangslee commented Mar 20, 2024

According to the program you provided, the installation can be successful, but only the management container keeps restarting and reporting errors:

2024-03-20T07:49:46Z INFO management/cmd/management.go:407: loading OIDC configuration from the provided IDP configuration endpoint https://netbird1.test.buzz:33443/.well-known/openid-configuration

Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://netbird1.test.buzz:33443/.well-known/openid-configuration Get "https://netbird1.test.buzz:33443/.well-known/openid-configuration": dial tcp [2403:7c51:553:fe82:cc36:12ef:ceca:5bcf]:33443: connect: cannot assign requested address”

netbird

安全组没有放行端口?

试试这个分支的一键部署文件?

https://github.com/jiangslee/netbird/blob/main-jsl/infrastructure_files/getting-started-with-zitadel.sh

@liuyishengaaa
Copy link

Based on the program you just sent, I tested it again and encountered the same issue. Port testing with the "nc" command confirms that the ports are open.

@liuyishengaaa
Copy link

If there's a senior developer who can provide the source code for installation instead of deploying it using containers, it would make problem-solving much easier.

@jiangslee
Copy link
Author

jiangslee commented Mar 20, 2024

Based on the program you just sent, I tested it again and encountered the same issue. Port testing with the "nc" command confirms that the ports are open.

root@iZj6cb9lplrwa2ekfias0hZ:~/docker-netbird# tree ./certs
./certs
├── netbird.domain.com.key
└── netbird.domain.com.pem

0 directories, 2 files
root@iZj6cb9lplrwa2ekfias0hZ:~/docker-netbird# wget https://raw.githubusercontent.com/jiangslee/netbird/main-jsl/infrastructure_files/getting-started-with-zitadel.sh
--2024-03-20 20:49:12--  https://raw.githubusercontent.com/jiangslee/netbird/main-jsl/infrastructure_files/getting-started-with-zitadel.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27425 (27K) [text/plain]
Saving to: ‘getting-started-with-zitadel.sh’

getting-started-with-zitadel.sh                                                     100%[=================================================================================================================================================================================================================>]  26.78K  --.-KB/s    in 0.01s   

2024-03-20 20:49:12 (2.25 MB/s) - ‘getting-started-with-zitadel.sh’ saved [27425/27425]
root@iZj6cb9lplrwa2ekfias0hZ:~/docker-netbird# chmod +x getting-started-with-zitadel.sh 
root@iZj6cb9lplrwa2ekfias0hZ:~/docker-netbird# ./getting-started-with-zitadel.sh 
The NETBIRD_DOMAIN variable cannot be empty.
Enter the domain you want to use for NetBird (e.g. netbird.my-domain.com): netbird.domain.com
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the http port you want to use for NetBird (e.g. 80): 8088
The NETBIRD_HTTP_PORT variable cannot be empty.
Enter the NETBIRD_8080_PORT you want to use for NetBird (e.g. 8080): 8081
The NETBIRD_3478_PORT variable cannot be empty.
Enter the TURN_LISTENING_PORT you want to use for NetBird (e.g. 3478): 3478
The NETBIRD_PORT variable cannot be empty.
Enter the https port you want to use for NetBird (e.g. 443): 8443
Rendering initial files...

Initializing Zitadel's CockroachDB


WARN[0000] /root/docker-netbird/docker-compose.yml: `version` is obsolete 
[+] Running 7/7
 ✔ crdb 6 layers [⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled       
....
 ✔ Container docker-netbird-signal-1      Started  2.6s 
 ✔ Container docker-netbird-caddy-1       Running  0.0s 
 ✔ Container docker-netbird-management-1  Started  2.4s 
 ✔ Container docker-netbird-dashboard-1   Started    2.7s 
 ✔ Container docker-netbird-coturn-1      Started   1.7s 
 ✔ Container docker-netbird-crdb-1        Healthy    0.0s 
 ✔ Container docker-netbird-zitadel-1     Running   0.0s 

Done!

You can access the NetBird dashboard at https://netbird.domain.com
Login with the following credentials:
Username: [email protected]
Password: qyT3eRudIfANO****ePAXP3AQ9JBs@
root@iZj6cb9lplrwa2ekfias0hZ:~/docker-netbird# docker compose ps -a
WARN[0000] /root/docker-netbird/docker-compose.yml: `version` is obsolete 
NAME                          IMAGE                             COMMAND                  SERVICE      CREATED         STATUS                   PORTS
docker-netbird-caddy-1        caddy                             "caddy run --config …"   caddy        8 minutes ago   Up 5 minutes             443/udp, 2019/tcp, 0.0.0.0:8088->80/tcp, :::8088->80/tcp, 0.0.0.0:8443->443/tcp, :::8443->443/tcp
docker-netbird-coturn-1       coturn/coturn                     "docker-entrypoint.s…"   coturn       4 minutes ago   Up 4 minutes             
docker-netbird-crdb-1         cockroachdb/cockroach:v22.2.2     "/cockroach/cockroac…"   crdb         8 minutes ago   Up 8 minutes (healthy)   8080/tcp, 26257/tcp
docker-netbird-dashboard-1    netbirdio/dashboard:latest        "/usr/bin/supervisor…"   dashboard    4 minutes ago   Up 4 minutes             80/tcp, 443/tcp
docker-netbird-management-1   netbirdio/management:latest       "/go/bin/netbird-mgm…"   management   4 minutes ago   Up 4 minutes             
docker-netbird-signal-1       netbirdio/signal:latest           "/go/bin/netbird-sig…"   signal       4 minutes ago   Up 4 minutes             
docker-netbird-zitadel-1      ghcr.io/zitadel/zitadel:v2.31.3   "/app/zitadel start-…"   zitadel      8 minutes ago   Up 7 minutes

@liuyishengaaa

我刚新建了一个云服务器实例,可以一键部署。

要不你新建一个实例试试看?是不是你的环境有什么限制?

I've just set up a new cloud server instance with a one-click deployment option.

Would you like to try creating a new instance yourself? Perhaps there are some restrictions in your environment.

安全组放行端口参考:
Here's a reference for opening ports in the security group(in my case):
image

image

@jiangslee
Copy link
Author

有个Q群可以交流一下Netbird,群号:677407258

@ismail0234 ismail0234 mentioned this pull request Nov 11, 2024
6 tasks
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

Successfully merging this pull request may close these issues.

5 participants