Hello YaCy team,
I've been setting up my new instance using the YACY_ environment variables, and I've found that while it works for some settings like port or upnp.enabled, it does not work for others, like staticIP or browserPopUpTrigger. The environment variables for the latter to just be ignored, and my yacy.init still contains browserPopUpTrigger=true, and my startup logs still show the log lines where it tries to launch the browser.
Digging through the code, I think I might have found the problematic place:
|
for (final Map.Entry<String, String> entry: System.getenv().entrySet()) { |
|
final String yacykey = entry.getKey(); |
|
if (yacykey.startsWith("YACY_")) { |
|
key = yacykey.substring(5).toLowerCase().replace('_', '.'); |
|
if (this.configProps.containsKey(key)) this.configProps.put(key, entry.getValue()); |
|
} |
|
} |
I think the problem here is the toLowerCase here in line 146. Take for example the YACY_BROWSERPOPUPTRIGGER variable. The key value would end up as browserpopuptrigger, and I assume that the configProps.containsKey method does a case sensitive comparison and thus won't find the key, leading to the environment variable not being used.
For this one I'm afraid I wasn't able to come up with a good solution I could propose.
Hello YaCy team,
I've been setting up my new instance using the
YACY_environment variables, and I've found that while it works for some settings likeportorupnp.enabled, it does not work for others, likestaticIPorbrowserPopUpTrigger. The environment variables for the latter to just be ignored, and myyacy.initstill containsbrowserPopUpTrigger=true, and my startup logs still show the log lines where it tries to launch the browser.Digging through the code, I think I might have found the problematic place:
yacy_search_server/source/net/yacy/server/serverSwitch.java
Lines 143 to 149 in 6d8c08b
I think the problem here is the
toLowerCasehere in line 146. Take for example theYACY_BROWSERPOPUPTRIGGERvariable. Thekeyvalue would end up asbrowserpopuptrigger, and I assume that theconfigProps.containsKeymethod does a case sensitive comparison and thus won't find the key, leading to the environment variable not being used.For this one I'm afraid I wasn't able to come up with a good solution I could propose.