Exios66 / Literary-Vault

Active Catalog of the Documentation, Backend, and Infrastructure for Neuroscience Research Expansion. || [https://exios66.github.io/Literary-Vault/]
https://morningstar-developments.gitbook.io/morningstar-docs-storage/
Other
2 stars 2 forks source link

Fix code scanning alert no. 20: Flask app is run in debug mode #48

Closed Exios66 closed 2 weeks ago

Exios66 commented 2 weeks ago

Fixes https://github.com/Exios66/Literary-Vault/security/code-scanning/20

To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. This can be achieved by using an environment variable to control the debug mode, enabling it only when explicitly required (e.g., during development). We will modify the app.run() call to check the environment variable and set the debug mode accordingly.

  1. Import the os module to access environment variables.
  2. Modify the app.run() call to set the debug parameter based on an environment variable (e.g., FLASK_DEBUG).

Suggested fixes powered by Copilot Autofix. Review carefully before merging.