mitchray / ample

A simple web browser client for Ampache
https://ample-player.vercel.app/
GNU Affero General Public License v3.0
63 stars 13 forks source link

Config file doesn't appear to be working #56

Closed troycarpenter closed 4 months ago

troycarpenter commented 4 months ago

Trying the 3.0.0 Beta5 from zip file. I tried setting up the (now) required config file ample.json. However, the login page says "No Ampache URL was set in the config file". I have tried to put the file in the ./config directory as well as the root directory for ample.

{
    "ampacheURL": "https://ampache.mydomain.com",
    "loginMessage": "My Music Server",
}

I then went back to my 2.0.3 install and tried to add the config there (I didn't realize it supported a config file). It also didn't work there either (the Ampache URL in the login screen was the default "https://ampache-server" entry).

I need some help trying to figure out why Ample isn't reading the configuration file.

troycarpenter commented 4 months ago

So after clearing some caches and the like, I can say that the 2.0.3 is now using the config file. Let me verify if 3.x is also now working.

3.0.0Beta5 still doesn't appear to be reading the config.

mitchray commented 4 months ago

Are there any messages in the browser console?

troycarpenter commented 4 months ago

This is from the Developer Tools -> console. image If there's another console I should be looking at, let me know. But nothing in that console output seems to be related to the server name.

troycarpenter commented 4 months ago

Also, I can see in the Network tab that the ample.json file is fetched and I can see its contents.

One oddity is that it is showing as https://ampache-server.com/ample//config/ample.json. I'm not sure if the extra forward slash makes a difference. If I put the URL in my browser with the extra slash it still brings up the ample.json file correctly.

mitchray commented 4 months ago

Do you have a trailing slash in your ampacheURL in the config (there shouldn't be one)

That wouldn't affect the config file loading

mitchray commented 4 months ago

It also needs to be a valid JSON file (https://jsonlint.com/), so remove the comma after "My Music Server". I think that will be the cause, I'll make mention of that in the readme

troycarpenter commented 4 months ago

That did fix it. I will note that the config file in the README also has a comma after the last entry after the logo: line, which is why I didn't even think about it.