Files
Pine a813a139dc feat: serverrun/serverdata 全服务栈(参考 PineSoundServer)
- serverrun/:start-all.sh 一键编排 + start-compute/start-emqx + envcopy/encrypt-certs
- 服务编排:core(Dockerfile+compose)、compute-engine(build.sh+compose)、mysql、redis、mqtt(EMQX)
- serverdata/:新增 compute-data/compute-logs/mysql-data/redis-data/emqx-data/emqx-log
- 全服务仅 loopback 暴露,算力引擎 :3000 经 core 代理
2026-08-24 01:00:52 +08:00

19 lines
543 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 配置加密:.env → .env.enc(参考 PineSoundServer envcopy.sh
# 用途:生产机不落明文配置,仅保留加密包;部署时解密注入。
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
ENC_KEY="${ENC_KEY:-}"
if [ -z "$ENC_KEY" ]; then
echo "错误:请设置 ENC_KEYopenssl rand -hex 32" >&2
exit 1
fi
SRC="${1:-.env}"
DST="${SRC}.enc"
openssl enc -aes-256-cbc -pbkdf2 -salt -in "$SRC" -out "$DST" -pass pass:"$ENC_KEY"
echo "已加密:$SRC -> $DST"