Implement 3DS settings screen #18

Open
opened 2026-01-27 07:08:47 +00:00 by maj · 0 comments
Owner

Description

Create a settings screen where users can configure their Nextcloud server URL, username, and password. Settings should persist across app restarts.

Important: Encourage users to use Nextcloud app passwords instead of their main account password for better security.

Tasks

  • Create settings screen UI with guidance text
  • Implement server URL input with validation
  • Implement username input
  • Implement password/app password input
  • Add help text about app passwords
  • Add connection test button
  • Save settings to SD card
  • Load settings on startup
  • Validate URL format (must be http:// or https://)
  • Show connection status with clear error messages
  • Add clear credentials option
  • Warn if HTTP is used instead of HTTPS

Settings Storage

  • Location: /3ds/nextcloud-share/config.json
  • Format: JSON (using nlohmann/json)
  • Security: The app cannot distinguish between regular passwords and app passwords (they work identically with HTTP Basic Auth)

Settings UI Design

┌─────────────────────────────────────┐
│ Nextcloud Settings                  │
├─────────────────────────────────────┤
│ Server URL:                         │
│ [https://cloud.example.com____]     │
│                                     │
│ Username:                           │
│ [john________________]              │
│                                     │
│ Password/App Password:              │
│ [••••••••••••••••••••]              │
│                                     │
│ ⓘ Security Tip:                    │
│   Use an app password instead of    │
│   your main password. Create one:   │
│   Settings → Security →             │
│   App Passwords                     │
│                                     │
│ [Test Connection] [Save] [Help]     │
└─────────────────────────────────────┘

App Password Support

Why recommend app passwords:

  • Limited scope (files only, not account settings)
  • Revocable without changing main password
  • Shows as separate session in Nextcloud
  • Safer if device is lost or compromised

Implementation notes:

  • App passwords work identically to regular passwords via HTTP Basic Auth
  • We cannot enforce or detect app password usage
  • Provide clear guidance and help text in the UI
  • Consider adding a "Help" button with detailed instructions

Validation

  • URL must start with http:// or https://
  • Warn user if HTTP is used (insecure)
  • Test connection before saving
  • Show clear error messages for:
    • Invalid URL format
    • Network errors
    • Authentication failures (401)
    • Server not found
    • SSL/TLS errors

Acceptance Criteria

  • Settings screen functional with all inputs
  • Help text about app passwords is visible
  • Can input URL, username, and password
  • Connection test works and shows meaningful errors
  • Settings persist correctly to SD card JSON
  • Settings load correctly on startup
  • URL validation working (requires http:// or https://)
  • Warning shown for HTTP (non-HTTPS) URLs
  • Clear error messages for all failure cases
  • Help button/section explains app password creation
  • Works with both regular passwords and app passwords
  • See docs/configuration.md for app password creation instructions
  • Authentication implementation in Issue #9
## Description Create a settings screen where users can configure their Nextcloud server URL, username, and password. Settings should persist across app restarts. **Important**: Encourage users to use Nextcloud app passwords instead of their main account password for better security. ## Tasks - [ ] Create settings screen UI with guidance text - [ ] Implement server URL input with validation - [ ] Implement username input - [ ] Implement password/app password input - [ ] Add help text about app passwords - [ ] Add connection test button - [ ] Save settings to SD card - [ ] Load settings on startup - [ ] Validate URL format (must be http:// or https://) - [ ] Show connection status with clear error messages - [ ] Add clear credentials option - [ ] Warn if HTTP is used instead of HTTPS ## Settings Storage - **Location**: `/3ds/nextcloud-share/config.json` - **Format**: JSON (using nlohmann/json) - **Security**: The app cannot distinguish between regular passwords and app passwords (they work identically with HTTP Basic Auth) ## Settings UI Design ``` ┌─────────────────────────────────────┐ │ Nextcloud Settings │ ├─────────────────────────────────────┤ │ Server URL: │ │ [https://cloud.example.com____] │ │ │ │ Username: │ │ [john________________] │ │ │ │ Password/App Password: │ │ [••••••••••••••••••••] │ │ │ │ ⓘ Security Tip: │ │ Use an app password instead of │ │ your main password. Create one: │ │ Settings → Security → │ │ App Passwords │ │ │ │ [Test Connection] [Save] [Help] │ └─────────────────────────────────────┘ ``` ## App Password Support **Why recommend app passwords:** - ✅ Limited scope (files only, not account settings) - ✅ Revocable without changing main password - ✅ Shows as separate session in Nextcloud - ✅ Safer if device is lost or compromised **Implementation notes:** - App passwords work identically to regular passwords via HTTP Basic Auth - We cannot enforce or detect app password usage - Provide clear guidance and help text in the UI - Consider adding a "Help" button with detailed instructions ## Validation - URL must start with `http://` or `https://` - Warn user if HTTP is used (insecure) - Test connection before saving - Show clear error messages for: - Invalid URL format - Network errors - Authentication failures (401) - Server not found - SSL/TLS errors ## Acceptance Criteria - [ ] Settings screen functional with all inputs - [ ] Help text about app passwords is visible - [ ] Can input URL, username, and password - [ ] Connection test works and shows meaningful errors - [ ] Settings persist correctly to SD card JSON - [ ] Settings load correctly on startup - [ ] URL validation working (requires http:// or https://) - [ ] Warning shown for HTTP (non-HTTPS) URLs - [ ] Clear error messages for all failure cases - [ ] Help button/section explains app password creation - [ ] Works with both regular passwords and app passwords ## Related Documentation - See `docs/configuration.md` for app password creation instructions - Authentication implementation in Issue #9
maj added this to the Milestone 3: Nintendo 3DS App milestone 2026-01-27 07:08:47 +00:00
maj added the uipriority:mediumfeatureplatform:3ds labels 2026-01-27 07:08:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: maj/nextcloud-share#18