feat: Add configure-whatsapp.sh helper script to automate bridge config setup on NAS
This commit is contained in:
36
configure-whatsapp.sh
Normal file
36
configure-whatsapp.sh
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Automatisches Setup für die mautrix-whatsapp Konfiguration
|
||||||
|
# Ausgeführt im Matrix-Projektverzeichnis auf dem NAS
|
||||||
|
|
||||||
|
CONFIG_FILE="data/whatsapp/config.yaml"
|
||||||
|
|
||||||
|
if [ ! -f "$CONFIG_FILE" ]; then
|
||||||
|
echo "Fehler: $CONFIG_FILE wurde noch nicht generiert!"
|
||||||
|
echo "Bitte starte zuerst den whatsapp Container einmalig, um die Datei zu erzeugen:"
|
||||||
|
echo " docker compose up -d whatsapp"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Passe Konfiguration in $CONFIG_FILE an..."
|
||||||
|
|
||||||
|
# Homeserver Einstellungen
|
||||||
|
sed -i 's|address: http://localhost:8008|address: http://matrix_synapse:8008|g' "$CONFIG_FILE"
|
||||||
|
sed -i 's|domain: example.com|domain: mischlabs.de|g' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Appservice Einstellungen
|
||||||
|
sed -i 's|address: http://localhost:29318|address: http://matrix_whatsapp:29318|g' "$CONFIG_FILE"
|
||||||
|
sed -i 's|hostname: 127.0.0.1|hostname: 0.0.0.0|g' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Datenbank auf SQLite umstellen
|
||||||
|
sed -i 's|type: postgres|type: sqlite3-fk-wal|g' "$CONFIG_FILE"
|
||||||
|
sed -i 's|uri: postgres://user:password@host/database?sslmode=disable|uri: file:/data/mautrix-whatsapp.db?_txlock=immediate|g' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Token hinterlegen
|
||||||
|
sed -i 's|as_token: "This value is generated when generating the registration"|as_token: "0a3c59d1cbf443b88cca6147def3c8e83da2fc074d584cfeb3f4b8487e8f3418"|g' "$CONFIG_FILE"
|
||||||
|
sed -i 's|hs_token: "This value is generated when generating the registration"|hs_token: "55a049f147eb43a1897cdd5dc49961fbe8694fe52f3a447bbd12abee1905ae10"|g' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
# Berechtigungen anpassen
|
||||||
|
sed -i 's|example.com: user|mischlabs.de: admin|g' "$CONFIG_FILE"
|
||||||
|
sed -i 's|@admin:example.com|@MrDiderot:mischlabs.de|g' "$CONFIG_FILE"
|
||||||
|
|
||||||
|
echo "Erfolgreich konfiguriert! Du kannst den Bridge-Container nun neu starten."
|
||||||
Reference in New Issue
Block a user