Rework configuration process
Dynamically loads `config.json` on startup. Fixes #167, #284, #449, #486 Change-Id: I9efb1079c0c88e6e0272c5fda734a367aa8f84a3
This commit is contained in:

committed by
Manuel Stahl

parent
ef3836313c
commit
4b1277f653
42
README.md
42
README.md
@@ -64,11 +64,6 @@ You have three options:
|
||||
- download dependencies: `yarn install`
|
||||
- start web server: `yarn start`
|
||||
|
||||
You can fix the homeserver, so that the user can no longer define it himself.
|
||||
Either you define it at startup (e.g. `REACT_APP_SERVER=https://yourmatrixserver.example.com yarn start`)
|
||||
or by editing it in the [.env](.env) file. See also the
|
||||
[documentation](https://create-react-app.dev/docs/adding-custom-environment-variables/).
|
||||
|
||||
#### Steps for 3)
|
||||
|
||||
- run the Docker container from the public docker registry: `docker run -p 8080:80 awesometechnologies/synapse-admin` or use the [docker-compose.yml](docker-compose.yml): `docker-compose up -d`
|
||||
@@ -76,8 +71,6 @@ or by editing it in the [.env](.env) file. See also the
|
||||
> note: if you're building on an architecture other than amd64 (for example a raspberry pi), make sure to define a maximum ram for node. otherwise the build will fail.
|
||||
|
||||
```yml
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
synapse-admin:
|
||||
container_name: synapse-admin
|
||||
@@ -88,7 +81,6 @@ or by editing it in the [.env](.env) file. See also the
|
||||
# - NODE_OPTIONS="--max_old_space_size=1024"
|
||||
# # see #266, PUBLIC_URL must be without surrounding quotation marks
|
||||
# - PUBLIC_URL=/synapse-admin
|
||||
# - REACT_APP_SERVER="https://matrix.example.com"
|
||||
ports:
|
||||
- "8080:80"
|
||||
restart: unless-stopped
|
||||
@@ -96,6 +88,40 @@ or by editing it in the [.env](.env) file. See also the
|
||||
|
||||
- browse to http://localhost:8080
|
||||
|
||||
### Restricting available homeserver
|
||||
|
||||
You can restrict the homeserver(s), so that the user can no longer define it himself.
|
||||
|
||||
Edit `config.json` to restrict either to a single homeserver:
|
||||
|
||||
```json
|
||||
{
|
||||
"restrictBaseUrl": "https://your-matrixs-erver.example.com"
|
||||
}
|
||||
```
|
||||
|
||||
or to a list of homeservers:
|
||||
|
||||
```json
|
||||
{
|
||||
"restrictBaseUrl": [
|
||||
"https://your-first-matrix-server.example.com",
|
||||
"https://your-second-matrix-server.example.com"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The `config.json` can be injected into a Docker container using a bind mount.
|
||||
|
||||
```yml
|
||||
services:
|
||||
synapse-admin:
|
||||
...
|
||||
volumes:
|
||||
./config.json:/app/config.json
|
||||
...
|
||||
```
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||
|
Reference in New Issue
Block a user