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

feat(cups): add manual printer addition by IP/hostname (#1868)

Add a new "Add by Address" flow in the printer settings that allows
users to manually add printers by IP address or hostname, enabling
printing to devices not visible via mDNS/Avahi discovery (e.g.,
printers behind Tailscale subnet routers, VPNs, or across network
boundaries).

Go backend:
- New cups.testConnection IPC method that probes remote printers via
  IPP Get-Printer-Attributes with /ipp/print then / fallback
- Input validation with host sanitization and protocol allowlist
- Auth-aware probing (HTTP 401/403 reported as reachable)
- lpadmin CLI fallback for CreatePrinter/DeletePrinter when
  cups-pk-helper polkit authorization fails

QML frontend:
- "Add by Address" toggle alongside existing device discovery
- Manual entry form with host, port, protocol fields
- Test Connection button with loading state and result display
- Smart PPD auto-selection by probed makeModel with driverless fallback
- All strings use I18n.tr() with translator context

Includes 20+ unit tests covering validation, probe delegation, TLS
flag propagation, auth error detection, and handler routing.
This commit is contained in:
Giorgio De Trane
2026-03-01 02:36:16 +01:00
committed by GitHub
parent 9cb0d8baf2
commit 20d383d4ab
9 changed files with 1148 additions and 43 deletions

View File

@@ -769,6 +769,13 @@
"reference": "",
"comment": ""
},
{
"term": "Add by Address",
"translation": "",
"context": "Toggle button to manually add a printer by IP or hostname",
"reference": "",
"comment": ""
},
{
"term": "Adjust the number of columns in grid view mode.",
"translation": "",
@@ -1994,6 +2001,13 @@
"reference": "",
"comment": ""
},
{
"term": "Caps Lock is on",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Center Section",
"translation": "",
@@ -2834,6 +2848,13 @@
"reference": "",
"comment": ""
},
{
"term": "Connection failed",
"translation": "",
"context": "Status message when test connection to printer fails",
"reference": "",
"comment": ""
},
{
"term": "Contains",
"translation": "",
@@ -3842,6 +3863,13 @@
"reference": "",
"comment": ""
},
{
"term": "Discover Devices",
"translation": "",
"context": "Toggle button to scan for printers via mDNS/Avahi",
"reference": "",
"comment": ""
},
{
"term": "Disk",
"translation": "",
@@ -5711,6 +5739,13 @@
"reference": "",
"comment": ""
},
{
"term": "Got It",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Goth Corner Radius",
"translation": "",
@@ -6145,6 +6180,13 @@
"reference": "",
"comment": ""
},
{
"term": "Host",
"translation": "",
"context": "Label for printer IP address or hostname input field",
"reference": "",
"comment": ""
},
{
"term": "Hostname",
"translation": "",
@@ -6236,6 +6278,13 @@
"reference": "",
"comment": ""
},
{
"term": "IP address or hostname",
"translation": "",
"context": "Placeholder text for manual printer address input",
"reference": "",
"comment": ""
},
{
"term": "ISO Date",
"translation": "",
@@ -9638,6 +9687,13 @@
"reference": "",
"comment": ""
},
{
"term": "Port",
"translation": "",
"context": "Label for printer port number input field",
"reference": "",
"comment": ""
},
{
"term": "Portal",
"translation": "",
@@ -9897,6 +9953,13 @@
"reference": "",
"comment": ""
},
{
"term": "Printer reachable",
"translation": "",
"context": "Status message when test connection to printer succeeds",
"reference": "",
"comment": ""
},
{
"term": "Printers",
"translation": "",
@@ -10128,6 +10191,20 @@
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read:",
"translation": "",
@@ -12571,6 +12648,13 @@
"reference": "",
"comment": ""
},
{
"term": "Test Connection",
"translation": "",
"context": "Button to test connection to a printer by IP address",
"reference": "",
"comment": ""
},
{
"term": "Test Page",
"translation": "",
@@ -12585,6 +12669,13 @@
"reference": "",
"comment": ""
},
{
"term": "Testing...",
"translation": "",
"context": "Button state while testing printer connection",
"reference": "",
"comment": ""
},
{
"term": "Text",
"translation": "",
@@ -13922,6 +14013,13 @@
"reference": "",
"comment": ""
},
{
"term": "What's New",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "When enabled, apps are sorted alphabetically. When disabled, apps are sorted by usage frequency.",
"translation": "",
@@ -14727,53 +14825,18 @@
"reference": "",
"comment": ""
},
{
"term": "↑/↓: Navigate • Enter: Paste • Del: Delete • F10: Help",
"translation": "",
"context": "Keyboard hints when enter-to-paste is enabled",
"reference": "",
"comment": ""
},
{
"term": "What's New",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Got It",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Caps Lock is on",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "↑/↓: Nav • Space: Expand • Enter: Action/Expand • E: Text",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "↑/↓: Navigate • Enter: Paste • Del: Delete • F10: Help",
"translation": "",
"context": "Keyboard hints when enter-to-paste is enabled",
"reference": "",
"comment": ""
}
]