Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix config backup/restore by enforcing 12-char minimum password (related to #646)

rcourtmancb9d8d1ab13b
diff --git a/frontend-modern/src/components/FirstRunSetup.tsx b/frontend-modern/src/components/FirstRunSetup.tsx
index e9652c1d5d..a991e628ee 100644
--- a/frontend-modern/src/components/FirstRunSetup.tsx
+++ b/frontend-modern/src/components/FirstRunSetup.tsx
@@ -100,8 +100,8 @@ export const FirstRunSetup: Component<{ force?: boolean; showLegacyBanner?: bool
showError('Passwords do not match');
return;
}
- if (password().length < 8) {
- showError('Password must be at least 8 characters');
+ if (password().length < 12) {
+ showError('Password must be at least 12 characters');
return;
}
}
@@ -404,7 +404,7 @@ IMPORTANT: Keep these credentials secure!
value={password()}
onInput={(e) => setPassword(e.currentTarget.value)}
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-blue-500 focus:border-transparent"
- placeholder="Enter password (min 8 characters)"
+ placeholder="Enter password (min 12 characters)"
/>
<input
type="password"
diff --git a/frontend-modern/src/components/Settings/ChangePasswordModal.tsx b/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
index 3852e99b52..a514b1a03d 100644
--- a/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
+++ b/frontend-modern/src/components/Settings/ChangePasswordModal.tsx
@@ -31,8 +31,8 @@ export const ChangePasswordModal: Component<ChangePasswordModalProps> = (props)
return;
}
- if (newPassword().length < 8) {
- setError('Password must be at least 8 characters');
+ if (newPassword().length < 12) {
+ setError('Password must be at least 12 characters');
return;
}
@@ -163,9 +163,9 @@ export const ChangePasswordModal: Component<ChangePasswordModalProps> = (props)
class={controlClass('shadow-sm')}
required
disabled={loading()}
- minLength={8}
+ minLength={12}
/>
- <p class={`${formHelpText} mt-1`}>Minimum 8 characters</p>
+ <p class={`${formHelpText} mt-1`}>Minimum 12 characters</p>
</div>
<div class={formField}>
diff --git a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx
index 4e00f05be9..f7e30d3557 100644
--- a/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx
+++ b/frontend-modern/src/components/Settings/QuickSecuritySetup.tsx
@@ -61,8 +61,8 @@ export const QuickSecuritySetup: Component<QuickSecuritySetupProps> = (props) =>
const setupSecurity = async () => {
// Validate custom password if using
if (useCustomPassword()) {
- if (customPassword().length < 8) {
- showError('Password must be at least 8 characters');
+ if (customPassword().length < 12) {
+ showError('Password must be at least 12 characters');
return;
}
if (customPassword() !== confirmPassword()) {
@@ -267,7 +267,7 @@ Important:
/>
</div>
<div class={formField}>
- <label class={labelClass()}>Password (min 8 characters)</label>
+ <label class={labelClass()}>Password (min 12 characters)</label>
<input
type="password"
value={customPassword()}
diff --git a/internal/auth/password.go b/internal/auth/password.go
index d8eee6a2a3..902695ec4c 100644
--- a/internal/auth/password.go
+++ b/internal/auth/password.go
@@ -13,7 +13,8 @@ const (
BcryptCost = 12
// MinPasswordLength is the minimum required password length
- MinPasswordLength = 8
+ // Set to 12 to match the encryption requirement for config backups
+ MinPasswordLength = 12
)
// HashPassword generates a bcrypt hash from a plain text password