mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-08 20:20:19 +08:00
Use PostgreSQL as the only database backend across runtime, schema tooling, installation, Compose, and CI. Update regression tests and reject removed drivers explicitly.
27 lines
635 B
Bash
Executable File
27 lines
635 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# 生成安全密钥
|
|
|
|
set -euo pipefail
|
|
|
|
urlsafe_rand() { openssl rand -base64 "$1" | tr '+/' '-_' | tr -d '='; }
|
|
|
|
jwt_key=$(urlsafe_rand 32)
|
|
encryption_key=$(urlsafe_rand 32)
|
|
db_password=$(urlsafe_rand 32)
|
|
redis_password=$(urlsafe_rand 32)
|
|
|
|
cat <<EOF
|
|
|
|
将以下内容添加到 .env 文件:
|
|
|
|
JWT_SECRET_KEY=${jwt_key}
|
|
ENCRYPTION_KEY=${encryption_key}
|
|
DB_PASSWORD=${db_password}
|
|
REDIS_PASSWORD=${redis_password}
|
|
|
|
注意:
|
|
- JWT_SECRET_KEY 用于用户登录 token 签名
|
|
- ENCRYPTION_KEY 用于敏感数据加密 (如 Provider API Keys)
|
|
- 数据库和 Redis 密码分别生成,不复用应用加密密钥
|
|
EOF
|