Skip to content

Commit

Permalink
Merge branch 'main' of github.com:matrix-org/dendrite into i2p-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Aug 3, 2024
2 parents b3c663f + c876790 commit 5d36ec5
Show file tree
Hide file tree
Showing 76 changed files with 2,270 additions and 380 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/dendrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
cache: true

- name: Install Node
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3

Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
- uses: actions/cache@v4
# manually set up caches, as they otherwise clash with different steps using setup-go with cache=true
with:
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
- uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
cache: true
- uses: actions/cache@v4
with:
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "stable"
go-version-file: 'go.mod'
cache: true
- uses: actions/cache@v4
with:
Expand Down
46 changes: 23 additions & 23 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 30m
timeout: 5m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1
Expand All @@ -18,24 +18,6 @@ run:
#build-tags:
# - mytag

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- bin
- docs

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*\\.md$"
- ".*\\.sh$"
- "^cmd/syncserver-integration-tests/testdata.go$"

# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
Expand All @@ -50,7 +32,8 @@ run:
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats:
- format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down Expand Up @@ -79,9 +62,8 @@ linters-settings:
# see https://github.com/kisielk/errcheck#excluding-functions for details
#exclude: /path/to/file.txt
govet:
# report about shadowed variables
check-shadowing: true

enable:
- shadow
# settings per analyzer
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
Expand Down Expand Up @@ -217,6 +199,24 @@ linters:


issues:
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
exclude-files:
- ".*\\.md$"
- ".*\\.sh$"
- "^cmd/syncserver-integration-tests/testdata.go$"

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
exclude-dirs:
- bin
- docs

# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
Expand Down
23 changes: 23 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## Dendrite 0.xx.x

### Other

- Bump required Go version to 1.21

## Dendrite 0.13.7 (2024-04-09)

### Fixes

- Fixed an issue where the displayname/avatar of an invited user was replaced with the inviter's details
- Improved server startup performance by avoiding unnecessary room ACL queries
- This change reduces memory footprint as it caches ACL regex patterns once instead of for each room
- Unnecessary Relay related queries have been removed. **Note**: To use relays, you now need to explicitly enable them using the `federation_api.enable_relays` config
- Fixed space summaries over federation
- Improved usage of external NATS JetStream by reusing existing connections instead of opening new ones unnecessarily

### Features

- Modernized Appservices (contributed by [tulir](https://github.com/tulir))
- Added event reporting with Synapse Admin endpoints for querying them
- Updated dependencies

## Dendrite 0.13.6 (2024-01-26)

Upgrading to this version is **highly** recommended, as it contains several QoL improvements.
Expand Down
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing to Dendrite

Thank you for taking the time to contribute to Matrix!

This is the repository for Dendrite, a second-generation Matrix homeserver written in Go.

## Sign off

We ask that everybody who contributes to this project signs off their contributions, as explained below.

We follow a simple 'inbound=outbound' model for contributions: the act of submitting an 'inbound' contribution means that the contributor agrees to license their contribution under the same terms as the project's overall 'outbound' license - in our case, this is Apache Software License v2 (see [LICENSE](./LICENSE)).

In order to have a concrete record that your contribution is intentional and you agree to license it under the same terms as the project's license, we've adopted the same lightweight approach used by the [Linux Kernel](https://www.kernel.org/doc/html/latest/process/submitting-patches.html), [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), and many other projects: the [Developer Certificate of Origin](https://developercertificate.org/) (DCO). This is a simple declaration that you wrote the contribution or otherwise have the right to contribute it to Matrix:

```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

If you agree to this for your contribution, then all that's needed is to include the line in your commit or pull request comment:

```
Signed-off-by: Your Name <your@email.example.org>
```

Git allows you to add this signoff automatically when using the `-s` flag to `git commit`, which uses the name and email set in your `user.name` and `user.email` git configs.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#
# base installs required dependencies and runs go mod download to cache dependencies
#
# Pinned to alpine3.18 until https://github.com/mattn/go-sqlite3/issues/1164 is solved
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.21-alpine3.18 AS base
FROM --platform=${BUILDPLATFORM} docker.io/golang:1.22-alpine AS base
RUN apk --update --no-cache add bash build-base curl git

#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you have further questions, please take a look at [our FAQ](docs/FAQ.md) or j
See the [Planning your Installation](https://matrix-org.github.io/dendrite/installation/planning) page for
more information on requirements.

To build Dendrite, you will need Go 1.20 or later.
To build Dendrite, you will need Go 1.21 or later.

For a usable federating Dendrite deployment, you will also need:

Expand Down
3 changes: 1 addition & 2 deletions build/docker/Dockerfile.demo-pinecone
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Pinned to alpine3.18 until https://github.com/mattn/go-sqlite3/issues/1164 is solved
FROM docker.io/golang:1.21-alpine3.18 AS base
FROM docker.io/golang:1.22 AS base

#
# Needs to be separate from the main Dockerfile for OpenShift,
Expand Down
3 changes: 1 addition & 2 deletions build/docker/Dockerfile.demo-yggdrasil
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Pinned to alpine3.18 until https://github.com/mattn/go-sqlite3/issues/1164 is solved
FROM docker.io/golang:1.21-alpine3.18 AS base
FROM docker.io/golang:1.22 AS base

#
# Needs to be separate from the main Dockerfile for OpenShift,
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/Complement.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#syntax=docker/dockerfile:1.2

FROM golang:1.20-bullseye as build
FROM golang:1.22-bookworm as build
RUN apt-get update && apt-get install -y sqlite3
WORKDIR /build

Expand Down
2 changes: 1 addition & 1 deletion build/scripts/ComplementLocal.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# Use these mounts to make use of this dockerfile:
# COMPLEMENT_HOST_MOUNTS='/your/local/dendrite:/dendrite:ro;/your/go/path:/go:ro'
FROM golang:1.18-stretch
FROM golang:1.22-bookworm
RUN apt-get update && apt-get install -y sqlite3

ENV SERVER_NAME=localhost
Expand Down
12 changes: 6 additions & 6 deletions build/scripts/ComplementPostgres.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#syntax=docker/dockerfile:1.2

FROM golang:1.20-bullseye as build
FROM golang:1.22-bookworm as build
RUN apt-get update && apt-get install -y postgresql
WORKDIR /build

# No password when connecting over localhost
RUN sed -i "s%127.0.0.1/32 md5%127.0.0.1/32 trust%g" /etc/postgresql/13/main/pg_hba.conf && \
# No password when connecting to Postgres
RUN sed -i "s%peer%trust%g" /etc/postgresql/15/main/pg_hba.conf && \
# Bump up max conns for moar concurrency
sed -i 's/max_connections = 100/max_connections = 2000/g' /etc/postgresql/13/main/postgresql.conf
sed -i 's/max_connections = 100/max_connections = 2000/g' /etc/postgresql/15/main/postgresql.conf

# This entry script starts postgres, waits for it to be up then starts dendrite
RUN echo '\
#!/bin/bash -eu \n\
pg_lsclusters \n\
pg_ctlcluster 13 main start \n\
pg_ctlcluster 15 main start \n\
\n\
until pg_isready \n\
do \n\
Expand Down Expand Up @@ -50,7 +50,7 @@ EXPOSE 8008 8448
# At runtime, generate TLS cert based on the CA now mounted at /ca
# At runtime, replace the SERVER_NAME with what we are told
CMD /build/run_postgres.sh && ./generate-keys --keysize 1024 --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key && \
./generate-config -server $SERVER_NAME --ci --db postgresql://postgres@localhost/postgres?sslmode=disable > dendrite.yaml && \
./generate-config -server $SERVER_NAME --ci --db "user=postgres database=postgres host=/var/run/postgresql/" > dendrite.yaml && \
# Bump max_open_conns up here in the global database config
sed -i 's/max_open_conns:.*$/max_open_conns: 1990/g' dendrite.yaml && \
cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \
Expand Down
Loading

0 comments on commit 5d36ec5

Please sign in to comment.