mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
Change back kafka version to upstream
This commit is contained in:
commit
cf2913ad52
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -40,3 +40,6 @@ _testmain.go
|
||||||
*.pem
|
*.pem
|
||||||
*.key
|
*.key
|
||||||
*.crt
|
*.crt
|
||||||
|
|
||||||
|
# Default configuration file
|
||||||
|
dendrite.yaml
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.10.x
|
|
||||||
- 1.11.x
|
- 1.11.x
|
||||||
|
- 1.12.x
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TEST_SUITE="lint"
|
- TEST_SUITE="lint"
|
||||||
|
|
@ -23,9 +23,6 @@ cache:
|
||||||
directories:
|
directories:
|
||||||
- .downloads
|
- .downloads
|
||||||
|
|
||||||
install:
|
|
||||||
- go get github.com/constabulary/gb/...
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./scripts/travis-test.sh
|
- ./scripts/travis-test.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,13 @@ See [INSTALL.md](INSTALL.md) for instructions on setting up a running dev
|
||||||
instance of dendrite, and [CODE_STYLE.md](CODE_STYLE.md) for the code style
|
instance of dendrite, and [CODE_STYLE.md](CODE_STYLE.md) for the code style
|
||||||
guide.
|
guide.
|
||||||
|
|
||||||
We use `gb` for managing our dependencies, so `gb build` and `gb test` is how
|
As of May 2019, we're not using `gb` anymore, which is the tool we had been
|
||||||
to build dendrite and run the unit tests respectively. Be aware that a list of
|
using for managing our dependencies. We're now using Go modules. To build
|
||||||
all dendrite packages is the expected output for all tests succeeding with `gb
|
Dendrite, run the `build.sh` script at the root of this repository (which runs
|
||||||
test`. There are also [scripts](scripts) for [linting](scripts/find-lint.sh)
|
`go install` under the hood), and to run unit tests, run `go test ./...` (which
|
||||||
and doing a [build/test/lint run](scripts/build-test-lint.sh).
|
should pick up any unit test and run it). There are also [scripts](scripts) for
|
||||||
|
[linting](scripts/find-lint.sh) and doing a [build/test/lint
|
||||||
|
run](scripts/build-test-lint.sh).
|
||||||
|
|
||||||
|
|
||||||
## Picking Things To Do
|
## Picking Things To Do
|
||||||
|
|
@ -33,18 +35,6 @@ nonetheless fairly well-contained.
|
||||||
We ask people who are familiar with Dendrite to leave the [good first issue](https://github.com/matrix-org/dendrite/labels/good%20first%20issue)
|
We ask people who are familiar with Dendrite to leave the [good first issue](https://github.com/matrix-org/dendrite/labels/good%20first%20issue)
|
||||||
issues so that there is always a way for new people to come and get involved.
|
issues so that there is always a way for new people to come and get involved.
|
||||||
|
|
||||||
## Contributing to dependencies
|
|
||||||
|
|
||||||
Dependencies are located in `vendor/src` and are managed by `gb`. If you need
|
|
||||||
to make some changes in those directories, you first need to open a PR in the
|
|
||||||
dependency repository. Once your PR is merged, you need to run `gb vendor
|
|
||||||
update $repo_url` (example: `gb vendor update github.com/matrix-org/gomatrix`)
|
|
||||||
in the dendrite repository to update the dependency.
|
|
||||||
|
|
||||||
You can then create a commit containing only the modified vendor files (along
|
|
||||||
with the `vendor/manifest` file), name it with the command you just ran (ie
|
|
||||||
`gb vendor update github.com/matrix-org/gomatrix`), and open a PR on Dendrite.
|
|
||||||
|
|
||||||
## Getting Help
|
## Getting Help
|
||||||
|
|
||||||
For questions related to developing on Dendrite we have a dedicated room on
|
For questions related to developing on Dendrite we have a dedicated room on
|
||||||
|
|
@ -57,4 +47,3 @@ For more general questions please use [#dendrite:matrix.org](https://matrix.to/#
|
||||||
|
|
||||||
We ask that everyone who contributes to the project signs off their
|
We ask that everyone who contributes to the project signs off their
|
||||||
contributions, in accordance with the [DCO](https://github.com/matrix-org/matrix-doc/blob/master/CONTRIBUTING.rst#sign-off).
|
contributions, in accordance with the [DCO](https://github.com/matrix-org/matrix-doc/blob/master/CONTRIBUTING.rst#sign-off).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Dendrite can be run in one of two configurations:
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Go 1.10+
|
- Go 1.11+
|
||||||
- Postgres 9.5+
|
- Postgres 9.5+
|
||||||
- For Kafka (optional if using the monolith server):
|
- For Kafka (optional if using the monolith server):
|
||||||
- Unix-based system (https://kafka.apache.org/documentation/#os)
|
- Unix-based system (https://kafka.apache.org/documentation/#os)
|
||||||
|
|
@ -30,8 +30,7 @@ git clone https://github.com/matrix-org/dendrite
|
||||||
cd dendrite
|
cd dendrite
|
||||||
|
|
||||||
# Build it
|
# Build it
|
||||||
go get github.com/constabulary/gb/...
|
./build.sh
|
||||||
gb build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If using Kafka, install and start it (c.f. [scripts/install-local-kafka.sh](scripts/install-local-kafka.sh)):
|
If using Kafka, install and start it (c.f. [scripts/install-local-kafka.sh](scripts/install-local-kafka.sh)):
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,10 @@ We aim to try and make it as easy as possible to jump in.
|
||||||
|
|
||||||
For questions about Dendrite we have a dedicated room on Matrix
|
For questions about Dendrite we have a dedicated room on Matrix
|
||||||
[#dendrite:matrix.org](https://matrix.to/#/#dendrite:matrix.org).
|
[#dendrite:matrix.org](https://matrix.to/#/#dendrite:matrix.org).
|
||||||
|
Development discussion should happen in
|
||||||
|
[#dendrite-dev:matrix.org](https://matrix.to/#/#dendrite-dev:matrix.org).
|
||||||
|
|
||||||
# Progress
|
# Progress
|
||||||
|
|
||||||
There's plenty still to do to make Dendrite usable! We're tracking progress in
|
There's plenty still to do to make Dendrite usable! We're tracking progress in
|
||||||
a [spreadsheet](https://docs.google.com/spreadsheets/d/1tkMNpIpPjvuDJWjPFbw_xzNzOHBA-Hp50Rkpcr43xTw).
|
a [project board](https://github.com/matrix-org/dendrite/projects/2).
|
||||||
|
|
|
||||||
3
build.sh
Executable file
3
build.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/...
|
||||||
|
|
@ -65,12 +65,6 @@ type Data struct {
|
||||||
func VerifyUserFromRequest(
|
func VerifyUserFromRequest(
|
||||||
req *http.Request, data Data,
|
req *http.Request, data Data,
|
||||||
) (*authtypes.Device, *util.JSONResponse) {
|
) (*authtypes.Device, *util.JSONResponse) {
|
||||||
// Try to find local user from device database
|
|
||||||
dev, devErr := verifyAccessToken(req, data.DeviceDB)
|
|
||||||
if devErr == nil {
|
|
||||||
return dev, verifyUserParameters(req)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to find the Application Service user
|
// Try to find the Application Service user
|
||||||
token, err := ExtractAccessToken(req)
|
token, err := ExtractAccessToken(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -128,6 +122,12 @@ func VerifyUserFromRequest(
|
||||||
return &dev, nil
|
return &dev, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try to find local user from device database
|
||||||
|
dev, devErr := verifyAccessToken(req, data.DeviceDB)
|
||||||
|
if devErr == nil {
|
||||||
|
return dev, verifyUserParameters(req)
|
||||||
|
}
|
||||||
|
|
||||||
return nil, &util.JSONResponse{
|
return nil, &util.JSONResponse{
|
||||||
Code: http.StatusUnauthorized,
|
Code: http.StatusUnauthorized,
|
||||||
JSON: jsonerror.UnknownToken("Unrecognized access token"),
|
JSON: jsonerror.UnknownToken("Unrecognized access token"),
|
||||||
|
|
@ -77,7 +77,11 @@ func Setup(
|
||||||
v1mux := apiMux.PathPrefix(pathPrefixV1).Subrouter()
|
v1mux := apiMux.PathPrefix(pathPrefixV1).Subrouter()
|
||||||
unstableMux := apiMux.PathPrefix(pathPrefixUnstable).Subrouter()
|
unstableMux := apiMux.PathPrefix(pathPrefixUnstable).Subrouter()
|
||||||
|
|
||||||
authData := auth.Data{accountDB, deviceDB, cfg.Derived.ApplicationServices}
|
authData := auth.Data{
|
||||||
|
AccountDB: accountDB,
|
||||||
|
DeviceDB: deviceDB,
|
||||||
|
AppServices: cfg.Derived.ApplicationServices,
|
||||||
|
}
|
||||||
|
|
||||||
r0mux.Handle("/createRoom",
|
r0mux.Handle("/createRoom",
|
||||||
common.MakeAuthAPI("createRoom", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
common.MakeAuthAPI("createRoom", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse {
|
||||||
|
|
@ -139,6 +139,6 @@ func writeEvent(event gomatrixserverlib.Event) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
panic(fmt.Errorf("Format %q is not valid, must be %q or %q", format, "InputRoomEvent", "Event"))
|
panic(fmt.Errorf("Format %q is not valid, must be %q or %q", *format, "InputRoomEvent", "Event"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -41,7 +41,7 @@ var (
|
||||||
// Postgres docker container name (for running psql). If not set, psql must be in PATH.
|
// Postgres docker container name (for running psql). If not set, psql must be in PATH.
|
||||||
postgresContainerName = os.Getenv("POSTGRES_CONTAINER")
|
postgresContainerName = os.Getenv("POSTGRES_CONTAINER")
|
||||||
// Test image to be uploaded/downloaded
|
// Test image to be uploaded/downloaded
|
||||||
testJPEG = test.Defaulting(os.Getenv("TEST_JPEG_PATH"), "src/github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests/totem.jpg")
|
testJPEG = test.Defaulting(os.Getenv("TEST_JPEG_PATH"), "cmd/mediaapi-integration-tests/totem.jpg")
|
||||||
kafkaURI = test.Defaulting(os.Getenv("KAFKA_URIS"), "localhost:9092")
|
kafkaURI = test.Defaulting(os.Getenv("KAFKA_URIS"), "localhost:9092")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue