From 910777fd354cc941c7cb9519f24e9c19452dfb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 19:56:46 +0100 Subject: [PATCH] Add support for custom ssh port --- conf/app.ini | 2 +- scripts/_common.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/app.ini b/conf/app.ini index 96503e7..e06c763 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -18,7 +18,7 @@ DOMAIN = __DOMAIN__ HTTP_PORT = __PORT__ ROOT_URL = https://__URL__/ DISABLE_SSH = false -SSH_PORT = 22 +SSH_PORT = __SSH_PORT_ OFFLINE_MODE = false APP_DATA_PATH = __DATA_PATH__ LANDING_PAGE = explore diff --git a/scripts/_common.sh b/scripts/_common.sh index cfbd13f..b57a1de 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -48,6 +48,7 @@ config_nginx() { } config_gitea() { + ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" cp ../conf/app.ini "$final_path/custom/conf" @@ -68,6 +69,7 @@ config_gitea() { ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" ynh_replace_string "__PORT__" $port "$final_path/custom/conf/app.ini" ynh_replace_string "__APP__" $app "$final_path/custom/conf/app.ini" + ynh_replace_string "__SSH_PORT_" $ssh_port "$final_path/custom/conf/app.ini" ynh_store_file_checksum "$final_path/custom/conf/app.ini" }