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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Logo Broken In preview View #1816

Closed
3 of 11 tasks
dalgarin opened this issue Jan 23, 2024 · 4 comments
Closed
3 of 11 tasks

Custom Logo Broken In preview View #1816

dalgarin opened this issue Jan 23, 2024 · 4 comments
Labels

Comments

@dalgarin
Copy link

馃悰 Bug Report

After clicking "Push It", the preview page (http://localhost:5100/en/p/wdbq1ro5qscnylnc/preview) is loaded but the custom logo fails to load/shows a broken image icon.

Reviewing the docker console, the following error is displayed:
ActionController::RoutingError (No route matches [GET] "/en/p/wdbq1ro5qscnylnc/media/pwpush_logo_light.png")

馃敩 How To Reproduce

Steps to reproduce the behavior:

  1. Build a custom image based off pglombardo/pwpush, with custom logos copied to the image (see dockerfile and build command below)
  2. Run the container (see command below) and launch site
  3. Confirm that custom logo loaded properly on the main page
  4. Enter some password and click "Push It!"
  5. When the "Your push has been created." page (preview view) loads, confirm that the custom logo is displayed as a broken image.
  6. Stop container
  7. Run new container directly from pglombardo/pwpush:release with media folder mapped (see second command below)
  8. Confirm that custom logo loaded properly on the main page
  9. Enter some password and click "Push It!"
  10. When the "Your push has been created." page (preview view) loads, confirm that the custom logo is displayed as a broken image.

Code sample

Dockerfile used to build custom image:

FROM pglombardo/pwpush:release

COPY media/pwpush_logo_dark.png /opt/PasswordPusher/public/media/pwpush_logo_dark.png
COPY media/pwpush_logo_light.png /opt/PasswordPusher/public/media/pwpush_logo_light.png

docker commands

docker build -t pwpush:test .
docker run -it -p "5100:5100" -e "PWP__BRAND__LIGHT_LOGO=media/pwpush_logo_light.png" -e "PWP__BRAND__DARK_LOGO=media/pwpush_logo_dark.png" pwpush:test

additional docker command

docker run -it -p "5100:5100" -e "PWP__BRAND__LIGHT_LOGO=media/pwpush_logo_light.png" -e "PWP__BRAND__DARK_LOGO=media/pxg_pwpush_logo_dark.png" -v ./media:/opt/PasswordPusher/public/media pglombardo/pwpush:release

Environment

Where are you running/using Password Pusher?

  • pwpush.com
  • Docker Image
    • pwpush
    • custom image
  • Heroku
  • Digital Ocean
  • Microsoft Azure
  • Google Cloud
  • AWS
  • Source Code
  • Other (please specify)

If applicable, what version of Password Pusher?
Tested with "release" (1.34.1) and 1.36.7

Screenshots

馃搱 Expected behavior

When a push has been created and the "Your push has been created." page (preview view) is displayed, the custom logo should load properly.

馃搸 Additional context

Although examples provided use docker running locally, the same behavior has been observed when running the container in AWS.

Copy link

Hello @dalgarin, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

@pglombardo
Copy link
Owner

Hi @dalgarin,

Could you try setting the image page with a leading /? For example:

PWP__BRAND__LIGHT_LOGO=/media/pwpush_logo_light.png

With the entire Docker command:

docker run -it -p "5100:5100" -e "PWP__BRAND__LIGHT_LOGO=/media/pwpush_logo_light.png" -e "PWP__BRAND__DARK_LOGO=/media/pxg_pwpush_logo_dark.png" -v ./media:/opt/PasswordPusher/public/media pglombardo/pwpush:release

With this change, http://localhost:5100/media/pwpush_logo_light.png should give you the logo and it should then render correctly in the application.

Let me know - I believe that is the correct fix.

@dalgarin
Copy link
Author

Thank you for the quick response. Adding a preceding / does indeed resolve the issue. Thank you again for the assistance and I apologize for crying wolf.

@pglombardo
Copy link
Owner

Excellent to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants