diff --git a/bundles/archive/files/archive b/bundles/archive/files/archive index 49de155..fab7b27 100644 --- a/bundles/archive/files/archive +++ b/bundles/archive/files/archive @@ -24,6 +24,6 @@ gsutil ${'\\'} -x '${'|'.join(options['exclude'])}' ${'\\'} % endif '${options['encrypted_path']}' ${'\\'} - 'gs://${bucket}/${node.name}${path}' ${'\\'} + 'gs://${bucket}/${node_id}${path}' ${'\\'} 2>&1 | logger -st gsutil % endfor diff --git a/bundles/archive/files/get_file b/bundles/archive/files/get_file index 88a60c5..81f94b7 100644 --- a/bundles/archive/files/get_file +++ b/bundles/archive/files/get_file @@ -3,7 +3,7 @@ FILENAME=$1 TMPFILE=$(mktemp /tmp/archive_file.XXXXXXXXXX) 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) gsutil cat "gs://$BUCKET/$NODE$FILENAME" > "$TMPFILE" diff --git a/bundles/archive/items.py b/bundles/archive/items.py index fb42c07..dedf580 100644 --- a/bundles/archive/items.py +++ b/bundles/archive/items.py @@ -11,7 +11,7 @@ directories['/etc/archive'] = {} files['/etc/archive/archive.json'] = { 'content': dumps( { - 'node_name': node.name, + 'node_id': node.metadata.get('id'), **node.metadata.get('archive'), }, indent=4, @@ -23,6 +23,7 @@ files['/opt/archive/archive'] = { 'content_type': 'mako', 'mode': '700', 'context': { + 'node_id': node.metadata.get('id'), 'paths': node.metadata.get('archive/paths'), 'bucket': node.metadata.get('gcloud/bucket'), 'processes': 4, diff --git a/bundles/gocryptfs/items.py b/bundles/gocryptfs/items.py index 0032762..d2486ca 100644 --- a/bundles/gocryptfs/items.py +++ b/bundles/gocryptfs/items.py @@ -31,6 +31,9 @@ files['/etc/gocryptfs/gocryptfs.conf'] = { for path, options in node.metadata.get('gocryptfs/paths').items(): directories[options['mountpoint']] = { + 'preceded_by': [ + f'svc_systemd:gocryptfs-{options["id"]}:stop', + ], 'needed_by': [ f'svc_systemd:gocryptfs-{options["id"]}', ],