| ... |
... |
@@ -42,6 +42,8 @@ import java.nio.file.Files; |
|
42
|
42
|
import java.nio.file.Path;
|
|
43
|
43
|
import java.util.Collections;
|
|
44
|
44
|
import java.util.Map;
|
|
|
45
|
+import java.util.Properties;
|
|
|
46
|
+import java.util.Set;
|
|
45
|
47
|
|
|
46
|
48
|
/**
|
|
47
|
49
|
* Web server configuration.
|
| ... |
... |
@@ -90,9 +92,13 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar |
|
90
|
92
|
ServerConfig fakeConfig = new ServerConfig(setCommonExtraConfigDirectory(setConfigFileName(init)), true);
|
|
91
|
93
|
fakeConfig.initFirst();
|
|
92
|
94
|
|
|
|
95
|
+ // Get extra scope options (if any)
|
|
|
96
|
+ Properties extraProperties = new Properties();
|
|
|
97
|
+ fakeConfig.get().putAll(extraProperties, ApplicationConfigScope.EXTRA);
|
|
|
98
|
+ extraProperties.put(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
|
|
93
|
99
|
// Now that common files are ready, starts a normal configuration without system file and without migration possible
|
|
94
|
100
|
ApplicationConfigInit realInit = ApplicationConfigInit.forAllScopesWithout(ApplicationConfigScope.HOME, ApplicationConfigScope.ENV, ApplicationConfigScope.SYSTEM)
|
|
95
|
|
- .addDefaults(ServerConfigOption.CONTEXT_PATH.getKey(), contextPath);
|
|
|
101
|
+ .setDefaults(extraProperties);
|
|
96
|
102
|
|
|
97
|
103
|
ServerConfig config = new ServerConfig(setInstanceExtraConfigDirectory(setConfigFileName(realInit)));
|
|
98
|
104
|
config.init(true);
|
| ... |
... |
@@ -143,7 +149,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar |
|
143
|
149
|
File extraConfigFile = get().getExtraConfigFile();
|
|
144
|
150
|
if (Files.notExists(extraConfigFile.toPath())) {
|
|
145
|
151
|
log.info(String.format("Save common configuration file to: %s", extraConfigFile));
|
|
146
|
|
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
|
|
|
152
|
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
|
|
147
|
153
|
}
|
|
148
|
154
|
|
|
149
|
155
|
File log4jConfigurationFile = getCommonLog4jConfigurationFile();
|
| ... |
... |
@@ -174,7 +180,7 @@ public class ServerConfig extends GeneratedServerConfig implements CleanTemporar |
|
174
|
180
|
// See https://gitlab.com/ultreiaio/ird-observe/-/issues/2735
|
|
175
|
181
|
|
|
176
|
182
|
log.info(String.format("Save instance configuration file to: %s", extraConfigFile));
|
|
177
|
|
- ConfigHelper.save(get(), extraConfigFile, new String[0], ServerResources.APPLICATION_CONFIGURATION, options());
|
|
|
183
|
+ ConfigHelper.save(get(), extraConfigFile, Set.of(), ServerResources.APPLICATION_CONFIGURATION, options());
|
|
178
|
184
|
|
|
179
|
185
|
if (log.isInfoEnabled()) {
|
|
180
|
186
|
String message = getConfigurationDescription();
|