feat: add support for using TLS to connect to Redis

This commit is contained in:
iBenzene
2026-01-31 00:53:39 +08:00
parent c3d1891ccd
commit f2e206700c
15 changed files with 91 additions and 22 deletions

View File

@@ -31,6 +31,7 @@ export interface RedisConfig {
port: number
password: string
db: number
enable_tls: boolean
}
export interface AdminConfig {

View File

@@ -69,7 +69,9 @@ export default {
port: 'Port',
password: 'Password (optional)',
database: 'Database',
passwordPlaceholder: 'Password'
passwordPlaceholder: 'Password',
enableTls: 'Enable TLS',
enableTlsHint: 'Use TLS when connecting to Redis (public CA certs)'
},
admin: {
title: 'Admin Account',

View File

@@ -66,7 +66,9 @@ export default {
port: '端口',
password: '密码(可选)',
database: '数据库',
passwordPlaceholder: '密码'
passwordPlaceholder: '密码',
enableTls: '启用 TLS',
enableTlsHint: '连接 Redis 时使用 TLS公共 CA 证书)'
},
admin: {
title: '管理员账户',

View File

@@ -91,6 +91,18 @@
</div>
</div>
<div class="flex items-center justify-between rounded-xl border border-gray-200 p-3 dark:border-dark-700">
<div>
<p class="text-sm font-medium text-gray-900 dark:text-white">
{{ t("setup.redis.enableTls") }}
</p>
<p class="text-xs text-gray-500 dark:text-dark-400">
{{ t("setup.redis.enableTlsHint") }}
</p>
</div>
<Toggle v-model="formData.redis.enable_tls" />
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="input-label">{{ t('setup.database.username') }}</label>
@@ -517,7 +529,8 @@ const formData = reactive<InstallRequest>({
host: 'localhost',
port: 6379,
password: '',
db: 0
db: 0,
enable_tls: false
},
admin: {
email: '',