openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.69k stars 153 forks source link

Add port check to quickstart #706

Closed gberl002 closed 1 year ago

gberl002 commented 2 years ago

It would be nice to have a command to check if all the necessary quickstart related ports are available so the install doesn't fail. This could be either a command (that would be applied to ziti-doc repo) that's copy/pasted or even better, added to expressInstall and maybe a reference on how to change the port (in a case where the user cannot free it for the install).

avinilcode commented 1 year ago

@gberl002 Can i work on this? Please assign it to me.

dovholuknf commented 1 year ago

Sure thing. You'll want to add a function to ziti-cli-functions.sh. It probably should just make sure nothing else is running on the configured ports before running. You should be able to test failures by using nc to hold up the port before trying expressInstall

avinilcode commented 1 year ago

I will ask there any questions around it. Thanks

avinilcode commented 1 year ago

@dovholuknf Can you please tell me, port number 6262,1280,3023 and 10000 is it exhaustive list of ports that are being used in this project?

dovholuknf commented 1 year ago

I think it's configurable but by default the ports that need to be checked for the quickstart are 8441 for the controller, 8442 for the edge router connections, 8443 for Zac.

Probably should be a function written that's relatively Linux portable that just tests a given port for being in use and returns a value indicating if the provided port is in use, then for starters, before trying to configure the controller port 8441, the most vital port, this check is performed.

It should be right at the area where jq is checked and a friendly error produced

dovholuknf commented 1 year ago

Yes, you should check ZITI_EDGE_CONTROLLER_PORT not 8441.

avinilcode commented 1 year ago

Understood, working on it

avinilcode commented 1 year ago

@dovholuknf Please review my PR and let me know