loops instance settings: fixes and improvements

This commit is contained in:
Helmut Merz 2024-12-18 19:15:08 +01:00
parent 2b5a5ec65a
commit 78c8b196bf
5 changed files with 19 additions and 8 deletions

View file

@ -1,8 +1,8 @@
# py-scopes/demo/config.py
# loops/config.py
# (used for testing only)
from dotenv import load_dotenv
from os import getenv
from scopes.server.app import zope_app_factory
load_dotenv()
@ -11,7 +11,6 @@ server_port = getenv('SERVER_PORT', '8099')
app_factory = zope_app_factory
# storage settings
from scopes.storage.db.postgres import StorageFactory
dbengine = 'postgresql+psycopg'
dbname = getenv('DBNAME', 'demo')
dbuser = getenv('DBUSER', 'demo')

View file

@ -11,7 +11,7 @@ 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))
loops_path = (getenv('LOOPS_PATH', 'loops/demo'))
# storage settings
from scopes.storage.db.postgres import StorageFactory

13
inst/loops/env.in Normal file
View file

@ -0,0 +1,13 @@
# loops/inst/loops/.env
SERVER_ID=0
SERVER_PORT_0=8800
SERVER_PORT_1=8801
SHELL_PW=dummy
LOOPS_PATH=loops/demo
DBNAME=ccotest
DBUSER=ccotest
DBPASSWORD=cco
DBSCHEMA=loops

View file

@ -2,7 +2,6 @@
set -a
# use environment variables for instance-specific configuration:
#ZOPE_CONF=zope-1.conf
#SERVER_PORT=8091
#SERVER_ID=0
python -c "from loops.server.main import main; main()"

View file

@ -7,8 +7,8 @@ site-definition application.zcml
<zodb>
<filestorage>
path var/filestorage/Data.fs
blob-dir var/blob
path var/filestorage/Data.$(SERVER_ID).fs
blob-dir var/blob.$(SERVER_ID)
</filestorage>
# Uncomment this if you want to connect to a ZEO server instead: