This commit is contained in:
ai-dev
2025-09-21 23:38:26 +02:00
parent 4c55afbc92
commit e8098221d8
10 changed files with 119 additions and 134 deletions

View File

@@ -1,14 +0,0 @@
#!/command/with-contenv bash
set -euo pipefail
SRC_DIR=/rootfs-config
DST_DIR=/usr/share/opensearch/config
if [ -d "$SRC_DIR" ]; then
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
for f in "$SRC_DIR"/*; do
base=$(basename "$f")
if [ ! -f "$DST_DIR/$base" ]; then
cp "$f" "$DST_DIR/"
echo "[cont-init] Copied $base"
fi
done
fi

View File

@@ -1,27 +0,0 @@
#!/command/with-contenv bash
set -euo pipefail
OPTIONS_FILE=/data/options.json
# Read options from Supervisor
admin_password=$(bashio::config 'admin_password')
# Export as environment variables for OpenSearch
export OPENSEARCH_INITIAL_ADMIN_PASSWORD="${admin_password}"
if [ ! -f "$OPTIONS_FILE" ]; then
echo "[cont-init] No options.json, skipping plugin install"
exit 0
fi
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
echo "[cont-init] No plugins configured, skipping"
exit 0
fi
echo "[cont-init] Installing plugins from options.json"
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
echo "[cont-init] Installing plugin: $plugin"
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
echo "[cont-init] Installed $plugin"
else
echo "[cont-init] Failed to install $plugin (continuing)"
fi
done