added SHORT_URL_LEN to env

This commit is contained in:
Rayan fernandes 2021-06-06 18:12:06 +05:30
parent 83c5528fea
commit befe2b18b9
2 changed files with 2 additions and 1 deletions

View File

@ -49,6 +49,7 @@ pip3 install -U -r requirements.txt
| `RESULTS_PER_PAGE` (optional) | Number of results to be returned per page defaults to 20.
| `TGINDEX_USERNAME` (optional) | Username for authentication, defaults to `''`.
| `PASSWORD` (optional) | Username for authentication, defaults to `''`.
| `SHORT_URL_LEN` (optional) | Url length for aliases
| `SESSION_COOKIE_LIFETIME` (optional) | Number of minutes, for which authenticated session is valid for, after which user has to login again. defaults to 60.
| `SECRET_KEY` (optional) | Long string for signing the session cookies, required if authentication is enabled.

View File

@ -49,7 +49,7 @@ if not logo_folder.exists():
logo_folder.mkdir(parents=True)
username = os.environ.get("TGINDEX_USERNAME", "")
password = os.environ.get("PASSWORD", "")
SHORT_URL_LEN = 3
SHORT_URL_LEN = int(os.environ.get("SHORT_URL_LEN", 3))
authenticated = username and password
SESSION_COOKIE_LIFETIME = int(os.environ.get("SESSION_COOKIE_LIFETIME") or "60")
try: