Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #91 from matrix-org/develop
Browse files Browse the repository at this point in the history
0.3.0
t3chguy authored Jun 12, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 668241f + c2eb819 commit 32cddd1
Showing 1,481 changed files with 1,088 additions and 581,867 deletions.
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Created by .ignore support plugin (hsz.mobi)
### Go template
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Binaries
bin/
# Dependency directories
vendor/
Dockerfile
.dockerignore

7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: go
go:
- 1.8
- tip
- 1.13
install:
- go get github.com/constabulary/gb/...
- go get github.com/valyala/quicktemplate/qtc
- qtc
script:
- gb build
- go build ./cmd/...
- go test ./...
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM golang:1.11-alpine
FROM golang:1.13-alpine

RUN apk --update add git gcc musl-dev
RUN go get github.com/valyala/quicktemplate/qtc

COPY . /src
WORKDIR /src
COPY . /src

RUN apk --update add git
RUN go get github.com/constabulary/gb/...
RUN go get github.com/valyala/quicktemplate/qtc
RUN qtc
RUN gb build
RUN go build ./cmd/matrix-static

FROM alpine

# We need this otherwise we don't have a good list of CAs
RUN apk --update add ca-certificates && mkdir /opt/matrix-static

WORKDIR /opt/matrix-static/
COPY --from=0 /src/bin/* /bin/
COPY --from=0 /src/assets ./assets
COPY --from=0 /src/matrix-static /bin/
COPY ./assets/ ./assets

CMD ["matrix-static"]
ENTRYPOINT matrix-static
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,13 +5,23 @@ Matrix Static
`git clone` or download this repository as an archive and extract then follow below instructions.

```
go get github.com/constabulary/gb/...
go get github.com/valyala/quicktemplate/qtc
qtc
gb build
go build -o bin/ ./cmd/...
```
After this, executables will be in the `bin` directory.

### Docker
```shell
docker build -t matrix-static .
docker run -v $(pwd)/config.json:/opt/matrix-static/config.json -p 8000:8000 -it matrix-static
```

or for windows:
```shell script
docker run -v %cd%/config.json:/opt/matrix-static/config.json -p 8000:8000 -it matrix-static
```

and pass any command line arguments to the end of the command.

### Usage
First you must create a config, there is a sample json file provided or you can use the helper binary `register-guest` to register a guest on a given homeserver and write an appropriate config file.
@@ -36,9 +46,15 @@ Accepts the following command line arguments:

`--enable-prometheus-metrics` if set, enables the `/metrics` endpoint for metrics.

`--num-workers=` to specify the number of worker goroutines to start, defaults to 32
`--num-workers=` to specify the number of worker goroutines to start, defaults to 32.

`--public-serve-prefix=` to specify the router prefix to use for the user-facing html-serving routes, defaults to `/`.

`--logger-directory` to specify where the output logs should go.

`--cache-ttl` to specify how long since last access to keep a room in memory and up to date for, defaults to 30 minutes.

`--public-serve-prefix=` to specify the router prefix to use for the user-facing html-serving routes, defaults to `/`
`--cache-min-rooms` to specify the minimum number of rooms to always keep in memory, defaults to 10.



Loading

0 comments on commit 32cddd1

Please sign in to comment.