changeset 7778:267c0dbcddd3

kallithea-cli: set ssh_authorized_keys when creating .ini file so it doesn't have to be set manually before using ssh The user that is creating the .ini will be / should be the kallithea user that also will be used at runtime.
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 22 Jun 2019 19:46:25 +0200
parents b27e515df83c
children a185042de98a
files kallithea/bin/kallithea_cli_config.py kallithea/lib/paster_commands/template.ini.mako
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/bin/kallithea_cli_config.py	Mon Nov 17 14:42:45 2014 -0500
+++ b/kallithea/bin/kallithea_cli_config.py	Sat Jun 22 19:46:25 2019 +0200
@@ -62,6 +62,7 @@
 
     mako_variable_values = {
         'git_hook_interpreter': sys.executable,
+        'user_home_path': os.path.expanduser('~'),
     }
     ini_settings = defaultdict(dict)
 
--- a/kallithea/lib/paster_commands/template.ini.mako	Mon Nov 17 14:42:45 2014 -0500
+++ b/kallithea/lib/paster_commands/template.ini.mako	Sat Jun 22 19:46:25 2019 +0200
@@ -331,6 +331,9 @@
 
 <%text>## File where users' SSH keys will be stored *if* ssh_enabled is true.</%text>
 #ssh_authorized_keys = /home/kallithea/.ssh/authorized_keys
+%if user_home_path:
+ssh_authorized_keys = ${user_home_path}/.ssh/authorized_keys
+%endif
 
 <%text>## Path to be used in ssh_authorized_keys file to invoke kallithea-cli with ssh-serve.</%text>
 #kallithea_cli_path = /srv/kallithea/venv/bin/kallithea-cli