1
0
Fork 0
mirror of https://github.com/koniu/recoll-webui.git synced 2025-10-03 17:59:50 +02:00

enable global configuration of path rewrites (fixes #78)

This commit is contained in:
koniu 2020-07-21 11:58:51 +01:00
parent 4e748d6544
commit c3151abc2b

View file

@ -40,6 +40,15 @@ DEFAULTS = {
'perpage': 25, 'perpage': 25,
'csvfields': 'filename title author size time mtype url', 'csvfields': 'filename title author size time mtype url',
'title_link': 'download', 'title_link': 'download',
'mounts': {
# Override default links for directories.
# Useful for rewriting links to access the files on a server.
# If not specified, the url will be dir path prefixed with 'file://'.
#
# Path in recoll.conf : Remote url
# '/media/data/docs' : 'https://media.server.com/docs',
# '/var/www/data' : 'file:///192.168.1.2/data',
},
} }
# sort fields/labels # sort fields/labels
@ -123,7 +132,7 @@ def get_config():
config['mounts'] = {} config['mounts'] = {}
for d in config['dirs']: for d in config['dirs']:
name = 'mount_%s' % urllib.quote(d,'') name = 'mount_%s' % urllib.quote(d,'')
config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, '']) config['mounts'][d] = select([bottle.request.get_cookie(name), DEFAULTS['mounts'].get(d), 'file://%s' % d], [None, ''])
return config return config
#}}} #}}}
#{{{ get_dirs #{{{ get_dirs