fix services

This commit is contained in:
2024-12-23 23:44:38 +01:00
parent 42b4f85699
commit 768b1d6db9
7 changed files with 143 additions and 27 deletions

View File

@@ -8,6 +8,8 @@ import logging
from cryptography.fernet import Fernet
from waitress import serve
app = Flask(__name__)
# Configurazione
hash_file = "data/master_hash.txt"
@@ -21,10 +23,9 @@ DB_CONFIG = {
"host": os.getenv("DB_HOST"),
"port": os.getenv("DB_PORT")
}
app = Flask(__name__)
# Configura il logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - PID: %(process)d %(levelname)s - %(message)s')
logging.basicConfig(level=logging.INFO, format='- PID: %(process)d %(levelname)s - %(message)s')
def get_db_connection():
return psycopg2.connect(
@@ -218,5 +219,4 @@ def list_sites_api():
# Avvio dell'app
if __name__ == '__main__':
init_db()
#app.run(host='0.0.0.0', port=5000)
serve(app, host='0.0.0.0', port=5000)