this issue to override the default apollo url was ...
# prefect-server
m
this issue to override the default apollo url was closed a few days ago but I am still unable to get this to default to anything other than localhost: https://github.com/PrefectHQ/ui/issues/99
I am setting the PREFECT_SERVER__APOLLO_URL environment variable in the ui container to my backend url
in dev console I can print out the settings
Copy code
docker run --rm -e PREFECT_SERVER__APOLLO_URL=<https://my-apollo.backend/> -p 8080:8080 prefe
cthq/ui:latest
it is propagating
but still trying to talk to localhost
n
Hi @matt forbes - can you try opening your console and typing
localStorage.clear()
and pressing enter?
And then refreshing the page?
m
that did it
local storage persists even in incognito? that's interesting
it takes a few tries of clearing/refreshing to get it to stick
this is pretty weird behavior
n
Yeah that does sound odd, I can look into that some more if it persists - this is a pretty non-standard feature for an SPA like this so it may take some tweaking to get right
m
it gets a little weirder on the server
since VUE_APP_BASE_URL is set to localhost by default
I think I may need to override this as well?
n
Hm, I think you should be ok without doing that but I could be wrong; what are you seeing?
m
in public/index.html it tries to load the settings for the app
it does that by requesting settings.json
and that VUE_APP_BASE_URL is set to localhost
so on the server, this does not work
n
Ah I see, that makes sense. A quick fix would be to modify
index.html
to update that call to
process.env.VUE_APP_BASE_URL
To match the endpoint of your server
m
does that url get baked in or can I override
VUE_APP_BASE_URL
when I start the container?
n
That gets baked in, unfortunately, which is why we need to have this weird async call at the start in the first place
m
ohhh this is just a static site... hm
yeah this is making more sense now
ok I can just replace it in the dockerfile
thanks
n
Exactly - I can look into a better way to deliver that, I have a few ideas
m
can't it just fetch
/settings.json?
n
Yeah that might work!
m
👍
RUN sed -i 's/http:\/\/localhost:8080//g' /var/www/index.html
in the dockerfile did do the trick
and it loads the settings.json fine
and in
prefect_ui_settings
it is pointing to the right url
n
Fantastic! If you want to PR that change to the UI that’s be great!
m
and lots of
localStorage.clear()
and still pointing to localhost
😕
yeah I can send a PR for that
but still having an issue
getting closer though
n
Hm ok, I can look into it over the weekend or early next week
m
sounds good, I may just try to brute force replace it on my end, but would be nice to have the apollo_url override actually work
thanks for your help