diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..23c5afb71 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,36 @@ +version: 2 +jobs: + dendrite: + docker: + # TODO: Change to a pre-made image with sytest installed + - image: matrixdotorg/sytest-synapse + working_directory: / + steps: + - checkout + + # Set up dendrite + - run: + name: Build Dendrite + command: go get github.com/constabulary/gb/... && gb build + - run: + name: Copy custom dendrite config + command: cp .circleci/dendrite-config.yaml dendrite.yaml + - run: + name: Generating self-signed server keys + command: | + test -f server.key || openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 3650 -nodes -subj /CN=localhost + test -f matrix_key.pem || ./bin/generate-keys -private-key matrix_key.pem + + - store_artifacts: + path: /logs + destination: logs + - store_test_results: + path: /logs +workflows: + version: 2 + build: + jobs: + - dendrite: + filters: + branches: + only: master \ No newline at end of file diff --git a/.circleci/dendrite-config.yaml b/.circleci/dendrite-config.yaml new file mode 100644 index 000000000..44946cb01 --- /dev/null +++ b/.circleci/dendrite-config.yaml @@ -0,0 +1,147 @@ +# The config file format version +# This is used by dendrite to tell if it understands the config format. +# This will change if the structure of the config file changes or if the meaning +# of an existing config key changes. +version: 0 + +# The matrix specific config +matrix: + # The name of the server. This is usually the domain name, e.g 'matrix.org', 'localhost'. + server_name: "localhost" + # The path to the PEM formatted matrix private key. + private_key: "matrix_key.pem" + # The x509 certificates used by the federation listeners for this server + federation_certificates: ["server.crt"] + # The list of identity servers trusted to verify third party identifiers by this server. + # Defaults to no trusted servers. + trusted_third_party_id_servers: + - vector.im + - matrix.org + - riot.im + +# The media repository config +media: + # The base path to where the media files will be stored. May be relative or absolute. + base_path: /var/dendrite/media + + # The maximum file size in bytes that is allowed to be stored on this server. + # Note: if max_file_size_bytes is set to 0, the size is unlimited. + # Note: if max_file_size_bytes is not set, it will default to 10485760 (10MB) + max_file_size_bytes: 10485760 + + # Whether to dynamically generate thumbnails on-the-fly if the requested resolution is not already generated + # NOTE: This is a possible denial-of-service attack vector - use at your own risk + dynamic_thumbnails: false + + # A list of thumbnail sizes to be pre-generated for downloaded remote / uploaded content + # method is one of crop or scale. If omitted, it will default to scale. + # crop scales to fill the requested dimensions and crops the excess. + # scale scales to fit the requested dimensions and one dimension may be smaller than requested. + thumbnail_sizes: + - width: 32 + height: 32 + method: crop + - width: 96 + height: 96 + method: crop + - width: 320 + height: 240 + method: scale + - width: 640 + height: 480 + method: scale + - width: 800 + height: 600 + method: scale + +# The config for the TURN server +turn: + # Whether or not guests can request TURN credentials + turn_allow_guests: true + # How long the authorization should last + turn_user_lifetime: "1h" + # The list of TURN URIs to pass to clients + turn_uris: [] + + # Authorization via Shared Secret + # The shared secret from coturn + turn_shared_secret: "" + + # Authorization via Static Username & Password + # Hardcoded Username and Password + turn_username: "" + turn_password: "" + +# The config for communicating with kafka +kafka: + # Where the kafka servers are running. + addresses: ["localhost:9092"] + # Whether to use naffka instead of kafka. + # Naffka can only be used when running dendrite as a single monolithic server. + # Kafka can be used both with a monolithic server and when running the + # components as separate servers. + # If enabled database.naffka must also be specified. + use_naffka: false + # The names of the kafka topics to use. + topics: + output_room_event: roomserverOutput + output_client_data: clientapiOutput + output_typing_event: typingServerOutput + user_updates: userUpdates + +# The postgres connection configs for connecting to the databases e.g a postgres:// URI +database: + account: "postgres://dendrite@localhost/dendrite_account?sslmode=disable" + device: "postgres://dendrite@localhost/dendrite_device?sslmode=disable" + media_api: "postgres://dendrite@localhost/dendrite_mediaapi?sslmode=disable" + sync_api: "postgres://dendrite@localhost/dendrite_syncapi?sslmode=disable" + room_server: "postgres://dendrite@localhost/dendrite_roomserver?sslmode=disable" + server_key: "postgres://dendrite@localhost/dendrite_serverkey?sslmode=disable" + federation_sender: "postgres://dendrite@localhost/dendrite_federationsender?sslmode=disable" + appservice: "postgres://dendrite@localhost/dendrite_appservice?sslmode=disable" + public_rooms_api: "postgres://dendrite@localhost/dendrite_publicroomsapi?sslmode=disable" + # If using naffka 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. +# These shouldn't be exposed to the public internet. +# These aren't needed when running dendrite as a monolithic server. +listen: + room_server: "localhost:7770" + client_api: "localhost:7771" + federation_api: "localhost:7772" + sync_api: "localhost:7773" + media_api: "localhost:7774" + public_rooms_api: "localhost:7775" + federation_sender: "localhost:7776" + appservice_api: "localhost:7777" + typing_server: "localhost:7778" + +# The configuration for tracing the dendrite components. +tracing: + # Config for the jaeger opentracing reporter. + # See https://godoc.org/github.com/uber/jaeger-client-go/config#Configuration + # for documentation. + jaeger: + disabled: true + +# A list of application service config files to use +application_services: + config_files: [] + +# The configuration for dendrite logs +logging: + # The logging type, only "file" is supported at the moment + - type: "file" + # The logging level, must be one of debug, info, warn, error, fatal, panic. + level: "info" + # Parameters for this type of log + params: + # File logging must be given a path to a directory. Each component will write to a different file. Logs are rotated each day and gzipped + path: "logs/dendrite.log" + # It is possible to have multiple logging hooks at the same time. + # To save only errors in a different directory, uncomment the following. + # - type: "file" + # level: "error" + # params: + # path: "/var/log/dendrite/errors" diff --git a/.circleci/sytest-database.yaml b/.circleci/sytest-database.yaml new file mode 100644 index 000000000..8a9b0ec6a --- /dev/null +++ b/.circleci/sytest-database.yaml @@ -0,0 +1,4 @@ +args: + database: dendrite + host: /var/run/postgresql +type: pg \ No newline at end of file diff --git a/docs/sytest.md b/docs/sytest.md new file mode 100644 index 000000000..a0f7d85c1 --- /dev/null +++ b/docs/sytest.md @@ -0,0 +1,8 @@ +# SyTest + +Dendrite uses [SyTest](https://github.com/matrix-org/sytest) for its +integration testing. When creating a new PR, add the test IDs that your PR +should allow to pass to `testfile` in dendrite's root directory. Not all PRs +need to make new tests pass. If we find your PR should be making a test pass we +may ask you to add to that file, as generally Dendrite's progress can be +tracked through the amount of SyTest tests it passes. diff --git a/testfile b/testfile new file mode 100644 index 000000000..e69de29bb