Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect via Android app #200

Open
taiBsu opened this issue Jul 6, 2022 · 2 comments
Open

Unable to connect via Android app #200

taiBsu opened this issue Jul 6, 2022 · 2 comments

Comments

@taiBsu
Copy link

taiBsu commented Jul 6, 2022

Describe the bug
I have set up the SEPIA home docker container as a docker-compose container after doing the setup manually via the command given in the installation instruction. My docker-compose.yml looks as follows:

version: "3"
services:
  sepia:
    image: sepia/home:latest
    container_name: sepia
    restart: always
    volumes:
      - ./home:/home/admin/sepia-home-data
    ports:
      - 20726:20726
      - 20723:20723
    networks:
      - mynetwork

networks:
  mynetwork:
    external: true

Then after finishing the installation, I set up a reverse proxy to access the sepia backend via sepia.mydomain.com:

<IfModule mod_ssl.c>
<VirtualHost *:443>

  ServerName sepia.mydomain.org

  # Define reverse-proxy locations
  ProxyPass / http://sepia:20726/
  ProxyPassReverse / http://sepia:20726/

  # Upgrade WebSocket connection
  <Location /chat/>
    ProxyPass http://sepia:20723/

    RewriteEngine On
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
    RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
    RewriteRule /messages/(.*) ws://sepia:20723/messages/$1 [P]
  </Location>

  SSLCertificateFile /etc/letsencrypt/live/mydomain.org/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.org/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

Now, when trying to access my server via the Android app, I keep getting "Connecting..." - "Disconnected" output on the top of the app below the S.E.P.I.A. text. It just won't connect.

SEPIA client and server versions

  • Client OS: Android 10 (/e/OS)
  • SEPIA-Client version: v0.24.2
  • SEPIA-Server version: latest (probably 0.26.2), pulled via hub.docker.com

To Reproduce
Steps to reproduce the behavior:

  1. Install the server
  2. Install the android app
  3. Login with customized hostname (my.domain.org/sepia) and login credentials
  4. error connecting

Expected behavior
Well, it should connect.

Oh, by the way, thanks for the great work! :D

@fquirin
Copy link
Contributor

fquirin commented Jul 7, 2022

Hi @taiBsu ,

I think the issue is with splitting 20726 and 20723, any specific reason for that? 🤔
Apache should be able to upgrade the Websocket connection automatically depending on either the ws:// URL or request header. I'm assuming the module 'mod_proxy_wstunnel' is installed?

If you can't get rid of the 20723 port in any way try to change the path from <Location /chat/> to <Location /sepia/chat/>.

@fquirin
Copy link
Contributor

fquirin commented Jul 7, 2022

Some additional info to help fixing the issue:

  • If your domain is sepia.mydomain.org you should probably forward to http://[SEPIA-IP]:20726
  • In your clients use the hostname sepia.mydomain.org/sepia, this will help the client to identify the correct URLs and paths
  • You can always overwrite all automatically assigned URLs via client connection settings if you want to use sepia.mydomain.org instead of sepia.mydomain.org/sepia as hostname

My best guess would be something like this (untested ^^):

<VirtualHost *:443>
  ServerName sepia.mydomain.org
  
  Define HOST [SEPIA-IP]
  
  # Make sure forward-proxy is disabled
  ProxyRequests Off

  # Define reverse-proxy locations
  ProxyPass / http://${HOST}:20726/

  # WebSocket support
  RewriteEngine on
  RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
  RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
  RewriteRule .* ws://${HOST}:20726%{REQUEST_URI} [P]
  
</VirtualHost>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants