matrix.yml aktualisiert
This commit is contained in:
parent
f8dcd85b2c
commit
39c92e8b63
15
matrix.yml
15
matrix.yml
@ -101,21 +101,27 @@
|
||||
postgresqluser=$(pwgen -s 32 1)
|
||||
postgresqlpassword=$(pwgen -s 32 1)
|
||||
matrixadminpassword=$(pwgen -s 32 1)
|
||||
matrixsrvuserpassword=$(pwgen -s 32 1)
|
||||
|
||||
[ -f env ] || echo "POSTGRES_USER=!POSTGRESUSER!
|
||||
POSTGRES_PASSWORD=!POSTGRESPASSWORD!
|
||||
MATRIX_ADMIN_PASSWORD=!MATRIX_ADMIN_PASSWORD!
|
||||
" >env
|
||||
|
||||
[ -f env.user ] || echo "MATRIX_SRV_USER={{ ansible_facts['hostname'] }}
|
||||
MATRIX_SRV_USER_PASSWORD=!MATRIX_SEV_USER_PASSWORD!
|
||||
" >env.user
|
||||
|
||||
[ -f env.db ] || echo "POSTGRES_USER=!POSTGRESUSER!
|
||||
POSTGRES_PASSWORD=!POSTGRESPASSWORD!
|
||||
" >env.db
|
||||
|
||||
chmod 440 env env.db
|
||||
chown root:docker env env.db
|
||||
chmod 440 env env.db env.user
|
||||
chown root:docker env env.db env.user
|
||||
sed -i "s/\!MATRIX_ADMIN_PASSWORD\!/$matrixadminpassword/g" env
|
||||
sed -i "s/\!POSTGRESUSER\!/$postgresqluser/g" env env.db
|
||||
sed -i "s/\!POSTGRESPASSWORD\!/$postgresqlpassword/g" env env.db
|
||||
sed -i "s/\!MATRIX_SEV_USER_PASSWORD\!/$matrixsrvuserpassword/g" env.user
|
||||
|
||||
if ! grep -q "name: psycopg2" data/homeserver.yaml
|
||||
then
|
||||
@ -449,7 +455,10 @@
|
||||
sleep 120
|
||||
cd /home/docker/matrix.{{inventory_hostname}} || exit 1
|
||||
. ./env
|
||||
docker compose exec matrix.{{inventory_hostname}}--synapse register_new_matrix_user -c /data/homeserver.yaml -a -u mx-admin -p $MATRIX_ADMIN_PASSWORD http://localhost:8008 >matrix.init.log 2>&1
|
||||
. ./env.user
|
||||
date >>matrix.init.log
|
||||
docker compose exec matrix.{{inventory_hostname}}--synapse register_new_matrix_user -c /data/homeserver.yaml -a -u mx-admin -p $MATRIX_ADMIN_PASSWORD http://localhost:8008 >>matrix.init.log 2>&1
|
||||
docker compose exec matrix.{{inventory_hostname}}--synapse register_new_matrix_user -c /data/homeserver.yaml -u $MATRIX_SRV_USER -p $MATRIX_SRV_USER_PASSWORD http://localhost:8008 >>matrix.init.log 2>&1
|
||||
backup: yes
|
||||
validate: /bin/bash -n %s
|
||||
# notify: run matrix.init
|
||||
|
Loading…
Reference in New Issue
Block a user