wip
This commit is contained in:
parent
0232df0fa7
commit
0cc287fdd5
5 changed files with 37 additions and 35 deletions
|
@ -9,8 +9,8 @@ else
|
|||
DRY='-n'
|
||||
fi
|
||||
|
||||
% for dir, conf in dirs.items():
|
||||
# ${dir}
|
||||
% for path, options in paths.items():
|
||||
# ${path}
|
||||
gsutil ${'\\'}
|
||||
-m ${'\\'}
|
||||
-o 'GSUtil:parallel_process_count=${processes}' ${'\\'}
|
||||
|
@ -20,8 +20,8 @@ gsutil ${'\\'}
|
|||
-r ${'\\'}
|
||||
-d ${'\\'}
|
||||
-e ${'\\'}
|
||||
-x '${'|'.join(conf.get('exclude', []))}' ${'\\'}
|
||||
'${dir}' ${'\\'}
|
||||
'gs://${bucket}/${node.name}${dir}' ${'\\'}
|
||||
2>&1 | tee | logger -t gsutil
|
||||
-x '${'|'.join(options.get('exclude', []))}' ${'\\'}
|
||||
'${options['encrypted_path']}' ${'\\'}
|
||||
'gs://${bucket}/${node.name}${path}' ${'\\'}
|
||||
2>&1 | logger -st gsutil
|
||||
% endfor
|
||||
|
|
|
@ -6,7 +6,7 @@ files['/opt/archive'] = {
|
|||
'content_type': 'mako',
|
||||
'mode': '700',
|
||||
'context': {
|
||||
'dirs': node.metadata.get('archive'),
|
||||
'paths': node.metadata.get('archive/paths'),
|
||||
'bucket': node.metadata.get('gcloud/bucket'),
|
||||
'processes': 4,
|
||||
'threads': 4,
|
||||
|
|
|
@ -1,22 +1,40 @@
|
|||
defaults = {
|
||||
'archive': {},
|
||||
'archive': {
|
||||
'paths': {},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'archive/paths',
|
||||
)
|
||||
def paths(metadata):
|
||||
return {
|
||||
'archive': {
|
||||
'paths': {
|
||||
path: {
|
||||
'encrypted_path': f'/mnt/gocryptfs{path}',
|
||||
'exclude': [
|
||||
'^\..*',
|
||||
'/\..*',
|
||||
],
|
||||
} for path in metadata.get('archive/paths')
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'gocryptfs/paths',
|
||||
)
|
||||
def gocryptfs(metadata):
|
||||
paths = {}
|
||||
|
||||
for path in metadata.get('archive/paths'):
|
||||
paths[path] = {
|
||||
'mountpoint': f'/mnt/gocryptfs{path}',
|
||||
'reverse': True,
|
||||
}
|
||||
|
||||
return {
|
||||
'gocryptfs': {
|
||||
'paths': paths,
|
||||
},
|
||||
'paths': {
|
||||
path: {
|
||||
'mountpoint': options['encrypted_path'],
|
||||
'reverse': True,
|
||||
} for path, options in metadata.get('archive/paths').items()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ def systemd(metadata):
|
|||
'CIPHER': options["mountpoint"]
|
||||
},
|
||||
'ExecStart': [
|
||||
'/usr/bin/gocryptfs -fg -reverse -masterkey $MASTERKEY -ctlsock $SOCKET $PLAIN $CIPHER',
|
||||
'/usr/bin/gocryptfs -fg -plaintextnames -reverse -masterkey $MASTERKEY -ctlsock $SOCKET $PLAIN $CIPHER',
|
||||
],
|
||||
'ExecStopPost': [
|
||||
'/usr/bin/umount $CIPHER'
|
||||
|
|
|
@ -13,19 +13,3 @@ defaults = {
|
|||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'archive',
|
||||
)
|
||||
def exclude_hidden_files_from_archive(metadata):
|
||||
return {
|
||||
'archive': {
|
||||
dir: {
|
||||
'exclude': [
|
||||
'^\..*',
|
||||
'/\..*',
|
||||
],
|
||||
} for dir, conf in metadata.get('archive').items()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue