Change example database config to postgres

This commit is contained in:
Tulir Asokan
2021-12-26 13:12:29 +02:00
parent 7e6978bc10
commit 9fd506e098
5 changed files with 8 additions and 5 deletions

View File

@@ -7,9 +7,6 @@ function fixperms {
cd /opt/mautrix-telegram
# Replace database path in config.
sed -i "s#sqlite:///mautrix-telegram.db#sqlite:////data/mautrix-telegram.db#" /data/config.yaml
if [ ! -f /data/config.yaml ]; then
cp example-config.yaml /data/config.yaml
echo "Didn't find a config file."

View File

@@ -45,6 +45,10 @@ class Config(BaseBridgeConfig):
def forbidden_defaults(self) -> List[ForbiddenDefault]:
return [
*super().forbidden_defaults,
ForbiddenDefault(
"appservice.database",
"postgres://username:password@hostname/dbname",
),
ForbiddenDefault(
"appservice.public.external",
"https://example.com/public",

View File

@@ -37,7 +37,7 @@ appservice:
# Format examples:
# SQLite: sqlite:///filename.db
# Postgres: postgres://username:password@hostname/dbname
database: sqlite:///mautrix-telegram.db
database: postgres://username:password@hostname/dbname
# Additional arguments for asyncpg.create_pool() or sqlite3.connect()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
# https://docs.python.org/3/library/sqlite3.html#sqlite3.connect

View File

@@ -24,3 +24,6 @@ prometheus_client>=0.6,<0.13
python-olm>=3,<4
pycryptodome>=3,<4
unpaddedbase64>=1,<3
#/sqlite
aiosqlite>=0.16,<0.18

View File

@@ -8,6 +8,5 @@ mautrix>=0.14.0rc4,<0.15
# Fork to make session storage async
tulir-telethon==1.25.0a1
asyncpg>=0.20,<0.26
aiosqlite>=0.17,<0.18
mako>=1,<2
setuptools