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

PyWB 2.6.2 ignoring SCRIPT_NAME when deployed under a prefix #686

Closed
anjackson opened this issue Dec 20, 2021 · 4 comments · Fixed by #688
Closed

PyWB 2.6.2 ignoring SCRIPT_NAME when deployed under a prefix #686

anjackson opened this issue Dec 20, 2021 · 4 comments · Fixed by #688

Comments

@anjackson
Copy link
Contributor

anjackson commented Dec 20, 2021

Describe the bug

Even after 2.6.2 #682, static resources are not being loaded when PyWB is deployed under a prefix. We deploy PyWB under e.g. /wayback/ so the static resources are at /wayback/static/. For 2.5.x this is picked up by the SCRIPT_NAME UWSGI parameter, but this is ignored by 2.6.2.

EDIT: Ah, so this is not really to do with static resources - the whole app does not realize it is deployed under a prefix and doesn't work at all for us.

Config is at:

Steps to reproduce the bug

Deploy under a prefix

Expected behavior

Application uses supplied prefix as the deployment prefix.

Screenshots

Environment

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Based on container version webrecorder/pywb:2.6.2

Additional context

@anjackson anjackson changed the title Static resources still not loaded in 2.6.2 Static resources still not loaded in 2.6.2 when deployed under a prefix Dec 20, 2021
@anjackson anjackson changed the title Static resources still not loaded in 2.6.2 when deployed under a prefix PyWB 2.6.2 ignoring SCRIPT_NAME when deployed under a prefix Dec 20, 2021
@anjackson
Copy link
Contributor Author

For context, I had to change template escaping when going from PyWB 2.5.x to 2.6.x (see here) but otherwise the UKWA extension code is unchanged.

I did not have to set the static path before, and I don't know how to set it.

@anjackson
Copy link
Contributor Author

anjackson commented Dec 21, 2021

The only thing I can find is:

kwargs['static_prefix'] = env.get('pywb.static_prefix', '/static')

But I can't set pywb.static_prefix as an environment variable (because you're not supposed to put a . in an environment variable name and so the deployment system won't let me set it).

Also, I think the default should be {{wb_prefix}}/static not just /static.

Setting static_prefix in `conf`` is just ignored.

@anjackson
Copy link
Contributor Author

Ah, okay, so there's a difference between different pages. The actual playback pages are working fine, and pick up the right prefix automatically, and also pick up the static_prefix setting (which actually breaks things in this case).

It's the 'index' pages that have problems. e.g. the page that lists collections has no CSS/JS, and the Collection Search page too. But the Calendar and the playback itself are fine.

ikreymer added a commit that referenced this issue Dec 21, 2021
- ensure pywb.static_prefix includes pywb.app_prefix (via SCRIPT_NAME) for non replay templates, fixes #686
@ikreymer
Copy link
Member

Should be fixed in 2.6.3, should not need to set the static path or any additional changes.

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

Successfully merging a pull request may close this issue.

2 participants