Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
3.12k stars 125 forks source link

Web UI doesn't point to API_ENDPOINT #186

Closed KenHV closed 1 year ago

KenHV commented 1 year ago

The link in web UI points to localhost:8080/oauth/spotify or an older URL I used for API_ENDPOINT.

I'm able to authenticate by manually going to API_ENDPOINT/oauth/spotify, but it makes no difference to the web UI.

Logs say this: ys-web | Setting API Endpoint to 'https://ys.kenharris.xyz/api' but the link is either localhost:8080 or ys.kenharris.xyz/backend (the old URL).

I have tried stopping/starting/deleting/pruning. I've tried with different browsers, different devices and with incognito mode as well. Clearing cache doesn't help. I've also tried delete window.API_ENDPOINT as someone in another issue had success with it. Purging Cloudflare cache has no effect either.

Docker logs.

Config:

version: "3"

services:
  ys-server:
    container_name: ys-server
    image: yooooomi/your_spotify_server
    restart: always
    links:
      - ys-mongo
    depends_on:
      - ys-mongo
    environment:
      - API_ENDPOINT=https://ys.kenharris.xyz/api # This MUST be included as a valid URL in the spotify dashboard
      - CLIENT_ENDPOINT=https://ys.kenharris.xyz
      - SPOTIFY_PUBLIC=
      - SPOTIFY_SECRET=
      - CORS=all # all if you want to allow every origin
    # Port 8080
    networks:
      - default
      - npm

  ys-mongo:
    container_name: mongo
    image: mongo:4.4.8
    restart: always
    volumes:
      - ./your_spotify_db:/data/db

  ys-web:
    container_name: ys-web
    image: yooooomi/your_spotify_client
    restart: always
    environment:
      - API_ENDPOINT=https://ys.kenharris.xyz/api
    # Port 3000
    networks:
      - default
      - npm

networks:
  npm:
    external: true
KenHV commented 1 year ago

The URL seems to have updated by itself now, but even with the proper URL I'm still getting the same page, and I'm not able to access the URL manually to authenticate.

image

Yooooomi commented 1 year ago

Hello, I'm sorry it is happening to you. Could you share the logs of your browser? It seems like it's not related to your_spotify but rather to your hosting.

KenHV commented 1 year ago

Hey, how do I get browser logs? If it helps, I'm running both services through Nginx Proxy Manager.

Yooooomi commented 1 year ago

Right click page, inspect, click the console tab. After this refresh your page and try to log in. Also, did you do step 5 of the readme?

KenHV commented 1 year ago

Nothing pops up in the logs there, and I have done step 5. Sorry for the delay, I have limited access to internet in these parts.

ToxicMushroom commented 1 year ago

for me cloudflare was caching the js document containing the url

unkindlykiller commented 1 year ago

for me cloudflare was caching the js document containing the url

same here i ended up making a page rule to bypass caching for spotify

KenHV commented 1 year ago

for me cloudflare was caching the js document containing the url

This worked, thank you!