Tygs / 0bin

Client side encrypted pastebin
https://0bin.net
Do What The F*ck You Want To Public License
1.37k stars 198 forks source link

ensure_app_context is called without arguments when importing #134

Closed Glandos closed 4 years ago

Glandos commented 4 years ago

It seems that ensure_app_context is called on top level of routes.py.

However, when using the wsgi.py, the get_app calls it with arguments, especially to be able to configure data directory. Since it's called without arguments, the following error occurs:

PermissionError: [Errno 13] Permission denied: '/home/www-0bin/.local/share/0bin'
ksamuel commented 4 years ago

Yes, I need to add some env var reading in WSGI.py. I wasn't expecting people trying the new version so quickly to be honest :)

I haven't even updated the doc yet.

Glandos commented 4 years ago

You know, sometimes, you're busy idling, so you're trying to update :wink:

ksamuel commented 4 years ago

I just checked, and we already read from the env vars ZEROBIN_DATA_DIR and ZEROBIN_CONFIG_DIR, so if you desire to use the wsgi file with a user that doesn't have a home directory, you can set those.

I'll add that to the doc, but systemd and mod_wsgi both provide a way to do so.