From b87d3cc9754d36603517207fa9a2715f45bf34c8 Mon Sep 17 00:00:00 2001 From: Sophie Schiller Date: Sun, 4 Jul 2021 20:38:27 +0200 Subject: [PATCH] bw/matrix-dimension switch to dedicated user --- .../matrix-dimension/files/matrix-dimension.service | 4 ++-- bundles/matrix-dimension/items.py | 10 +++++----- bundles/matrix-dimension/metadata.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bundles/matrix-dimension/files/matrix-dimension.service b/bundles/matrix-dimension/files/matrix-dimension.service index 14b91f4..9d2bebc 100644 --- a/bundles/matrix-dimension/files/matrix-dimension.service +++ b/bundles/matrix-dimension/files/matrix-dimension.service @@ -3,8 +3,8 @@ Description=Matrix Dimension After=network.target [Service] -User=matrix-support -Group=matrix-support +User=matrix-dimension +Group=matrix-dimension Environment="NODE_ENV=production" ExecStart=/usr/bin/node ${config['install_dir']}/build/app/index.js WorkingDirectory=${config['install_dir']} diff --git a/bundles/matrix-dimension/items.py b/bundles/matrix-dimension/items.py index 594ba89..8bdf28f 100644 --- a/bundles/matrix-dimension/items.py +++ b/bundles/matrix-dimension/items.py @@ -3,8 +3,8 @@ repo.libs.tools.require_bundle(node, 'nodejs') directories = { node.metadata['matrix-dimension']['install_dir']: { - 'owner': 'matrix-support', - 'group': 'matrix-support', + 'owner': 'matrix-dimension', + 'group': 'matrix-dimension', }, } @@ -24,8 +24,8 @@ git_deploy = { files = { '{}/config/production.yaml'.format(node.metadata['matrix-dimension']['install_dir']): { - 'owner': 'matrix-support', - 'group': 'matrix-support', + 'owner': 'matrix-dimension', + 'group': 'matrix-dimension', 'content_type': 'mako', 'context': { 'config': node.metadata.get('matrix-dimension', {}), @@ -49,7 +49,7 @@ files = { actions = { 'matrix_dimension_build': { - 'command': 'cd ' + node.metadata['matrix-dimension']['install_dir'] + ' && sudo -u matrix-support npm install && sudo -u matrix-support npm run build', + 'command': 'cd ' + node.metadata['matrix-dimension']['install_dir'] + ' && sudo -u matrix-dimension npm install && sudo -u matrix-dimension npm run build', 'needs': { 'pkg_apt:nodejs', }, diff --git a/bundles/matrix-dimension/metadata.py b/bundles/matrix-dimension/metadata.py index 23627ae..b9cf3df 100644 --- a/bundles/matrix-dimension/metadata.py +++ b/bundles/matrix-dimension/metadata.py @@ -27,7 +27,7 @@ defaults = { }, }, 'users': { - 'matrix-support': { + 'matrix-dimension': { 'home': '/var/opt/matrix-dimension', }, },