-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Update ztApi.ts - change default URL of the Local Zerotier URL #196
Conversation
I think address http://zerotier:9993 may be a bit misleading, especially for the standalone version installations. My proposition is to use by default (if not specified in .env file ZT_ADDR variable) http://127.0.0.1:9993 which should work everywhere.
This should avoid problem as described here |
ZT_ADDR is not added to docker-compose env as default. Using import { isRunningInDocker } from "./docker";
const LOCAL_ZT_ADDR =
process.env.ZT_ADDR || isRunningInDocker()
? "http://zerotier:9993"
: "http://127.0.0.1:9993"; When not docker enviroment use |
Great! You're absolutely right. That will do trick :) |
Do you want me to add the changes, or will you add them yourself? |
When not docker enviroment use http://127.0.0.1:9993 else http://zerotier:9993
Just updated my PR. Please check. |
Perfect. |
Thanks for cooperation! Then you can merge into |
Well... we have to consider to change also in other files for visual experience in webUI, because I still see this: Grepping for "http://zerotier:9993" I found
excluding auto generated during build. I think that cruical is Could you add proper conditions? |
i will add a check during the registration if the user is in docker or not and update db accourdingly. |
OK, thanks! 👍 But what about existing users?... |
users who already uses ztnet as standalone, has probably already changed this value. I dont want to create a new migration that will force new values in db when they update. |
Understood. Basically, I only mean the visual effect in webUI as a placeholder in the screenshot as I pasted above :) |
I have updated the placeholder so the correct value will be displayed |
i will take ta deeper dive into this later. I think there is a potensial bug when using the |
You're right. I've the same issue... |
I think address http://zerotier:9993 may be a bit misleading, especially for the standalone version installations. My proposition is to use by default (if not specified in .env file ZT_ADDR variable) http://127.0.0.1:9993 which should work everywhere.