From 2b5a5ec65a082eac7de29d8a082d5521acdd1ef6 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 18 Dec 2024 11:33:23 +0100 Subject: [PATCH] add SERVER_ID to instance config --- inst/loops/config.py | 4 +++- inst/loops/zope.conf | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/inst/loops/config.py b/inst/loops/config.py index 5504dd5..02b7939 100644 --- a/inst/loops/config.py +++ b/inst/loops/config.py @@ -5,8 +5,10 @@ from os import getenv load_dotenv() +server_id = getenv('SERVER_ID') zope_conf = getenv('ZOPE_CONF', 'zope.conf') -server_port = getenv('SERVER_PORT', '8099') +server_port = getenv('SERVER_PORT', + server_id and getenv(f'SERVER_PORT_{server_id}')) or '8080' shell_pw = (getenv('SHELL_PW', 'dummy')) loops_path = (getenv('LOOPS_PATH', None)) diff --git a/inst/loops/zope.conf b/inst/loops/zope.conf index ab4a5e2..4d3fb8a 100644 --- a/inst/loops/zope.conf +++ b/inst/loops/zope.conf @@ -13,12 +13,12 @@ site-definition application.zcml # Uncomment this if you want to connect to a ZEO server instead: # -# server localhost:8100 +# server $(ZEO_SERVER) # storage 1 # # ZEO client cache, in bytes -# cache-size 20MB +# cache-size $(ZEO_CACHE_SIZE) # # Uncomment to have a persistent disk cache -# #client zeo1 +# #client zeo1$(SERVER_ID) # @@ -28,7 +28,7 @@ site-definition application.zcml # the tokens STDOUT or STDERR. - path var/log/z3-deploy.log + path var/log/loops-$(SERVER_ID).log formatter zope.exceptions.log.Formatter