add opensearch addons

This commit is contained in:
ai-dev
2025-09-21 16:25:15 +02:00
parent f8ce15efbd
commit ae63025087
71 changed files with 1060 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/command/with-contenv bash
set -euo pipefail
OPTIONS_FILE=/data/options.json
if [ ! -f "$OPTIONS_FILE" ]; then
echo "[cont-init] No options.json, skipping dashboards plugin install"
exit 0
fi
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
echo "[cont-init] No dashboards plugins configured, skipping"
exit 0
fi
echo "[cont-init] Installing dashboards plugins from options.json"
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
echo "[cont-init] Installing dashboards plugin: $plugin"
if /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install --allow-root "$plugin"; then
echo "[cont-init] Installed dashboards plugin $plugin"
else
echo "[cont-init] Failed to install dashboards plugin $plugin (continuing)"
fi
done

View File

@@ -0,0 +1,3 @@
#!/command/execlineb -S0
# Prevent restart loops; allow clean exit
exit 0

View File

@@ -0,0 +1,8 @@
#!/command/with-contenv bash
set -euo pipefail
OPTIONS_FILE=/data/options.json
HOST=$(jq -r '.opensearch_host // "http://localhost"' "$OPTIONS_FILE" 2>/dev/null || echo "http://localhost")
PORT=$(jq -r '.opensearch_port // 9200' "$OPTIONS_FILE" 2>/dev/null || echo 9200)
OPTS_HOSTS="${HOST}:${PORT}"
echo "[s6-run] Starting OpenSearch Dashboards connecting to ${OPTS_HOSTS}"
exec /usr/share/opensearch-dashboards/bin/opensearch-dashboards --opensearch.hosts="${OPTS_HOSTS}" --server.host=0.0.0.0