Remove registration shared secret and update database info

This commit is contained in:
Roger Gonzalez 2025-01-31 12:42:48 -03:00
parent bb23fe1a0f
commit 632772250e
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
2 changed files with 14 additions and 18 deletions

View File

@ -17,7 +17,6 @@ A simple way to set up Synapse with bridges for WhatsApp, Telegram, and Discord,
## Features ## Features
- Integrated bridges for WhatsApp, Telegram, and Discord - Integrated bridges for WhatsApp, Telegram, and Discord
- Automated media management with Cleanmedia
- Simple setup process with provided scripts - Simple setup process with provided scripts
- Docker-based deployment for easy maintenance - Docker-based deployment for easy maintenance
@ -40,28 +39,28 @@ This script will:
- Prompt you for your domain (the one you configured in "Before Starting") - Prompt you for your domain (the one you configured in "Before Starting")
- Generate a secure database password - Generate a secure database password
- Create your private key and config in the `./config/synapse` directory - Create your private key and config in the `./config/synapse` directory
- Display two important pieces of information: - Display the Database configuration info
- The "Registration shared secret"
- The Database URI
**Important**: Make sure to save both the registration shared secret AND the Database URI in a secure location. The Database URI will be needed later when configuring the bridges for WhatsApp, Telegram, and Discord. **Important**: Make sure to save the Database information in a secure location. The Database URI will be needed later when configuring the bridges for WhatsApp, Telegram, and Discord.
3. Open your configuration file located at `./config/synapse/homeserver.yaml`. **You may need `sudo` to edit this file.** Search for `registration_shared_secret` and paste the registration secret you copied in the previous step. The section should look similar to this: 3. Open your configuration file located at `./config/synapse/homeserver.yaml`. **You may need `sudo` to edit this file.** Search for `database` and replace it with the following:
```yaml ```yaml
client_api: database:
registration_disabled: true name: psycopg2
registration_requires_token: false args:
registration_shared_secret: "YourBigCopiedKey123" # This is your key! user: synapse
guests_disabled: false password: YourBigPassword # Replace with your DB password here!
enable_registration_captcha: false dbname: synapse
recaptcha_api_js_url: "" host: postgres
cp_min: 5
cp_max: 10
``` ```
4. Start the core services: 4. Start the core services:
```sh ```sh
docker compose up -d postgres monolith docker compose up -d postgres synapse
``` ```
5. Once PostgreSQL is up, create the bridge databases: 5. Once PostgreSQL is up, create the bridge databases:

View File

@ -21,14 +21,11 @@ docker run -it --rm \
-e SYNAPSE_REPORT_STATS=no \ -e SYNAPSE_REPORT_STATS=no \
matrixdotorg/synapse:latest generate matrixdotorg/synapse:latest generate
# Generate and display the registration shared secret
SHARED_SECRET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 50)
echo
echo "Registration shared secret: $SHARED_SECRET"
echo "Database info:" echo "Database info:"
echo " - Host: postgres" echo " - Host: postgres"
echo " - Username: synapse" echo " - Username: synapse"
echo " - Password: $DB_PASSWORD" echo " - Password: $DB_PASSWORD"
echo " - Database: synapse" echo " - Database: synapse"
echo "Database URI: postgres://synapse:$DB_PASSWORD@postgres/synapse?sslmode=disable"
echo echo
echo "Make sure to save this information securely!" echo "Make sure to save this information securely!"