odysseusmax / tg-index

Python web app to index telegram chats and serve its files for download over HTTP.
GNU General Public License v3.0
383 stars 468 forks source link

SECRET_KEY is not optional ? #35

Closed rayanfer32 closed 3 years ago

rayanfer32 commented 3 years ago
D:\codesafe\tgindexpro_venv
Traceback (most recent call last):
  File "C:\Users\rayanfer32\AppData\Local\Programs\Python\Python39\lib\runpy.py", li
ne 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\rayanfer32\AppData\Local\Programs\Python\Python39\lib\runpy.py", li
ne 87, in _run_code
    exec(code, run_globals)
  File "D:\codesafe\tgindexpro_venv\tg-index\app\__main__.py", line 12, in <modu
le>
    Indexer().run()
  File "D:\codesafe\tgindexpro_venv\tg-index\app\main.py", line 39, in __init__
    EncryptedCookieStorage(
  File "D:\codesafe\tgindexpro_venv\lib\site-packages\aiohttp_session\cookie_sto
rage.py", line 28, in __init__
    self._fernet = fernet.Fernet(secret_key)
  File "D:\codesafe\tgindexpro_venv\lib\site-packages\cryptography\fernet.py", l
ine 34, in __init__
    raise ValueError(
ValueError: Fernet key must be 32 url-safe base64-encoded bytes.
Press any key to continue . . .
odysseusmax commented 3 years ago

added a fix in the latest update

rayanfer32 commented 3 years ago

Issue persists because of SECRET_KEY="" in the else block

pseudokawaii commented 3 years ago

@rayanfer32 I think it's because session middleware for storing the cookie is trying to encode the SECRET_KEY even though it doesn't exist. I created a pull request with a possible fix, hope that'll resolve the issue since it did with my repl.it deployment.

odysseusmax commented 3 years ago

this was fixed along with other bugs in the latest push.