add element web to the dev stack

This commit is contained in:
Aine 2025-01-13 11:02:31 +02:00
parent ddf3298b41
commit 1ca029fe94
No known key found for this signature in database
GPG Key ID: 34969C908CCA2804
6 changed files with 63 additions and 2 deletions

View File

@ -123,7 +123,7 @@ The following list contains such features - they are only available for [etke.cc
`just run-dev` to start the development stack (depending on your system speed, you may want to re-run this command if `just run-dev` to start the development stack (depending on your system speed, you may want to re-run this command if
user creation fails) user creation fails)
This command initializes the development environment (local Synapse server and Postgres DB), This command initializes the development environment (local Synapse server, Element Web client app, and Postgres DB),
and launches the app in a dev mode at `http://localhost:5173` and launches the app in a dev mode at `http://localhost:5173`
After that open [http://localhost:5173](http://localhost:5173?username=admin&password=admin&server=http://localhost:8008) in your browser, After that open [http://localhost:5173](http://localhost:5173?username=admin&password=admin&server=http://localhost:8008) in your browser,
@ -133,6 +133,8 @@ login using the following credentials:
* Password: admin * Password: admin
* Homeserver URL: http://localhost:8008 * Homeserver URL: http://localhost:8008
Element Web runs on http://localhost:8080
### Support ### Support
If you have any questions or need help, feel free to join the [community room](https://matrix.to/#/#synapse-admin:etke.cc) or create an issue on GitHub. If you have any questions or need help, feel free to join the [community room](https://matrix.to/#/#synapse-admin:etke.cc) or create an issue on GitHub.

View File

@ -18,3 +18,17 @@ services:
POSTGRES_PASSWORD: synapse POSTGRES_PASSWORD: synapse
POSTGRES_DB: synapse POSTGRES_DB: synapse
POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8" POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8"
element:
image: docker.io/vectorim/element-web:latest
depends_on:
synapse:
condition: service_healthy
restart: true
ports:
- "8080:8080"
volumes:
- ./testdata/element/nginx.conf:/etc/nginx/nginx.conf:ro
- /dev/null:/etc/nginx/conf.d/default.conf:ro
- ./testdata/element/config.json:/app/config.json:ro

View File

@ -16,6 +16,8 @@ run-dev:
@docker-compose -f docker-compose-dev.yml up -d postgres @docker-compose -f docker-compose-dev.yml up -d postgres
@echo "Starting Synapse..." @echo "Starting Synapse..."
@docker-compose -f docker-compose-dev.yml up -d synapse @docker-compose -f docker-compose-dev.yml up -d synapse
@echo "Starting Element Web..."
@docker-compose -f docker-compose-dev.yml up -d element
@echo "Ensure admin user is registered..." @echo "Ensure admin user is registered..."
@docker-compose -f docker-compose-dev.yml exec synapse register_new_matrix_user --admin -u admin -p admin -c /config/homeserver.yaml http://localhost:8008 || true @docker-compose -f docker-compose-dev.yml exec synapse register_new_matrix_user --admin -u admin -p admin -c /config/homeserver.yaml http://localhost:8008 || true
@echo "Starting the app..." @echo "Starting the app..."

9
testdata/element/config.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"default_hs_url": "http://localhost:8008",
"default_is_url": "https://vector.im",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
"enableLabs": true
}

34
testdata/element/nginx.conf vendored Normal file
View File

@ -0,0 +1,34 @@
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
client_body_temp_path /tmp/client_body_temp;
proxy_temp_path /tmp/proxy_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

View File

@ -78,7 +78,7 @@ password_config:
pid_file: /homeserver.pid pid_file: /homeserver.pid
presence: presence:
enabled: true enabled: true
public_baseurl: http://synapse:8008/ public_baseurl: http://localhost:8008/
push: push:
include_content: true include_content: true
rc_admin_redaction: rc_admin_redaction: