From 72444e4a4f31b70dfb7ddd875ef874f637699dce Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 19 Jun 2020 09:37:19 +0100 Subject: [PATCH] User API polylith component (#1151) * User API polylith component * Add docker-pull.sh --- build/docker/config/dendrite-config.yaml | 1 + build/docker/docker-compose.polylith.yml | 11 +++++++++++ build/docker/images-build.sh | 1 + build/docker/images-pull.sh | 16 ++++++++++++++++ build/docker/images-push.sh | 1 + dendrite-config.yaml | 6 ++++-- docs/INSTALL.md | 10 ++++++++++ internal/config/config.go | 1 + 8 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 build/docker/images-pull.sh diff --git a/build/docker/config/dendrite-config.yaml b/build/docker/config/dendrite-config.yaml index 26dc272ab..f421b2e71 100644 --- a/build/docker/config/dendrite-config.yaml +++ b/build/docker/config/dendrite-config.yaml @@ -117,6 +117,7 @@ listen: federation_sender: "federation_sender:7776" edu_server: "edu_server:7777" key_server: "key_server:7779" + user_api: "user_api:7780" # The configuration for tracing the dendrite components. tracing: diff --git a/build/docker/docker-compose.polylith.yml b/build/docker/docker-compose.polylith.yml index 178604093..af2ae4e81 100644 --- a/build/docker/docker-compose.polylith.yml +++ b/build/docker/docker-compose.polylith.yml @@ -152,6 +152,17 @@ services: networks: - internal + user_api: + hostname: user_api + image: matrixdotorg/dendrite:userapi + command: [ + "--config=dendrite.yaml" + ] + volumes: + - ./config:/etc/dendrite + networks: + - internal + networks: internal: attachable: true diff --git a/build/docker/images-build.sh b/build/docker/images-build.sh index 6bc058962..e43d2d040 100755 --- a/build/docker/images-build.sh +++ b/build/docker/images-build.sh @@ -18,3 +18,4 @@ docker build -t matrixdotorg/dendrite:publicroomsapi --build-arg component=de docker build -t matrixdotorg/dendrite:roomserver --build-arg component=dendrite-room-server -f build/docker/Dockerfile.component . docker build -t matrixdotorg/dendrite:syncapi --build-arg component=dendrite-sync-api-server -f build/docker/Dockerfile.component . docker build -t matrixdotorg/dendrite:serverkeyapi --build-arg component=dendrite-server-key-api-server -f build/docker/Dockerfile.component . +docker build -t matrixdotorg/dendrite:userapi --build-arg component=dendrite-user-api-server -f build/docker/Dockerfile.component . diff --git a/build/docker/images-pull.sh b/build/docker/images-pull.sh new file mode 100755 index 000000000..edccf4a33 --- /dev/null +++ b/build/docker/images-pull.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +docker pull matrixdotorg/dendrite:monolith + +docker pull matrixdotorg/dendrite:clientapi +docker pull matrixdotorg/dendrite:clientproxy +docker pull matrixdotorg/dendrite:eduserver +docker pull matrixdotorg/dendrite:federationapi +docker pull matrixdotorg/dendrite:federationsender +docker pull matrixdotorg/dendrite:federationproxy +docker pull matrixdotorg/dendrite:keyserver +docker pull matrixdotorg/dendrite:mediaapi +docker pull matrixdotorg/dendrite:publicroomsapi +docker pull matrixdotorg/dendrite:roomserver +docker pull matrixdotorg/dendrite:syncapi +docker pull matrixdotorg/dendrite:userapi diff --git a/build/docker/images-push.sh b/build/docker/images-push.sh index b39d98d65..2b4303872 100755 --- a/build/docker/images-push.sh +++ b/build/docker/images-push.sh @@ -13,3 +13,4 @@ docker push matrixdotorg/dendrite:mediaapi docker push matrixdotorg/dendrite:publicroomsapi docker push matrixdotorg/dendrite:roomserver docker push matrixdotorg/dendrite:syncapi +docker push matrixdotorg/dendrite:userapi diff --git a/dendrite-config.yaml b/dendrite-config.yaml index 52793cda4..73bfec247 100644 --- a/dendrite-config.yaml +++ b/dendrite-config.yaml @@ -108,7 +108,9 @@ kafka: output_send_to_device_event: eduServerSendToDeviceOutput user_updates: userUpdates -# The postgres connection configs for connecting to the databases e.g a postgres:// URI +# The postgres connection configs for connecting to the databases, e.g. +# for Postgres: postgres://username:password@hostname/database +# for SQLite: file:filename.db or file:///path/to/filename.db database: account: "postgres://dendrite:itsasecret@localhost/dendrite_account?sslmode=disable" device: "postgres://dendrite:itsasecret@localhost/dendrite_device?sslmode=disable" @@ -122,7 +124,7 @@ database: max_open_conns: 100 max_idle_conns: 2 conn_max_lifetime: -1 - # If using naffka you need to specify a naffka database + # If 'use_naffka: true' set above then you need to specify a naffka database # naffka: "postgres://dendrite:itsasecret@localhost/dendrite_naffka?sslmode=disable" # The TCP host:port pairs to bind the internal HTTP APIs to. diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 184b777d8..b4c81a42b 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -329,3 +329,13 @@ finished). ```bash ./bin/dendrite-key-server --config dendrite.yaml ``` + +### User server + +This manages user accounts, device access tokens and user account data, +amongst other things. + +```bash +./bin/dendrite-user-api-server --config dendrite.yaml +``` + diff --git a/internal/config/config.go b/internal/config/config.go index 2bd56ad9e..baa82be23 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -226,6 +226,7 @@ type Dendrite struct { ServerKeyAPI Address `yaml:"server_key_api"` AppServiceAPI Address `yaml:"appservice_api"` SyncAPI Address `yaml:"sync_api"` + UserAPI Address `yaml:"user_api"` RoomServer Address `yaml:"room_server"` FederationSender Address `yaml:"federation_sender"` PublicRoomsAPI Address `yaml:"public_rooms_api"`