mirror of
https://github.com/runcitadel/core.git
synced 2024-12-28 15:42:59 +00:00
Fix generation of some hidden services
This commit is contained in:
parent
d5b4ff6bb2
commit
324077a453
|
@ -43,7 +43,7 @@ def createComposeConfigFromV2(app: dict, nodeRoot: str):
|
||||||
newApp = convertDataDirToVolumeGen2(newApp)
|
newApp = convertDataDirToVolumeGen2(newApp)
|
||||||
newApp = configureIps(newApp, networkingFile, envFile)
|
newApp = configureIps(newApp, networkingFile, envFile)
|
||||||
newApp = configureMainPort(newApp, nodeRoot)
|
newApp = configureMainPort(newApp, nodeRoot)
|
||||||
configureHiddenServices(newApp, nodeRoot)
|
newApp = configureHiddenServices(newApp, nodeRoot)
|
||||||
finalConfig: AppStage4 = convertContainersToServices(newApp)
|
finalConfig: AppStage4 = convertContainersToServices(newApp)
|
||||||
newApp = classToDict(finalConfig)
|
newApp = classToDict(finalConfig)
|
||||||
del newApp['metadata']
|
del newApp['metadata']
|
||||||
|
|
|
@ -100,7 +100,7 @@ def configureIps(app: AppStage2, networkingFile: str, envFile: str):
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
def configureHiddenServices(app: AppStage3, nodeRoot: str) -> None:
|
def configureHiddenServices(app: AppStage3, nodeRoot: str) -> AppStage3:
|
||||||
dotEnv = parse_dotenv(path.join(nodeRoot, ".env"))
|
dotEnv = parse_dotenv(path.join(nodeRoot, ".env"))
|
||||||
hiddenServices = ""
|
hiddenServices = ""
|
||||||
|
|
||||||
|
@ -113,8 +113,11 @@ def configureHiddenServices(app: AppStage3, nodeRoot: str) -> None:
|
||||||
)
|
)
|
||||||
hiddenServices += getContainerHiddenService(
|
hiddenServices += getContainerHiddenService(
|
||||||
app.metadata, container, dotEnv[env_var], container.name == mainContainer.name)
|
app.metadata, container, dotEnv[env_var], container.name == mainContainer.name)
|
||||||
|
if container.hiddenServicePorts:
|
||||||
|
del container.hiddenServicePorts
|
||||||
|
|
||||||
torDaemons = ["torrc-apps", "torrc-apps-2", "torrc-apps-3"]
|
torDaemons = ["torrc-apps", "torrc-apps-2", "torrc-apps-3"]
|
||||||
torFileToAppend = torDaemons[random.randint(0, len(torDaemons) - 1)]
|
torFileToAppend = torDaemons[random.randint(0, len(torDaemons) - 1)]
|
||||||
with open(path.join(nodeRoot, "tor", torFileToAppend), 'a') as f:
|
with open(path.join(nodeRoot, "tor", torFileToAppend), 'a') as f:
|
||||||
f.write(hiddenServices)
|
f.write(hiddenServices)
|
||||||
|
return app
|
||||||
|
|
Loading…
Reference in New Issue
Block a user