Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Fixes issue ## Description of Changes I removed the use of the `FLASK_ENV` variable in the application and replaced it with the `ENV` variable. This was done to remove the warning that you'll see below and to simply the potential updating of Flask to a version higher than `v2.3`. ```console 'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead. ``` ## Startup Console Log Output <details><summary>Console Log Output Before Change</summary> ```console 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 15:42:33 openoversight-postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.064 UTC [1] LOG: starting PostgreSQL 15.3 (Debian 15.3-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.064 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.064 UTC [1] LOG: listening on IPv6 address "::", port 5432 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.065 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.069 UTC [29] LOG: database system was shut down at 2023-07-11 20:42:24 UTC 2023-07-11 15:42:33 openoversight-postgres-1 | 2023-07-11 20:42:33.073 UTC [1] LOG: database system is ready to accept connections 2023-07-11 15:42:33 openoversight-web-1 | yarn run v1.22.19 2023-07-11 15:42:33 openoversight-web-1 | warning package.json: No license field 2023-07-11 15:42:33 openoversight-web-1 | $ sass OpenOversight/app/static/scss/index.scss OpenOversight/app/static/dist/index.css 2023-07-11 15:42:34 openoversight-web-1 | Done in 0.76s. 2023-07-11 15:42:34 openoversight-web-1 | yarn run v1.22.19 2023-07-11 15:42:34 openoversight-web-1 | warning package.json: No license field 2023-07-11 15:42:34 openoversight-web-1 | $ sass --watch OpenOversight/app/static/scss/index.scss OpenOversight/app/static/dist/index.css 2023-07-11 15:42:34 openoversight-web-1 | 'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead. 2023-07-11 15:42:34 openoversight-web-1 | /usr/local/lib/python3.11/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. 2023-07-11 15:42:34 openoversight-web-1 | warnings.warn( 2023-07-11 15:42:34 openoversight-web-1 | Sass is watching for changes. Press Ctrl-C to stop. 2023-07-11 15:42:34 openoversight-web-1 | 2023-07-11 15:42:34 openoversight-web-1 | [2023-07-11 20:42:34,720] INFO in __init__: OpenOversight startup 2023-07-11 15:42:34 openoversight-web-1 | 'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead. 2023-07-11 15:42:34 openoversight-web-1 | 'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead. 2023-07-11 15:42:34 openoversight-web-1 | * Serving Flask app 'OpenOversight.app' 2023-07-11 15:42:34 openoversight-web-1 | * Debug mode: on 2023-07-11 15:42:34 openoversight-web-1 | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. 2023-07-11 15:42:34 openoversight-web-1 | * Running on all addresses (0.0.0.0) 2023-07-11 15:42:34 openoversight-web-1 | * Running on http://127.0.0.1:3000 2023-07-11 15:42:34 openoversight-web-1 | * Running on http://172.18.0.3:3000 2023-07-11 15:42:34 openoversight-web-1 | Press CTRL+C to quit 2023-07-11 15:42:34 openoversight-web-1 | * Restarting with stat 2023-07-11 15:42:35 openoversight-web-1 | 'FLASK_ENV' is deprecated and will not be used in Flask 2.3. Use 'FLASK_DEBUG' instead. ``` </details> <details><summary>Console Log Output After Change</summary> ```console 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 15:37:52 openoversight-postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.079 UTC [1] LOG: starting PostgreSQL 15.3 (Debian 15.3-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.079 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.079 UTC [1] LOG: listening on IPv6 address "::", port 5432 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.081 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.085 UTC [29] LOG: database system was shut down at 2023-07-11 20:37:08 UTC 2023-07-11 15:37:52 openoversight-postgres-1 | 2023-07-11 20:37:52.090 UTC [1] LOG: database system is ready to accept connections 2023-07-11 15:37:52 openoversight-web-1 | yarn run v1.22.19 2023-07-11 15:37:52 openoversight-web-1 | warning package.json: No license field 2023-07-11 15:37:52 openoversight-web-1 | $ sass OpenOversight/app/static/scss/index.scss OpenOversight/app/static/dist/index.css 2023-07-11 15:37:53 openoversight-web-1 | Done in 0.84s. 2023-07-11 15:37:53 openoversight-web-1 | yarn run v1.22.19 2023-07-11 15:37:53 openoversight-web-1 | warning package.json: No license field 2023-07-11 15:37:53 openoversight-web-1 | $ sass --watch OpenOversight/app/static/scss/index.scss OpenOversight/app/static/dist/index.css 2023-07-11 15:37:53 openoversight-web-1 | /usr/local/lib/python3.11/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend. 2023-07-11 15:37:53 openoversight-web-1 | warnings.warn( 2023-07-11 15:37:53 openoversight-web-1 | [2023-07-11 20:37:53,820] INFO in __init__: OpenOversight startup 2023-07-11 15:37:53 openoversight-web-1 | * Serving Flask app 'OpenOversight.app' 2023-07-11 15:37:53 openoversight-web-1 | * Debug mode: off 2023-07-11 15:37:53 openoversight-web-1 | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. 2023-07-11 15:37:53 openoversight-web-1 | * Running on all addresses (0.0.0.0) 2023-07-11 15:37:53 openoversight-web-1 | * Running on http://127.0.0.1:3000 2023-07-11 15:37:53 openoversight-web-1 | * Running on http://172.18.0.3:3000 2023-07-11 15:37:53 openoversight-web-1 | Press CTRL+C to quit 2023-07-11 15:37:53 openoversight-web-1 | Sass is watching for changes. Press Ctrl-C to stop. ``` </details> ## Tests and linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment. --------- Co-authored-by: Madison Swain-Bowden <[email protected]>
- Loading branch information