nodebbs 0.3.0-beta.4 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/docker-compose.yml +0 -1
- package/dist/templates/env +2 -2
- package/dist/utils/env.js +0 -11
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -59,7 +59,6 @@ services:
|
|
|
59
59
|
JWT_SECRET: ${JWT_SECRET:-change-this-to-a-secure-random-string-in-production}
|
|
60
60
|
JWT_ACCESS_TOKEN_EXPIRES_IN: ${JWT_ACCESS_TOKEN_EXPIRES_IN:-1y}
|
|
61
61
|
CORS_ORIGIN: ${CORS_ORIGIN:-*}
|
|
62
|
-
APP_URL: ${APP_URL:-http://localhost:3100}
|
|
63
62
|
TZ: Asia/Shanghai
|
|
64
63
|
volumes:
|
|
65
64
|
- api_uploads:/app/apps/api/uploads
|
package/dist/templates/env
CHANGED
|
@@ -34,10 +34,10 @@ JWT_ACCESS_TOKEN_EXPIRES_IN=1y
|
|
|
34
34
|
|
|
35
35
|
# CORS 配置
|
|
36
36
|
# 生产环境建议设置为具体的域名,例如: https://yourdomain.com
|
|
37
|
+
# 支持通配符 * 格式:https://yourdomain.com,https://*.yourdomain.com
|
|
37
38
|
CORS_ORIGIN=*
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
APP_URL=http://localhost:3100
|
|
40
|
+
|
|
41
41
|
|
|
42
42
|
# ========================================
|
|
43
43
|
# Web 前端配置
|
package/dist/utils/env.js
CHANGED
|
@@ -95,11 +95,6 @@ export async function initEnv() {
|
|
|
95
95
|
default: '7100'
|
|
96
96
|
});
|
|
97
97
|
const serverApiUrl = `http://api:${apiPort}`;
|
|
98
|
-
const defaultAppUrl = `http://localhost:${webPort}`;
|
|
99
|
-
const appUrl = await input({
|
|
100
|
-
message: '设置 APP_URL (应用访问地址):',
|
|
101
|
-
default: defaultAppUrl
|
|
102
|
-
});
|
|
103
98
|
const corsOrigin = await input({
|
|
104
99
|
message: '设置 CORS_ORIGIN (允许跨域的域名):',
|
|
105
100
|
default: '*'
|
|
@@ -111,7 +106,6 @@ export async function initEnv() {
|
|
|
111
106
|
console.log(`JWT_SECRET: ${jwtSecret.substring(0, 3)}******`);
|
|
112
107
|
console.log(`WEB_PORT: ${webPort}`);
|
|
113
108
|
console.log(`API_PORT: ${apiPort}`);
|
|
114
|
-
console.log(`APP_URL: ${appUrl}`);
|
|
115
109
|
console.log(`SERVER_API_URL: ${serverApiUrl}`);
|
|
116
110
|
console.log(`CORS_ORIGIN: ${corsOrigin}`);
|
|
117
111
|
console.log('==========================================\n');
|
|
@@ -135,7 +129,6 @@ export async function initEnv() {
|
|
|
135
129
|
'WEB_PORT': webPort,
|
|
136
130
|
'API_PORT': apiPort,
|
|
137
131
|
'SERVER_API_URL': serverApiUrl,
|
|
138
|
-
'APP_URL': appUrl,
|
|
139
132
|
'CORS_ORIGIN': corsOrigin,
|
|
140
133
|
};
|
|
141
134
|
// 针对每个 Key 进行替换。
|
|
@@ -250,10 +243,6 @@ export async function checkEnv(envType) {
|
|
|
250
243
|
logger.warning('生产环境建议设置具体的 CORS_ORIGIN');
|
|
251
244
|
warnings++;
|
|
252
245
|
}
|
|
253
|
-
if (!envConfig.APP_URL || envConfig.APP_URL === 'http://localhost:3100') {
|
|
254
|
-
logger.warning('生产环境建议设置实际的 APP_URL');
|
|
255
|
-
warnings++;
|
|
256
|
-
}
|
|
257
246
|
}
|
|
258
247
|
if (errors > 0) {
|
|
259
248
|
logger.error(`发现 ${errors} 个配置错误,无法继续。`);
|
package/oclif.manifest.json
CHANGED