bitflicker64 commented on code in PR #2952:
URL:
https://github.com/apache/incubator-hugegraph/pull/2952#discussion_r2839158290
##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -15,32 +15,66 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+set -euo pipefail
-# create a folder to save the docker-related file
-DOCKER_FOLDER='./docker'
-mkdir -p $DOCKER_FOLDER
-
+DOCKER_FOLDER="./docker"
INIT_FLAG_FILE="init_complete"
+GRAPH_CONF="./conf/graphs/hugegraph.properties"
+
+mkdir -p "${DOCKER_FOLDER}"
+
+log() { echo "[hugegraph-server-entrypoint] $*"; }
+
+fail_on_deprecated() {
+ local old_name="$1" new_name="$2"
+ if [[ -n "${!old_name:-}" ]]; then
+ echo "ERROR: deprecated env '${old_name}' detected. Use '${new_name}'
instead." >&2
+ exit 2
+ fi
+}
+
+set_prop() {
+ local key="$1" val="$2" file="$3"
+ if grep -q -E "^[[:space:]]*${key}[[:space:]]*=" "${file}"; then
+ sed -ri "s#^([[:space:]]*${key}[[:space:]]*=).*#\\1${val}#" "${file}"
+ else
+ echo "${key}=${val}" >> "${file}"
+ fi
+}
-if [ ! -f "${DOCKER_FOLDER}/${INIT_FLAG_FILE}" ]; then
- # wait for storage backend
- ./bin/wait-storage.sh
- if [ -z "$PASSWORD" ]; then
- echo "init hugegraph with non-auth mode"
+# ── Guard deprecated vars ─────────────────────────────────────────────
+fail_on_deprecated "BACKEND" "HG_SERVER_BACKEND"
Review Comment:
Updated the entrypoint to ensure deprecated environment variables no longer
prevent startup. Legacy variables are now mapped to their modern equivalents
with a warning, preserving compatibility with existing deployments while
maintaining current behavior for properly configured environments.
--
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]