comparison sync.py @ 191:d7ddfe3837b0

syncthing clients update
author drewp@bigasterisk.com
date Mon, 12 Jun 2023 13:07:42 -0700
parents 65412d39025e
children 83573e3350bd
comparison
equal deleted inserted replaced
190:21d67aae89c0 191:d7ddfe3837b0
17 def install_syncthing(user, version, os='linux', arch='amd64'): 17 def install_syncthing(user, version, os='linux', arch='amd64'):
18 tmpdir = Path('/tmp/syncthing_install') 18 tmpdir = Path('/tmp/syncthing_install')
19 dl_name = f'syncthing-{os}-{arch}-{version}' 19 dl_name = f'syncthing-{os}-{arch}-{version}'
20 url = f'https://github.com/syncthing/syncthing/releases/download/{version}/{dl_name}.tar.gz' 20 url = f'https://github.com/syncthing/syncthing/releases/download/{version}/{dl_name}.tar.gz'
21 files.directory(tmpdir) 21 files.directory(tmpdir)
22 files.download(url, str(tmpdir / 'archive.tgz')) # bugreport 22 files.download(url, str(tmpdir / f'{dl_name}.tgz')) # bugreport
23 server.shell([f'cd {tmpdir}; aunpack archive.tgz']) 23 server.shell([f'cd {tmpdir}; aunpack {dl_name}.tgz'])
24 24
25 systemd.service(service=f'syncthing@{user}', running=False) 25 systemd.service(service=f'syncthing@{user}', running=False)
26 26
27 user_svc_template = '/lib/systemd/system/syncthing@.service' 27 user_svc_template = '/lib/systemd/system/syncthing@.service'
28 server.shell([ 28 server.shell([
36 files.link(f'/etc/systemd/system/multi-user.target.wants/syncthing@{user}.service', user_svc_template) 36 files.link(f'/etc/systemd/system/multi-user.target.wants/syncthing@{user}.service', user_svc_template)
37 systemd.service(service=f'syncthing@{user}', enabled=True, restarted=True, daemon_reload=True) 37 systemd.service(service=f'syncthing@{user}', enabled=True, restarted=True, daemon_reload=True)
38 38
39 39
40 # also see /my/serv/filesync/syncthing/deploy.yaml for the container one 40 # also see /my/serv/filesync/syncthing/deploy.yaml for the container one
41 version = 'v1.23.2' 41 version = 'v1.23.4'
42 42
43 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd. 43 # primary instance is in k8s (/my/serv/filesync/syncthing); the rest are run with systemd.
44 # Configs are in ~/.config/syncthing/ on each box 44 # Configs are in ~/.config/syncthing/ on each box
45 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']: 45 if host.name in ['dash', 'dot', 'slash', 'plus', 'bang' ,'ditto']:
46 apt.packages(packages=['syncthing'], present=False) 46 apt.packages(packages=['syncthing'], present=False)