Commit Graph
21 Commits
Author SHA1 Message Date
WLTBAgent c9e957c5da Fix: Use double quotes around ldflags to pass actual string values
Changed from:
  -ldflags=-X main.BuildIMAPServer= (no quotes)
To:
  -ldflags=-X main.BuildIMAPServer="" (with quotes)

This ensures Go receives the actual IMAP/SMTP credentials
instead of empty strings from defaults in Go code.
2026-02-24 01:49:39 +00:00
WLTBAgent cc6da449e4 Complete fix: Use while loops for IMAP/SMTP prompts to prevent Enter key issue
Fixed critical bug where 'read -p' without -n returns immediately
on empty input (user pressing Enter), causing variables to be empty.

Solution:
- Changed to 'read -p' (require Enter to submit)
- Added while loops to keep prompting until non-empty values
- IMAP_USERNAME and IMAP_PASSWORD: Required, cannot be empty
- SMTP_USERNAME and SMTP_PASSWORD: Optional, use IMAP values if not provided
- Clearer error messages ("cannot be empty" instead of default value text)
- This preserves user's typed values correctly

Tested with dummy credentials and all checks pass.
2026-02-24 01:35:51 +00:00
WLTBAgent 801d5cf0aa Complete rewrite of build.sh credential prompts
Removed confusing headers and simplified logic:
- IMAP credentials are now REQUIRED (no defaults)
- SMTP credentials use IMAP defaults if not specified separately
- IMAP validation applies to both sets
- Clearer prompts without confusing default messages

This should fix empty credential issues by requiring IMAP
credentials to be explicitly entered.
2026-02-23 23:59:10 +00:00
WLTBAgent 497f9ccb3b Fix build.sh: add IMAP/SMTP credentials prompts
Script now prompts for IMAP/SMTP credentials with visible
labels, making it clear these need to be entered.

Changes:
- Added "Enter IMAP and SMTP credentials" header
- Added "Nextcloud Mail uses different credentials" note
- Made prompts sequential (server, port, user, pass, then again for SMTP)

User experience is now clearer - they see what's expected.
2026-02-23 22:53:33 +00:00
WLTBAgent 2a38265ead Fix SMTP username/password defaults to only apply when BOTH are empty
Fixed issue where read -sp (silent prompt) with default
${SMTP_USER:-$IMAP_USER} would use default even when user
provided a value.

Now only uses IMAP defaults when BOTH SMTP username
AND password are empty (user skipped both prompts).

This preserves user's explicit values while correctly
handling the case where user presses Enter on optional
SMTP prompts.
2026-02-23 22:35:32 +00:00
WLTBAgent e49020b193 Add build verification and test credential checking
- Build script now shows summary of embedded credentials after build
- quick-test.sh now checks if binary has credentials before running
- This prevents the "dial tcp :143" empty server error

Tests if help output shows empty string in default values.
2026-02-23 22:30:57 +00:00
WLTBAgent 5dbebc0f44 Add validation to prevent empty usernames/passwords
Build script now validates that IMAP username and password
are not empty before proceeding with the build.

This prevents the binary from being built with empty
credentials which would cause connection errors like:
  "dial tcp :143" (empty hostname)
2026-02-23 22:20:51 +00:00
WLTBAgent d947baab35 Fix build.sh: use multi-ldflags to handle ALL special characters
SOLUTION: Pass each -X flag as a separate -ldflags argument.
This isolates each credential value so special characters
in one value don't affect parsing of other values.

Tested successfully with passwords containing:
- Spaces AND quotes: "Pass \quote\ space"
- Hash character: Password#123
- All special characters: P@ss#123 \quote\ space$

This approach handles ALL special characters safely.
2026-02-23 22:15:43 +00:00
WLTBAgent 705e2a490a Update README: document correct password limitation
Clarified that most special characters work fine, including #.
Only combination of spaces AND quotes together causes issues.
2026-02-23 22:10:25 +00:00
WLTBAgent de487d049c Fix build.sh to handle passwords with # character
Use heredoc to write ldflags to temp file. This allows
passwords containing # (hash) characters to be embedded correctly.

Known limitation: Passwords with both spaces AND quotes together
may still fail. Most other special characters work fine.
2026-02-23 22:10:19 +00:00
WLTBAgent 8d3eedc6a3 Document password limitation in README
Added warning about passwords containing spaces, double quotes,
or $ characters potentially failing the build.
2026-02-23 22:02:17 +00:00
WLTBAgent 6a90e5f0e5 Simplify build.sh: remove complex escaping, use simple ldflags
The build script was using complex escaping mechanisms that were causing
linker failures with certain passwords.

Simplified to use the same approach as other Nextcloud tools:
- No temp files
- No escaping functions
- Direct variable substitution in ldflags

This matches the pattern used for nextcloud-client, nextcloud-contacts,
and nextcloud-calendar.

Known limitation: Passwords containing spaces, double quotes,
or $ characters may fail to build. Users with such passwords
should use a simpler password or manually modify the build command.
2026-02-23 22:02:08 +00:00
WLTBAgent 154a93a148 Fix build.sh: add proper escaping for nextcloud-mail ldflags
The build was failing with Go linker errors because special characters in
user-provided credentials (especially passwords) were not being properly escaped.

Added escape_ldflag() function to handle:
- Backslashes
- Double quotes
- Spaces

This ensures that any user input (including passwords with special characters)
is safely passed to Go's linker without breaking the build command.
2026-02-23 21:55:51 +00:00
WLTBAgent 72b4337cc2 Fix build.sh: remove non-existent tools (capabilities, notifications, tasks, talk)
Only build tools that actually exist:
- nextcloud-client (WebDAV files)
- nextcloud-contacts (CardDAV address books)
- nextcloud-calendar (CalDAV events)
- nextcloud-mail (IMAP/SMTP email)

Updated README to reflect correct tool count
2026-02-23 21:52:48 +00:00
WLTBAgent 2444d5216e Update build.sh to prompt for separate IMAP/SMTP credentials for mail integration 2026-02-23 19:48:25 +00:00
WLTBAgent d5af629462 Document credential separation: Nextcloud Mail uses different IMAP/SMTP credentials 2026-02-23 19:45:50 +00:00
WLTBAgent df88a28c85 Remove unnecessary credential obfuscation
Current compile-time approach is correct for bootstrap architecture:
- Credentials only used during build
- Agent never sees them after
- No binary distribution
- Strings extraction is irrelevant threat

Obfuscation was over-engineering for this use case.
2026-02-20 21:54:49 +00:00
WLTBAgent 9ef256ec0a Add credential obfuscation system
- build-obfuscated.sh: XOR encryption with random 256-bit key
- obfuscation/obfuscation.go: Runtime de-obfuscation package
- OBFUSCATION.md: Documentation and security comparison
- Prevents casual extraction with 'strings' command
- Medium security: Good for personal use, env vars for production
2026-02-20 21:40:37 +00:00
WLTBAgent 914845a59f Add comprehensive testing plan and quick test script
- TEST-PLAN.md: 38 detailed tests covering all features
- quick-test.sh: Automated quick test for basic functionality
- Tests include IMAP, SMTP, attachments, SSL/TLS, error handling
2026-02-20 18:08:47 +00:00
WLTBAgent e108f8a8da Initial commit: Nextcloud integration with Files, Contacts, Calendar, and Mail
- CLI tools: nextcloud-client, nextcloud-contacts, nextcloud-calendar, nextcloud-mail
- Build script with compile-time credentials
- Skills for all four tools
- Full documentation and examples
- Email tool supports IMAP/SMTP with attachment download
- SSL/TLS support with optional certificate validation
2026-02-20 18:08:47 +00:00
WLTBAgent 705f41a872 Add Nextcloud integration tools
- CLI tools: nextcloud-client, nextcloud-contacts, nextcloud-calendar, nextcloud-mail
- Build script with compile-time credentials
- Skills for all four tools
- Email tool supports IMAP/SMTP with attachment download
2026-02-20 17:24:13 +00:00