kaangiray26 / forte

Self-hosted, music streaming platform
https://forte.buzl.uk/
GNU General Public License v3.0
342 stars 12 forks source link

Ports #93

Closed jame25 closed 1 year ago

jame25 commented 1 year ago

I already run a number of services in docker compose, including nginx-proxy-manager which utilizes ports '80', '81' and '443'.

I can enter the forte dashboard on port 3000, however I am unable to access the player itself.

Any suggestions appreciated.

kaangiray26 commented 1 year ago

If you can access the dashboard on port 3000, everything should be fine. Please check out the documentation about using forte and logging in: https://github.com/kaangiray26/forte#usage

The web player is hosted at https://forte.buzl.uk. You access the player by going to this address and using the address of your server as the Forte server adddress. Hope this clears things for you.

jame25 commented 1 year ago

Thanks for the response (and your patience). I finally understand.

http://localhost:3000 works as expected on the host machine, however I cannot login on any networked device, i.e via http://0.0.0.0:3000 or http://192.168.0.100:3000

kaangiray26 commented 1 year ago

To make forte accessible to devices other than your host machine you need to make forte publically available. I'd recommend reading this section here:https://github.com/kaangiray26/forte#using-publicly

jame25 commented 1 year ago

I am unable to get forte working publicly, it looks like an Acme-challenge failure. Log: forte_acme.log

I'd also like to request Reverse proxy support (https://github.com/kaangiray26/forte/issues/83)

kaangiray26 commented 1 year ago

https://github.com/kaangiray26/forte/issues/83#issuecomment-1451981858

kaangiray26 commented 1 year ago

Hey, forte-2.5 also addresses this issue. Should we close the issue by now?

jame25 commented 1 year ago

Thanks for the updates. I have mode set to 'public' and can access (without issue) the web player on host machine via ***.duckdns.org, however when I try to login on another machine on my LAN, the web player is not working - no tracks are shown, search is not functional, nor 'Profile'. Also, there are no errors in logs; no indication of activity at all.

kaangiray26 commented 1 year ago

Hi, I've released a new version that uses the public mode as default. It hosts the server at 0.0.0.0:3000. You can access it on your local machine by going to the address http://localhost:3000. However, there is a catch. If you want to connect to it using another device (let it be on the same network or not) you need to make the server host the application with a secure context, meaning you need a SSL certificate. You can use your reverse proxy to assign SSL certificates and use the public address to connect.

Please let me know if you get other errors, thanks.

jame25 commented 1 year ago

Sorry if I am repeating myself, I only want to be as clear as possible about what is happening.

I've already configured a SSL reverse proxy (https://example.duckdns.org) that points to http://:3000 - and this works (forte dashboard is accessible) locally, across networked machines and via the internet. I am able to login on local machine to https://forte.buzl.uk (web player) using http://localhost:3000 and with my https://example.duckdns.org domain and everything works as expected. However, while https://forte.buzl.uk will accept https://example.duckdns.org, username and token on networked machines and via the internet (phone/5G) - the web player is not functional, no music is listed.

kaangiray26 commented 1 year ago

Hi, I've pushed a new release that focuses on using nginx as a reverse proxy and removes some unnecessary dependencies. I've also included a small instruction to set up nginx for forte.

I've tried the setup and I can confirm that forte is running with the current setup behind a reverse proxy with a SSL certificate. I've tested with an android device on Chrome browser, running both in the same and external network. Everything is functional.

Please check your nginx setup and compare it to: https://github.com/kaangiray26/forte#using-nginx-as-a-reverse-proxy-with-ssl

jame25 commented 1 year ago

Thanks again. As I stated in first post, I use nginx-proxy-manager already and successfully with a number of different containers. I believe it to be a popular option, as it (usually) makes setting up and maintaining a reverse proxy very simple. Please do consider supporting nginx-proxy-manager as it is likely I will not be the last user posting about it.

I've tried to establish (based on your manual nginx instructions) what might be at issue with my setup. Are there any obvious mistakes in the below screenshots? All other settings are default.

npm-1 npm-2

EDIT: Below is my docker-compose.yml and the log output when running Forte. Could the fact that Forte always uses http://0.0.0.0:3000 - despite specifying 192.168.0.100:3000 - be the issue?

Forte: container_name: Forte image: kaangiray26/forte:2.7 ports:

  • "192.168.0.100:3000:3000" depends_on: postgres: condition: service_healthy environment: mode: public port: 3000 # Set Port forte_server: https://example.duckdns.org forte_email: example@gmail.com NODE_ENV: production # Set Node Environment POSTGRES_HOST: postgres POSTGRES_PORT: 5432 POSTGRES_DB: forte POSTGRES_USER: forte POSTGRES_PASSWORD: forte volumes:
  • /home/plex/Music:/library
..: Starting forte :..
..: Open the web player at https://forte.buzl.uk/ :..
..: Server:    http://0.0.0.0:3000/ :..
kaangiray26 commented 1 year ago

Hi again, please try using the following docker-compose.yml file that I've changed for you:

version: '3'
services:
    app:
        image: kaangiray26/forte:2.7
        restart: on-failure
        ports:
            - "3000:3000"
        depends_on:
            postgres:
                condition: service_healthy
        environment:
            port: 3000               # Set Port
            mode: public             # Set to public or greenlock
            NODE_ENV: production     # Set Node Environment
            POSTGRES_HOST: postgres  # Postgres Host/IP
            POSTGRES_PORT: 5432      # Postgres Database Port
            POSTGRES_DB: forte       # Set Postgres Database Name
            POSTGRES_USER: forte     # Set Postgres Username
            POSTGRES_PASSWORD: forte # Set Postgres Password
        volumes:
            - /home/plex/Music:/library
    postgres:
        image: kaangiray26/postgres:2.0
        restart: always
        environment:
            POSTGRES_DB: forte       # Set Postgres Database Name
            POSTGRES_USER: forte     # Set Postgres Username
            POSTGRES_PASSWORD: forte # Set Postgres Password
        volumes:
            - db-data:/var/lib/postgresql/data
        healthcheck:
            test: [ "CMD-SHELL", "pg_isready -U forte" ]
            interval: 10s
            timeout: 5s
            retries: 5
volumes:
    db-data:

And also in the first screenshot you've sent, try the value http://localhost:3000.

jame25 commented 1 year ago

I've applied your modified docker-compose.yml and there has been no obvious change.

And also in the first screenshot you've sent, try the value http://localhost:3000.

Anything other than http://192.168.0.100:3000 is not accepted by https://forte.buzl.uk - "login failed"

kaangiray26 commented 1 year ago

I think this is highly a problem with your nginx configuration and has nothing to do with forte itself. I don't know how can I just support nginx-proxy-manager, as it is something completely abstract from the application here. Nginx reverse proxy adds itself on top of an application layer and I can't just add things to edit files in the system.

kaangiray26 commented 1 year ago

You can try forte-2.8 as a suggestion.

jame25 commented 1 year ago

You can try forte-2.8 as a suggestion.

Thanks for persisting, I have good news. Web player is now functional, tracks are visible and can be played, and I can access the 'Profile' section. Only obvious issue is volume control - I can mute/unmute but not change volume level.

vol_bug
kaangiray26 commented 1 year ago

Great to hear that it's working for you, to change volume you move your pointer above the volume button and then scroll down or up.

Happy listening!

kaangiray26 commented 1 year ago

I think we can close the issue now.