Pos teste de instalação

This commit is contained in:
SyllasGS committed 2026-05-07 14:20:40 -03:00
1 parent 5d92a6c99a
commit ed7e5f55cb
5 files changed
+83 -32

No files matched your search

+9 -8
View File
@@ -127,14 +127,15 @@ def normalize_config(data: dict, default_password: str) -> dict:
return config
def load_license_key(require_env: bool) -> bytes:
env_key = os.getenv("VFM_LICENSE_MASTER_KEY")
if env_key:
return env_key.encode("utf-8")
if require_env:
raise RuntimeError(
"VFM_LICENSE_MASTER_KEY e obrigatoria em producao. Defina a variavel de ambiente antes de iniciar o sistema."
)
def load_license_key(require_env: bool) -> bytes:
env_key = os.getenv("VFM_LICENSE_MASTER_KEY")
allow_legacy = os.getenv("VFM_ALLOW_LEGACY_LICENSE_KEY", os.getenv("ALLOW_LEGACY_LICENSE_KEY", "0")) == "1"
if env_key:
return env_key.encode("utf-8")
if require_env and not allow_legacy:
raise RuntimeError(
"VFM_LICENSE_MASTER_KEY e obrigatoria em producao. Defina a variavel de ambiente antes de iniciar o sistema."
)
LOGGER.warning(
"VFM_LICENSE_MASTER_KEY nao definido. Usando chave legada embutida; mova a chave para variavel de ambiente."
)