From 19e478f2a976acfb8d7bc247ac0be5d82f2a18d8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 20 Dec 2022 18:13:08 +0000 Subject: [PATCH 1/2] Make sample config just have the HS config The other options are things people usually won't need or want to set, so just keep it to the basics. * Rename config sample to match element-web * Update / simplify build instructions * Rename nginx config file to differentiate it from EC config --- .env.example | 1 - Dockerfile | 2 +- README.md | 21 +++++++++------------ config/config.sample.json | 8 ++++++++ config/{default.conf => nginx.conf} | 0 sample.config.json | 5 ----- 6 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 config/config.sample.json rename config/{default.conf => nginx.conf} (100%) delete mode 100644 sample.config.json diff --git a/.env.example b/.env.example index bd8b6ba..596de72 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,6 @@ #### # Used for determining the homeserver to use for short urls etc. -# VITE_DEFAULT_HOMESERVER=http://localhost:8008 # VITE_FALLBACK_STUN_ALLOWED=false # VITE_CUSTOM_THEME=true diff --git a/Dockerfile b/Dockerfile index e46c60e..3d7363a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN scripts/dockerbuild.sh FROM nginxinc/nginx-unprivileged:alpine COPY --from=builder /src/dist /app -COPY config/default.conf /etc/nginx/conf.d/ +COPY config/nginx.conf /etc/nginx/conf.d/ USER root diff --git a/README.md b/README.md index d666263..c80c790 100644 --- a/README.md +++ b/README.md @@ -15,20 +15,19 @@ Until prebuilt tarballs are available, you'll need to build Element Call from so git clone https://github.com/vector-im/element-call.git cd element-call yarn -cp .env.example .env -cp sample.config.json public/config.json -``` - -You can now edit the configuration in `.env` and `public/config.json` to your liking. (See the [configuration](#Configuration) section for details.) The most important thing is to set `VITE_DEFAULT_HOMESERVER` to the homeserver that the app should use, such as `https://call.ems.host`. - -Next, build the project: - -``` yarn build ``` If all went well, you can now find the build output under `dist` as a series of static files. These can be hosted using any web server of your choice. +You may also wish to add a configuration file (Element Call uses the domain it's hosted on as a Homeserver URL by default, +but you can change this in the config file). This goes in `public/config.json` - you can use the sample as a starting point: + +``` +cp config/config.sample.json public/config.json +# edit public/config.json +``` + Because Element Call uses client-side routing, your server must be able to route any requests to non-existing paths back to `/index.html`. For example, in Nginx you can achieve this with the `try_files` directive: ``` @@ -59,11 +58,9 @@ git clone https://github.com/vector-im/element-call.git cd element-call yarn yarn link matrix-js-sdk -cp .env.example .env -cp sample.config.json public/config.json ``` -By default, the app expects you to have [Synapse](https://matrix-org.github.io/synapse/latest/setup/installation.html) installed locally and running on port 8008. If you wish to use another homeserver, you can set it in your `.env` file. +By default, the app expects you to have [Synapse](https://matrix-org.github.io/synapse/latest/setup/installation.html) installed locally and running on port 8008. If you wish to use another homeserver, you can add a config file as above. You're now ready to launch the development server: diff --git a/config/config.sample.json b/config/config.sample.json new file mode 100644 index 0000000..de936b3 --- /dev/null +++ b/config/config.sample.json @@ -0,0 +1,8 @@ +{ + "default_server_config": { + "m.homeserver": { + "base_url": "https://call.ems.host", + "server_name": "call.ems.host" + } + } +} diff --git a/config/default.conf b/config/nginx.conf similarity index 100% rename from config/default.conf rename to config/nginx.conf diff --git a/sample.config.json b/sample.config.json deleted file mode 100644 index bd05a88..0000000 --- a/sample.config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rageshake": { - "submit_url": "https://element.io/bugreports/submit" - } -} From b94562d43b1cb6ed7499d6459b493e6892a4737b Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 20 Dec 2022 18:26:10 +0000 Subject: [PATCH 2/2] Indent config sample properly --- config/config.sample.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.sample.json b/config/config.sample.json index de936b3..7afb8f6 100644 --- a/config/config.sample.json +++ b/config/config.sample.json @@ -1,8 +1,8 @@ { "default_server_config": { - "m.homeserver": { - "base_url": "https://call.ems.host", - "server_name": "call.ems.host" - } + "m.homeserver": { + "base_url": "https://call.ems.host", + "server_name": "call.ems.host" + } } }