mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-05-28 00:58:52 +08:00

### 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>
31 lines
671 B
Bash
Executable File
31 lines
671 B
Bash
Executable File
#!/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
|