https://prefect.io logo
Title
s

Sam Cook

08/24/2021, 1:42 PM
@znicholasbrown @Kevin Kho Has there been any progress on this issue? My team would very much like to upgrade our UI instance and this is a big blocker at the moment. https://github.com/PrefectHQ/ui/issues/861
n

nicholas

08/24/2021, 2:02 PM
Hi @Sam Cook - that issue should be resolved (looks like it didnโ€™t get closed though)z have you tried on the latest version of Core?
s

Sam Cook

08/24/2021, 2:37 PM
Oh, sweet! Let me update my test bed and see how that's looking
๐Ÿ‘ 1
I updated to the latest version and I still see the issue. The root page is served under the correct root path, but follow on pages still do not respect the set root path.
n

nicholas

08/24/2021, 3:42 PM
Interesting, I was under the impression the updated nginx image would fix this
s

Sam Cook

08/24/2021, 3:47 PM
I cracked open the index html, and there's a lot of references like
<link rel="stylesheet" href="/fonts/fonts.css">
I'm guessing the hard links are causing direct access to the root. Maybe simply changing to something like
<link rel="stylesheet" href="./fonts/fonts.css">
might fix it. I can try to update in the pod, but I'm guessing that pops up a lot in the embedded JS files as well
n

nicholas

08/24/2021, 3:48 PM
Yeah it would cause those sources are coming from a few different places, including webpack and our own scripts
s

Sam Cook

08/24/2021, 3:50 PM
The last workable version I used I just hardcoded my prefix for the webpack build and built a bespoke image, but since the FA-PRO inclusion I can't build locally anymore
n

nicholas

08/24/2021, 3:51 PM
yeah that tracks, i'm gonna try to solve this today so we can close that ticket
๐Ÿ™Œ 1
s

Sam Cook

08/24/2021, 3:52 PM
Thanks so much! 10/10 customer service. I should leave a Yelp review lol
๐Ÿ˜† 1
k

Kevin Kho

08/24/2021, 3:54 PM
I know youโ€™re joking but if ever you have an Azure account, we take reviews in the Azure Marketplace lol
๐Ÿ‘€ 1
n

nicholas

08/24/2021, 6:45 PM
On further investigation, I don't think this will be possible to fix on our end - the reason is that relative urls (which is the only way we can do this without requiring a full rebuild of the application on every server start) break application chunk loading because we use native browser
history.pushState
spec to prevent full page reloads when the application routes. An workaround to this would be to use a custom nginx config in your container with a proxy pass to route requests to the correct locatione
s

Sam Cook

08/24/2021, 6:52 PM
For security reasons I can't put a default route to the server level pointing to the Prefect UI, so that's not going to work out since I can't route to the container without a prefix. Is it at all feasible for me to build a ui image with the prefix route set? The only thing stopping me now is premium FA assets
n

nicholas

08/24/2021, 7:45 PM
Hm yes and no. You can build the UI image just fine by replacing the couple of references of
fontawesome-pro
with
fontawesome-free
without any license... however that will break instances in the UI where we use special icons. I'm looking into how we might remove that download need altogether to let you pre-build everything if needed
while of course not needing to change every icon we use ๐Ÿ˜›
s

Sam Cook

08/24/2021, 7:50 PM
I wonder if there's a way I can take the existing built image and do a rebuild using the existing fa-pro as a cache? Maybe a minimal two stage build where I just pull the fa files to the second stage
n

nicholas

08/24/2021, 7:51 PM
oof that sounds messy to maintain tbh
s

Sam Cook

08/24/2021, 7:51 PM
oh, horrendously
n

nicholas

08/24/2021, 7:51 PM
i think i've actually found a way to include everything we need in the project by default, so we don't need to pull the FA icons in at all, they'll already be there
which would let you do whatever you'd like with the project
s

Sam Cook

08/24/2021, 7:52 PM
oh, that would be amazing
n

nicholas

08/24/2021, 9:03 PM
ok it looks like at least that's a change that we'll be able to push through, i've got a demo of this working locally
๐Ÿ™Œ 1
Btw this has been merged and should be released this week
s

Sam Cook

08/30/2021, 2:25 AM
Thanks for this! I just got my local build working, only had to do a little fiddling to get everything working. Boy is that not a quick build process.
n

nicholas

08/30/2021, 6:59 AM
That's why we removed it from the normal startup ๐Ÿ˜ž
l

Luca Schneider

08/30/2021, 10:44 AM
Hi all, has this been fixed and pushed ? Also struggling to use UI behind a proxy. Thanks
s

Sam Cook

08/30/2021, 1:14 PM
@Luca Schneider There's no official fix for putting the UI behind a proxy, but my build is on Dockerhub and you can use it. The path prefix is hardcoded to
/prefectui/
, though. https://hub.docker.com/repository/docker/majikman111/prefect-ui-proxy
๐Ÿ‘ 1