Skip to content

Commit fdb7d3f

Browse files
authored
Merge branch 'main' into main
2 parents 280bc61 + 58a4c6f commit fdb7d3f

27 files changed

+3607
-329
lines changed

.github/workflows/docker.yml

+15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ jobs:
2121
contents: read
2222
packages: write
2323
security-events: write # To upload Trivy sarif files
24+
id-token: write # needed for signing the images with GitHub OIDC Token
2425
steps:
26+
- name: Install Cosign
27+
uses: sigstore/[email protected]
2528
- name: Checkout
2629
uses: actions/checkout@v3
2730
- name: Set up QEMU
@@ -62,6 +65,18 @@ jobs:
6265
ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:latest
6366
ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:${{ github.ref_name }}
6467
68+
- name: Sign the images with GitHub OIDC Token
69+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
70+
env:
71+
DIGEST: ${{ steps.docker_build_sliding_sync_release.outputs.digest }}
72+
TAGS: ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:${{ github.ref_name }}
73+
run: |
74+
images=""
75+
for tag in ${TAGS}; do
76+
images+="${tag}@${DIGEST} "
77+
done
78+
cosign sign --yes ${images}
79+
6580
- name: Run Trivy vulnerability scanner
6681
uses: aquasecurity/trivy-action@master
6782
with:

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ location /.well-known/matrix/client {
8383
```
8484

8585
### Running
86-
There are two ways to run the proxy:
86+
There are three ways to run the proxy:
8787
- Compiling from source:
8888
```
8989
$ CGO_ENABLED=0 go build ./cmd/syncv3
@@ -95,6 +95,12 @@ $ SYNCV3_SECRET=$(cat .secret) SYNCV3_SERVER="https://matrix-client.matrix.org"
9595
docker run --rm -e "SYNCV3_SERVER=https://matrix-client.matrix.org" -e "SYNCV3_SECRET=$(cat .secret)" -e "SYNCV3_BINDADDR=:8008" -e "SYNCV3_DB=user=$(whoami) dbname=syncv3 sslmode=disable host=host.docker.internal password='DATABASE_PASSWORD_HERE'" -p 8008:8008 ghcr.io/matrix-org/sliding-sync:latest
9696
```
9797

98+
- Precompiled binaries:
99+
100+
Download the binary for your architcture (eg. `syncv3_linux_amd64` for 64-bit AMD/Intel) from https://github.com/matrix-org/sliding-sync/releases/latest
101+
```
102+
$ SYNCV3_SECRET=$(cat .secret) SYNCV3_SERVER="https://matrix-client.matrix.org" SYNCV3_DB="user=$(whoami) dbname=syncv3 sslmode=disable password='DATABASE_PASSWORD_HERE'" SYNCV3_BINDADDR=0.0.0.0:8008 ./syncv3_linux_amd64
103+
```
98104

99105
Optionally also set `SYNCV3_TLS_CERT=path/to/cert.pem` and `SYNCV3_TLS_KEY=path/to/key.pem` to listen on HTTPS instead of HTTP.
100106
Make sure to tweak the `SYNCV3_DB` environment variable if the Postgres database isn't running on the host.

cmd/syncv3/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
var GitCommit string
2929

30-
const version = "0.99.15"
30+
const version = "0.99.18"
3131

3232
var (
3333
flags = flag.NewFlagSet("goose", flag.ExitOnError)
@@ -241,6 +241,7 @@ func main() {
241241
})
242242

243243
go h2.StartV2Pollers()
244+
go h2.Store.Cleaner(time.Hour)
244245
if args[EnvOTLP] != "" {
245246
h3 = otelhttp.NewHandler(h3, "Sync")
246247
}

grafana/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Using the Sliding Sync Grafana dashboard
2+
3+
**Set up Prometheus and Grafana.** Out of scope for this readme. Useful documentation about using Grafana with Prometheus: http://docs.grafana.org/features/datasources/prometheus/
4+
5+
**Configure the bind address** for prometheus metrics in sliding sync. For example: `SYNCV3_PROM=:2112`. Metrics will be accessible at `/metrics` at this address.
6+
7+
**Configure a new job in Prometheus** to scrape the sliding sync endpoint.
8+
9+
For example by adding the following job to `prometheus.yml`, if your sliding sync is running locally not in docker and you have `SYNCV3_PROM` configured to port 2112:
10+
11+
```
12+
# Sliding Sync
13+
- job_name: "Sliding Sync"
14+
static_configs:
15+
- targets: ["localhost:2112"]
16+
```
17+
18+
**Import the sliding sync dashboard into Grafana.** Download `sliding-sync.json`. Import it to Grafana and select the correct Prometheus datasource. http://docs.grafana.org/reference/export_import/

0 commit comments

Comments
 (0)