Add support for custom ssh port

This commit is contained in:
Josué Tille 2019-02-15 19:56:46 +01:00
parent 0e108f1261
commit 910777fd35
No known key found for this signature in database
GPG Key ID: D5E068C6DFA8681D
2 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,7 @@ DOMAIN = __DOMAIN__
HTTP_PORT = __PORT__ HTTP_PORT = __PORT__
ROOT_URL = https://__URL__/ ROOT_URL = https://__URL__/
DISABLE_SSH = false DISABLE_SSH = false
SSH_PORT = 22 SSH_PORT = __SSH_PORT_
OFFLINE_MODE = false OFFLINE_MODE = false
APP_DATA_PATH = __DATA_PATH__ APP_DATA_PATH = __DATA_PATH__
LANDING_PAGE = explore LANDING_PAGE = explore

View File

@ -48,6 +48,7 @@ config_nginx() {
} }
config_gitea() { 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" ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini"
cp ../conf/app.ini "$final_path/custom/conf" 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 "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini"
ynh_replace_string "__PORT__" $port "$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 "__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" ynh_store_file_checksum "$final_path/custom/conf/app.ini"
} }