Skip to content

Commit

Permalink
EODC
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Dec 16, 2024
1 parent 06a830e commit 45c629e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ __pycache__/
*.so
*.xml

/certs

# Distribution / packaging
.Python
env/
Expand Down
11 changes: 10 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,17 @@ def get_locale():
'de': 'German'
}

client_key_path = "/tmp/client-key.pem"

with open(client_key_path, "w") as key_file:
key_file.write(os.environ["SSL_KEY"])

ssl_args = {
"ssl_key": client_key_path,
}

# Initiate database
db = SQLAlchemy(app, engine_options={"pool_pre_ping": True})
db = SQLAlchemy(app, engine_options={"connect_args": ssl_args, "pool_pre_ping": True})

migrate = Migrate(app, db, directory=MIGRATION_DIR)

Expand Down
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
TESTING = True
DEBUG = True
FLASK_DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:NwwQb14QsGcnASCviwMSEcJCrSdqOcCj@cnqvnz.stackhero-network.com:7930/root?useSSL=true&requireSSL=true'
SQLALCHEMY_DATABASE_URI = 'mysql://root:NwwQb14QsGcnASCviwMSEcJCrSdqOcCj@cnqvnz.stackhero-network.com:7930/root'
MAIL_USERNAME = 'carculator@psi.ch'
MAIL_PASSWORD = 'xxxxxxxx'
MAIL_SERVER = 'smtp.gmail.com'
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ mysqlclient
gunicorn
pyyaml
werkzeug<3.0
netCDF4
netCDF4

0 comments on commit 45c629e

Please sign in to comment.