saleor / saleor-docs

Saleor documentation.
https://docs.saleor.io
106 stars 151 forks source link

environment variables need updating #1068

Open c-nv-s opened 8 months ago

c-nv-s commented 8 months ago

Whilst checking the documentation I noticed that it states that the environment variable PUBLIC_URL needs to be set as the location of where the saleor api is publicly reachable. https://docs.saleor.io/docs/3.x/setup/configuration#public_url

however that environment has no effect, and after a quick code search it appears the correct environment variable is APP_URL

  API_URL: "http://localhost:8000/graphql/",
  APP_MOUNT_URI: "/",
  APPS_MARKETPLACE_API_URI: "http://localhost:3000",
  APPS_TUNNEL_URL_KEYWORDS: ".ngrok.io;.saleor.live",
  IS_CLOUD_INSTANCE: "true",
  LOCALE_CODE: "EN",

in fact, searching all the above environment variables in the docs turns up nothing.

aniav commented 4 months ago

Hey @c-nv-s I just checked and the docs state that PUBLIC_URL:

Specifies the base URL at which Saleor is hosted, such as https://api.example.com/. This setting takes precedence over both ENABLE_SSL and Shop.domain (set using the GraphQL API) when generating URLs. Ensure to provide the complete URL, including the protocol: http:// or https://.

It doesn't say anything about the GraphQL API.

I also checked and search in the Saleor code doesn't have the APP_URL or API_URL env variables at all. app_url is used in apps but it has to be passed in the app manifest, so it seems like a different thing.

Am I looking at the right places?

c-nv-s commented 4 months ago

you can use the github magnifying glass on your repo to search your organization's code: https://github.com/saleor/saleor-dashboard/blob/9c5e786522259d1dae2c1aeaf98dc8e8f5bc87dd/testUtils/setup.ts#L24

aniav commented 4 months ago

Ah I think this is where the confusion is happening. The docs mention PUBLIC_URL and it's a setting for the main Saleor repository https://github.com/saleor/saleor

There is no instruction for self-hosting saleor-dashboard in docs at that moment.

The dashboard setup is in the repository in: https://github.com/saleor/saleor-dashboard/blob/main/docs/configuration.md