Open MattyBoombalatty opened 1 year ago
Same scenario here, only with Pixel5. The field is actually live searching, so if you type in matrix.org it will show up almost immediately beneath the search field. I also tried to add _matrix and _synapse/client to the URL, without any luck though.
I'm using nginx as the reverse proxy.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
access_log /var/log/nginx/matrix/access.log combined buffer=1m;
error_log /var/log/nginx/matrix/error.log;
# For the federation port
listen 8448 ssl http2 default_server;
listen [::]:8448 ssl http2 default_server;
server_name matrix.domain.tld;
location /.well-known/matrix/server {
return 200 '{"m.server": "matrix.domain.tld:443"}';
add_header Content-Type application/json;
}
location ~ ^(/_matrix|/_synapse/client) {
proxy_pass http://192.168.50.40:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_http_version 1.1;
client_max_body_size 50M;
}
}
I have more or less the same configuration as you. Not sure what is wrong here.
same here
Ditto
Had the same problem. You have to enable sliding sync for element x to be able to connect to your homeserver. see https://github.com/matrix-org/sliding-sync for infos on howto setup sliding sync. I did use https://gist.github.com/sjahl/ad0aafae419fa413ede67b5cf4d3d970 as docker compose reference .
Same same. Synapse and dendrite both fail on subdomain. Motorola phone, version 0.2.2 apk
Had the same problem. You have to enable sliding sync for element x to be able to connect to your homeserver. see https://github.com/matrix-org/sliding-sync for infos on howto setup sliding sync. I did use https://gist.github.com/sjahl/ad0aafae419fa413ede67b5cf4d3d970 as docker compose reference .
Could you share your reverse proxy configuration? I'm pretty sure I'm still missing a part in my config to get it working.
And thanks for the links you provided!
sure, here you go
server {
listen 80;
listen [::]:80;
server_name matrix.mydomain.de;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# For the federation port
listen 8448 ssl http2 default_server;
listen [::]:8448 ssl http2 default_server;
server_name matrix.mydomain.de;
# Certificates used
ssl_certificate /etc/letsencrypt/live/mydomain.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.de/privkey.pem;
location /_matrix/push/v1/notify {
proxy_pass http://127.0.0.1:8085/index.php/apps/uppush/gateway/matrix;
}
location /.well-known/matrix/server {
return 200 '{"m.server": "matrix.mydomain.de:443"}';
add_header Content-Type application/json;
}
location /.well-known/matrix/client {
return 200 '{ "m.homeserver": { "base_url": "https://matrix.mydomain.de" }, "org.matrix.msc3575.proxy": { "url": "https://matrix.mydomain.de" }}';
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
}
location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) {
proxy_pass http://localhost:8881;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
}
location ~ ^(/_matrix|/_synapse/client) {
# note: do not add a path (even a single /) after the port in `proxy_pass`,
# otherwise nginx will canonicalise the URI and cause signature verification
# errors.
proxy_pass http://192.168.129.4:8008;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
client_max_body_size 50M;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
}
}
Have a look at https://github.com/matrix-org/sliding-sync/issues/28, i did waste an hour of my life because of this.
Thanks, that did the trick. And thanks also for the link, my last session I already tried to debug the client functionality and got the 404, that's where I stopped and asked for your nginx config. Appreciate it.
Same problem here, cant log into custom subdomain on android.. iOS worked fine, regular element works fine also
sure, here you go
server { listen 80; listen [::]:80; server_name matrix.mydomain.de; return 301 https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; # For the federation port listen 8448 ssl http2 default_server; listen [::]:8448 ssl http2 default_server; server_name matrix.mydomain.de; # Certificates used ssl_certificate /etc/letsencrypt/live/mydomain.de/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mydomain.de/privkey.pem; location /_matrix/push/v1/notify { proxy_pass http://127.0.0.1:8085/index.php/apps/uppush/gateway/matrix; } location /.well-known/matrix/server { return 200 '{"m.server": "matrix.mydomain.de:443"}'; add_header Content-Type application/json; } location /.well-known/matrix/client { return 200 '{ "m.homeserver": { "base_url": "https://matrix.mydomain.de" }, "org.matrix.msc3575.proxy": { "url": "https://matrix.mydomain.de" }}'; add_header Content-Type application/json; add_header Access-Control-Allow-Origin *; } location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) { proxy_pass http://localhost:8881; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_headers_hash_max_size 512; proxy_headers_hash_bucket_size 128; } location ~ ^(/_matrix|/_synapse/client) { # note: do not add a path (even a single /) after the port in `proxy_pass`, # otherwise nginx will canonicalise the URI and cause signature verification # errors. proxy_pass http://192.168.129.4:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; # Nginx by default only allows file uploads up to 1M in size # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml client_max_body_size 50M; proxy_headers_hash_max_size 512; proxy_headers_hash_bucket_size 128; } }
Have a look at matrix-org/sliding-sync#28, i did waste an hour of my life because of this.
I just followed this and now Element X sees my server and asks me for User/Password, but when i try to login i end on a "Setting up your account. This is a one time process, thanks for waiting" screen loop.
On Synapse logs i see some key generation being made successfully, but it ends on a:
2023-12-04 13:58:37,613 - synapse.http.server - 124 - INFO - GET-501 - <XForwardedForRequest at 0x7f421e12a950 method='GET' uri='/_matrix/client/v3/user/@XXXXX:matrix-XXX.XXX.XX/account_data/m.org.matrix.custom.backup_disabled' clientproto='HTTP/1.1' site='8008'> SynapseError: 404 - Account data not found
sure, here you go
server { listen 80; listen [::]:80; server_name matrix.mydomain.de; return 301 https://$host$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; # For the federation port listen 8448 ssl http2 default_server; listen [::]:8448 ssl http2 default_server; server_name matrix.mydomain.de; # Certificates used ssl_certificate /etc/letsencrypt/live/mydomain.de/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/mydomain.de/privkey.pem; location /_matrix/push/v1/notify { proxy_pass http://127.0.0.1:8085/index.php/apps/uppush/gateway/matrix; } location /.well-known/matrix/server { return 200 '{"m.server": "matrix.mydomain.de:443"}'; add_header Content-Type application/json; } location /.well-known/matrix/client { return 200 '{ "m.homeserver": { "base_url": "https://matrix.mydomain.de" }, "org.matrix.msc3575.proxy": { "url": "https://matrix.mydomain.de" }}'; add_header Content-Type application/json; add_header Access-Control-Allow-Origin *; } location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync) { proxy_pass http://localhost:8881; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; proxy_headers_hash_max_size 512; proxy_headers_hash_bucket_size 128; } location ~ ^(/_matrix|/_synapse/client) { # note: do not add a path (even a single /) after the port in `proxy_pass`, # otherwise nginx will canonicalise the URI and cause signature verification # errors. proxy_pass http://192.168.129.4:8008; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $host; # Nginx by default only allows file uploads up to 1M in size # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml client_max_body_size 50M; proxy_headers_hash_max_size 512; proxy_headers_hash_bucket_size 128; } }
Have a look at matrix-org/sliding-sync#28, i did waste an hour of my life because of this.
I just followed this and now Element X sees my server and asks me for User/Password, but when i try to login i end on a "Setting up your account. This is a one time process, thanks for waiting" screen loop.
On Synapse logs i see some key generation being made successfully, but it ends on a:
2023-12-04 13:58:37,613 - synapse.http.server - 124 - INFO - GET-501 - <XForwardedForRequest at 0x7f421e12a950 method='GET' uri='/_matrix/client/v3/user/@XXXXX:matrix-XXX.XXX.XX/account_data/m.org.matrix.custom.backup_disabled' clientproto='HTTP/1.1' site='8008'> SynapseError: 404 - Account data not found
No one?
I think there are a bunch of misconfiguration scenarioes here: 1) EXA needs sliding sync set up and working and does not provide a nice error if there is none https://github.com/element-hq/element-x-android/issues/1384 https://github.com/element-hq/element-x-android/issues/1214 https://github.com/element-hq/element-x-android/issues/1097
2) The .well-known files need to be served on your main domain (the one you see in your user account). So, if you are @user:domain.com but your matrix server runs in matrix.domain.com, your well-knowns need to be served from https://domain.com/.well-known/...
Can you help me with my problem?
2024-03-05 11:57:48,060 - synapse.http.server - 130 - INFO - GET-313398 - <XForwardedForRequest at 0x7fa2adb010 method='GET' uri='/_matrix/client/unstable/org.matrix.msc3575/sync?timeout=30000' clientproto='HTTP/1.0' site='8008'> SynapseError: 404 - Unrecognized request 2024-03-05 11:57:48,063 - synapse.http.server - 130 - INFO - GET-313399 - <XForwardedForRequest at 0x7fa3b19910 method='GET' uri='/_matrix/client/unstable/org.matrix.msc3575/sync?timeout=30000' clientproto='HTTP/1.0' site='8008'> SynapseError: 404 - Unrecognized request 2024-03-05 11:57:48,064 - synapse.access.http.8008 - 472 - INFO - GET-313398 - 46.216.113.14 - 8008 - {None} Processed request: 0.001sec/0.003sec (0.006sec, 0.000sec) (0.000sec/0.000sec/0) 59B 404 "GET /_matrix/client/unstable/org.matrix.msc3575/sync?timeout=30000 HTTP/1.0" "Element X/0.4.4 (samsung SM-S921B; Android 14; UP1A.231005.007.S921BXXU1AXBA; Sdk TODO)" [0 dbevts] 2024-03-05 11:57:48,067 - synapse.access.http.8008 - 472 - INFO - GET-313399 - 46.216.113.14 - 8008 - {None} Processed request: 0.001sec/0.003sec (0.000sec, 0.000sec) (0.000sec/0.000sec/0) 59B 404 "GET /_matrix/client/unstable/org.matrix.msc3575/sync?timeout=30000 HTTP/1.0" "Element X/0.4.4 (samsung SM-S921B; Android 14; UP1A.231005.007.S921BXXU1AXBA; Sdk TODO)" [0 dbevts]
endless account customization on login.
i just managed to get my element-x for android login and start a sync, but for some reason i get this when i enabled debugging on my sliding-sync container:
Sync v3 [0.99.16] (66fd58b)
Debug=false LogLevel=debug MaxConns=0
2024/05/08 10:57:32 goose: no migrations to run. current version: 20231108122539
10:57:32 INF creating handler
10:57:32 INF retrieved global snapshot from database
10:57:32 INF listening on :8009
10:57:32 INF StartV2Pollers num_devices=0 num_fail_decrypt=0
10:57:32 INF StartV2Pollers finished
INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.001 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:06 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
10:58:07 INF c= duration=0.000 size=19 status=404
Creating an infinite loop on the login process. I cannot find any issue there who could explain it here. Here is my compose file:
version: '2.3'
services:
synapse:
image: docker.io/matrixdotorg/synapse:v1.106.0
container_name: MatrixSynapse-TEST
restart: unless-stopped
ports:
- 8008:8008
env_file:
- ./env/.synapseenv
volumes:
- ./synapse-files:/data
- /mnt/Matrix-DATA:/data/media_store
depends_on:
- db
db:
image: docker.io/postgres:15.4-alpine
container_name: MatrixDB-TEST
env_file:
- ./env/.dbenv
volumes:
- ./db:/var/lib/postgresql/data
restart: unless-stopped
element:
image: vectorim/element-web:v1.11.65
container_name: MatrixElement-TEST
ports:
- 8085:80
restart: unless-stopped
volumes:
- ./element/element-config.json:/app/config.json
sliding-proxy:
image: ghcr.io/matrix-org/sliding-sync:v0.99.16
container_name: MatrixSlidingSync-TEST
restart: unless-stopped
ports:
- '8009:8009'
environment:
- "SYNCV3_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
- "SYNCV3_SERVER=https://matrixhost.mydomain.net"
- "SYNCV3_DB=user=syncv3 dbname=syncv3 sslmode=disable host=sliding-postgres password=XXXXXXXX"
- "SYNCV3_BINDADDR=:8009"
- "SYNCV3_LOG_LEVEL=debug"
depends_on:
- sliding-postgres
sliding-postgres:
image: docker.io/postgres:15-alpine
container_name: MatrixSlidingSyncDB-TEST
restart: unless-stopped
environment:
- POSTGRES_USER=syncv3
- POSTGRES_PASSWORD=XXXXXXXX
- POSTGRES_DB=syncv3
volumes:
- ./sliding_db_data:/var/lib/postgresql/data
And my nginx proxy manager proxy host configuration file:
# ------------------------------------------------------------
# matrixhost.mydomain.net
# ------------------------------------------------------------
map $scheme $hsts_header {
https "max-age=63072000; preload";
}
server {
set $forward_scheme http;
set $server "chats-test.internal.local";
set $port 8008;
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name matrixhost.mydomain.net;
# Let's Encrypt SSL
include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-22/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-22/privkey.pem;
# Block Exploits
include conf.d/include/block-exploits.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
# Force SSL
include conf.d/include/force-ssl.conf;
access_log /data/logs/proxy-host-20_access.log proxy;
error_log /data/logs/proxy-host-20_error.log warn;
location ~ ^(\/_matrix|\/_synapse\/client) {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8008;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
client_max_body_size 128M;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
}
location ~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync|sliding-sync) {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8009;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
}
location /.well-known/matrix/client {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8008;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
return 200 '{"m.homeserver": {"base_url": "https://matrixhost.mydomain.net"}, "org.matrix.msc3575.proxy": {"url": "https://matrixhost.mydomain.net/sliding-sync"}}';
add_header Access-Control-Allow-Origin *;
}
location /.well-known/matrix/server {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8008;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
return 200 '{"m.server": "matrixhost.mydomain.net:443"}';
add_header Content-Type application/json;
}
location /_matrix/push/v1/notify {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8085/index.php/apps/uppush/gateway/matrix;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://chats-test.internal.local:8085;
# Block Exploits
include conf.d/include/block-exploits.conf;
# Force SSL
include conf.d/include/force-ssl.conf;
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security $hsts_header always;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
Configured using this example posted previously: https://github.com/element-hq/element-x-android/issues/1414#issuecomment-1740791371
And adjusted it using the issues mentioned there: https://github.com/element-hq/element-x-android/issues/1414#issuecomment-1923478246
I would be utterly happy if someone could give me some light to debug this and find a solution. I want to be ready to migrate my test environment to be ready when element x goes stable on production. If it's better to fill a new issue please tell me.
Thanks in advance
Someone familiar with the setup should create documentation, including requirements and examples on setting up connection to own server. This would be invaluable
Someone familiar with the setup should create documentation, including requirements and examples on setting up connection to own server. This would be invaluable
Agree with you, I've been 3 months trying to make it work without success getting lots of different errors.
This project documentation on the server side needs to improve, a pair of MD on a git and a YouTube video isn't enough.
I see nothing fixed with the latest release. The client complains about server URLs but don't seem to work with URLs itself (it looks so at least). Element X must be able to work with private/test servers, so this issue is important.
Steps to reproduce
Outcome
What did you expect?
Being able to connect to log in to homeserver from the Element X homeserver choice screen.
What happened instead?
My homeserver domain
subdomain.domain.tld
does not appear in the list, unless I usehttps://subdomain.domain.tld
. After selecting it, however, I am prompted with an error that the homeserver cannot be reached. My server uses standard username/password authentication, not SSO.Your phone model
Samsung
Operating system version
Android 13
Application version and app store
Element X version 0.2.1
Homeserver
Synapse 1.92.3
Will you send logs?
Yes
Are you willing to provide a PR?
No