Browse Source

Moving around DB credentials and dumps

master
Miguel Gagliardo 5 months ago
parent
commit
969187d956
1 changed files with 8 additions and 9 deletions
  1. 8
    9
      install.sh

+ 8
- 9
install.sh View File

86
 
86
 
87
 docker network create --driver=bridge --subnet=10.10.10.0/24 --gateway=10.10.10.1 matrix_server
87
 docker network create --driver=bridge --subnet=10.10.10.0/24 --gateway=10.10.10.1 matrix_server
88
 
88
 
89
+# Randomly pick a DB password
90
+PG_PASS=$(pwgen -s 28 -1)
91
+
92
+# Replace PG_PASS Password and DOMAIN in docker compose YAML
93
+sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml"
94
+sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml"
95
+
89
 # Generate synapse file
96
 # Generate synapse file
90
 echo -e "Generating synapse file..\n"
97
 echo -e "Generating synapse file..\n"
91
-
92
 docker compose run --rm -e SYNAPSE_SERVER_NAME=${DOMAIN} -e SYNAPSE_REPORT_STATS=yes synapse generate
98
 docker compose run --rm -e SYNAPSE_SERVER_NAME=${DOMAIN} -e SYNAPSE_REPORT_STATS=yes synapse generate
93
 
99
 
94
 # Replace DB config in Synapse's homeserver.yaml
100
 # Replace DB config in Synapse's homeserver.yaml
113
 turn_user_lifetime: 86400000
119
 turn_user_lifetime: 86400000
114
 turn_shared_secret: "${TURN_STATIC_SECRET}"
120
 turn_shared_secret: "${TURN_STATIC_SECRET}"
115
 turn_uris: [ "turn:${DOMAIN}?transport=udp" ]
121
 turn_uris: [ "turn:${DOMAIN}?transport=udp" ]
122
+suppress_key_server_warning: true
116
 EOF
123
 EOF
117
 
124
 
118
-# Randomly pick a DB password
119
-PG_PASS=$(pwgen -s 28 -1)
120
-
121
 # Replace Password in homeserver.yaml
125
 # Replace Password in homeserver.yaml
122
 sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/config/synapse/homeserver.yaml"
126
 sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/config/synapse/homeserver.yaml"
123
 
127
 
124
-# Replace PG_PASS Password and DOMAIN in docker compose YAML
125
-sed -i "s|DOMAIN|${DOMAIN}|g" "${BASE_DIR}/docker-compose.yaml"
126
-sed -i "s|PG_PASS|${PG_PASS}|g" "${BASE_DIR}/docker-compose.yaml"
127
-
128
 # Replace Sliding Sync key
128
 # Replace Sliding Sync key
129
 SLIDING_SYNC_KEY=$(openssl rand -hex 32)
129
 SLIDING_SYNC_KEY=$(openssl rand -hex 32)
130
 sed -i "s|SLIDING_SYNC_KEY|${SLIDING_SYNC_KEY}|g" "${BASE_DIR}/docker-compose.yaml"
130
 sed -i "s|SLIDING_SYNC_KEY|${SLIDING_SYNC_KEY}|g" "${BASE_DIR}/docker-compose.yaml"
226
 
226
 
227
 # Finally, start services
227
 # Finally, start services
228
 # Ensuring the DB dir is clean before bootstrapping
228
 # Ensuring the DB dir is clean before bootstrapping
229
-rm -rf ${BASE_DIR}/db/*
230
 systemctl enable --now matrix.service
229
 systemctl enable --now matrix.service

Loading…
Cancel
Save