bundles/backup-client: support using a non-standard ssh port
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-11-14 12:49:57 +01:00
parent f405dca771
commit ff607777ce
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 11 additions and 4 deletions

View file

@ -13,7 +13,7 @@ rsync_errors=""
% for path in sorted(paths): % for path in sorted(paths):
rsync -zaAP --numeric-ids --delete --relative \ rsync -zaAP --numeric-ids --delete --relative \
--rsync-path="/usr/bin/rsync --fake-super" \ --rsync-path="/usr/bin/rsync --fake-super" \
-e "ssh -o IdentityFile=/etc/backup.priv -o StrictHostKeyChecking=accept-new" \ -e "ssh -o IdentityFile=/etc/backup.priv -o StrictHostKeyChecking=accept-new -p ${port}" \
"${path}" "$ssh_login":backups/ "${path}" "$ssh_login":backups/
exitcode=$? exitcode=$?

View file

@ -7,12 +7,19 @@ if node.metadata['backups'].get('exclude_from_backups', False):
}, },
} }
else: else:
if ':' in node.metadata['backup-client']['server']:
server, port = node.metadata['backup-client']['server'].split(':')
else:
server = node.metadata['backup-client']['server']
port = 22
files = { files = {
'/usr/local/bin/generate-backup': { '/usr/local/bin/generate-backup': {
'content_type': 'mako', 'content_type': 'mako',
'context': { 'context': {
'username': node.metadata['backup-client']['user-name'], 'username': node.metadata['backup-client']['user-name'],
'server': node.metadata['backup-client']['server'], 'server': server,
'port': port,
'paths': node.metadata.get('backups', {}).get('paths', {}), 'paths': node.metadata.get('backups', {}).get('paths', {}),
}, },
'mode': '0700', 'mode': '0700',

View file

@ -25,7 +25,7 @@ groups['all'] = {
}, },
}, },
'backup-client': { 'backup-client': {
'server': 'franzi-home.kunbox.net', 'server': 'franzi-home.kunbox.net:2022',
}, },
}, },
'pip_command': 'pip3', 'pip_command': 'pip3',

View file

@ -60,7 +60,7 @@ groups['home'] = {
'relayhost': '[mx0.kunbox.net]:2525', 'relayhost': '[mx0.kunbox.net]:2525',
}, },
'backup-client': { 'backup-client': {
'server': '172.19.138.20', 'server': '172.19.138.20:22',
}, },
}, },
} }