Development
This commit is contained in:
parent
32d6c739be
commit
c3baeff875
3 changed files with 2 additions and 9 deletions
|
|
@ -32,7 +32,6 @@ from api_apply_health import bp as api_apply_health_bp
|
||||||
from session_interface import SqliteSessionInterface
|
from session_interface import SqliteSessionInterface
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = os.environ.get('SECRET_KEY', os.urandom(24))
|
|
||||||
app.session_interface = SqliteSessionInterface(config_utils.ACCOUNTS_DB)
|
app.session_interface = SqliteSessionInterface(config_utils.ACCOUNTS_DB)
|
||||||
config_utils.init_accounts_db()
|
config_utils.init_accounts_db()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ services:
|
||||||
- PYTHONPATH=/routlin_location
|
- PYTHONPATH=/routlin_location
|
||||||
- WEB_APP_DISPLAY_NAME=Routlin Dashboard
|
- WEB_APP_DISPLAY_NAME=Routlin Dashboard
|
||||||
- INITIAL_MANAGER_EMAIL=mgrotke@gmail.com
|
- INITIAL_MANAGER_EMAIL=mgrotke@gmail.com
|
||||||
- SECRET_KEY=ey8hSQCCYE5kQXV8nOg1CB44LSd3AoUet2ZBc3aZlFrwBbazE7aHcxXWyuT97eAObet5jmOL0CjMg0rB1hE4d2SBVYHPfl8De55EiFv307r1QP3Mf5XgOSSCxD3TuD
|
|
||||||
- CREDENTIALS_KEY=TwnRAoORr7OaMVeS3q4JJP3NYvBDlyPB8qgl2ovAlm2OGsNf0qsnv0a67MXgaozKWf5Gc1CM0Z1m0xdTQeiw4R0RKK0fmLKMKfttOp2sfKg9lDsMZavJWzn5VS8dyD
|
- CREDENTIALS_KEY=TwnRAoORr7OaMVeS3q4JJP3NYvBDlyPB8qgl2ovAlm2OGsNf0qsnv0a67MXgaozKWf5Gc1CM0Z1m0xdTQeiw4R0RKK0fmLKMKfttOp2sfKg9lDsMZavJWzn5VS8dyD
|
||||||
- SMTP_HOST=smtp.gmail.com
|
- SMTP_HOST=smtp.gmail.com
|
||||||
- SMTP_PORT=587
|
- SMTP_PORT=587
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ Usage:
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import secrets
|
|
||||||
import shutil
|
import shutil
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -289,7 +288,7 @@ def _set_env_var(content, key, value):
|
||||||
def _dash_already_configured():
|
def _dash_already_configured():
|
||||||
if not COMPOSE_FILE.exists():
|
if not COMPOSE_FILE.exists():
|
||||||
return False
|
return False
|
||||||
return bool(re.search(r"^\s*- SECRET_KEY=\S", COMPOSE_FILE.read_text(), re.MULTILINE))
|
return bool(re.search(r"^\s*- INITIAL_MANAGER_EMAIL=\S", COMPOSE_FILE.read_text(), re.MULTILINE))
|
||||||
|
|
||||||
def setup_docker_compose(reuse_config=False):
|
def setup_docker_compose(reuse_config=False):
|
||||||
header("Dashboard Configuration")
|
header("Dashboard Configuration")
|
||||||
|
|
@ -323,9 +322,6 @@ def setup_docker_compose(reuse_config=False):
|
||||||
|
|
||||||
content = COMPOSE_FILE.read_text()
|
content = COMPOSE_FILE.read_text()
|
||||||
|
|
||||||
print(" Generating SECRET_KEY...")
|
|
||||||
secret_key = secrets.token_urlsafe(96) # ~128 chars
|
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print(" SMTP is used to send email verification codes for new accounts.")
|
print(" SMTP is used to send email verification codes for new accounts.")
|
||||||
print(" (Gmail users: use an App Password, not your account password.)")
|
print(" (Gmail users: use an App Password, not your account password.)")
|
||||||
|
|
@ -342,7 +338,6 @@ def setup_docker_compose(reuse_config=False):
|
||||||
smtp_password = prompt_str("SMTP password", secret=True)
|
smtp_password = prompt_str("SMTP password", secret=True)
|
||||||
smtp_from = prompt_str("SMTP From address", default=smtp_user)
|
smtp_from = prompt_str("SMTP From address", default=smtp_user)
|
||||||
|
|
||||||
content = _set_env_var(content, "SECRET_KEY", secret_key)
|
|
||||||
content = _set_env_var(content, "INITIAL_MANAGER_EMAIL", manager_email)
|
content = _set_env_var(content, "INITIAL_MANAGER_EMAIL", manager_email)
|
||||||
content = _set_env_var(content, "SMTP_HOST", smtp_host)
|
content = _set_env_var(content, "SMTP_HOST", smtp_host)
|
||||||
content = _set_env_var(content, "SMTP_PORT", smtp_port)
|
content = _set_env_var(content, "SMTP_PORT", smtp_port)
|
||||||
|
|
@ -680,7 +675,7 @@ def main():
|
||||||
reuse_config = False
|
reuse_config = False
|
||||||
if dash_installed:
|
if dash_installed:
|
||||||
reuse_config = prompt_yn(
|
reuse_config = prompt_yn(
|
||||||
"Re-use existing Docker configuration? (Keeps SECRET_KEY and SMTP credentials, preserving active sessions and email settings)",
|
"Re-use existing Docker configuration? (Keeps SECRET_KEY and SMTP credentials)",
|
||||||
default="y"
|
default="y"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue