bw/matrix-dimension switch to dedicated user

This commit is contained in:
Sophie Schiller 2021-07-04 20:38:27 +02:00
parent 2a78fa95a1
commit 9fb5293c80
3 changed files with 8 additions and 8 deletions

View file

@ -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']}

View file

@ -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',
},

View file

@ -27,7 +27,7 @@ defaults = {
},
},
'users': {
'matrix-support': {
'matrix-dimension': {
'home': '/var/opt/matrix-dimension',
},
},