Exeprotector/env_config_example.txt
2025-10-23 18:28:10 +08:00

37 lines
1.2 KiB
Plaintext
Raw 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.

# API服务器环境变量配置示例
# 将这些内容添加到服务器的 ~/.bashrc 或 systemd 服务文件中
# ========== 数据库配置 ==========
export DB_HOST=localhost
export DB_USER=taiyi
export DB_PASSWORD=taiyi1224
export DB_NAME=filesend_db
# ========== API配置 ==========
# ⚠️ 必须修改为随机字符串!
# 生成方法python3 -c "import os; print(os.urandom(32).hex())"
export API_KEY=change-this-to-random-string-at-least-32-characters-long
# ========== 使用方法 ==========
# 方法1添加到 ~/.bashrc推荐
# 1. nano ~/.bashrc
# 2. 复制上面的 export 语句到文件末尾
# 3. 修改为实际值
# 4. source ~/.bashrc
# 方法2在 systemd 服务文件中配置
# 在 /etc/systemd/system/license-api.service 的 [Service] 部分添加:
# Environment="DB_HOST=localhost"
# Environment="DB_USER=taiyi"
# Environment="DB_PASSWORD=taiyi1224"
# Environment="DB_NAME=filesend_db"
# Environment="API_KEY=你的密钥"
# ========== 安全提示 ==========
# ⚠️ API_KEY 必须修改为强随机字符串至少32个字符
# ⚠️ 不要在公共场合分享这些配置
# ⚠️ 定期更换 API_KEY 以提高安全性
# ⚠️ 使用 chmod 600 限制配置文件权限