Skip to content

Commit

Permalink
Make qwc_config schema name configurable through QWC_CONFIG_SCHEMA ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jul 31, 2024
1 parent b3d4951 commit 022bbbd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from qwc_services_core.runtime_config import RuntimeConfig


qwc_config_schema = os.getenv("QWC_CONFIG_SCHEMA", "qwc_config")

# Flask application
app = Flask(__name__)
api = Api(app, version='1.0', title='Permalink API',
Expand Down Expand Up @@ -51,10 +53,10 @@ def db_conn():
config = config_handler.tenant_config(tenant)

db_url = config.get('db_url', 'postgresql:///?service=qwc_configdb')
permalinks_table = config.get('permalinks_table', 'qwc_config.permalinks')
permalinks_table = config.get('permalinks_table', qwc_config_schema + '.permalinks')
user_permalink_table = config.get(
'user_permalink_table', 'qwc_config.user_permalinks')
user_bookmark_table = config.get('user_bookmark_table', 'qwc_config.user_bookmarks')
'user_permalink_table', qwc_config_schema + '.user_permalinks')
user_bookmark_table = config.get('user_bookmark_table', qwc_config_schema + '.user_bookmarks')

db = db_engine.db_engine(db_url)
return (db, permalinks_table, user_permalink_table, user_bookmark_table)
Expand Down

0 comments on commit 022bbbd

Please sign in to comment.