Compare commits
1 Commits
master
...
b7d7e0891c
| Author | SHA1 | Date | |
|---|---|---|---|
| b7d7e0891c |
20
Cargo.toml
20
Cargo.toml
@@ -6,30 +6,30 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4.28"
|
log = "0.4.28"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
clap = { version = "4.5.51", features = ["derive", "env"] }
|
clap = { version = "4.5.47", features = ["derive", "env"] }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
anyhow = "1.0.100"
|
anyhow = "1.0.99"
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.223", features = ["derive"] }
|
||||||
serde_json = "1.0.143"
|
serde_json = "1.0.143"
|
||||||
rust-s3 = { version = "0.37.0", features = ["tokio"] }
|
rust-s3 = { version = "0.36.0-beta.2", features = ["tokio"] }
|
||||||
actix-web = "4.11.0"
|
actix-web = "4.11.0"
|
||||||
actix-session = { version = "0.11.0", features = ["redis-session"] }
|
actix-session = { version = "0.11.0", features = ["redis-session"] }
|
||||||
light-openid = "1.0.4"
|
light-openid = "1.0.4"
|
||||||
thiserror = "2.0.17"
|
thiserror = "2.0.16"
|
||||||
rand = "0.9.2"
|
rand = "0.9.2"
|
||||||
rust-embed = "8.9.0"
|
rust-embed = "8.7.2"
|
||||||
mime_guess = "2.0.5"
|
mime_guess = "2.0.5"
|
||||||
askama = "0.14.0"
|
askama = "0.14.0"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
uuid = { version = "1.18.0", features = ["v4", "serde"] }
|
uuid = { version = "1.18.1", features = ["v4", "serde"] }
|
||||||
ipnet = { version = "2.11.0", features = ["serde"] }
|
ipnet = { version = "2.11.0", features = ["serde"] }
|
||||||
chrono = "0.4.42"
|
chrono = "0.4.42"
|
||||||
futures-util = { version = "0.3.31", features = ["sink"] }
|
futures-util = { version = "0.3.31", features = ["sink"] }
|
||||||
jwt-simple = { version = "0.12.13", default-features = false, features = ["pure-rust"] }
|
jwt-simple = { version = "0.12.12", default-features = false, features = ["pure-rust"] }
|
||||||
actix-remote-ip = "0.1.0"
|
actix-remote-ip = "0.1.0"
|
||||||
bytes = "1.10.1"
|
bytes = "1.10.1"
|
||||||
sha2 = "0.11.0-rc.3"
|
sha2 = "0.11.0-rc.2"
|
||||||
base16ct = { version = "0.3.0", features = ["alloc"] }
|
base16ct = { version = "0.3.0", features = ["alloc"] }
|
||||||
ruma = { version = "0.13.0", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
ruma = { version = "0.13.0", features = ["client-api-c", "client-ext-client-api", "client-hyper-native-tls", "rand"] }
|
||||||
actix-ws = "0.3.0"
|
actix-ws = "0.3.0"
|
||||||
tokio = { version = "1.48.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
tokio = { version = "1.47.1", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
||||||
|
|||||||
@@ -18,20 +18,13 @@ docker run --rm -it docker.io/pierre42100/matrix_gateway --help
|
|||||||
|
|
||||||
## Setup dev environment
|
## Setup dev environment
|
||||||
```
|
```
|
||||||
mkdir -p storage/maspostgres storage/synapse storage/minio
|
mkdir -p storage/postgres storage/synapse storage/minio
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
To create default account, in another terminal, run the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker compose --profile create-accounts up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
URLs:
|
URLs:
|
||||||
* Element: http://localhost:8080/
|
* Element: http://localhost:8080/
|
||||||
* Synapse: http://localhost:8448/
|
* Synapse: http://localhost:8448/
|
||||||
* Matrix Authentication Service: http://localhost:8778/
|
|
||||||
* OpenID configuration: http://127.0.0.1:9001/dex/.well-known/openid-configuration
|
* OpenID configuration: http://127.0.0.1:9001/dex/.well-known/openid-configuration
|
||||||
* Minio console: http://localhost:9002/
|
* Minio console: http://localhost:9002/
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,15 @@
|
|||||||
services:
|
services:
|
||||||
mas:
|
|
||||||
image: ghcr.io/element-hq/matrix-authentication-service:main
|
|
||||||
user: "1000"
|
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
|
||||||
- masdb
|
|
||||||
volumes:
|
|
||||||
- ./docker/mas:/config:ro
|
|
||||||
command: server -c /config/config.yaml
|
|
||||||
ports:
|
|
||||||
- "8778:8778/tcp"
|
|
||||||
|
|
||||||
mas_create_admin1:
|
|
||||||
image: ghcr.io/element-hq/matrix-authentication-service:main
|
|
||||||
user: "1000"
|
|
||||||
restart: no
|
|
||||||
profiles: ["create-accounts"]
|
|
||||||
depends_on:
|
|
||||||
- mas
|
|
||||||
volumes:
|
|
||||||
- ./docker/mas:/config:ro
|
|
||||||
command: |
|
|
||||||
manage register-user -c /config/config.yaml -y --ignore-password-complexity
|
|
||||||
-p admin1 -e admin1@admin1.local --admin -d "Admin One" admin1
|
|
||||||
|
|
||||||
mas_create_user1:
|
|
||||||
image: ghcr.io/element-hq/matrix-authentication-service:main
|
|
||||||
user: "1000"
|
|
||||||
restart: no
|
|
||||||
profiles: ["create-accounts"]
|
|
||||||
depends_on:
|
|
||||||
- mas
|
|
||||||
volumes:
|
|
||||||
- ./docker/mas:/config:ro
|
|
||||||
command: |
|
|
||||||
manage register-user -c /config/config.yaml -y --ignore-password-complexity
|
|
||||||
-p user1 -e user1@user1.local -d "User One" user1
|
|
||||||
|
|
||||||
synapse:
|
synapse:
|
||||||
image: docker.io/matrixdotorg/synapse:latest
|
image: docker.io/matrixdotorg/synapse:latest
|
||||||
user: "1000"
|
user: "1000"
|
||||||
# Since synapse does not retry to connect to the database, restart upon
|
# Since synapse does not retry to connect to the database, restart upon
|
||||||
# failure
|
# failure
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
entrypoint: /bin/bash
|
||||||
|
command: >
|
||||||
|
-c "nohup bash -c 'sleep 10; /config/delayed_accounts_creation.sh' \&
|
||||||
|
./start.py"
|
||||||
|
|
||||||
# See the readme for a full documentation of the environment settings
|
# See the readme for a full documentation of the environment settings
|
||||||
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
|
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
|
||||||
environment:
|
environment:
|
||||||
@@ -55,25 +22,25 @@ services:
|
|||||||
# - ./files:/data
|
# - ./files:/data
|
||||||
# - /path/to/ssd:/data/uploads
|
# - /path/to/ssd:/data/uploads
|
||||||
# - /path/to/large_hdd:/data/media
|
# - /path/to/large_hdd:/data/media
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
# In order to expose Synapse, remove one of the following, you might for
|
# In order to expose Synapse, remove one of the following, you might for
|
||||||
# instance expose the TLS port directly:
|
# instance expose the TLS port directly:
|
||||||
ports:
|
ports:
|
||||||
- "8448:8448/tcp"
|
- 8448:8448/tcp
|
||||||
|
|
||||||
masdb:
|
db:
|
||||||
image: docker.io/postgres:18-alpine
|
image: docker.io/postgres:17-alpine
|
||||||
user: "1000"
|
user: "1000"
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB=masdb
|
- POSTGRES_USER=synapse
|
||||||
- POSTGRES_USER=masdb
|
|
||||||
- POSTGRES_PASSWORD=changeme
|
- POSTGRES_PASSWORD=changeme
|
||||||
# ensure the database gets created correctly
|
# ensure the database gets created correctly
|
||||||
# https://element-hq.github.io/synapse/latest/postgres.html#set-up-database
|
# https://element-hq.github.io/synapse/latest/postgres.html#set-up-database
|
||||||
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
|
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
|
||||||
- PGDATA=/data
|
|
||||||
volumes:
|
volumes:
|
||||||
# You may store the database tables in a local folder..
|
# You may store the database tables in a local folder..
|
||||||
- ./storage/maspostgres:/data
|
- ./storage/postgres:/var/lib/postgresql/data
|
||||||
# .. or store them on some high performance storage for better results
|
# .. or store them on some high performance storage for better results
|
||||||
# - /path/to/ssd/storage:/var/lib/postgresql/data
|
# - /path/to/ssd/storage:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
http:
|
|
||||||
listeners:
|
|
||||||
- name: web
|
|
||||||
resources:
|
|
||||||
- name: discovery
|
|
||||||
- name: human
|
|
||||||
- name: oauth
|
|
||||||
- name: compat
|
|
||||||
- name: graphql
|
|
||||||
- name: assets
|
|
||||||
binds:
|
|
||||||
- address: '[::]:8778'
|
|
||||||
proxy_protocol: false
|
|
||||||
- name: internal
|
|
||||||
resources:
|
|
||||||
- name: health
|
|
||||||
binds:
|
|
||||||
- host: localhost
|
|
||||||
port: 8081
|
|
||||||
proxy_protocol: false
|
|
||||||
trusted_proxies:
|
|
||||||
- 192.168.0.0/16
|
|
||||||
- 172.16.0.0/12
|
|
||||||
- 10.0.0.0/10
|
|
||||||
- 127.0.0.1/8
|
|
||||||
- fd00::/8
|
|
||||||
- ::1/128
|
|
||||||
public_base: http://localhost:8778/
|
|
||||||
issuer: http://localhost:8778/
|
|
||||||
database:
|
|
||||||
uri: postgresql://masdb:changeme@masdb/masdb
|
|
||||||
max_connections: 10
|
|
||||||
min_connections: 0
|
|
||||||
connect_timeout: 30
|
|
||||||
idle_timeout: 600
|
|
||||||
max_lifetime: 1800
|
|
||||||
email:
|
|
||||||
from: '"Authentication Service" <root@localhost>'
|
|
||||||
reply_to: '"Authentication Service" <root@localhost>'
|
|
||||||
transport: blackhole
|
|
||||||
secrets:
|
|
||||||
encryption: 12de9ad7bc2bacfa2ab9b1e3f7f1b3feb802195c8ebe66a8293cdb27f00be471
|
|
||||||
keys:
|
|
||||||
- kid: Bj2PICQ7mf
|
|
||||||
key: |
|
|
||||||
-----BEGIN RSA PRIVATE KEY-----
|
|
||||||
MIIEogIBAAKCAQEAsCYCrrCJA7IuGbTYzP5yZN74QszbzudBUCX6MyN/+36HO2r6
|
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vTPVPvjc6N0dT+y8Mf9bu+LcEt
|
|
||||||
+uZqPOZNbO5Vi+UgGeM9zZpxq/K7dpJmM/jNAoGBALsYHRGxKTsEwFEkZZCxaWIg
|
|
||||||
HpPL4e8hRwL6FC13BeitFBpHQDX27yi5yi+Lo1I4ngz3xk+bvERhYaDLhrkML0j4
|
|
||||||
KGQPfsTBI3vBO3UJA5Ua9XuwG19M7L0BvYPjfmfk2bUyGlM63w4zyMMUfD/3JA+w
|
|
||||||
ls1ZHTWxAZOh/sRdGirlAoGAX16B1+XgmDp6ZeAtlzaUGd5U1eKTxFF6U1SJ+VIB
|
|
||||||
+gYblHI84v+riB06cy6ULDnM0C+9neJAs24KXKZa0pV+Zk8O6yLrGN0kV2jYoL5+
|
|
||||||
kcFkDa13T3+TssxvLNz22LKyi9GUWYZjuQi/nMLPg/1t8k+Oj7/Iia822WkRzRvL
|
|
||||||
51kCgYEAwrN5Us8LR+fThm3C0vhvwv2wap6ccw0qq5+FTN+igAZAmmvKKvhow2Vi
|
|
||||||
LnPKBkc7QvxvQSNoXkdUo4qs3zOQ7DGvJLqSG9pwxFW5X1+78pNEm5OWe8AlT1uZ
|
|
||||||
Jz8Z1/Ae7fr/fFaucW9LkWjcuoPwPLiZ3b7ZQ6phs8qzoL+FpBI=
|
|
||||||
-----END RSA PRIVATE KEY-----
|
|
||||||
- kid: HcRvLHat12
|
|
||||||
key: |
|
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
|
||||||
MHcCAQEEIOCCFSnkfz1ksln6kus8enQstBTu0q62IGJVzuX0WiXPoAoGCCqGSM49
|
|
||||||
AwEHoUQDQgAEVWPLbvSdxquLAjU3zJLcCWdaxr6QK1tPVbV1IS+87QUMv/zKiCMa
|
|
||||||
fNpwgBXwU7dF0gY507R2yY9pcdTmRtnRug==
|
|
||||||
-----END EC PRIVATE KEY-----
|
|
||||||
- kid: YjMITk5VSn
|
|
||||||
key: |
|
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
|
||||||
MIGkAgEBBDCoPSjaN7qqnPz+vdzHeIy8RZCCtFOqLTkvylM1gz6xOGaVsS63VJw9
|
|
||||||
Td9BtpolZ0egBwYFK4EEACKhZANiAAT8tH88HYBHNiQTSqZzlxElSuSDC0+Xn0O9
|
|
||||||
ukj0xTTVBp8rUM9lCJQAlB8PjS2XK/n0YvYdzysQb3AYqszJa45/rOGvSar30YNE
|
|
||||||
gwpJvu36xNIKZT+nHalNwg069FdjNBc=
|
|
||||||
-----END EC PRIVATE KEY-----
|
|
||||||
- kid: NvFzzeMRU3
|
|
||||||
key: |
|
|
||||||
-----BEGIN EC PRIVATE KEY-----
|
|
||||||
MHQCAQEEILJEmFPDGFZoBVBQf1P6h4YfasYsFiu8a6FrFxiJvKXPoAcGBSuBBAAK
|
|
||||||
oUQDQgAE4NY5H3+D8r9GNOhrpbUn2dvLZIzi4A+SiwfqvtvPEmZkW+KDbd2tzKmx
|
|
||||||
maydZBn52QWedVY65snGAEoh9mV1TQ==
|
|
||||||
-----END EC PRIVATE KEY-----
|
|
||||||
passwords:
|
|
||||||
enabled: true
|
|
||||||
schemes:
|
|
||||||
- version: 1
|
|
||||||
algorithm: argon2id
|
|
||||||
minimum_complexity: 0
|
|
||||||
account:
|
|
||||||
password_registration_enabled: true
|
|
||||||
password_registration_email_required: false
|
|
||||||
matrix:
|
|
||||||
kind: synapse
|
|
||||||
homeserver: localhost
|
|
||||||
secret: IhKoLn6jWf1qRRZWvqgaKuIdwD6H0Mvx
|
|
||||||
endpoint: http://synapse:8448/
|
|
||||||
|
|
||||||
policy:
|
|
||||||
data:
|
|
||||||
client_registration:
|
|
||||||
allow_insecure_uris: true
|
|
||||||
2
docker/synapse/delayed_accounts_creation.sh
Executable file
2
docker/synapse/delayed_accounts_creation.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
register_new_matrix_user -a --user admin1 --password admin1 --config /config/homeserver.yaml;
|
||||||
|
register_new_matrix_user --no-admin --user user1 --password user1 --config /config/homeserver.yaml;
|
||||||
@@ -33,9 +33,3 @@ signing_key_path: "/config/localhost.signing.key"
|
|||||||
trusted_key_servers:
|
trusted_key_servers:
|
||||||
- server_name: "matrix.org"
|
- server_name: "matrix.org"
|
||||||
# vim:ft=yaml
|
# vim:ft=yaml
|
||||||
matrix_authentication_service:
|
|
||||||
enabled: true
|
|
||||||
endpoint: http://mas:8778/
|
|
||||||
secret: "IhKoLn6jWf1qRRZWvqgaKuIdwD6H0Mvx"
|
|
||||||
# Alternatively, using a file:
|
|
||||||
#secret_file: /path/to/secret.txt
|
|
||||||
|
|||||||
Reference in New Issue
Block a user