diff --git a/README.md b/README.md index e706bbf..cf0aa6f 100644 --- a/README.md +++ b/README.md @@ -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 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` 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 * Homeserver URL: http://localhost:8008 +Element Web runs on http://localhost:8080 + ### 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. diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 42b1cd8..38fb001 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -18,3 +18,17 @@ services: POSTGRES_PASSWORD: synapse POSTGRES_DB: synapse 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 + diff --git a/justfile b/justfile index 3eb086e..9c0968e 100644 --- a/justfile +++ b/justfile @@ -16,6 +16,8 @@ run-dev: @docker-compose -f docker-compose-dev.yml up -d postgres @echo "Starting 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..." @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..." diff --git a/testdata/element/config.json b/testdata/element/config.json new file mode 100644 index 0000000..9a45c89 --- /dev/null +++ b/testdata/element/config.json @@ -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 +} + diff --git a/testdata/element/nginx.conf b/testdata/element/nginx.conf new file mode 100644 index 0000000..97c6ad0 --- /dev/null +++ b/testdata/element/nginx.conf @@ -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; + } + } +} diff --git a/testdata/synapse/homeserver.yaml b/testdata/synapse/homeserver.yaml index 392d444..cd90908 100644 --- a/testdata/synapse/homeserver.yaml +++ b/testdata/synapse/homeserver.yaml @@ -78,7 +78,7 @@ password_config: pid_file: /homeserver.pid presence: enabled: true -public_baseurl: http://synapse:8008/ +public_baseurl: http://localhost:8008/ push: include_content: true rc_admin_redaction: