Replace cookie authentication with revocable Bearer sessions, optional one-use PNG challenges, bounded login limits, and short-lived market WebSocket tickets. Keep captcha disabled by default. Standardize ordinary JSON responses while preserving HTTP statuses, raw OpenAPI, redirects, SSE, and WebSocket semantics. Revoke long connections with their owning session. Expose official calendar data and collector status to the frontend and research tools, support bilingual news topics, and keep summaries and forward-only labels explicit. Verify the staged snapshot with all 305 backend tests.
13 lines
798 B
Bash
13 lines
798 B
Bash
# 复制为仓库根目录 .env(chmod 600);只有这一套配置
|
|
DATABASE_URL=postgresql+asyncpg://alphapulse:<密码>@postgres:5432/alphapulse
|
|
# DB 14 与 AFFiNE 共用,key 一律带 ap: 前缀
|
|
REDIS_URL=redis://:<密码>@redis:6379/14
|
|
JWT_SECRET=<openssl rand -hex 32>
|
|
ADMIN_USERNAME=admin
|
|
# 哈希含 $,必须用单引号包住,否则 compose 会做变量替换
|
|
ADMIN_PASSWORD_HASH='<python -m alphapulse.core.auth hash-password 的输出>'
|
|
# 登录验证码默认关闭;设为 true 后启用,修改后须重新部署 API
|
|
LOGIN_CAPTCHA_ENABLED=false
|
|
# 加密存库的第三方 API key(Fernet);丢失后已存的 key 无法解密,需要在页面重新填写
|
|
SECRET_ENCRYPTION_KEY=<python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())">
|