Config property for config file path
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Ryan Harg 2024-11-29 10:12:48 +01:00
parent f11bf314c7
commit 58553c6932
3 changed files with 7 additions and 4 deletions

View file

@ -32,6 +32,7 @@ ddnssclient can also be configured using some properties or environment variable
| ddnsclient.ip-provider | DDNSCLIENT_IP_PROVIDER | an ip lookup provider (see below) | null (random) |
| ddnsclient.dns.resolver | DDNSCLIENT_DNS_RESOLVER | e.g. "9.9.9.9", "1.1.1.1" | "9.9.9.9" |
| ddnsclient.backoff-duration | DDNSCLIENT_BACKOFF_DURATION | e.g. "60s", "1m" | "300s" |
| ddnssclient.config-file | DDNSCLIENT_CONFIG_FILE | e.g. "/path/to/your/config.json" | "config.json" |
## IP lookup

View file

@ -19,8 +19,11 @@ public class AppConfig {
@Produces
@ApplicationScoped
public Config config(ObjectMapper objectMapper) throws IOException {
File configFile = new File("config.json");
public Config config(
ObjectMapper objectMapper,
@ConfigProperty(name = "ddnsclient.config-file", defaultValue = "config.json") String configFilePath)
throws IOException {
File configFile = new File(configFilePath);
return objectMapper.readValue(configFile, Config.class);
}

View file

@ -1,4 +1,3 @@
quarkus.log.level=INFO
quarkus.log.category."de.rpr.ddnsclient".min-level=TRACE
quarkus.log.category."de.rpr.ddnsclient".level=INFO
quarkus.log.category."de.rpr.ddnsclient".level=INFO