}
installDir = file(install4jHomeDir)
mediaTypes = Arrays.asList(install4jMediaTypes.split(","))
- if (dev.equals("true")) {
+ if (install4jFaster.equals("true")) {
faster = true
}
}
Wildcards can be used (*.mycompany.com) and multiple values can be
separated by commas (app1.foo.com,app2.bar.com,app3.baz.com). -->
<properties>
- <getdown.host.whitelist />
+ <getdown.host.whitelist>jalview.org,*.jalview.org</getdown.host.whitelist>
</properties>
<build>
// process, our caller can use the appbase to download a new configuration file
_appbase = config.getString("appbase");
+ // see if locatorConfig override
+ if (locatorConfig != null && !StringUtil.isBlank(locatorConfig.getString("appbase"))) {
+ _appbase = locatorConfig.getString("appbase");
+ }
+
if (_appbase == null) {
throw new RuntimeException("m.missing_appbase");
}
public static void addStartupFile(String filename) {
_startupFiles.add(new File(filename));
}
-
private Config createLocatorConfig(Config.ParseOpts opts) {
if (_locatorFile == null) {
log.warning("Given locator file does not exist", "file", _locatorFile);
}
- // appbase is sanitised in HostWhitelist and here!
- Map<String, Object> tmpdata = new HashMap<>();
- tmpdata.put("appbase", tmpConfig.getString("appbase"));
- tmpdata.put("appargs", tmpConfig.getString("appargs"));
- tmpdata.put("jvmargs", tmpConfig.getString("jvmargs"));
- tmpdata.put(LOCATOR_FILE_EXTENSION+"replace", tmpConfig.getString(LOCATOR_FILE_EXTENSION+"replace"));
- tmpdata.put(LOCATOR_FILE_EXTENSION+"merge", tmpConfig.getString(LOCATOR_FILE_EXTENSION+"merge"));
- locatorConfig = new Config(tmpdata);
+ // appbase is sanitised in HostWhitelist
+ Map<String, Object> tmpData = new HashMap<>();
+ for (Map.Entry<String, Object> entry : tmpConfig.getData().entrySet()) {
+ String key = entry.getKey();
+ Object value = entry.getValue();
+ String mkey = key.indexOf('.') > -1 ? key.substring(key.indexOf('.') + 1) : key;
+ if (Config.allowedReplaceKeys.contains(mkey) || Config.allowedMergeKeys.contains(mkey)) {
+ tmpData.put(key, value);
+ }
+ }
+ locatorConfig = new Config(tmpData);
} catch (Exception e) {
log.warning("Failure reading locator file", "file", _locatorFile, e);
}
+ log.info("Returning locatorConfig", locatorConfig);
+
return locatorConfig;
}
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
public String[] getMultiValue (String name)
{
Object value = _data.get(name);
+ if (value == null) {
+ return new String[] {};
+ }
if (value instanceof String) {
return new String[] { (String)value };
} else {
String key = entry.getKey();
Object nvalue = entry.getValue();
- if (!merge || key.equals("appbase")) {
- _data.put(key, nvalue);
- } else {
+ String mkey = key.indexOf('.') > -1 ? key.substring(key.indexOf('.') + 1) : key;
+ if (merge && allowedMergeKeys.contains(mkey)) {
- // merge
+ // merge multi values
Object value = _data.get(key);
}
}
+ } else if (allowedReplaceKeys.contains(mkey)){
+
+ // replace value
+
+ _data.put(key, nvalue);
+ } else {
+ log.warning("Not merging key '"+key+"' into config");
}
}
}
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry<String, Object> entry : getData().entrySet()) {
+ String key = entry.getKey();
+ Object val = entry.getValue();
+ sb.append(key);
+ sb.append("=");
+ if (val instanceof String) {
+ sb.append((String)val);
+ } else if (val instanceof String[]) {
+ sb.append(Arrays.toString((String[])val));
+ } else {
+ sb.append("Value not String or String[]");
+ }
+ sb.append("\n");
+ }
+ return sb.toString();
+ }
+
public Map<String, Object> getData() {
return _data;
}
private final Map<String, Object> _data;
+
+ public static final List<String> allowedReplaceKeys = Arrays.asList("appbase","apparg","jvmarg"); // these are the ones we might use
+ public static final List<String> allowedMergeKeys = Arrays.asList("apparg","jvmarg"); // these are the ones we might use
+ //private final List<String> allowedMergeKeys = Arrays.asList("apparg","jvmarg","resource","code","java_location"); // (not exhaustive list here)
}
-mv clean package -Dgetdown.host.whitelist=jalview.org,*.jalview.org && cp launcher/target/getdown-launcher-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-launcher.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j8lib/getdown-core.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j11lib/getdown-core.jar
+mvn clean package -Dgetdown.host.whitelist=jalview.org,*.jalview.org && cp launcher/target/getdown-launcher-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-launcher.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j8lib/getdown-core.jar && cp core/target/getdown-core-1.8.3-SNAPSHOT.jar ../../../j11lib/getdown-core.jar
install4jInstallerFileAssociations = file_associations_auto-install4j.xml
install4jBuildDir = build/install4j
install4jMediaTypes = windows,macosArchive,linuxRPM,linuxDeb,unixArchive
+install4jFaster = false
+
OSX_KEYSTORE =
OSX_KEYPASS =
JSIGN_SH = echo
<versionLine x="85" y="109" text="version ${compiler:sys.version}" fontSize="8" fontColor="0,0,0" bold="false" />
</text>
</splashScreen>
- <java mainClass="com.threerings.getdown.launcher.GetdownApp" mainMode="1" vmParameters="" arguments=". noappid" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
+ <java mainClass="com.threerings.getdown.launcher.GetdownApp" mainMode="1" vmParameters="" arguments=". jalview" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
<classPath>
<archive location="getdown-launcher.jar" failOnError="true" />
</classPath>
<versionLine x="85" y="109" text="version ${compiler:sys.version}" fontSize="8" fontColor="0,0,0" bold="false" />
</text>
</splashScreen>
- <java mainClass="com.threerings.getdown.launcher.GetdownApp" mainMode="1" vmParameters="" arguments=". noappid" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
+ <java mainClass="com.threerings.getdown.launcher.GetdownApp" mainMode="1" vmParameters="" arguments=". jalview" allowVMPassthroughParameters="true" preferredVM="" bundleRuntime="true">
<classPath>
<archive location="getdown-launcher.jar" failOnError="true" />
</classPath>
<component id="1156" />
</excludedComponents>
<includedDownloadableComponents />
- <excludedLaunchers>
- <launcher id="737" />
- </excludedLaunchers>
+ <excludedLaunchers />
<excludedBeans />
<overriddenPrincipalLanguage id="en" customLocalizationFile="" />
<exclude>