mirror of
https://github.com/bitnami/containers.git
synced 2026-02-19 14:08:07 +08:00
[bitnami/neo4j] Release 4.4.12-debian-11-r5 (#12528)
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
@@ -5,7 +5,7 @@ ARG TARGETARCH
|
||||
|
||||
LABEL org.opencontainers.image.authors="https://bitnami.com/contact" \
|
||||
org.opencontainers.image.description="Application packaged by Bitnami" \
|
||||
org.opencontainers.image.ref.name="4.4.12-debian-11-r4" \
|
||||
org.opencontainers.image.ref.name="4.4.12-debian-11-r5" \
|
||||
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/neo4j" \
|
||||
org.opencontainers.image.title="neo4j" \
|
||||
org.opencontainers.image.vendor="VMware, Inc." \
|
||||
|
||||
@@ -126,10 +126,14 @@ is_neo4j_not_running() {
|
||||
neo4j_configure_memory_settings() {
|
||||
## neo4j-admin memrec returns the settings to be added in neo4j.conf
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/tools/neo4j-admin-memrec/#neo4j-admin-memrec
|
||||
local -a neo4j_admin_args=("memrec")
|
||||
if [ "$(get_neo4j_major_version)" -ge 5 ]; then
|
||||
neo4j_admin_args=("server" "memory-recommendation")
|
||||
fi
|
||||
info "Adjusting memory settings"
|
||||
while IFS= read -r setting; do
|
||||
neo4j_conf_set "${setting%=*}" "${setting#*=}"
|
||||
done < <(neo4j-admin memrec | grep -E "^[^#].*=")
|
||||
done < <(neo4j-admin "${neo4j_admin_args[@]}" | grep -E "^[^#].*=")
|
||||
}
|
||||
|
||||
########################
|
||||
@@ -173,8 +177,8 @@ neo4j_initialize() {
|
||||
## The logic in this function is based on the sections here https://neo4j.com/docs/operations-manual/current/configuration/
|
||||
info "Initializing Neo4j ..."
|
||||
|
||||
rm -f "${NEO4J_TMP_DIR}/neo4j*.pid"
|
||||
rm -f "${NEO4J_LOGS_DIR}/neo4j*.log"
|
||||
find "${NEO4J_TMP_DIR}" -type f -name "neo4j*.pid" -delete
|
||||
find "${NEO4J_LOGS_DIR}" -type f -name "neo4j*.log" -delete
|
||||
|
||||
## Configure permissions for read-write directories
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/configuration/file-locations/#file-locations-permissions
|
||||
@@ -197,17 +201,7 @@ neo4j_initialize() {
|
||||
|
||||
info "Configuring Neo4j with settings provided via environment variables"
|
||||
if ! [[ -f "${NEO4J_MOUNTED_CONF_DIR}/neo4j.conf" ]]; then
|
||||
local -r host="${NEO4J_HOST:-$(get_machine_ip)}"
|
||||
## Connector configuration
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/configuration/connectors/
|
||||
neo4j_conf_set "dbms.default_listen_address" "$NEO4J_BIND_ADDRESS"
|
||||
neo4j_conf_set "dbms.connector.bolt.advertised_address" ":${NEO4J_BOLT_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.connector.http.advertised_address" ":${NEO4J_HTTP_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.connector.https.advertised_address" ":${NEO4J_HTTPS_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.default_advertised_address" "$host"
|
||||
## Upgrade configuration (This is for allowing automatic schema upgrades)
|
||||
## Source: https://neo4j.com/docs/upgrade-migration-guide/current/upgrade/upgrade-4.3/deployment-upgrading/
|
||||
neo4j_conf_set "dbms.allow_upgrade" "$NEO4J_ALLOW_UPGRADE"
|
||||
configure_neo4j_connector_settings
|
||||
else
|
||||
info "Found mounted neo4j.conf file in ${NEO4J_MOUNTED_CONF_DIR}/neo4j.conf. The general Neo4j configuration will be skipped"
|
||||
fi
|
||||
@@ -226,10 +220,14 @@ neo4j_initialize() {
|
||||
## Set initial password
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/configuration/set-initial-password/
|
||||
info "Configuring initial password"
|
||||
local -a neo4j_admin_args=("set-initial-password")
|
||||
if [ "$(get_neo4j_major_version)" -ge 5 ]; then
|
||||
neo4j_admin_args=("dbms" "set-initial-password")
|
||||
fi
|
||||
if am_i_root; then
|
||||
debug_execute gosu "$NEO4J_DAEMON_USER" neo4j-admin set-initial-password "$NEO4J_PASSWORD"
|
||||
debug_execute gosu "$NEO4J_DAEMON_USER" neo4j-admin "${neo4j_admin_args[@]}" "$NEO4J_PASSWORD"
|
||||
else
|
||||
debug_execute neo4j-admin set-initial-password "$NEO4J_PASSWORD"
|
||||
debug_execute neo4j-admin "${neo4j_admin_args[@]}" "$NEO4J_PASSWORD"
|
||||
fi
|
||||
else
|
||||
info "Deploying Neo4j with persisted data"
|
||||
@@ -268,3 +266,53 @@ neo4j_custom_init_scripts() {
|
||||
touch "$NEO4J_VOLUME_DIR"/.user_scripts_initialized
|
||||
fi
|
||||
}
|
||||
|
||||
########################
|
||||
# Returns neo4j major version
|
||||
# Globals:
|
||||
# NEO4J_BASE_DIR
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
get_neo4j_major_version() {
|
||||
neo4j_version="$("${NEO4J_BASE_DIR}/bin/neo4j" version)"
|
||||
neo4j_version="${neo4j_version#"neo4j "}"
|
||||
major_version="$(get_sematic_version "$neo4j_version" 1)"
|
||||
echo "${major_version:-0}"
|
||||
}
|
||||
|
||||
########################
|
||||
# Configure connectors settings
|
||||
# Globals:
|
||||
# NEO4J_*
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
configure_neo4j_connector_settings() {
|
||||
local -r host="${NEO4J_HOST:-$(get_machine_ip)}"
|
||||
local -r neo4j_major_version="$(get_neo4j_major_version)"
|
||||
if [ "$neo4j_major_version" -eq 4 ]; then
|
||||
## Connector configuration
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/configuration/connectors/
|
||||
neo4j_conf_set "dbms.default_listen_address" "$NEO4J_BIND_ADDRESS"
|
||||
neo4j_conf_set "dbms.connector.bolt.advertised_address" ":${NEO4J_BOLT_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.connector.http.advertised_address" ":${NEO4J_HTTP_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.connector.https.advertised_address" ":${NEO4J_HTTPS_PORT_NUMBER}"
|
||||
neo4j_conf_set "dbms.default_advertised_address" "$host"
|
||||
## Upgrade configuration (This is for allowing automatic schema upgrades)
|
||||
## Source: https://neo4j.com/docs/upgrade-migration-guide/current/upgrade/upgrade-4.3/deployment-upgrading/
|
||||
neo4j_conf_set "dbms.allow_upgrade" "$NEO4J_ALLOW_UPGRADE"
|
||||
elif [ "$neo4j_major_version" -ge 5 ]; then
|
||||
neo4j_conf_set "server.default_listen_address" "$NEO4J_BIND_ADDRESS"
|
||||
neo4j_conf_set "server.bolt.advertised_address" ":${NEO4J_BOLT_PORT_NUMBER}"
|
||||
neo4j_conf_set "server.http.advertised_address" ":${NEO4J_HTTP_PORT_NUMBER}"
|
||||
neo4j_conf_set "server.https.advertised_address" ":${NEO4J_HTTPS_PORT_NUMBER}"
|
||||
neo4j_conf_set "server.default_advertised_address" "$host"
|
||||
else
|
||||
error "Neo4j branch ${neo4j_major_version} not supported"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ set -o pipefail
|
||||
. /opt/bitnami/scripts/libfs.sh
|
||||
. /opt/bitnami/scripts/liblog.sh
|
||||
|
||||
export JAVA_HOME="/opt/bitnami/java"
|
||||
|
||||
# Ensure the Neo4j base directory exists and has proper permissions
|
||||
info "Configuring file permissions for Neo4j"
|
||||
|
||||
@@ -36,14 +38,19 @@ for dir in "$NEO4J_CONF_DIR" "$NEO4J_PLUGINS_DIR" "$NEO4J_LOGS_DIR" "$NEO4J_DATA
|
||||
done
|
||||
|
||||
info "Configuring default settings in configuration files"
|
||||
|
||||
dir_settings_prefix="dbms"
|
||||
if [ "$(get_neo4j_major_version)" -ge 5 ]; then
|
||||
dir_settings_prefix="server"
|
||||
fi
|
||||
## Configure the default paths for neo4j
|
||||
## Source: https://neo4j.com/docs/operations-manual/current/configuration/file-locations/#file-locations
|
||||
neo4j_conf_set "dbms.directories.data" "$NEO4J_DATA_DIR"
|
||||
neo4j_conf_set "dbms.directories.plugins" "$NEO4J_PLUGINS_DIR"
|
||||
neo4j_conf_set "dbms.directories.logs" "$NEO4J_LOGS_DIR"
|
||||
neo4j_conf_set "dbms.directories.import" "$NEO4J_IMPORT_DIR"
|
||||
neo4j_conf_set "dbms.directories.transaction.logs.root" "${NEO4J_DATA_DIR}/transactions"
|
||||
neo4j_conf_set "dbms.directories.dumps.root" "${NEO4J_DATA_DIR}/dumps"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.data" "$NEO4J_DATA_DIR"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.plugins" "$NEO4J_PLUGINS_DIR"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.logs" "$NEO4J_LOGS_DIR"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.import" "$NEO4J_IMPORT_DIR"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.transaction.logs.root" "${NEO4J_DATA_DIR}/transactions"
|
||||
neo4j_conf_set "${dir_settings_prefix}.directories.dumps.root" "${NEO4J_DATA_DIR}/dumps"
|
||||
|
||||
## Create empty file for apoc.conf file as it is not included in the default neo4j installation
|
||||
## Source: https://neo4j.com/labs/apoc/4.2/config/
|
||||
|
||||
@@ -2,4 +2,3 @@ rolling-tags:
|
||||
- "4"
|
||||
- "4-debian-11"
|
||||
- "4.4.12"
|
||||
- "latest"
|
||||
|
||||
Reference in New Issue
Block a user