directus-labs / directus-template-cli

Apply "templates" to a new, empty Directus project.
MIT License
88 stars 15 forks source link

Getting Warning: Invalid token despite correct token given when attempting to extract a template from a directus docker installation #44

Closed Andersang closed 10 months ago

Andersang commented 10 months ago

I'm getting a "Warning: Invalid token" when attempting to extract a template from a Directus docker installation on a local environment. I've verified that the static access token I've provided is correct using Postman.

The Directus instance I have set up is accessible on my local machine at http://localhost:7055/. I'm running the Template CLI using the Docker Desktop Exec interface. This is a preview of the inputs I gave:

What is your Directus URL?: localhost:7055
What is your Directus Admin Token?: <directus admin static access token here>
 ›   Warning: Invalid token
bryantgillespie commented 10 months ago

Hmm if the token is correct - it could be the url.

  1. Have you got the 7055 port exposed in your Docker setup?

  2. Have you tried the url as http://localhost:7055/?

Andersang commented 10 months ago

Yes to both. Still haven't got it working - I was wondering if it's an issue with locally hosted docker containers.

Andersang commented 10 months ago

Issue is solved. A mistake on my part - for local installations where port mapping is done, we must still use the default directus port at 8055 for template-cli if we are running the script in docker desktop's exec tab. Using http://localhost:8055/ works.

bryantgillespie commented 10 months ago

Closing this issue