feat(web): add password setup page, change password, and settings tabs

- First-time visitors see a password setup page instead of open access
- Password persisted to SQLite (env var DBX_PASSWORD takes priority)
- Add change password in settings dialog (Security tab, web only)
- Split settings dialog into Editor and Security tabs
- Argon2 hashing for all password storage
This commit is contained in:
t8y2
2026-05-05 22:22:04 +08:00
parent 8cc4dfb268
commit 0f40488bf1
10 changed files with 460 additions and 140 deletions
+22
View File
@@ -2,6 +2,26 @@ export default {
app: {
name: "DBX",
},
auth: {
setupTitle: "Set up access password",
setupDescription: "Set a password to protect your instance",
loginDescription: "Database management tool",
newPassword: "Enter new password",
confirmPassword: "Confirm password",
enterPassword: "Enter access password",
passwordMismatch: "Passwords do not match",
setPassword: "Set Password",
login: "Login",
processing: "Processing...",
loginFailed: "Incorrect password",
connectFailed: "Connection failed",
changePassword: "Change Password",
oldPassword: "Current password",
oldPasswordWrong: "Current password is incorrect",
passwordChanged: "Password changed successfully",
changePasswordFailed: "Failed to change password",
changePasswordDescription: "Enter your current password and choose a new one",
},
toolbar: {
newConnection: "New Connection",
newQuery: "New Query",
@@ -625,6 +645,8 @@ export default {
},
settings: {
title: "Settings",
editorTab: "Editor",
securityTab: "Security",
fontFamily: "Font Family",
selectFont: "Select font...",
fontSize: "Font Size",
+22
View File
@@ -2,6 +2,26 @@ export default {
app: {
name: "DBX",
},
auth: {
setupTitle: "设置访问密码",
setupDescription: "设置密码以保护您的实例",
loginDescription: "数据库管理工具",
newPassword: "输入新密码",
confirmPassword: "确认密码",
enterPassword: "请输入访问密码",
passwordMismatch: "两次输入的密码不一致",
setPassword: "设置密码",
login: "登录",
processing: "处理中...",
loginFailed: "密码错误",
connectFailed: "连接失败",
changePassword: "修改密码",
oldPassword: "当前密码",
oldPasswordWrong: "当前密码不正确",
passwordChanged: "密码修改成功",
changePasswordFailed: "密码修改失败",
changePasswordDescription: "输入当前密码并设置新密码",
},
toolbar: {
newConnection: "新建连接",
newQuery: "新建查询",
@@ -617,6 +637,8 @@ export default {
},
settings: {
title: "设置",
editorTab: "编辑器",
securityTab: "安全",
fontFamily: "字体",
selectFont: "选择字体...",
fontSize: "字号",