Changeset - a4715df40299
[Not reviewed]
default
0 3 0
Mads Kiilerich - 8 years ago 2017-05-30 02:59:45
mads@kiilerich.com
make-config: use %(here)s in the generated file instead of hardcoding absolute path

Restore what paster make-config did until we introduced gearbox in
d2aa8b1625a4. The make-config sub command was re-introduced in 6c8af2d22deb but
created files with absolute paths.
3 files changed with 8 insertions and 12 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/paster_commands/make_config.py
Show inline comments
 
@@ -125,7 +125,6 @@ def _run(args):
 
    # use default that cannot be replaced
 
    tmpl_stored_args.update({
 
        'uuid': lambda: uuid.uuid4().hex,
 
        'here': os.path.dirname(os.path.abspath(args.config_file)),
 
    })
 
    try:
 
        # built in template
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -2,6 +2,8 @@
 
<%text>################################################################################</%text>
 
<%text>################################################################################</%text>
 
# Kallithea - config file generated with kallithea-config                      #
 
#                                                                              #
 
# The %(here)s variable will be replaced with the parent directory of this file#
 
<%text>################################################################################</%text>
 
<%text>################################################################################</%text>
 

	
 
@@ -182,15 +184,15 @@ static_files = true
 
<%text>## Available Languages:</%text>
 
<%text>## cs de fr hu ja nl_BE pl pt_BR ru sk zh_CN zh_TW</%text>
 
lang =
 
cache_dir = ${here}/data
 
index_dir = ${here}/data/index
 
cache_dir = %(here)s/data
 
index_dir = %(here)s/data/index
 

	
 
<%text>## perform a full repository scan on each server start, this should be</%text>
 
<%text>## set to false after first startup, to allow faster server restarts.</%text>
 
initial_repo_scan = false
 

	
 
<%text>## uncomment and set this path to use archive download cache</%text>
 
archive_cache_dir = ${here}/tarballcache
 
archive_cache_dir = %(here)s/tarballcache
 

	
 
<%text>## change this to unique ID for security</%text>
 
app_instance_uuid = ${uuid()}
 
@@ -337,8 +339,8 @@ celery.always.eager = false
 
<%text>###         BEAKER CACHE        ####</%text>
 
<%text>####################################</%text>
 

	
 
beaker.cache.data_dir = ${here}/data/cache/data
 
beaker.cache.lock_dir = ${here}/data/cache/lock
 
beaker.cache.data_dir = %(here)s/data/cache/data
 
beaker.cache.lock_dir = %(here)s/data/cache/lock
 

	
 
beaker.cache.regions = short_term,long_term,sql_cache_short
 

	
 
@@ -494,7 +496,7 @@ logview.pylons.util = #eee
 

	
 
%if database_engine == 'sqlite':
 
# SQLITE [default]
 
sqlalchemy.url = sqlite:///${here}/kallithea.db?timeout=60
 
sqlalchemy.url = sqlite:///%(here)s/kallithea.db?timeout=60
 

	
 
%elif database_engine == 'postgres':
 
# POSTGRESQL
scripts/generate-ini.py
Show inline comments
 
@@ -21,7 +21,6 @@ selected_mako_conditionals = set([
 
mako_variable_values = {
 
    'host': '127.0.0.1',
 
    'port': '5000',
 
    'here': '%(here)s',
 
    'uuid()': '${app_instance_uuid}',
 
}
 

	
 
@@ -32,8 +31,6 @@ ini_files = [
 
        Kallithea - config for tests:
 
        sqlalchemy and kallithea_test.sqlite
 
        custom logging
 

	
 
        The %(here)s variable will be replaced with the parent directory of this file
 
        ''',
 
        {
 
            '[server:main]': {
 
@@ -72,8 +69,6 @@ ini_files = [
 
        initial_repo_scan = true
 
        debug = true
 
        verbose and colorful logging
 

	
 
        The %(here)s variable will be replaced with the parent directory of this file
 
        ''',
 
        {
 
            '[server:main]': {
0 comments (0 inline, 0 general)