Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2ad4204
FS-1467: Make conversation metadata APIs fault tolerant to federation…
lepsa May 9, 2023
a89af51
Fix: `/i/user/meta-info` (stern) (#3281)
battermann May 10, 2023
3054eca
Handle race conditions in /integration (#3278)
fisx May 11, 2023
b4e2bfd
Update docs.wire.com (#3284)
fisx May 11, 2023
bba86a4
Restore deleted scripts (#3287)
smatting May 11, 2023
2fd31da
Port MLS test framework to new integration suite (#3288)
pcapriotti May 11, 2023
0b1e04c
Complete FUTUREWORK: remove import dependency (#3291)
smatting May 11, 2023
b3224a8
Small improvements to the new integration suite (#3293)
pcapriotti May 15, 2023
4203f0c
Add parametrised tests (#3296)
pcapriotti May 15, 2023
0bd9c3c
Fix problems in cabal-run-integration and Makefile
smatting May 16, 2023
fea6b89
Remove INTEGRATION_FEDERATION_TESTS variable (#3300)
smatting May 17, 2023
69499df
fix: Flaky DPoP access token test (#3302)
battermann May 17, 2023
fbdfeff
Implement test listing (#3301)
pcapriotti May 17, 2023
59a61f8
[FS-1148] Better resilience to unreachable backends (#3282)
May 17, 2023
4568341
Register and Update OAuth client via Stern/Backoffice (#3305)
battermann May 22, 2023
34970d3
Use `Domain` type everywhere. (#3307)
pcapriotti May 23, 2023
f657ae3
Use feature singletons in TeamFeatureStore (#3308)
pcapriotti May 23, 2023
08d0ae8
coturn: Add federation and DTLS support to Helm chart (#3283)
supersven May 23, 2023
b0d97ec
fix: link to correct privacy whitepaper (#3311)
comawill May 23, 2023
a705a85
Split Feature module to prevent import cycles (#3310)
pcapriotti May 24, 2023
7b37e4e
Start sending backend notifications through RabbitMQ (#3276)
elland May 24, 2023
2c4a3ce
brig: Make RabbitMQ config optional (#3314)
akshaymankar May 25, 2023
c3e38b2
dev-setup: Use seperate AWS things for each backend instance (#3315)
akshaymankar May 25, 2023
f978c63
Merge branch 'develop' into mls-olaf
akshaymankar May 25, 2023
cef6b95
Merge branch 'develop' into mls-olaf
smatting May 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ path_add "PYTHONPATH" "./hack/python"
# Locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# RabbitMQ
export RABBITMQ_USERNAME=guest
export RABBITMQ_PASSWORD=alpaca-grapefruit
20 changes: 2 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ endif
ci: c db-migrate
ifeq ("$(package)", "all")
ifneq ("$(suite)", "new")
echo ./hack/bin/cabal-run-integration.sh all
./hack/bin/cabal-run-integration.sh all
endif
ifneq ("$(suite)", "old")
make c package=integration
echo ./hack/bin/cabal-run-integration.sh integration
./hack/bin/cabal-run-integration.sh integration
endif
else
ifeq ("$(package)", "integration")
Expand Down Expand Up @@ -306,17 +306,13 @@ ifeq ($(package), all)
./dist/galley-schema --keyspace galley_test --replication-factor 1 --reset
./dist/gundeck-schema --keyspace gundeck_test --replication-factor 1 --reset
./dist/spar-schema --keyspace spar_test --replication-factor 1 --reset
ifeq ($(INTEGRATION_FEDERATION_TESTS), 1)
./dist/brig-schema --keyspace brig_test2 --replication-factor 1 --reset
./dist/galley-schema --keyspace galley_test2 --replication-factor 1 --reset
./dist/gundeck-schema --keyspace gundeck_test2 --replication-factor 1 --reset
./dist/spar-schema --keyspace spar_test2 --replication-factor 1 --reset
endif
else
$(EXE_SCHEMA) --keyspace $(package)_test --replication-factor 1 --reset
ifeq ($(INTEGRATION_FEDERATION_TESTS), 1)
$(EXE_SCHEMA) --keyspace $(package)_test2 --replication-factor 1 --reset
endif
endif
./dist/brig-index reset --elasticsearch-index-prefix directory --elasticsearch-server http://localhost:9200 > /dev/null
./dist/brig-index reset --elasticsearch-index-prefix directory2 --elasticsearch-server http://localhost:9200 > /dev/null
Expand All @@ -334,12 +330,10 @@ db-migrate: c
./dist/galley-schema --keyspace galley_test --replication-factor 1 > /dev/null
./dist/gundeck-schema --keyspace gundeck_test --replication-factor 1 > /dev/null
./dist/spar-schema --keyspace spar_test --replication-factor 1 > /dev/null
ifeq ($(INTEGRATION_FEDERATION_TESTS), 1)
./dist/brig-schema --keyspace brig_test2 --replication-factor 1 > /dev/null
./dist/galley-schema --keyspace galley_test2 --replication-factor 1 > /dev/null
./dist/gundeck-schema --keyspace gundeck_test2 --replication-factor 1 > /dev/null
./dist/spar-schema --keyspace spar_test2 --replication-factor 1 > /dev/null
endif
./dist/brig-index reset --elasticsearch-index-prefix directory --elasticsearch-server http://localhost:9200 > /dev/null
./dist/brig-index reset --elasticsearch-index-prefix directory2 --elasticsearch-server http://localhost:9200 > /dev/null

Expand Down Expand Up @@ -402,16 +396,6 @@ kube-integration-teardown:
kube-integration-e2e-telepresence:
./services/brig/federation-tests.sh $(NAMESPACE)

.PHONY: kube-integration-setup-sans-federation
kube-integration-setup-sans-federation: guard-tag charts-integration
# by default "test-<your computer username> is used as namespace
# you can override the default by setting the NAMESPACE environment variable
export NAMESPACE=$(NAMESPACE); ./hack/bin/integration-setup.sh

.PHONY: kube-integration-teardown-sans-federation
kube-integration-teardown-sans-federation:
export NAMESPACE=$(NAMESPACE); ./hack/bin/integration-teardown.sh

.PHONY: kube-restart-%
kube-restart-%:
kubectl delete pod -n $(NAMESPACE) -l app=$(*)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ will, eventually, have built a range of docker images. Make sure to [give Docker

See the `Makefile`s and `Dockerfile`s, as well as [build/ubuntu/README.md](build/ubuntu/README.md) for details.

#### 2. Use nix-provided build environment
#### 2. Use nix-provided build environment

This is suitable only for local development and testing. See [build instructions](./docs/src/developer/developer/building.md) in the developer documentation.

Expand Down
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ packages:
, libs/wire-api-federation/
, libs/wire-message-proto-lens/
, libs/zauth/
, services/background-worker/
, services/brig/
, services/cannon/
, services/cargohold/
Expand Down Expand Up @@ -66,6 +67,8 @@ package assets
ghc-options: -Werror
package auto-whitelist
ghc-options: -Werror
package background-worker
ghc-options: -Werror
package bilge
ghc-options: -Werror
package billing-team-member-backfill
Expand Down
38 changes: 38 additions & 0 deletions changelog.d/0-release-notes/background-worker
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
This release introduces a new component: background-worker. This is currently
only used to forward notifications to federated backends. Enabling federation in
the wire-server helm chart automatically installs this component.

When federation is enabled, wire-server will require running RabbitMQ. The helm
chart in `rabbitmq` can be used to install RabbitMQ. Please refer to the
documentation at https://docs.wire.com to install RabbitMQ in Kubernetes. These
new configurations are required:

```yaml
brig:
config:
rabbitmq:
host: rabbitmq
port: 5672
vHost: /
secrets:
rabbitmq:
username: <YOUR_USERNAME>
password: <YOUR_PASSWORD>
background-worker:
config:
rabbitmq:
host: rabbitmq
port: 5672
vHost: /
remoteDomains: []
secrets:
rabbitmq:
username: <YOUR_USERNAME>
password: <YOUR_PASSWORD>
```

The above are the default values (except for secrets, which do not have
defaults), if they work they are not required to be configured.
`background-worker.config.remoteDomains` should contain all the remote domains
with which the wire-server instance allows federating. This change is
incompatible with open-federation.
1 change: 1 addition & 0 deletions changelog.d/1-api-changes/FS-1467
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updating conversation meta-data APIs to be fault tolerant of unavailable federation servers.
1 change: 1 addition & 0 deletions changelog.d/2-features/coturn-federation-dtls-helm-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add federation options to the `coturn` Helm chart including DTLS support. The options themselves are strongly inspired by the `restund` Helm chart.
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/pr-3281
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed `/i/user/meta-info` in backoffice/stern
2 changes: 2 additions & 0 deletions changelog.d/5-internal/feature-singletons
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Use feature singletons in TeamFeatureStore

4 changes: 4 additions & 0 deletions changelog.d/5-internal/integration-qol
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Add convenience getJSON and getBody functions
- baseRequest now adds Z headers automatically
- Add liftIO versions of putStrLn etc
- Add Show instances for MLSState
1 change: 1 addition & 0 deletions changelog.d/5-internal/list-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement test listing
1 change: 1 addition & 0 deletions changelog.d/5-internal/mls-integration
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port MLS test framework to new integration suite
1 change: 1 addition & 0 deletions changelog.d/5-internal/pr-3305
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Register/Update OAuth client via backoffice/stern
1 change: 1 addition & 0 deletions changelog.d/5-internal/ptests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add parametrised tests
1 change: 1 addition & 0 deletions changelog.d/6-federation/failed-to-process
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Several federation Galley endpoints have a breaking change in their response types: "leave-conversation", "update-conversation" and "send-mls-message". They have been extended with information related to unreachable users.
9 changes: 4 additions & 5 deletions charts/background-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
# TODO(elland): Review this
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: {{ .Values.replicaCount }}
# Ensures only one version of the background worker is running at any given
# moment. This means small downtime, but the background workers should be
# able to catch up.
type: Recreate
selector:
matchLabels:
app: background-worker
Expand Down
3 changes: 1 addition & 2 deletions charts/background-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ resources:
cpu: "100m"
limits:
memory: "512Mi"
# TODO(elland): Create issue for a metrics endpoint
# FUTUREWORK: Implement metrics
# metrics:
# serviceMonitor:
# enabled: false
config:
# TODO(elland): Proper logging
logLevel: Info
logFormat: StructuredJSON
rabbitmq:
Expand Down
4 changes: 0 additions & 4 deletions charts/brig/templates/tests/brig-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ spec:
value: "dummy"
- name: AWS_REGION
value: "eu-west-1"
{{- if .Values.tests.enableFederationTests }}
- name: INTEGRATION_FEDERATION_TESTS
value: "1"
{{- end }}
{{- if .Values.config.enableFederation }}
- name: RABBITMQ_USERNAME
value: "guest"
Expand Down
2 changes: 0 additions & 2 deletions charts/brig/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ turn:
# baseDomain: turn.example.com # Must be configured if serversSource is dns
discoveryIntervalSeconds: 10 # Used only if serversSource is dns

tests:
enableFederationTests: false
serviceAccount:
# When setting this to 'false', either make sure that a service account named
# 'brig' exists or change the 'name' field to 'default'
Expand Down
2 changes: 1 addition & 1 deletion charts/coturn/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ version: 0.0.42
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.6.2-wireapp.2
appVersion: 4.6.2-federation-wireapp.10
45 changes: 45 additions & 0 deletions charts/coturn/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- define "coturn.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "coturn.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "coturn.labels" -}}
helm.sh/chart: {{ include "coturn.chart" . }}
{{ include "coturn.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "coturn.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{- define "coturn.selectorLabels" -}}
app.kubernetes.io/name: {{ include "coturn.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
25 changes: 24 additions & 1 deletion charts/coturn/templates/configmap-coturn-conf-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ data:
no-tls
{{- end }}

# This is mandatory for federated DTLS
CA-file=/etc/ssl/certs/ca-certificates.crt

## don't turn on coturn's cli.
no-cli

## turn, stun.
listening-ip=__COTURN_EXT_IP__
listening-port={{ .Values.coturnTurnListenPort }}
max-allocate-lifetime=3600
relay-ip=__COTURN_EXT_IP__
realm=dummy.io
no-stun-backward-compatibility
Expand Down Expand Up @@ -82,3 +84,24 @@ data:
zrest
## static authentication secrets will be added below this line when the
## runtime configuration is generated.

{{- if .Values.federate.enabled }}
### federation setup
federation-listening-ip=__COTURN_EXT_IP__
federation-listening-port={{ .Values.federate.port }}
federation-no-dtls={{ not .Values.federate.dtls.enabled }}
{{- if .Values.federate.dtls.enabled }}
federation-cert=/coturn-dtls-certificate/tls.crt
federation-pkey=/coturn-dtls-certificate/tls.key
{{ if hasKey .Values.federate.dtls.tls "privateKeyPassword" }}
federation-pkey-pwd={{ .Values.federate.dtls.tls.privateKeyPassword }}
{{ end }}
# list of host/ip/cert common names / subject alt names, and optional issuer
# names to accept DTLS connections from. There can be multiple entries, each
# entry is formated as:
# <hostname>[,<issuer>]
{{ range $entry := .Values.federate.dtls.remoteWhitelist }}
federation-remote-whitelist={{ $entry.host }}{{ if hasKey $entry "issuer" }},{{ $entry.issuer }}{{end}}
{{ end }}
{{ end }}
{{ end }}
41 changes: 41 additions & 0 deletions charts/coturn/templates/secret-or-certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.federate.dtls.enabled -}}

{{- if .Values.federate.dtls.tls.issuerRef -}}
{{- if or .Values.federate.dtls.tls.key .Values.federate.dtls.tls.crt }}
{{- fail "issuerRef and {crt,key} are mutually exclusive" -}}
{{- end -}}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: "{{ include "coturn.fullname" . }}"
labels:
{{- include "coturn.labels" . | nindent 4 }}
{{- if .Values.federate.dtls.tls.certificate.labels }}
{{- toYaml .Values.federate.dtls.tls.certificate.labels | nindent 4}}
{{- end }}
spec:
dnsNames:
{{- toYaml .Values.federate.dtls.tls.certificate.dnsNames | nindent 4 }}
secretName: coturn-dtls-certificate
issuerRef:
{{- toYaml .Values.federate.dtls.tls.issuerRef | nindent 4 }}
privateKey:
rotationPolicy: Always
algorithm: ECDSA
size: 384
{{- else if and .Values.federate.dtls.tls.key .Values.federate.dtls.tls.crt }}
apiVersion: v1
kind: Secret
metadata:
name: coturn-dtls-certificate
labels:
{{- include "coturn.labels" . | nindent 4 }}
type: Opaque
data:
tls.key: {{ .Values.federate.dtls.tls.key | b64enc }}
tls.crt: {{ .Values.federate.dtls.tls.crt | b64enc }}
{{- else -}}
{{- fail "must specify tls.key and tls.crt , or tls.issuerRef" -}}
{{- end -}}

{{- end -}}
10 changes: 10 additions & 0 deletions charts/coturn/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
secret:
secretName: {{ .Values.tls.secretRef }}
{{- end }}
{{- if .Values.federate.dtls.enabled }}
- name: coturn-dtls-certificate
secret:
secretName: coturn-dtls-certificate
{{- end }}
initContainers:
- name: get-external-ip
image: bitnami/kubectl:1.24.12
Expand Down Expand Up @@ -116,6 +121,11 @@ spec:
mountPath: /secrets-tls/
readOnly: true
{{- end }}
{{- if .Values.federate.dtls.enabled }}
- name: coturn-dtls-certificate
mountPath: /coturn-dtls-certificate/
readOnly: true
{{- end }}
command:
- /bin/sh
- -c
Expand Down
Loading