nhost / cli

Nhost CLI
https://docs.nhost.io/development/cli/overview
MIT License
77 stars 28 forks source link

feat: allow selecting local subdomain #896

Closed dbarrosop closed 3 months ago

dbarrosop commented 3 months ago

Adds local-subdomain flag to set new-style's subdomain (old style still works):

❯ nhost --local-subdomain 127-0-0-1 up
Checking versions...
✅ Auth is already on a recommended version: 0.30.0
🟡 Storage is not on a recommended version. Recommended: 0.6.1
   More info: https://github.com/nhost/hasura-storage/releases
🟡 PostgreSQL is not on a recommended version. Recommended: 14.11-20240515-1, 14.11-20240718-1, 15.6-20240718-1, 16.2-20240718-1
   More info: https://hub.docker.com/r/nhost/postgres
🟡 Hasura is not on a recommended version. Recommended: v2.38.0-ce
🟡 A new version of Nhost CLI is available: v1.21.0
   You can upgrade the CLI by running `nhost sw upgrade`
   More info: https://github.com/nhost/cli/releases
Setting up Nhost development environment...
Starting Nhost development environment...
[+] Running 11/11
 ✔ Container myproject-traefik-1       Healthy                                                           17.7s
 ✔ Container myproject-dashboard-1     Healthy                                                           17.7s
 ✔ Container myproject-functions-1     Healthy                                                           17.7s
 ✔ Container myproject-mailhog-1       Healthy                                                           17.7s
 ✔ Container myproject-minio-1         Healthy                                                           17.7s
 ✔ Container myproject-postgres-1      Healthy                                                           17.7s
 ✔ Container myproject-graphql-1       Healthy                                                           17.7s
 ✔ Container myproject-configserver-1  Healthy                                                           17.7s
 ✔ Container myproject-console-1       Healthy                                                           12.5s
 ✔ Container myproject-auth-1          Healthy                                                           12.5s
 ✔ Container myproject-storage-1       Healthy                                                            7.5s
Applying migrations...
INFO nothing to apply on database: default
Applying metadata...
Restarting services to reapply metadata if needed...
[+] Restarting 3/3
 ✔ Container myproject-functions-1  Started                                                              10.3s
 ✔ Container myproject-auth-1       Started                                                               0.6s
 ✔ Container myproject-storage-1    Started                                                               0.6s
Downloading metadata...
Unable to find image 'hasura/graphql-engine:metadata.cli-migrations-v3' locally
docker: Error response from daemon: manifest for hasura/graphql-engine:metadata.cli-migrations-v3 not found: manifest unknown: manifest unknown.
See 'docker run --help'.
Reapplying metadata...
INFO Metadata reloaded
WARN Metadata is inconsistent, use 'hasura metadata ic list' command to see the inconsistent objects
Nhost development environment started.
URLs:
- Postgres:         postgres://postgres:postgres@localhost:5432/local
- Hasura:           https://127-0-0-1.hasura.local.nhost.run
- GraphQL:          https://127-0-0-1.graphql.local.nhost.run
- Auth:             https://127-0-0-1.auth.local.nhost.run
- Storage:          https://127-0-0-1.storage.local.nhost.run
- Functions:        https://127-0-0-1.functions.local.nhost.run
- Dashboard:        https://127-0-0-1.dashboard.local.nhost.run
- Mailhog:          https://127-0-0-1.mailhog.local.nhost.run

SDK Configuration:
 Subdomain:    127-0-0-1
 Region:       local
Run `nhost up` to reload the development environment
Run `nhost down` to stop the development environment
Run `nhost logs` to watch the logs

It also sets the correct public urls for the various services accordingly (i.e. presigned urls for storage or callback urls for auth):

Screenshot 2024-08-15 at 14 17 40