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

[Ghost Admin] User Avatar URL Renders Incorrectly When [cdnURL] Defined #21838

Open
1 task done
alexgmathews opened this issue Dec 9, 2024 · 2 comments
Open
1 task done
Labels
needs:info [triage] Blocked on missing information

Comments

@alexgmathews
Copy link

alexgmathews commented Dec 9, 2024

Issue Summary

Ghost Admin does not render the correct URL for the user avatar when cdnURL is defined.

Steps to Reproduce

  1. Spin up a new stand-alone instance of Ghost

  2. Observe that without defining cdnURL, the user avatar HTML renders as:

    <div class="gh-user-avatar relative" style="background-image: url(/ghost/assets/img/user-image-639a88b784fb5f10964be8b975ca9fdf.png);">
    
  3. 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 path https://assets.ghost.io/admin/1234/

  4. Observe that after defining cdnURL, the user avatar HTML renders as:

     <div class="gh-user-avatar relative" style="background-image: url(/img/user-image-639a88b784fb5f10964be8b975ca9fdf.png);">
    
  5. I think the user avatar HTML should render as... (This is the behavior of other dynamically-generated URLs in Ghost's admin):

     <div class="gh-user-avatar relative" style="background-image: url(https://testdomain.com/ghost/assets/img/user-image-639a88b784fb5f10964be8b975ca9fdf.png);">
    

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

screenshot

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Dec 9, 2024
@alexgmathews alexgmathews changed the title [Ghost Admin] User-Profile Avatar URL Renders Incorrectly When [cdnURL] Defined [Ghost Admin] User Avatar URL Renders Incorrectly When [cdnURL] Defined Dec 9, 2024
@ErisDS
Copy link
Member

ErisDS commented Dec 17, 2024

Hi @alexgmathews, can you explain what your use-case is for using cdnURL? Also how/where are you setting it?

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.

@ErisDS ErisDS added the needs:info [triage] Blocked on missing information label Dec 17, 2024
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Dec 17, 2024
Copy link
Contributor

Note from our bot: The needs:info label has been added to this issue. Updating your original issue with more details is great, but won't notify us, so please make sure you leave a comment so that we can see when you've updated us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:info [triage] Blocked on missing information
Projects
None yet
Development

No branches or pull requests

3 participants
@ErisDS @alexgmathews and others