Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running supabase locally as docker, It's impossible to to assign a value of environment variable to site_url in config.toml. #23296

Open
GA1 opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working cli Related to supabase/cli needs-analysis Issue status is unknown and/or not possible to triage with the current info

Comments

@GA1
Copy link

GA1 commented Apr 26, 2024

Bug report

  • [] I confirm this is a bug with Supabase, not with my own application.
  • [] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When running supabase locally as docker, It's impossible to to assign a value of environment variable to site_url in config.toml.

To Reproduce

I used supabase-cli to create a supabase directory with the default config:
Screenshot 2024-04-26 at 13 13 10

In the config I replaced the site_url with a custom hardcoded url: localhost:5173 because I wanted my google sign in work locally, and localhost:5173 is the address of my local frontend application.

Unfortunately when I try to replace the hardcoded url with an environment variable (that I provide during the run of supabase)

[auth]
enabled = true
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
# in emails.
site_url = "env(SUPABASE_CONFIG_SITE_URL)"
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
additional_redirect_urls = ["https://127.0.0.1:3000"]
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
jwt_expiry = 3600
# If disabled, the refresh token will never expire.

Screenshot 2024-04-26 at 13 16 34

the site_url is not getting replaced, instead it's understood as string, and used as such, what can be seen in one of the redirects I get in the browser:

http://localhost:54321/env(SUPABASE_CONFIG_SITE_URL)#access_token=....

aaaaaaaa

Expected behavior

The site_url should be replaced with the value of SUPABASE_CONFIG_SITE_URL just like other parameters in the config are replaced with other variables

System information

  • OS: macOS Sonoma 14.1.2
  • Version of Node.js: [e.g. 20.11.1]
  • Supabase-cli version: 1.150.0
@GA1 GA1 added the bug Something isn't working label Apr 26, 2024
@encima encima added cli Related to supabase/cli needs-analysis Issue status is unknown and/or not possible to triage with the current info labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Related to supabase/cli needs-analysis Issue status is unknown and/or not possible to triage with the current info
Projects
None yet
Development

No branches or pull requests

2 participants