Skip to content

Commit 548a783

Browse files
authored
Rename log url prefix (modmail-dev#39)
* Update app.py * Update env.example
1 parent 5cd1737 commit 548a783

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
from core.models import LogEntry
1414
from core.utils import get_stack_variable, authrequired, User
1515

16-
prefix = os.getenv("URL_PREFIX", "/logs")
16+
if "URL_PREFIX" in os.environ:
17+
print("Using the legacy config var `URL_PREFIX`, rename it to `LOG_URL_PREFIX`")
18+
prefix = os.environ["URL_PREFIX"]
19+
else:
20+
prefix = os.getenv("LOG_URL_PREFIX", "/logs")
21+
1722
if prefix == "NONE":
1823
prefix = ""
1924

env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MONGO_URI=mongodb+srv://urihere
2-
URL_PREFIX=/logs
2+
LOG_URL_PREFIX=/logs
33
HOST=0.0.0.0
44
PORT=8000

0 commit comments

Comments
 (0)