Config property for config file path
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
f11bf314c7
commit
58553c6932
3 changed files with 7 additions and 4 deletions
|
@ -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.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.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" |
|
| 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
|
## IP lookup
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,11 @@ public class AppConfig {
|
||||||
|
|
||||||
@Produces
|
@Produces
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public Config config(ObjectMapper objectMapper) throws IOException {
|
public Config config(
|
||||||
File configFile = new File("config.json");
|
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);
|
return objectMapper.readValue(configFile, Config.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
quarkus.log.level=INFO
|
quarkus.log.level=INFO
|
||||||
quarkus.log.category."de.rpr.ddnsclient".min-level=TRACE
|
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
|
||||||
|
|
Loading…
Reference in a new issue