From f2e268fbcf2af5d895f92876450abb9b3f39e0f6 Mon Sep 17 00:00:00 2001 From: hajimi Date: Sun, 2 Aug 2026 11:16:37 +0800 Subject: [PATCH] chore: secure production runtime secrets --- .gitignore | 2 ++ docker/.env.crawler.production.example | 24 +++++++++++++++++++++ docker/.env.server.production.example | 30 ++++++++++++++++++++++++++ server/config/cache.php | 2 +- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 docker/.env.crawler.production.example create mode 100644 docker/.env.server.production.example diff --git a/.gitignore b/.gitignore index a539c28..c898c93 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ qa/ .tmp* .codex/ docker/.env.server +docker/.env.server.production +docker/.env.crawler.production diff --git a/docker/.env.crawler.production.example b/docker/.env.crawler.production.example new file mode 100644 index 0000000..5535c1c --- /dev/null +++ b/docker/.env.crawler.production.example @@ -0,0 +1,24 @@ +TZ=Asia/Shanghai + +DQD_DB_HOST=127.0.0.1 +DQD_DB_PORT=3300 +DQD_DB_NAME=sbnews +DQD_DB_USER=sbnews +DQD_DB_PASSWORD=change_me +DQD_DB_PREFIX=la_ +DQD_DB_CHARSET=utf8mb4 +DQD_DB_POOL_SIZE=5 + +DQD_REDIS_HOST=127.0.0.1 +DQD_REDIS_PORT=6377 +DQD_REDIS_PASSWORD=change_me +DQD_REDIS_DB=2 + +DQD_LOG_LEVEL=INFO +DQD_LOG_FILE=/app/logs/crawler.log + +EMBEDDING_API_KEY=change_me +EMBEDDING_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode +EMBEDDING_MODEL=text-embedding-v4 +EMBEDDING_DIM=1024 +EMBEDDING_BATCH_SIZE=10 diff --git a/docker/.env.server.production.example b/docker/.env.server.production.example new file mode 100644 index 0000000..cb9681a --- /dev/null +++ b/docker/.env.server.production.example @@ -0,0 +1,30 @@ +APP_DEBUG = false +DASHSCOPE_API_KEY = change_me + +[APP] +DEFAULT_TIMEZONE = Asia/Shanghai + +[DATABASE] +TYPE = mysql +HOSTNAME = 127.0.0.1 +DATABASE = sbnews +USERNAME = sbnews +PASSWORD = change_me +HOSTPORT = 3300 +CHARSET = utf8mb4 +DEBUG = false +PREFIX = la_ + +[CACHE] +DRIVER = redis +HOST = 127.0.0.1 +PORT = 6377 +PASSWORD = change_me +SELECT = 2 + +[LANG] +default_lang = zh-cn + +[PROJECT] +UNIQUE_IDENTIFICATION = likeadmin +DEMO_ENV = false diff --git a/server/config/cache.php b/server/config/cache.php index d21153d..51c18f6 100644 --- a/server/config/cache.php +++ b/server/config/cache.php @@ -33,7 +33,7 @@ return [ // 端口 'port' => env('cache.port', '6377'), // 密码 - 'password' => env('cache.password', 'hajiminanbeilvdou'), + 'password' => env('cache.password', ''), // 缓存前缀 'prefix' => 'la:', // 数据库编号