From b0fb181a59d209d513aa2d5395800586b24ac388 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 17 Jun 2026 12:41:24 +0300 Subject: [PATCH] only one deploy key; org ui --- deploy.vsh | 16 ++++++++++++++-- templates/layout/header.html | 1 + translations/en.tr | 3 +++ translations/ru.tr | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/deploy.vsh b/deploy.vsh index f554ada..1f2e9fc 100755 --- a/deploy.vsh +++ b/deploy.vsh @@ -7,6 +7,10 @@ const server = 'gitly' const remote_path = '/var/www/gitly' const local_binary = 'gitly_linux' +// Shared SSH connection so the key passphrase is only asked once. +const control_path = os.join_path(os.temp_dir(), 'gitly_deploy_cm.sock') +const ssh_opts = '-o ControlMaster=auto -o ControlPath=${control_path} -o ControlPersist=5m' + fn main() { if !os.exists(local_binary) { eprintln(term.red('${local_binary} not found. Build it first with:')) @@ -14,14 +18,22 @@ fn main() { exit(1) } + // Open a single master connection up front (prompts for the passphrase once). + // Every rsync/ssh below reuses it via the control socket. + println('Opening shared SSH connection...') + exec_safe('ssh ${ssh_opts} -fN ${server}') + defer { + os.system('ssh ${ssh_opts} -O exit ${server} 2>/dev/null') + } + println('Step 1: Syncing binary, static/ and translations/...') - rsync := 'rsync -avz' + rsync := 'rsync -avz -e "ssh ${ssh_opts}"' exec_safe('${rsync} ${local_binary} ${server}:${remote_path}/gitly') exec_safe('${rsync} static/ ${server}:${remote_path}/static/') exec_safe('${rsync} translations/ ${server}:${remote_path}/translations/') println('\nStep 2: Restarting gitly...') - exec_safe('ssh ${server} "sudo systemctl restart gitly"') + exec_safe('ssh ${ssh_opts} ${server} "sudo systemctl restart gitly"') println(term.green('\nDeployment successful!')) } diff --git a/templates/layout/header.html b/templates/layout/header.html index 6834791..ad93a39 100644 --- a/templates/layout/header.html +++ b/templates/layout/header.html @@ -33,6 +33,7 @@ %header_feed } .links { + %header_new_organization %header_settings @if ctx.user.is_admin %header_admin_panel diff --git a/translations/en.tr b/translations/en.tr index 1255e61..646f41a 100644 --- a/translations/en.tr +++ b/translations/en.tr @@ -812,6 +812,9 @@ Feed header_settings Settings ----- +header_new_organization +New organization +----- header_admin_panel Admin Panel ----- diff --git a/translations/ru.tr b/translations/ru.tr index 35fd5c5..2fb8fab 100644 --- a/translations/ru.tr +++ b/translations/ru.tr @@ -812,6 +812,9 @@ header_feed header_settings Настройки ----- +header_new_organization +Новая организация +----- header_admin_panel Панель администратора ----- -- 2.39.5