wip
This commit is contained in:
parent
c7c5d3f316
commit
f2e9768e65
4 changed files with 7 additions and 3 deletions
|
@ -24,6 +24,6 @@ gsutil ${'\\'}
|
||||||
-x '${'|'.join(options['exclude'])}' ${'\\'}
|
-x '${'|'.join(options['exclude'])}' ${'\\'}
|
||||||
% endif
|
% endif
|
||||||
'${options['encrypted_path']}' ${'\\'}
|
'${options['encrypted_path']}' ${'\\'}
|
||||||
'gs://${bucket}/${node.name}${path}' ${'\\'}
|
'gs://${bucket}/${node_id}${path}' ${'\\'}
|
||||||
2>&1 | logger -st gsutil
|
2>&1 | logger -st gsutil
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
FILENAME=$1
|
FILENAME=$1
|
||||||
TMPFILE=$(mktemp /tmp/archive_file.XXXXXXXXXX)
|
TMPFILE=$(mktemp /tmp/archive_file.XXXXXXXXXX)
|
||||||
BUCKET=$(cat /etc/gcloud/gcloud.json | jq -r .bucket)
|
BUCKET=$(cat /etc/gcloud/gcloud.json | jq -r .bucket)
|
||||||
NODE=$(cat /etc/archive/archive.json | jq -r .node_name)
|
NODE=$(cat /etc/archive/archive.json | jq -r .node_id)
|
||||||
MASTERKEY=$(cat /etc/gocryptfs/masterkey)
|
MASTERKEY=$(cat /etc/gocryptfs/masterkey)
|
||||||
|
|
||||||
gsutil cat "gs://$BUCKET/$NODE$FILENAME" > "$TMPFILE"
|
gsutil cat "gs://$BUCKET/$NODE$FILENAME" > "$TMPFILE"
|
||||||
|
|
|
@ -11,7 +11,7 @@ directories['/etc/archive'] = {}
|
||||||
files['/etc/archive/archive.json'] = {
|
files['/etc/archive/archive.json'] = {
|
||||||
'content': dumps(
|
'content': dumps(
|
||||||
{
|
{
|
||||||
'node_name': node.name,
|
'node_id': node.metadata.get('id'),
|
||||||
**node.metadata.get('archive'),
|
**node.metadata.get('archive'),
|
||||||
},
|
},
|
||||||
indent=4,
|
indent=4,
|
||||||
|
@ -23,6 +23,7 @@ files['/opt/archive/archive'] = {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'mode': '700',
|
'mode': '700',
|
||||||
'context': {
|
'context': {
|
||||||
|
'node_id': node.metadata.get('id'),
|
||||||
'paths': node.metadata.get('archive/paths'),
|
'paths': node.metadata.get('archive/paths'),
|
||||||
'bucket': node.metadata.get('gcloud/bucket'),
|
'bucket': node.metadata.get('gcloud/bucket'),
|
||||||
'processes': 4,
|
'processes': 4,
|
||||||
|
|
|
@ -31,6 +31,9 @@ files['/etc/gocryptfs/gocryptfs.conf'] = {
|
||||||
|
|
||||||
for path, options in node.metadata.get('gocryptfs/paths').items():
|
for path, options in node.metadata.get('gocryptfs/paths').items():
|
||||||
directories[options['mountpoint']] = {
|
directories[options['mountpoint']] = {
|
||||||
|
'preceded_by': [
|
||||||
|
f'svc_systemd:gocryptfs-{options["id"]}:stop',
|
||||||
|
],
|
||||||
'needed_by': [
|
'needed_by': [
|
||||||
f'svc_systemd:gocryptfs-{options["id"]}',
|
f'svc_systemd:gocryptfs-{options["id"]}',
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue