Closed gbtech-org closed 1 month ago
you can try something like this: ( not tested )
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header x-ztnet-auth $http_x_ztnet_auth;
In ztnet you can see all the logged in devices and the associated ip address, hence the X-Forwarded-For
it doesn't work with the solution you have provided I also tried to make it with cloudflare tunnel but the same unable to create network
are you sure the api key you use is correct?
Can you provide some code or information on how you add the x-ztnet-key
header ?
ah, sorry, i belived this was related to the api endpoints. Your issue is about the controller connection.
Are you using the default docker-compose layout? Have you changed any setting in the admin => controller page ?
no i don't change anything on admin controller
here are the logs i get from docker compose :
`ztnet | n [APIError]: APIError: APIError: Invalid API Key (get_controller_status) (network_create)
ztnet | at Object.R (/app/.next/server/chunks/8108.js:1:4632)
ztnet | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
ztnet | at async u (/app/.next/server/chunks/5354.js:52:24619)
ztnet | at async /app/.next/server/chunks/5354.js:11:13047
ztnet | at async resolveMiddleware (file:///app/node_modules/@trpc/server/dist/index.mjs:420:30)
ztnet | at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32)
ztnet | at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32)
ztnet | at async callRecursive (file:///app/node_modules/@trpc/server/dist/index.mjs:456:32)
ztnet | at async resolve (file:///app/node_modules/@trpc/server/dist/index.mjs:486:24)
ztnet | at async inputToProcedureCall (file:///app/node_modules/@trpc/server/dist/resolveHTTPResponse-cd1a9112.mjs:46:22) {
ztnet | status: undefined,
ztnet | statusText: undefined,
ztnet | cause: undefined
ztnet | }`
I found the problem so i will close this issue thank you for your support
What was your problem? I have the same one now.
EDIT: Found it. It was a too small network in the environment of the zerotier container I had
- ZT_ALLOW_MANAGEMENT_FROM=172.19.0.0/29
(which is only the first 6 ip addresses) and changed it to
- ZT_ALLOW_MANAGEMENT_FROM=172.19.0.0/24
because ztnet was outside of those 6 ips. Now it works.
It would be nice to post solutions and not just "I found the solution" without details.
I'm happy you find the solution by your self however i was ready to help you with this issue 🙂
For the next guy it would still help to write what your solution was.
I will do it next time 🙂
📝 Inquiry
🔖 Version
v0.7.0
🔧 Deployment Type
💻 Operating System
None
🌐 Browser
Chrome
📚 Any Other Information That May Be Helpful
No response