mirror of
https://github.com/openziti/zrok.git
synced 2025-08-18 03:39:58 +02:00
let load env config.json be partial or missing
This commit is contained in:
@@ -136,12 +136,15 @@ def __loadMetadata() -> Metadata:
|
|||||||
|
|
||||||
def __loadConfig() -> Config:
|
def __loadConfig() -> Config:
|
||||||
cf = configFile()
|
cf = configFile()
|
||||||
|
try:
|
||||||
with open(cf) as f:
|
with open(cf) as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
return Config(
|
return Config(
|
||||||
ApiEndpoint=data["api_endpoint"],
|
ApiEndpoint=data.get("api_endpoint", ""),
|
||||||
DefaultFrontend=data["default_frontend"]
|
DefaultFrontend=data.get("default_frontend", "")
|
||||||
)
|
)
|
||||||
|
except (FileNotFoundError, json.JSONDecodeError):
|
||||||
|
return Config(ApiEndpoint="", DefaultFrontend="")
|
||||||
|
|
||||||
|
|
||||||
def isEnabled() -> bool:
|
def isEnabled() -> bool:
|
||||||
|
Reference in New Issue
Block a user