-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
[Ghost Admin] Defining [cdnURL] triggers relative path construction for user-image.png specific to Ghost(Pro) that breaks on other hosting setups #21838
Comments
Hi @alexgmathews, can you explain what your use-case is for using This is a build time only variable used for loading the admin app from a different location to the main app. It's not documented anywhere that I know of and is working perfectly for its intended use. I think it's more likely a case of mistaken identity, but if you can explain what you're using it for and how we can probably help. |
Note from our bot: The |
Thank you, @ErisDS, for your clarifying questions. First, here's the relevant source code:
When you compare the code for all three, here's the odd thing thing about I'm extending Ghost's intended functionality and serving static assets (both front-end and admin) from a As you said, I'm not aware of IMAGE URL rendering incorrectly for its intended use cases. The issue I ran into (by hacking my way into it) is that when First, I found what strings to rewrite in the rendered HTML/XML to get Ghost's admin to load static assets over a This is as far as I could get on the admin dashboard before defining Eventually I figured out that I couldn't rewrite these paths because they were being called from client-side javascript: I looked through a Ghost(Pro) website and noticed
Here's an abstract of the NGINX configuration I'm using to define
Here are how IMAGE URL, OTHER URLs, and Resulting generated HTML:
The reason I think this is a [*1]: I created an isolated setup for this issue report with the below NGINX configuration. Instead of changing
|
Hey @alexgmathews 👋 Our team needed some more info to get to the bottom of this, however we've not heard back from you. We're going to close this for now, but let us know if you manage to dig up some more info and we'll reopen. |
@ErisDS - Apologies for my delayed response. It seems I was auto-bot-closed on for not having a timely response. Would you still consider? |
Issue Summary
Ghost Admin does not render the correct URL for the user avatar when
cdnURL
is defined.Steps to Reproduce
Spin up a new stand-alone instance of Ghost
Observe that without defining
cdnURL
, the user avatar HTML renders as:Modify the HTML-encoded EmberJS data inside
<meta name="ghost-admin/config/environment">
so that"cdnUrl": "https://testdomain.com/ghost/"
, the same path that Ghost would serve admin assets from if the path were undefined. I do so by post-processing the HTML for/ghost/
using NGINX subs_filter. I see Ghost(Pro) uses the pathhttps://assets.ghost.io/admin/1234/
Observe that after defining
cdnURL
, the user avatar HTML renders as:I think the user avatar HTML should render as... (This is the behavior of other dynamically-generated URLs in Ghost's admin):
Ghost Version
5.103.0
Node.js Version
18.20.5
How did you install Ghost?
Docker ghost:5-alpine
Database type
MySQL 8
Relevant log / error output
Code of Conduct
The text was updated successfully, but these errors were encountered: