Compare commits
	
		
			3 commits
		
	
	
		
			dacb7cfec3
			...
			1ea39b8117
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1ea39b8117 | |||
| bd118be239 | |||
| 21f871b2f8 | 
					 7 changed files with 28 additions and 7 deletions
				
			
		| 
						 | 
					@ -15,7 +15,7 @@ Raspberry pi as soundcard
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# install bw fork
 | 
					# install bw fork
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pip3 install --editable git+file:///Users/mwiegand/Projekte/bundlewrap-fork#egg=bundlewrap
 | 
					pip3 install --editable git+file:///Users/mwiegand/Projekte/bundlewrap-fork@main#egg=bundlewrap
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# monitor timers
 | 
					# monitor timers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ else
 | 
				
			||||||
  echo "INCREMENTAL BACKUP"
 | 
					  echo "INCREMENTAL BACKUP"
 | 
				
			||||||
  last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
 | 
					  last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$source_dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
 | 
				
			||||||
  [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
 | 
					  [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
 | 
				
			||||||
  $(zfs send -v -L -c -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset")
 | 
					  $(zfs send -v -L -i "#$last_bookmark" "$source_dataset@$new_bookmark" | $ssh sudo zfs recv "$target_dataset")
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ "$?" == "0" ]]
 | 
					if [[ "$?" == "0" ]]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,8 @@ Host *
 | 
				
			||||||
    GSSAPIAuthentication yes
 | 
					    GSSAPIAuthentication yes
 | 
				
			||||||
    StrictHostKeyChecking yes
 | 
					    StrictHostKeyChecking yes
 | 
				
			||||||
    GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
 | 
					    GlobalKnownHostsFile /etc/ssh/ssh_known_hosts
 | 
				
			||||||
    # fixme: prevents backup server from sleeping
 | 
					
 | 
				
			||||||
    # ControlMaster auto
 | 
					Host ${' '.join(sorted(multiplex_hosts))}
 | 
				
			||||||
    # ControlPath ~/.ssh/multiplex-%C
 | 
					    ControlMaster auto
 | 
				
			||||||
    # ControlPersist 5m
 | 
					    ControlPath ~/.ssh/multiplex-%C
 | 
				
			||||||
 | 
					    ControlPersist 5m
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,6 @@
 | 
				
			||||||
 | 
					from ipaddress import ip_interface
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# on debian bullseye raspberry images, starting the systemd ssh
 | 
					# on debian bullseye raspberry images, starting the systemd ssh
 | 
				
			||||||
# daemon seems to collide with an existing sysv daemon
 | 
					# daemon seems to collide with an existing sysv daemon
 | 
				
			||||||
dont_touch_sshd = node.metadata.get('FIXME_dont_touch_sshd', False)
 | 
					dont_touch_sshd = node.metadata.get('FIXME_dont_touch_sshd', False)
 | 
				
			||||||
| 
						 | 
					@ -24,6 +27,13 @@ files = {
 | 
				
			||||||
    '/etc/ssh/ssh_config': {
 | 
					    '/etc/ssh/ssh_config': {
 | 
				
			||||||
        'content_type': 'mako',
 | 
					        'content_type': 'mako',
 | 
				
			||||||
        'context': {
 | 
					        'context': {
 | 
				
			||||||
 | 
					            'multiplex_hosts': set(
 | 
				
			||||||
 | 
					                str(ip_interface(other_node.metadata.get('network/internal/ipv4')).ip)
 | 
				
			||||||
 | 
					                    for other_node in repo.nodes
 | 
				
			||||||
 | 
					                    if other_node.has_bundle('ssh')
 | 
				
			||||||
 | 
					                    and other_node.metadata.get('network/internal/ipv4', None)
 | 
				
			||||||
 | 
					                    and other_node.metadata.get('ssh/multiplex_incoming')
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        'triggers': [
 | 
					        'triggers': [
 | 
				
			||||||
            'svc_systemd:ssh:restart'
 | 
					            'svc_systemd:ssh:restart'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,12 @@
 | 
				
			||||||
from ipaddress import ip_interface
 | 
					from ipaddress import ip_interface
 | 
				
			||||||
from base64 import b64decode
 | 
					from base64 import b64decode
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaults = {
 | 
				
			||||||
 | 
					    'ssh': {
 | 
				
			||||||
 | 
					        'multiplex_incoming': True,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@metadata_reactor.provides(
 | 
					@metadata_reactor.provides(
 | 
				
			||||||
    'ssh/allow_users',
 | 
					    'ssh/allow_users',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ do
 | 
				
			||||||
    echo "INCREMENTAL BACKUP"
 | 
					    echo "INCREMENTAL BACKUP"
 | 
				
			||||||
    last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
 | 
					    last_bookmark=$(zfs list -t bookmark -H -o name | grep "^$dataset#$bookmark_prefix" | sort | tail -1 | cut -d '#' -f 2)
 | 
				
			||||||
    [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
 | 
					    [[ -z "$last_bookmark" ]] && echo "ERROR - last_bookmark is empty" && exit 98
 | 
				
			||||||
    $(zfs send -v -c -L -i "#$last_bookmark" "$dataset@$new_bookmark" | $ssh sudo zfs recv "$dataset" -o mountpoint=none)
 | 
					    $(zfs send -v -L -i "#$last_bookmark" "$dataset@$new_bookmark" | $ssh sudo zfs recv "$dataset" -o mountpoint=none)
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [[ "$?" == "0" ]]
 | 
					  if [[ "$?" == "0" ]]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,6 +38,10 @@
 | 
				
			||||||
        #         'apm': 1,
 | 
					        #         'apm': 1,
 | 
				
			||||||
        #     },
 | 
					        #     },
 | 
				
			||||||
        # },
 | 
					        # },
 | 
				
			||||||
 | 
					        'ssh': {
 | 
				
			||||||
 | 
					            # multipling prevents server from sleeping
 | 
				
			||||||
 | 
					            'multiplex_incoming': False,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        'wol-sleeper': {
 | 
					        'wol-sleeper': {
 | 
				
			||||||
            'network': 'internal',
 | 
					            'network': 'internal',
 | 
				
			||||||
            'waker': 'home.server',
 | 
					            'waker': 'home.server',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue