-
Notifications
You must be signed in to change notification settings - Fork 3
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
Django collectstatic uses --link
which causes uWSGI security errors
#186
Comments
|
Thank you for filing an issue! That error message originates from: It looks like uWSGI is calling realpath on the paths before checking that the paths exist within the static directories, which is a bit unfortunate, since it breaks the symlink case. It feels like uWSGI could instead normalise the path (to remove tricks like I checked to see if there was an upstream issue about this already but couldn't see one - want to file one? :-) That said, looking at the uWSGI repo it doesn't feel like they are keeping up with maintenance given the number of open issues and PRs. I also didn't get a rely to this bug report: From the buildpack's side, the options are:
For getting a sense uWSGI's relative popularity, PyPI stats report monthly downloads as: However, we don't know what percentage of those uWSGI downloads relate to Django users, or users that might try CNBs. Out of curiosity, what made you pick uWSGI? It's not a web server I've seen anyone recommend recently, and my sense was that it was waning in popularity. |
It's not well maintained and is waning in popularity. At the time it was chosen for this project that wasn't the case and there has been no reason to switch to something else. It does have some unique options that aren't available with other servers. Option 4 seems reasonable (but also raises the same issue as 2). I'm still holding out that there will be some post-build command supported by the buildpack instead of needing to resort to inline buildpacks 😄 I assumed this wouldn't get resolved in the buildpack, but wanted to document the issue somewhere. I will probably recommend folks switch to whitenoise for static file hosting which will circumvent the issue. |
Thank you for the extra context. I'll have more of a think about this before picking an option - either way, this issue existing will help others in a similar situation in the meantime :-) |
--link
which causes uWSGI security errors unless --static-safe
is used
--link
which causes uWSGI security errors unless --static-safe
is used--link
which causes uWSGI security errors
Given that:
...then I think we should wontfix this for now (we can always revisit in the future if needed). I appreciate you reporting this though - it's good for me to be aware of cases like this, and at least the workaround is now documented in an issue that others might find when searching :-) |
We have a Django application running with
uwsgi
and using--static-map
to serve the static files.When upgrading to the CNB buildpack, this functionality broke. We're seeing this error in the logs:
This is due to using
--link
in thecollectstatic
command:buildpacks-python/src/django.rs
Line 46 in 617a3cf
The text was updated successfully, but these errors were encountered: