get redis database mapping from libs.defaults
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-12-23 07:19:37 +01:00
parent b6b5beaa27
commit d288923969
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 14 additions and 10 deletions

View file

@ -29,12 +29,7 @@ type = sqlite3
;cache_mode = private ;cache_mode = private
[remote_cache] [remote_cache]
% if node.has_bundle('redis'):
type = redis
connstr = addr=127.0.0.1:6379
% else:
type = database type = database
% endif
[analytics] [analytics]
reporting_enabled = false reporting_enabled = false

View file

@ -15,7 +15,7 @@ REDIS = {
'HOST': 'localhost', 'HOST': 'localhost',
'PORT': 6379, 'PORT': 6379,
'PASSWORD': '', 'PASSWORD': '',
'DATABASE': 0, 'DATABASE': ${repo.libs.defaults.redis_databases['netbox'][0]},
'DEFAULT_TIMEOUT': 300, 'DEFAULT_TIMEOUT': 300,
'SSL': False, 'SSL': False,
}, },
@ -23,7 +23,7 @@ REDIS = {
'HOST': 'localhost', 'HOST': 'localhost',
'PORT': 6379, 'PORT': 6379,
'PASSWORD': '', 'PASSWORD': '',
'DATABASE': 1, 'DATABASE': ${repo.libs.defaults.redis_databases['netbox'][1]},
'DEFAULT_TIMEOUT': 300, 'DEFAULT_TIMEOUT': 300,
'SSL': False, 'SSL': False,
} }

View file

@ -25,10 +25,10 @@ ssl = False
% if node.has_bundle('redis'): % if node.has_bundle('redis'):
[celery] [celery]
backend = redis://127.0.0.1/1 backend = redis://127.0.0.1/${repo.libs.defaults.redis_databases['pretalx'][0]}
broker = redis://127.0.0.1/2 broker = redis://127.0.0.1/${repo.libs.defaults.redis_databases['pretalx'][1]}
[redis] [redis]
location = redis://@127.0.0.1:6379/3 location = redis://@127.0.0.1:6379/${repo.libs.defaults.redis_databases['pretalx'][2]}
session = True session = True
% endif % endif

View file

@ -1 +1,2 @@
servers = "127.0.0.1"; servers = "127.0.0.1";
db = "${repo.libs.defaults.redis_databases['rspamd']}

View file

@ -5,5 +5,13 @@ influxdb_org = 'encrypt$gAAAAABgg9hyjz4XtvG8NBw9uYxiumS3v7YKIrtc9tTTABg1f9R22gzn
influxdb_token = 'encrypt$gAAAAABgg9Ag632Xyuc6SWXaR1uH2tLOChmVKAoBIikhjntSSD2qJFL_eouVQGXCLH2HEuSbSdEXcTPn2qmhOiA9jmFdoDSbVbQUsp0EID1wLsWYG_Um2KOxZSF-tn9eDZlgShQYySjzO3nQRmdlJpVLUnGHsiwv_sHD2FstXGpfzTPZq5_egUqEc0K2X-aN2J6BTYc2fZAN' influxdb_token = 'encrypt$gAAAAABgg9Ag632Xyuc6SWXaR1uH2tLOChmVKAoBIikhjntSSD2qJFL_eouVQGXCLH2HEuSbSdEXcTPn2qmhOiA9jmFdoDSbVbQUsp0EID1wLsWYG_Um2KOxZSF-tn9eDZlgShQYySjzO3nQRmdlJpVLUnGHsiwv_sHD2FstXGpfzTPZq5_egUqEc0K2X-aN2J6BTYc2fZAN'
influxdb_url = 'https://influxdb.kunsmann.eu/' influxdb_url = 'https://influxdb.kunsmann.eu/'
# FIXME database conflicts
redis_databases = {
'netbox': (0, 1),
'rspamd': 0,
'paperless-ng': None, # probably 0, but undocumented
'pretalx': (1, 2, 3),
}
security_email = f'mailto:{hostmaster_email}' security_email = f'mailto:{hostmaster_email}'
security_lang = {'en', 'de'} security_lang = {'en', 'de'}