Zrok self-hosted answering 401's after zrok admin bootstrap command

Hello there!

I'm currently setting up a self-hosted version of zrok to work on top of my already working openziti network, but something isn't right. I'm following the self-hosted guide and I was able to run the zrok admin bootstrap config.yml command without any issues.

However, when I'm trying to create a public frontend with the command zrok admin create frontend {token} public https://{token}.your.dns.name, I received the following 401 error:

[ERROR]: create frontend request failed ([POST /frontend][401] createFrontendUnauthorized)

I tried to skip the create frontend step and run the zrok controller which it is working, but I can't go any further on the configuration process which involves creating an account with zrok admin create account <email> <password> which also gives me a 401.

How do I fix this?

Did you skip the section about setting up ZROK_ADMIN_TOKEN and putting an admin token in your zrok controller config? The admin commands use an "admin token" for authentication. You need to ensure that you've added a unique admin token to your controller config, and then have set the ZROK_ADMIN_TOKEN environment variable to match.

Look at this section of the docs:

The admin token was previous defined and match with the same value passed to the export ZROK_ADMIN_TOKEN command, however I missed the export ZROK_API_ENDPOINT command which was causing the error.

Thank you for the help and sorry about the incovenience!

Sure thing. That'll also do it...

You can also zrok config set apiEndpoint <yourEndpoint> to set that config into your zrok environment, also.