Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonee committed Apr 6, 2024
1 parent a9352ec commit 07273d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 17 additions & 1 deletion CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ docker run \
The recommended way to configure Watchlistarr is to use a config file.
If you have volume concerns, then use the Environment Variable alternative

The order that Watchlistarr loads configuration is:
```
Default configuration (built-in)
Overridden by Environment variables/properties
Overridden by config.yaml
```
So the config.yaml file takes precedence over anything else set elsewhere.

#### Config.yaml file configuration (Recommended)
In order to use the config.yaml configuration, you will need to add a new line to your docker command:
```bash
Expand Down Expand Up @@ -168,7 +176,15 @@ Note: Different versions of Java and console and Operating Systems read the prop
### Configuring the Java application
Note: The Watchlistarr Java application does not read Environment Variables

Similar to Docker, there are two ways to configure the Java application. The recommended way is to use the config.yaml file (there should be one generated in the same directory as your watchlistarr.jar after your first run). For more details on how to use this config.yaml file, read the `Config.yaml file configuration` section above.
Similar to Docker, there are two ways to configure the Java application.

#### Configuring config.yaml in Java
The recommended way is to use the config.yaml file (there should be one generated in the same directory as your watchlistarr.jar after your first run). For more details on how to use this config.yaml file, read the `Config.yaml file configuration` section above.

If you'd like to provide a `config.yaml` file from a different location than the local directory, you can provide the location using `configPath`. For example:
```bash
java "-DconfigPath=config/config.yaml" -Xmx100m -jar watchlistarr.jar
```

#### Providing Java properties directly
The second way to configure a Java application is to provide properties directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ object FileAndSystemPropertyReader extends ConfigurationReader {

private lazy val data: Map[String, String] = {
val yaml = new Yaml()
val configDirPath = "config"
val configFile = new File(s"$configDirPath/config.yaml")
val configFile = new File(SystemPropertyReader.getConfigOption("configPath").getOrElse(s"config/config.yaml"))

try {
// Ensure parent config folder exists
Expand Down

0 comments on commit 07273d6

Please sign in to comment.