bitflicker64 commented on code in PR #3192:
URL: https://github.com/apache/hugegraph/pull/3192#discussion_r4602930001
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -37,6 +37,45 @@ run_startup_step() {
return "$status"
}
+# Property reading/writing goes through props.awk, which implements the
+# java.util.Properties grammar HugeConfig applies (escapes, `:`/whitespace
+# separators, CR/CRLF/LF line terminators, continuations, first-definition-wins
+# duplicates). grep/sed rewrites disagree with it on mounted or upgraded
+# configs, silently producing two definitions of one key. Values move through
+# environment variables rather than argv so a PASSWORD never shows up in `ps`
+# output.
+#
+# props.awk lives in the packaged bin/ directory because bin/enable-auth.sh
+# reads properties with it too, and that assembly fileSet is what both the
+# release tarball and this image are built from. Beside the entrypoint is only
+# where the source tree and the tests put it.
+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+props_from_env="${PROPS_AWK:-}"
+yaml_from_env="${YAMLSCAN_AWK:-}"
+PROPS_AWK=""
+for candidate in "${props_from_env}" "${HERE}/props.awk"
"${HERE}/bin/props.awk"; do
+ if [[ -n "${candidate}" && -f "${candidate}" ]]; then
+ PROPS_AWK="${candidate}"
+ break
+ fi
+done
+if [[ -z "${PROPS_AWK}" ]]; then
+ log "ERROR: props.awk not found beside the entrypoint or in bin/"
Review Comment:
Important: master's `test/test-docker-entrypoint-process.sh` stages only
`start-hugegraph.sh` and `util.sh`, so this exit fires on its first case and
both `docker / docker-build` and `server-rocksdb` fail with `entrypoint exited
before .../exit0/child-running`. Copy `props.awk` into that fixture's `bin/`
and `yamlscan.awk` beside its `entrypoint.sh`.
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -48,7 +87,13 @@ encode_prop_value() {
char="${value:i:1}"
case "${char}" in
"\\") encoded+="\\\\" ;;
- " ") encoded+="\\ " ;;
+ # \u0020 and not `\ `: both readers turn it back into a space, but
+ # a line right-trimmed before the continuation check -- which is
how
+ # commons-configuration reads it -- leaves the backslash of `\ `
+ # behind at the end of the line, and that swallows the property
+ # written under it. A secret ending in a space used to move
+ # auth.authenticator inside the password value.
+ " ") encoded+="\\u0020" ;;
Review Comment:
Minor: `encode_prop_value` writes `\u0020` itself, so the `sed 's/\\
/\\u0020/g'` in `encode_auth_prop_value` and in the `HG_SERVER_SERVICE_ID`
mapping never match, and the comment on line 79 still says typed mappings keep
the old encoder. Drop both `sed` calls and update that comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]