librelad 875a60f90f LibrePortal v0.1.0 — initial release
A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys,
Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun
VPN routing, and a web dashboard to manage it all.

Free & open forever to self-host; optional paid hosted services fund it.
See PROMISE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-21 20:37:54 +01:00

34 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
passwordValidation()
{
# Password Setup for DB with complexity checking
# Initialize valid password flag
local valid_password=false
# Loop until a valid password is entered
while [ $valid_password = false ]
do
# Prompt the user for a password
echo -n "Enter your password: "
# Disable echoing of the password input, so that it is not displayed on the screen
stty -echo
# Read in the password input
read password
# Re-enable echoing of the input
stty echo
echo
# Check the length of the password
if [ ${#password} -lt 8 ]; then
isError "Password is too short. Please enter a password with at least 8 characters."
continue
fi
# Check the complexity of the password
if ! [[ "$password" =~ [[:lower:]] ]] || ! [[ "$password" =~ [[:upper:]] ]] || ! [[ "$password" =~ [[:digit:]] ]]; then
isError "Password is not complex enough. Please include at least one uppercase letter, one lowercase letter, and one numeric digit."
continue
fi
# If we make it here, the password is valid
local valid_password=true
done
}