This commit is contained in:
Kegan Dougal 2022-04-01 13:44:09 +01:00
parent 10495dffba
commit 06b02df0cc
3 changed files with 11 additions and 10 deletions

View File

@ -3,19 +3,16 @@ FROM docker.io/golang:1.17-alpine AS base
WORKDIR /build
COPY . /build
RUN apk --update --no-cache add bash build-base
RUN mkdir -p bin
RUN go build -trimpath -o bin/ ./cmd/syncv3
RUN apk --update --no-cache add bash build-base git && mkdir -p bin
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
go build -ldflags "-X main.GitCommit=$GIT_COMMIT" -trimpath -o bin/ ./cmd/syncv3
FROM alpine:latest
COPY --from=base /build/bin/* /usr/bin/
COPY client /usr/bin/client
ENV SYNCV3_BINDADDR="0.0.0.0:8008"
EXPOSE 8008
WORKDIR /usr/bin
RUN ls -l client
ENTRYPOINT /usr/bin/syncv3 -server "${SYNCV3_SERVER}" -db "${SYNCV3_DB}" -port "${SYNCV3_BINDADDR}"

View File

@ -18,9 +18,11 @@ $ ./syncv3 -server "https://matrix-client.matrix.org" -db "user=$(whoami) dbname
Then visit http://localhost:8008/client/ (with trailing slash) and paste in the `access_token` for any account on `-server`.
When you hit the Sync button nothing will happen initially, but you should see:
```
INF Poller: v2 poll loop started ip=::1 since= user_id=@kegan:matrix.org
```
Wait for the first initial v2 sync to be processed (this can take minutes!) and then v3 APIs will be responsive.
### How can I help?
@ -28,7 +30,3 @@ Wait for the first initial v2 sync to be processed (this can take minutes!) and
At present, the best way to help would be to run a local v3 server pointed at a busy account and just leave it and a client running in the background. Look at it occasionally and submit any issues you notice. You can save console logs by right-clicking -> Save As.
Please run the server with `SYNCV3_DEBUG=1` set. This will force the server to panic when assertions fail rather than just log them.
## API
API is under active development and is not stable. See [api.md](/api.md) for the current API.

View File

@ -2,6 +2,7 @@ package main
import (
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
@ -12,6 +13,10 @@ import (
"github.com/matrix-org/sync-v3/sync3/handler"
)
var GitCommit string
const version = "0.1.0"
var (
flagDestinationServer = flag.String("server", "", "The destination v2 matrix server")
flagBindAddr = flag.String("port", ":8008", "Bind address")
@ -19,6 +24,7 @@ var (
)
func main() {
fmt.Printf("Sync v3 [%s] (%s)\n", version, GitCommit)
flag.Parse()
if *flagDestinationServer == "" {
flag.Usage()