tree: 1a4e749a23977a623b1f23d0c4ee345343bddeb3 [path history] [tgz]
  1. BUILD.bazel
  2. main.go
  3. main_test.go
  4. README.md
app/matrix/media-repo-proxy/README.md

Matrix-Media-Repository Proxy

This is A Saurceful Of Go that between Matrix Media Repo instances and Ingresses.

It has one job: rewrite Host headers. The reason for this is that matrix-media-repo wants Host: hackerspace.pl (MXID domain) while our traffic comes in with Host: matrix.hackerspace.pl (actual Host at which we serve Matrix).

Alternatives considered

  1. Rewriting this in Nginx Ingress Controller: not easy to do on a per-rule basis, would require some extra ingresses and dumb loopbacks.
  2. Fixing matrix-media-repo: not easy with the assumptions their code makes and with no tests that we can run.

Running

Locally:

$ bazel run //app/matrix/media-repo-proxy -- -downstream_host=matrix.hackerspace.pl -upstream_host=hackerspace.pl -upstream=foo.bar.svc.cluster.local:8080

In prod, should be part of jsonnet infra and be brought up as needed.