Skip to content

clean cli & webui for multi-user configs#1229

Merged
AndreyNikiforov merged 8 commits intoicloud-photos-downloader:masterfrom
AndreyNikiforov:dev/cli-web
Aug 29, 2025
Merged

clean cli & webui for multi-user configs#1229
AndreyNikiforov merged 8 commits intoicloud-photos-downloader:masterfrom
AndreyNikiforov:dev/cli-web

Conversation

@AndreyNikiforov
Copy link
Copy Markdown
Collaborator

No description provided.

AndreyNikiforov and others added 8 commits August 28, 2025 23:03
Remove default fallback to icloudpd in Docker entrypoint script.
Users must now explicitly specify either 'icloud' or 'icloudpd'
as the first argument when running the container.

- Replace default case with error message and usage instructions
- Provide clear examples for both icloud and icloudpd usage
- Exit with error code 1 when no command is specified

Addresses icloud-photos-downloader#1067

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove main() function with Click decorators and callbacks
- Rename main_aux to main with argparse-based CLI parsing
- Replace click.confirm with standard input() for keyring prompts
- Update build scripts to use build_bin1 instead of build_bin2
- Maintain backward compatibility for icloud command interface

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove entire main() function with Click decorators and CLI logic
- Remove all Click callback functions (size_generator, mfa_provider_generator, etc.)
- Remove unused Click decorators and CONTEXT_SETTINGS
- Replace click.prompt with getpass.getpass in ask_password_in_console
- Remove unused imports: click, foundation, NoReturn, RawTreatmentPolicy
- Preserve core functionality while eliminating Click dependencies
- All tests pass, functionality maintained

This completes the migration from Click to argparse-based CLI system.
The main CLI entry point is now exclusively through icloudpd.cli module.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…pport

Major refactoring to eliminate the legacy Config class and modernize the codebase:

**Core Changes:**
- Remove Config class entirely from config.py and all references
- Remove convert_user_config_to_old_config() conversion function
- Update core_single_run() to accept GlobalConfig/UserConfig directly
- Remove unused core() function from base.py

**WebUI Enhancements:**
- Add expandable Global Configuration section with Bootstrap collapse
- Add expandable User Configurations section with accordion for multi-user support
- Display current user context during authentication and progress
- Add Bootstrap Icons for chevron indicators in collapsible sections
- Clear current user during watch interval pauses when no user is active
- Remove all legacy config display from templates

**Status Exchange Optimization:**
- Set global and user configs once before processing, not per user iteration
- Only update current_user in the loop for better watch mode performance
- Remove Config-related methods (set_config, get_config)

**Type Safety & Code Quality:**
- Fix PasswordProvider enum checks (was checking strings in enum collection)
- Add proper type annotations throughout
- All 198 tests pass, MyPy clean, functionality preserved

**Templates Updated:**
- index.html: Bootstrap Icons CSS, HTMX component reinitialization
- no_input.html: Complete redesign with collapsible config sections
- All auth templates: Add current user context display

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ng UI

When using --watch-with-interval, clear the current user from StatusExchange
before starting the wait period between processing cycles. This prevents the
WebUI from displaying a username during the wait, which could mislead users
into thinking a specific user is still being processed.

**Change:**
- Add clear_current_user() call before watch interval wait in run_with_configs()
- Add explanatory comment about UI clarity

**User Experience:**
- Before: WebUI showed last processed user during wait periods
- After: WebUI shows no current user during wait, correctly indicating idle state

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Changed password_providers_dict from Dict[str, ...] to Dict[PasswordProvider, ...]
- Updated all PasswordProvider comparisons to use direct enum comparison instead of string values
- Fixed LivePhotoMovFilenamePolicy comparison to use direct enum comparison
- Added missing LivePhotoMovFilenamePolicy import
- Updated function signatures to match new enum-keyed dictionary types
- Convert enum-keyed dict to string-keyed when calling authenticator function
- Fixed import ordering issues and moved freeze_support() call appropriately

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed click import from authentication.py
- Replaced click.echo() with custom echo() function using print()
- Replaced click.prompt() with custom prompt_string() function using input()
- Replaced click.prompt() with click.IntRange() with custom prompt_int_range() function
- Maintained exact same user experience and prompt formatting
- Removed "click==8.1.8" from pyproject.toml dependencies
- All authentication flows (2FA, 2SA, device selection) work identically
- All tests pass: 197 passed, 3 skipped

This reduces external dependencies while maintaining full backward compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed unnecessary mypy override for test_webui_demo module
- Deleted test_webui_demo.py script that was no longer needed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@AndreyNikiforov AndreyNikiforov merged commit 19f6925 into icloud-photos-downloader:master Aug 29, 2025
275 of 396 checks passed
@AndreyNikiforov AndreyNikiforov deleted the dev/cli-web branch August 29, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants