Skip to content

Commit 5ce42c4

Browse files
committed
feat: restore password strength validation (#4111)
1 parent 33b0131 commit 5ce42c4

12 files changed

Lines changed: 1088 additions & 1 deletion

File tree

archinstall/lib/menu/util.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from pathlib import Path
22

33
from archinstall.lib.menu.helpers import Input
4-
from archinstall.lib.models.users import Password
4+
from archinstall.lib.models.users import Password, PasswordStrength
5+
from archinstall.lib.output import warn
56
from archinstall.lib.translationhandler import tr
67
from archinstall.tui.ui.result import ResultType
78

@@ -33,6 +34,13 @@ def get_password(
3334
continue
3435

3536
password = Password(plaintext=result.get_value())
37+
38+
strength = PasswordStrength.strength(password.plaintext)
39+
if strength in (PasswordStrength.VERY_WEAK, PasswordStrength.WEAK):
40+
warn(tr('Weak password. Use uppercase, lowercase, numbers, and symbols.'))
41+
elif strength == PasswordStrength.MODERATE:
42+
warn(tr('Moderate password. Add length and more character variety.'))
43+
3644
break
3745

3846
if skip_confirmation:

archinstall/locales/base.pot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,3 +2049,9 @@ msgstr ""
20492049

20502050
msgid "The password did not match, please try again"
20512051
msgstr ""
2052+
2053+
msgid "Weak password. Use uppercase, lowercase, numbers, and symbols."
2054+
msgstr ""
2055+
2056+
msgid "Moderate password. Add length and more character variety."
2057+
msgstr ""

archinstall/locales/cs/LC_MESSAGES/base.po

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,3 +1869,154 @@ msgstr "Použít Network Manager (výchozí backend)"
18691869

18701870
msgid "Use Network Manager (iwd backend)"
18711871
msgstr "Použít Network Manager (iwd backend)"
1872+
1873+
msgid "Firewall"
1874+
msgstr ""
1875+
1876+
#, fuzzy
1877+
msgid "Select audio configuration"
1878+
msgstr "Uložit uživatelskou konfiguraci"
1879+
1880+
#, fuzzy
1881+
msgid "Enter credentials file decryption password"
1882+
msgstr "Heslo pro dešifrování souboru s přihlašovacími údaji"
1883+
1884+
#, fuzzy
1885+
msgid "Enter root password"
1886+
msgstr "Zadejte heslo: "
1887+
1888+
msgid "Select bootloader to install"
1889+
msgstr ""
1890+
1891+
#, fuzzy
1892+
msgid "Configuration preview"
1893+
msgstr "Konfigurace"
1894+
1895+
#, fuzzy
1896+
msgid "Enter a directory for the configuration(s) to be saved"
1897+
msgstr "Zadejte adresář pro uložení konfigurace (konfigurací): "
1898+
1899+
#, fuzzy
1900+
msgid "Select encryption type"
1901+
msgstr "Typ šifrování"
1902+
1903+
#, fuzzy
1904+
msgid "Select disks for the installation"
1905+
msgstr "Název počítače k instalaci: "
1906+
1907+
#, fuzzy
1908+
msgid "Enter a mountpoint"
1909+
msgstr "Zvolte přípojný bod:"
1910+
1911+
#, fuzzy, python-brace-format
1912+
msgid "Enter a size (default: {}): "
1913+
msgstr "Zadejte konec (výchozí: {}): "
1914+
1915+
#, fuzzy
1916+
msgid "Enter subvolume name"
1917+
msgstr "Název podsvazku"
1918+
1919+
#, fuzzy
1920+
msgid "Enter subvolume mountpoint"
1921+
msgstr "Přípojný bod podsvazku"
1922+
1923+
#, fuzzy
1924+
msgid "Select a disk configuration"
1925+
msgstr "Konfigurace disku"
1926+
1927+
#, fuzzy
1928+
msgid "Enter root mount directory"
1929+
msgstr "Kořenový adresář pro připojení"
1930+
1931+
msgid "You will use whatever drive-setup is mounted at the specified directory"
1932+
msgstr ""
1933+
1934+
msgid "WARNING: Archinstall won't check the suitability of this setup"
1935+
msgstr ""
1936+
1937+
#, fuzzy
1938+
msgid "Select main filesystem"
1939+
msgstr "Změnit souborový systém"
1940+
1941+
msgid "Enter a hostname"
1942+
msgstr ""
1943+
1944+
#, fuzzy
1945+
msgid "Select timezone"
1946+
msgstr "Zvolte časovou zónu"
1947+
1948+
#, fuzzy
1949+
msgid "Enter the number of parallel downloads to be enabled"
1950+
msgstr ""
1951+
"Zadejte povolený počet paralelních stahování.\n"
1952+
"\n"
1953+
"Poznámka:\n"
1954+
1955+
#, python-brace-format
1956+
msgid "Value must be between 1 and {}"
1957+
msgstr ""
1958+
1959+
#, fuzzy
1960+
msgid "Select which kernel(s) to install"
1961+
msgstr "Prosím vyberte přihlašovací obrazovku k instalaci"
1962+
1963+
#, fuzzy
1964+
msgid "Enter a respository name"
1965+
msgstr "Název repozitáře"
1966+
1967+
#, fuzzy
1968+
msgid "Enter the repository url"
1969+
msgstr "Změnit vlastní repozitář"
1970+
1971+
#, fuzzy
1972+
msgid "Enter server url"
1973+
msgstr "URL serveru"
1974+
1975+
#, fuzzy
1976+
msgid "Select mirror regions to be enabled"
1977+
msgstr "Zvolené oblasti zrcadel"
1978+
1979+
#, fuzzy
1980+
msgid "Select optional repositories to be enabled"
1981+
msgstr "Vyberte, které dodatečné balíčky mají být povoleny"
1982+
1983+
#, fuzzy
1984+
msgid "Select an interface"
1985+
msgstr "Smazat rozhraní"
1986+
1987+
#, fuzzy
1988+
msgid "Choose network configuration"
1989+
msgstr "Žádná konfigurace sítě"
1990+
1991+
#, fuzzy
1992+
msgid "No packages found"
1993+
msgstr "Nebylo nalezeno žádné U2F zařízení"
1994+
1995+
#, fuzzy
1996+
msgid "Select which greeter to install"
1997+
msgstr "Prosím vyberte přihlašovací obrazovku k instalaci"
1998+
1999+
#, fuzzy
2000+
msgid "Select a profile type"
2001+
msgstr "Zvolené profily: "
2002+
2003+
#, fuzzy
2004+
msgid "Enter new password"
2005+
msgstr "Zadejte heslo pro wifi"
2006+
2007+
msgid "Enter a username"
2008+
msgstr ""
2009+
2010+
#, fuzzy
2011+
msgid "Enter a password"
2012+
msgstr "Zadejte heslo: "
2013+
2014+
#, fuzzy
2015+
msgid "The password did not match, please try again"
2016+
msgstr "Potvrzovací heslo se neshoduje, zkuste to prosím znovu"
2017+
2018+
msgid "Weak password. Use uppercase, lowercase, numbers, and symbols."
2019+
msgstr ""
2020+
2021+
msgid "Moderate password. Add length and more character variety."
2022+
msgstr ""

archinstall/locales/de/LC_MESSAGES/base.po

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,157 @@ msgstr ""
18911891
msgid "Use Network Manager (iwd backend)"
18921892
msgstr ""
18931893

1894+
msgid "Firewall"
1895+
msgstr ""
1896+
1897+
#, fuzzy
1898+
msgid "Select audio configuration"
1899+
msgstr "Benutzerkonfiguration speichern"
1900+
1901+
#, fuzzy
1902+
msgid "Enter credentials file decryption password"
1903+
msgstr "Passwort für die Entschlüsselung der Anmeldedaten-Datei"
1904+
1905+
#, fuzzy
1906+
msgid "Enter root password"
1907+
msgstr "Passwort eingeben: "
1908+
1909+
msgid "Select bootloader to install"
1910+
msgstr ""
1911+
1912+
#, fuzzy
1913+
msgid "Configuration preview"
1914+
msgstr "Konfiguration"
1915+
1916+
#, fuzzy
1917+
msgid "Enter a directory for the configuration(s) to be saved"
1918+
msgstr "Geben Sie einen Ordner an, in dem Konfigurationen gespeichert werden sollen: "
1919+
1920+
#, fuzzy
1921+
msgid "Select encryption type"
1922+
msgstr "Verschlüsselungstyp"
1923+
1924+
#, fuzzy
1925+
msgid "Select disks for the installation"
1926+
msgstr "Gewünschter Gerätename/Hostname für die Installation: "
1927+
1928+
#, fuzzy
1929+
msgid "Enter a mountpoint"
1930+
msgstr "Wählen Sie einen Einhängeort aus:"
1931+
1932+
#, fuzzy, python-brace-format
1933+
msgid "Enter a size (default: {}): "
1934+
msgstr "Geben Sie das Ende ein (Standard: {}): "
1935+
1936+
#, fuzzy
1937+
msgid "Enter subvolume name"
1938+
msgstr "Name des Subvolumes"
1939+
1940+
#, fuzzy
1941+
msgid "Enter subvolume mountpoint"
1942+
msgstr "Subvolume-Einhängeort"
1943+
1944+
#, fuzzy
1945+
msgid "Select a disk configuration"
1946+
msgstr "Laufwerkskonfiguration"
1947+
1948+
#, fuzzy
1949+
msgid "Enter root mount directory"
1950+
msgstr "Einhängeverzeichnis der Root-Partition"
1951+
1952+
msgid "You will use whatever drive-setup is mounted at the specified directory"
1953+
msgstr ""
1954+
1955+
msgid "WARNING: Archinstall won't check the suitability of this setup"
1956+
msgstr ""
1957+
1958+
#, fuzzy
1959+
msgid "Select main filesystem"
1960+
msgstr "Dateisystem ändern"
1961+
1962+
msgid "Enter a hostname"
1963+
msgstr ""
1964+
1965+
#, fuzzy
1966+
msgid "Select timezone"
1967+
msgstr "Wählen Sie eine Zeitzone aus"
1968+
1969+
#, fuzzy
1970+
msgid "Enter the number of parallel downloads to be enabled"
1971+
msgstr ""
1972+
"Geben Sie die Nummer an parallelen Downloads an.\n"
1973+
"\n"
1974+
"Achtung:\n"
1975+
1976+
#, python-brace-format
1977+
msgid "Value must be between 1 and {}"
1978+
msgstr ""
1979+
1980+
#, fuzzy
1981+
msgid "Select which kernel(s) to install"
1982+
msgstr "Bitte den zu installierenden Greeter (Begrüßer/Anmeldebildschirm) auswählen"
1983+
1984+
#, fuzzy
1985+
msgid "Enter a respository name"
1986+
msgstr "Name des Repositoriums"
1987+
1988+
#, fuzzy
1989+
msgid "Enter the repository url"
1990+
msgstr "Benutzerdefiniertes Repositorium bearbeiten"
1991+
1992+
#, fuzzy
1993+
msgid "Enter server url"
1994+
msgstr "Server-URL"
1995+
1996+
#, fuzzy
1997+
msgid "Select mirror regions to be enabled"
1998+
msgstr "Ausgewählte Spiegelserver-Regionen"
1999+
2000+
#, fuzzy
2001+
msgid "Select optional repositories to be enabled"
2002+
msgstr "Wählen Sie aus, welche zusätzlichen Repositories verwendet werden sollen"
2003+
2004+
#, fuzzy
2005+
msgid "Select an interface"
2006+
msgstr "Verbindung löschen"
2007+
2008+
#, fuzzy
2009+
msgid "Choose network configuration"
2010+
msgstr "Keine Netzwerkkonfiguration"
2011+
2012+
#, fuzzy
2013+
msgid "No packages found"
2014+
msgstr "Keine U2F-Geräte gefunden"
2015+
2016+
#, fuzzy
2017+
msgid "Select which greeter to install"
2018+
msgstr "Bitte den zu installierenden Greeter (Begrüßer/Anmeldebildschirm) auswählen"
2019+
2020+
#, fuzzy
2021+
msgid "Select a profile type"
2022+
msgstr "Ausgewählte Profile: "
2023+
2024+
#, fuzzy
2025+
msgid "Enter new password"
2026+
msgstr "Passwort eingeben: "
2027+
2028+
msgid "Enter a username"
2029+
msgstr ""
2030+
2031+
#, fuzzy
2032+
msgid "Enter a password"
2033+
msgstr "Passwort eingeben: "
2034+
2035+
#, fuzzy
2036+
msgid "The password did not match, please try again"
2037+
msgstr "Das Passwort stimmt nicht überein, bitte versuche es erneut"
2038+
2039+
msgid "Weak password. Use uppercase, lowercase, numbers, and symbols."
2040+
msgstr ""
2041+
2042+
msgid "Moderate password. Add length and more character variety."
2043+
msgstr ""
2044+
18942045
#~ msgid "All open-source"
18952046
#~ msgstr "Alle quelloffene"
18962047

0 commit comments

Comments
 (0)