Skip to content

Commit 0f9ea4a

Browse files
SECURITY FIX - Disable flask debug by default
1 parent ff0c770 commit 0f9ea4a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

server/app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,13 @@ def load_user(user_id: str):
7676

7777
restore_lightning_monitor()
7878

79+
80+
def env_flag(name: str, default: bool = False) -> bool:
81+
value = os.environ.get(name)
82+
if value is None:
83+
return default
84+
return value.strip().lower() in {"1", "true", "yes", "on"}
85+
86+
7987
if __name__ == '__main__':
80-
app.run(host='0.0.0.0', port=8090, debug=True)
88+
app.run(host='127.0.0.1', port=8090, debug=env_flag('ALLSKY_DEV_SERVER_DEBUG'))

0 commit comments

Comments
 (0)