[Feature request] Support configuring initial credentials via environment variables
- Ngôn ngữ chính
- Java
- Star
- 6.4k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 115
Mô tả
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
### Motivation
When deploying IoTDB in a containerized or orchestrated environment (e.g. Kubernetes), there is currently no way to set the initial user credentials through environment variables. The only documented approach is to start the server with default credentials, manually connect, and run:
`ALTER USER root SET PASSWORD 'newpwd';`
This is impractical for automated deployments where manual intervention is not an option.
Requested behavior:
The entrypoint/startup scripts should check for the presence of environment variables — for example IOTDB_USER and IOTDB_PASSWORD — and, if set, apply those credentials automatically on first startup. This would allow orchestration tools (Helm charts, Docker Compose, etc.) to inject credentials via secrets without requiring a manual post-deploy step.
Use case:
```
- name: IOTDB_USER
valueFrom:
secretKeyRef:
name: iotdb-secret
key: iotdb-user
- name: IOTDB_PASSWORD
valueFrom:
secretKeyRef:
name: iotdb-secret
key: iotdb-password
```
In a Kubernetes Helm chart, we inject IOTDB_USER and IOTDB_PASSWORD into the pod spec from a Secret:
The environment variables are present inside the container, but IoTDB ignores them entirely. The server starts with the default root/root credentials regardless.
### Solution
If IOTDB_USER and IOTDB_PASSWORD are set, the startup scripts should apply them (e.g. by running the equivalent of ALTER USER root SET PASSWORD ...) so the instance is ready to use with the desired credentials without manual intervention.
### Alternatives
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định entrypoint của IoTDB hoặc các script khởi động dùng để khởi tạo máy chủ và thông tin xác thực. Theo dõi cách tài khoản root ban đầu được tạo, sau đó xác định nơi IOTDB_USER và IOTDB_PASSWORD có thể được đọc trong lần khởi động đầu tiên. Công việc được xem là hoàn tất khi một triển khai dạng container có thể cung cấp các biến đó và khởi động bằng thông tin xác thực được yêu cầu mà không cần can thiệp thủ công bằng ALTER USER.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker-compose, helm, java, kubernetes
- Lĩnh vực
- authentication, database, devops
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100