matrix-dimension #43

Closed
sophie wants to merge 15 commits from matrix-dimension into main
4 changed files with 16 additions and 16 deletions
Showing only changes of commit 3a26c766f9 - Show all commits

View file

@ -6,7 +6,7 @@ After=network.target
User=matrix-support
sophie marked this conversation as resolved Outdated
Outdated
Review

Please use a user dedicated to this bundle, naming them accordingly

Please use a user dedicated to this bundle, naming them accordingly

Resolved in b87d3cc975

Resolved in `b87d3cc975`
Group=matrix-support
Environment="NODE_ENV=production"
ExecStart=/usr/bin/node /opt/matrix/matrix-dimension/build/app/index.js
ExecStart=/usr/bin/node ${config['install_dir']}/build/app/index.js
WorkingDirectory=${config['install_dir']}
Restart=on-failure

View file

@ -2,8 +2,10 @@ repo.libs.tools.require_bundle(node, 'nodejs')
directories = {
node.metadata['matrix-dimension']['install_dir']: {},
node.metadata['matrix-dimension']['data_dir']: {},
node.metadata['matrix-dimension']['install_dir']: {
'owner': 'matrix-support',
'group': 'matrix-support',
},
}
git_deploy = {
@ -22,6 +24,8 @@ git_deploy = {
files = {
'{}/config/production.yaml'.format(node.metadata['matrix-dimension']['install_dir']): {
'owner': 'matrix-support',
'group': 'matrix-support',
'content_type': 'mako',
'context': {
'config': node.metadata.get('matrix-dimension', {}),
@ -44,8 +48,8 @@ files = {
}
actions = {
'matrix_dimenson_build': {
'command': 'cd ' + node.metadata['matrix-dimension']['install_dir'] + ' && npm install && npm run build',
'matrix_dimension_build': {
'command': 'cd ' + node.metadata['matrix-dimension']['install_dir'] + ' && sudo -u matrix-support npm install && sudo -u matrix-support npm run build',
'needs': {
'pkg_apt:nodejs',
},
@ -59,7 +63,7 @@ actions = {
svc_systemd = {
'matrix-dimension': {
'needs': {
'action:matrix-dimension_build',
'action:matrix_dimension_build',
'file:{}/config/production.yaml'.format(node.metadata['matrix-dimension']['install_dir']),
'postgres_db:matrix-dimension',
'postgres_role:matrix-dimension',

View file

@ -1,7 +1,7 @@
defaults = {
'matrix-dimension': {
'install_dir': '/opt/matrix-dimension',
'data_dir': '/var/opt/dimension',
'data_dir': '/var/opt/matrix-dimension',
kunsi marked this conversation as resolved
Review

Do we really need to backup this?

Do we really need to backup this?
Review

npm writes all kinds of install info to this location, I guess so.

npm writes all kinds of install info to this location, I guess so.
Review

If it's only information we can restore using a bw apply, there should be no need to backup this. But if it's more than that, i'm okay with backing this up.

If it's only information we can restore using a `bw apply`, there should be no need to backup this. But if it's more than that, i'm okay with backing this up.
'database': {
'user': 'matrix-dimension',
'password': repo.vault.password_for('{} postgresql matrix-dimension'.format(node.name)),
@ -20,13 +20,9 @@ defaults = {
},
},
},
'icinga2_api': {
'mautrix-telegram': {
'services': {
'MAUTRIX-TELEGRAM PROCESS': {
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_procs -a mautrix-telegram -c 1:',
},
},
'users': {
'matrix-support': {
'home': '/var/opt/matrix-dimension',
},
},
}
@ -39,7 +35,7 @@ def nginx_config(metadata):
'nginx': {
'vhosts': {
metadata.get('matrix-dimension/url'): {
'webroot': '/var/www/{}/webapp/'.format(metadata.get('element-web/url')),
'webroot': '/var/www/{}/webapp/'.format(metadata.get('matrix-dimension/url')),
'do_not_set_content_security_headers': True,
'max_body_size': '50M',
'proxy': {