Development
This commit is contained in:
parent
32d6c739be
commit
c3baeff875
3 changed files with 2 additions and 9 deletions
|
|
@ -13,7 +13,6 @@ Usage:
|
|||
import argparse
|
||||
import os
|
||||
import re
|
||||
import secrets
|
||||
import shutil
|
||||
import socket
|
||||
import subprocess
|
||||
|
|
@ -289,7 +288,7 @@ def _set_env_var(content, key, value):
|
|||
def _dash_already_configured():
|
||||
if not COMPOSE_FILE.exists():
|
||||
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):
|
||||
header("Dashboard Configuration")
|
||||
|
|
@ -323,9 +322,6 @@ def setup_docker_compose(reuse_config=False):
|
|||
|
||||
content = COMPOSE_FILE.read_text()
|
||||
|
||||
print(" Generating SECRET_KEY...")
|
||||
secret_key = secrets.token_urlsafe(96) # ~128 chars
|
||||
|
||||
print()
|
||||
print(" SMTP is used to send email verification codes for new accounts.")
|
||||
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_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, "SMTP_HOST", smtp_host)
|
||||
content = _set_env_var(content, "SMTP_PORT", smtp_port)
|
||||
|
|
@ -680,7 +675,7 @@ def main():
|
|||
reuse_config = False
|
||||
if dash_installed:
|
||||
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"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue