mirror of
https://github.com/openziti/zrok.git
synced 2025-08-17 19:31:12 +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()
|
||||||
with open(cf) as f:
|
try:
|
||||||
data = json.load(f)
|
with open(cf) as f:
|
||||||
return Config(
|
data = json.load(f)
|
||||||
ApiEndpoint=data["api_endpoint"],
|
return Config(
|
||||||
DefaultFrontend=data["default_frontend"]
|
ApiEndpoint=data.get("api_endpoint", ""),
|
||||||
)
|
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