1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 14:08:29 -04:00

refactor(auth): relay on distro system auth over DMS managed sessions

- Gate greeter external-auth status fprint availability only on confirmed setups
- Reload dankshell-U2F/U2F-Key watchers live

Related: #2874
Port 1.5

(cherry picked from commit 3938e60ce4)
This commit is contained in:
purian23
2026-07-17 17:27:45 -04:00
parent fc11dfbc57
commit f37f4a1f35
8 changed files with 296 additions and 272 deletions
+22 -22
View File
@@ -19,39 +19,39 @@ Item {
function greeterFingerprintDescription() {
if (SettingsData.greeterPamExternallyManaged)
return "greetd PAM is externally managed";
return I18n.tr("Managed by the primary PAM source", "factor managed by PAM source status");
if (SettingsData.greeterFingerprintSource === "pam")
return I18n.tr("PAM already provides fingerprint auth. Enable this to show it at login.", "greeter fingerprint login setting");
switch (SettingsData.greeterFingerprintReason) {
case "ready":
return I18n.tr("Authentication changes apply automatically.", "greeter auth setting description");
return I18n.tr("Authentication changes apply automatically", "greeter auth setting description");
case "missing_enrollment":
return I18n.tr("Fingerprint reader detected, but no prints are enrolled yet. You can enable this now and run Sync later.", "greeter fingerprint login setting");
case "missing_reader":
return I18n.tr("No fingerprint reader detected.", "fingerprint setting status");
return I18n.tr("No fingerprint reader detected", "fingerprint setting status");
case "missing_pam_support":
return I18n.tr("Not available — install fprintd and pam_fprintd, or configure greetd PAM.", "greeter fingerprint login setting");
default:
return I18n.tr("Fingerprint availability could not be confirmed.", "fingerprint setting status");
return I18n.tr("Fingerprint availability could not be confirmed", "fingerprint setting status");
}
}
function greeterU2fDescription() {
if (SettingsData.greeterPamExternallyManaged)
return "greetd PAM is externally managed";
return I18n.tr("Managed by the primary PAM source", "factor managed by PAM source status");
if (SettingsData.greeterU2fSource === "pam")
return I18n.tr("PAM already provides security-key auth. Enable this to show it at login.", "greeter security key login setting");
switch (SettingsData.greeterU2fReason) {
case "ready":
return I18n.tr("Authentication changes apply automatically.", "greeter auth setting description");
return I18n.tr("Authentication changes apply automatically", "greeter auth setting description");
case "missing_key_registration":
return I18n.tr("Security-key support was detected, but no registered key was found yet. You can enable this now and register one later.", "security key setting status");
case "missing_pam_support":
return I18n.tr("Not available — install or configure pam_u2f, or configure greetd PAM.", "greeter security key login setting");
default:
return I18n.tr("Security-key availability could not be confirmed.", "security key setting status");
return I18n.tr("Security-key availability could not be confirmed", "security key setting status");
}
}
@@ -305,7 +305,7 @@ Item {
onExited: exitCode => {
root.greeterSyncRunning = false;
if (exitCode === 0) {
var launched = root.greeterTerminalFallbackFromPrecheck ? I18n.tr("Terminal opened. Complete sync authentication there; it will close automatically when done.") : I18n.tr("Terminal fallback opened. Complete sync there; it will close automatically when done.");
var launched = root.greeterTerminalFallbackFromPrecheck ? I18n.tr("Terminal opened. Complete authentication there; it will close automatically when done.") : I18n.tr("Terminal fallback opened. Complete authentication there; it will close automatically when done.");
root.greeterStatusText = root.greeterStatusText ? root.greeterStatusText + "\n\n" + launched : launched;
SettingsData.clearGreeterSyncPending();
return;
@@ -396,11 +396,11 @@ Item {
SettingsCard {
width: parent.width
iconName: "info"
title: I18n.tr("Greeter Status")
title: I18n.tr("Status")
settingKey: "greeterStatus"
StyledText {
text: I18n.tr("Sync applies your theme and settings to the login screen. Other users should run dms greeter sync --profile instead of a full sync. Authentication changes apply automatically.")
text: I18n.tr("Sync applies your theme and settings to the login screen. Shared users should run dms greeter sync --profile instead of a primary user sync.")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
width: parent.width
@@ -470,11 +470,11 @@ Item {
SettingsCard {
width: parent.width
iconName: "fingerprint"
title: I18n.tr("Login Authentication")
title: I18n.tr("Authentication")
settingKey: "greeterAuth"
StyledText {
text: I18n.tr("Enable fingerprint or security key for DMS Greeter. Authentication changes apply automatically.")
text: I18n.tr("Enable fingerprint or security key for DMS Greeter")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
width: parent.width
@@ -485,8 +485,8 @@ Item {
SettingsToggleRow {
settingKey: "greeterPamExternallyManaged"
tags: ["greeter", "pam", "managed", "external", "greetd", "auth"]
text: "greetd PAM is externally managed"
description: "DMS removes its managed block from /etc/pam.d/greetd and stops writing to it"
text: I18n.tr("Use system PAM authentication", "system PAM policy toggle")
description: I18n.tr("DMS removes its managed block from /etc/pam.d/greetd and stops write services", "greeter system PAM toggle description")
checked: SettingsData.greeterPamExternallyManaged
onToggled: checked => SettingsData.set("greeterPamExternallyManaged", checked)
}
@@ -517,7 +517,7 @@ Item {
SettingsCard {
width: parent.width
iconName: "palette"
title: I18n.tr("Greeter Appearance")
title: I18n.tr("Appearance")
settingKey: "greeterAppearance"
StyledText {
@@ -553,12 +553,12 @@ Item {
settingKey: "greeterLockDateFormat"
tags: ["greeter", "date", "format"]
text: I18n.tr("Date Format")
description: I18n.tr("Greeter only — format for the date on the login screen")
description: I18n.tr("Format the date on the login screen")
options: root._lockDateFormatPresets.map(p => p.label)
currentValue: {
var current = (SettingsData.greeterLockDateFormat !== undefined && SettingsData.greeterLockDateFormat !== "") ? SettingsData.greeterLockDateFormat : SettingsData.lockDateFormat || "";
var match = root._lockDateFormatPresets.find(p => p.format === current);
return match ? match.label : (current ? I18n.tr("Custom: ") + current : root._lockDateFormatPresets[0].label);
return match ? match.label : (current ? I18n.tr("Custom") + ": " + current : root._lockDateFormatPresets[0].label);
}
onValueChanged: value => {
var preset = root._lockDateFormatPresets.find(p => p.label === value);
@@ -577,7 +577,7 @@ Item {
}
StyledText {
text: I18n.tr("Use a custom image for the login screen, or leave empty to use your desktop wallpaper.")
text: I18n.tr("Use a custom image for the login screen, or leave empty to use desktop wallpaper")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
width: parent.width
@@ -601,11 +601,11 @@ Item {
SettingsCard {
width: parent.width
iconName: "history"
title: I18n.tr("Greeter Behavior")
title: I18n.tr("Behavior")
settingKey: "greeterBehavior"
StyledText {
text: I18n.tr("Convenience options for the login screen. Sync to apply.")
text: I18n.tr("Convenience options for the login screen")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
width: parent.width
@@ -649,7 +649,7 @@ Item {
settingKey: "greeterDeps"
StyledText {
text: I18n.tr("Requires greetd, dms-greeter, and your user in the greeter group (plus fprintd/pam_fprintd for fingerprint, pam_u2f for security keys). Auth changes apply automatically and may open a terminal for sudo.")
text: I18n.tr("Requires greetd, dms-greeter, and your user in the greeter group (plus fprintd/pam_fprintd for fingerprint, pam_u2f for security keys).")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
width: parent.width
@@ -658,7 +658,7 @@ Item {
}
StyledText {
text: I18n.tr("Installation and PAM setup: see the ") + "<a href=\"https://danklinux.com/docs/dankgreeter/installation\" style=\"text-decoration:none; color:" + Theme.primary + ";\">DankGreeter docs</a> " + I18n.tr("or run ") + "'dms greeter install'."
text: I18n.tr("Installation and PAM setup are documented in the ") + "<a href=\"https://danklinux.com/docs/dankgreeter/installation\" style=\"text-decoration:none; color:" + Theme.primary + ";\">DankGreeter docs.</a> "
textFormat: Text.RichText
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText