linuxserver / docker-ombi

GNU General Public License v3.0
160 stars 35 forks source link

Feature Request: Move appsettings.json to /config #29

Closed JonLaliberte closed 5 years ago

JonLaliberte commented 6 years ago

The only way to make a change to the background images is by editing the /opt/ombi/appsettings.json file. It would be nice if this file were in /config (so the changes persist).

aptalca commented 6 years ago

Moving it to /config would be hacky because if it got updated later on by the developer, the user wouldn't get those updates and it may break.

I'll get in touch with the dev and see if it is something that may be added to the gui settings.

In the meantime, you can mount that file from a local location through your docker create/run command or compose yml.

-v /path/to/custom/appsettings.json:/opt/ombi/appsettings.json

JonLaliberte commented 6 years ago

Got it, thanks for the follow up!

jayotterbein commented 6 years ago

There are a few options that can be done right now. Looking at the Ombi code it's doing this:

var builder = new ConfigurationBuilder()
            .SetBasePath(env.ContentRootPath)
            .AddJsonFile("appsettings.json", false, false)
            .AddJsonFile($"appsettings.{env.EnvironmentName}.json", true)
            .AddEnvironmentVariables();

Appsettings.something.json

You can make a new appsettings.something.json file and set the env name; but this might impact other items in the Ombi code.

You need to find out what the current EnvironmentName is set to.. or you can set it yourself by using the environment variable ASPNETCORE_ENVIRONMENT

I don't plan to give more info on this one since it's convoluted

Environment Variables - I suggest this

You could add environment variables that match the setting you want to change. Here's how you might change the log level.

The json:

 "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Debug",
      "System": "Debug",
      "Microsoft": "None",
      "Hangfire": "None"
    }
},

You would add an environment variable -e "Logging:LogLevel:Default=Fatal"

Modifying Ombi to allow it

The other option is to ask Ombi to add another configuration designed for end user changes then expose that.

homerr commented 5 years ago

https://github.com/tidusjar/Ombi/issues/2653 gives further information on this one.

aptalca commented 5 years ago

A solution was provided using environment variables

eltiel commented 4 years ago

Sorry for bringing this up, but how do you apply the environment variables for the backgrounds considering that it is an array?

I've tried "LandingPageBackground:Movies=" and "LandingPageBackground:Movies=[]" but neither seems to work.

j0nnymoe commented 4 years ago

@eltiel following the instructions that's already been mentioned: https://github.com/linuxserver/docker-ombi/issues/29#issuecomment-380114852

eltiel commented 4 years ago

@eltiel following the instructions that's already been mentioned: #29 (comment)

I thought that method isn't recommended?