1 parent
74493f0d5b
commit
606861822b
18 files changed
+129
-90
No files matched your search
@@ -88,7 +88,6 @@ const baseGroups = [
|
||||
group('site', '站点与域名', '', [
|
||||
field('domains.primary', '主邮件域名', 'text', { required: true, placeholder: 'example.com' }),
|
||||
field('domains.web', '网页访问域名', 'text', { required: true, placeholder: 'mail.example.com' }),
|
||||
field('domains.adminRecovery', '超级管理员恢复域名', 'text', { placeholder: 'recovery.example.com', hint: '留空时使用主邮件域名。该配置仅用于本机恢复通道的部署标识与证书规划,不开放公网重置页面。' }),
|
||||
field('domains.accepted', '接收邮件的域名', 'list', { required: true, wide: false, hint: '需包含主邮件域名,每个域名单独填写。', placeholder: 'example.com' }),
|
||||
field('logLevel', '日志级别', 'select', { options: options([['', '默认级别'], ['debug', '调试'], ['info', '信息'], ['warn', '警告'], ['error', '错误']]) })
|
||||
]),
|
||||
@@ -327,9 +326,6 @@ export function validateFormConfig(section, config) {
|
||||
for (const name of ['primary', 'web']) {
|
||||
if (!validDomain(domains[name])) errors[`domains.${name}`] = '请填写有效域名,不包含协议、路径或空格'
|
||||
}
|
||||
if (domains.adminRecovery !== undefined && domains.adminRecovery !== '' && !validDomain(domains.adminRecovery)) {
|
||||
errors['domains.adminRecovery'] = '请填写有效域名,不包含协议、路径或空格'
|
||||
}
|
||||
if (Array.isArray(domains.accepted) && domains.accepted.every(validDomain)) {
|
||||
const accepted = domains.accepted.map(normalizedDomain)
|
||||
if (new Set(accepted).size !== accepted.length) errors['domains.accepted'] = '接收域名不能重复,大小写和末尾点视为同一域名'
|
||||
|
||||
@@ -52,7 +52,6 @@ export default defineConfig(({ mode, command }) => {
|
||||
const developmentTLS = command === 'serve' ? readDevelopmentTLS() : undefined
|
||||
const runtime = developmentTLS?.runtime
|
||||
const backendOrigin = runtime?.origin
|
||||
const publicRecoveryOrigin = runtime?.mailOrigin
|
||||
const frontendOrigin = runtime?.origin
|
||||
|
||||
return {
|
||||
@@ -81,9 +80,9 @@ export default defineConfig(({ mode, command }) => {
|
||||
cors: true,
|
||||
proxy: {
|
||||
"/api": developmentBackendProxy(backendUrl, backendOrigin),
|
||||
// 匿名恢复入口由后端按 Web 域名计算跳转,恢复 API 则必须保持主邮件域名的同源校验。
|
||||
// 匿名恢复页面与恢复 API 均复用 Web 域名和现有 HTTPS 证书。
|
||||
"/public-password-recovery": developmentBackendProxy(backendUrl, backendOrigin),
|
||||
"/rest/api/recovery": developmentBackendProxy(backendUrl, publicRecoveryOrigin),
|
||||
"/rest/api/recovery": developmentBackendProxy(backendUrl, backendOrigin),
|
||||
"/attachments": {
|
||||
target: backendUrl,
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in new issue
Block a user