mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Add Kibana component for Elasticsearch (#1710)
### What problem does this PR solve? Add Kibana component for Elasticsearch ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: Theta Wang (ncu) <chunshan.connect@gmail.com>
This commit is contained in:
30
docker/init-kibana.sh
Executable file
30
docker/init-kibana.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 等待 Elasticsearch 啟動
|
||||
until curl -u "elastic:${ELASTIC_PASSWORD}" -s http://es01:9200 >/dev/null; do
|
||||
echo "等待 Elasticsearch 啟動..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
|
||||
echo "使用者: elastic:${ELASTIC_PASSWORD}"
|
||||
|
||||
|
||||
|
||||
PAYLOAD="{
|
||||
\"password\" : \"${KIBANA_PASSWORD}\",
|
||||
\"roles\" : [ \"kibana_admin\",\"kibana_system\" ],
|
||||
\"full_name\" : \"${KIBANA_USER}\",
|
||||
\"email\" : \"${KIBANA_USER}@example.com\"
|
||||
}"
|
||||
echo "新用戶帳戶: $PAYLOAD"
|
||||
|
||||
# 創建新用戶帳戶
|
||||
curl -X POST "http://es01:9200/_security/user/${KIBANA_USER}" \
|
||||
-u "elastic:${ELASTIC_PASSWORD}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$PAYLOAD"s
|
||||
|
||||
echo "新用戶帳戶已創建"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user