Skip to content

Commit 20ad0e0

Browse files
Vijay VishwakarmaVijay Vishwakarma
authored andcommitted
Update .gitignore for enhanced security and modify app.py to bind to localhost
1 parent 8b33547 commit 20ad0e0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,20 @@ logs/
7070
# Test files
7171
test_*.py
7272
*_test.py
73+
74+
# Security - Credential Protection
75+
*.env
76+
*production.env*
77+
*config/production.env*
78+
.env.*
79+
secrets.*
80+
credentials.*
81+
passwords.*
82+
*secrets*
83+
*credentials*
84+
config/production.env
85+
config/*.env
86+
87+
# Flask session files
88+
flask_session/
89+
instance/

app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,4 +1820,7 @@ def admin_remove_photo(user_dn):
18201820

18211821
if __name__ == '__main__':
18221822
# Production configuration - debug disabled for security
1823-
app.run(debug=False, host='0.0.0.0', port=5000)
1823+
# Bind to localhost only for security - use reverse proxy for external access
1824+
host = os.getenv('HOST', '127.0.0.1') # Default to localhost, override via environment
1825+
port = int(os.getenv('PORT', '5000'))
1826+
app.run(debug=False, host=host, port=port)

0 commit comments

Comments
 (0)