接入Gitea Actions蓝绿发布:API_KEY构建时注入、新增Dockerfile

- src/config.js 的 API_KEY 改为从构建时环境变量 TINODE_API_KEY 注入,
  不再依赖官方demo默认值;未设置时保留原demo key作为本地快速测试的兜底
- webpack.config.js 新增 DefinePlugin 完成注入,并自动加载(gitignored的)
  .env.local,开发者本地调试不需要每次手动export
- 新增 Dockerfile(node构建+nginx serve) 和 docker/nginx.conf
- 新增 .gitea/workflows/deploy.yml:手动触发的蓝绿发布流程
This commit is contained in:
Your Name
2026-08-11 12:40:12 +08:00
parent 14e1e6b549
commit 85ac8ce43b
6 changed files with 114 additions and 2 deletions
+5 -2
View File
@@ -5,8 +5,11 @@ export const BASE_APP_NAME = 'TinodeWeb';
// Name of this application, used in the User-Agent.
export const APP_NAME = BASE_APP_NAME + '/' + (PACKAGE_VERSION || '0.25');
// API key. Use https://github.com/tinode/chat/tree/master/keygen to generate your own
export const API_KEY = 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';
// API key. Use https://github.com/tinode/chat/tree/master/keygen to generate your own.
// Injected at build time via webpack DefinePlugin from the TINODE_API_KEY env var
// (see webpack.config.js and .env.local). Falls back to the public sample key when unset,
// which only works against a backend still using the matching sample API_KEY_SALT.
export const API_KEY = process.env.TINODE_API_KEY || 'AQEAAAABAAD_rAp4DJh05a1HAwFT3A6K';
// The array of possible hosts to connect to.
export const KNOWN_HOSTS = {hosted: 'web.tinode.co', local: 'localhost:6060'};