Commit graph

13 commits

Author SHA1 Message Date
90babd1df3 install.sh: fix download() to check HTTP status instead of content — template files contain <!DOCTYPE>
- Replace fragile head -c 100 | grep content check with curl -w
  '%{http_code}' for accurate HTTP status detection
- The old check incorrectly rejected legitimate HTML template files
  (base.html starts with <!DOCTYPE html>)
- wget fallback uses its exit code instead (no content scanning)
2026-04-23 21:02:21 +00:00
a942afc52c Move web templates and static assets to web/ dir alongside binary; update install.sh to deploy them
- Moved templates from src/web/templates/ to web/templates/ and
  static CSS from src/web/static/ to web/static/
- Updated handlers.go paths (src/web/ → web/) so the binary looks
  for templates at the correct deployment location
- Updated install.sh to create web/templates/ and web/static/
  directories and download the files from the repo
- Removed old src/web/ directory (dead code)
- Rebuilt inboxer binary with corrected template paths
2026-04-23 20:53:42 +00:00
78af7f7a6a install.sh: fix hang at 'Starting inboxer service' by adding ReadWritePaths and start timeout
- Add ReadWritePaths=/opt/inboxer/data /opt/inboxer/logs to the systemd unit
  so ProtectSystem=full doesn't block SQLite DB and log file creation
- Wrap systemctl start with timeout 30s so the script never hangs forever
  if the service start job blocks
2026-04-23 20:39:07 +00:00
20e28907de install.sh: download from git repository instead of local copy; update README with deployment guide
install.sh now fetches bin/inboxer, bin/config.yaml, and bin/prompt.txt
from https://git.lohmar.co.uk/cclohmar/inboxer/raw/branch/main/bin/
so the script works as a standalone remote installer:

  curl -sSL https://git.lohmar.co.uk/cclohmar/inboxer/raw/branch/main/install.sh | sudo bash

Supports both curl and wget; validates downloads are not HTML error pages.

README.md rewritten with:
- One-line install command
- Manual build & deploy instructions
- Full configuration reference table
- Service management commands
- Architecture overview
2026-04-23 20:19:57 +00:00
6a6177c8fe install.sh: replace Unicode chars with ASCII (fixes ambiguous character warning) 2026-04-23 20:08:58 +00:00
01a58156a1 Consolidate all secrets into config.yaml — remove .env entirely
All configuration (including secrets) now lives in a single file:
bin/config.yaml. The separate .env file has been eliminated.

Changes:
- config.go: Added SMTPSettings struct + AI.APIKey to Config; removed
  godotenv import, Environment struct, and all os.Getenv() calls
- config.yaml: Added smtp section (host/port/username/password) and
  ai.api_key field with placeholder values
- main.go: Reads SMTP and API key from cfg instead of env
- smtp.go: Changed Port field from string to int
- otp_test.go: Updated Port values to int
- .env.example: Deleted (all config is in config.yaml)
- .gitignore: Removed .env.example; kept .env for safety
- go.mod/go.sum: Removed github.com/joho/godotenv dependency
- install.sh: No longer creates .env or uses EnvironmentFile;
  warns about placeholder values in config.yaml instead
2026-04-23 20:06:16 +00:00
54dd30a2d6 Add .env.example as single source of truth for secrets documentation
Anyone cloning the repo can now see exactly which environment variables
are required by reading .env.example at the repo root.

install.sh updated to copy .env.example during deployment (rather than
duplicating the template inline), keeping the two in sync.
2026-04-23 19:57:44 +00:00
a9216459fc Distribute binary in repo + add install.sh for /opt/inboxer deployment 2026-04-23 19:53:19 +00:00
766e3e3de6 Phase 4: Polish, settings fix, 7-way AI classification & empty-inbox guarantee (Version: 2026-04.5)
- Fixed settings form silently dropping fields (multipart/form-data parse)
- Fixed IMAP test connection (multipart parse + raw field logging)
- Added IMAPUsername field throughout (model, settings, handlers, worker)
- Replaced smtp.SendMail with custom sendMail (explicit HELO + STARTTLS)
- Added From header to OTP/Welcome emails (RFC5322 compliance)
- Worker now processes ALL INBOX emails (FetchBatch instead of FetchUnseen)
- Fixed go build . compiling debug scripts instead of src/cmd/main.go
- Added Notifications, Finance, Social classification folders (7 total)
- Refined AI prompt with precise category descriptions
- Added session guardrail to AGENTS.md
2026-04-23 18:35:30 +00:00
742fae8b95 Phase 4: Settings & IMAP connection flow fixes (Version: 2026-04.4)
- Fix settings password bug: only update when non-empty, remove form 'required'
- Fix dashboard stats: correct TotalProcessed template path, add setup banner
- Implement TestConnectionHandler with real go-imap connect+login
- Implement ProcessNowHandler: signals worker for immediate processing
- Add Worker.ProcessNow() with buffered signal channel
- Pass worker reference to Handler for process-now coordination
- Restructure main.go: create worker before handlers, start after wiring
2026-04-23 11:33:53 +00:00
283faddb05 Phase 3: AI Classification via DeepSeek (Version: 2026-04.3)
- DeepSeek API client with configurable model, temperature, max tokens
- Prompt template engine: loads bin/prompt.txt at runtime, substitutes {sender}/{subject}/{body}
- Response parser validates folder names (Important/eCommerce/Spam/Other) and confidence scores (1-100)
- Graceful fallback to placeholder classifier if prompt file/API key missing
- Email body text limit increased to 4000 chars for AI context
- Replaced EmailSummary.Snippet with EmailSummary.Body
- Wired real AI classifier into main.go init
2026-04-23 11:13:10 +00:00
8bb9ff067b Phase 2: IMAP Client & Background Worker (Version: 2026-04.2)
- IMAP client package with TLS/STARTTLS connection management, unseen fetching, batch fetching by UID range, message move/copy operations, folder management
- Background worker with steady-state (unseen polling) and catch-up (UID range backlog) modes, per-user IMAP connections, test mode support, placeholder AI classifier
- Database: GetUsersWithAutoStart() for worker user discovery
- Wired worker into main.go with graceful shutdown
2026-04-23 11:02:02 +00:00
065129493d Phase 1: Foundation, OTP Auth & Mobile Frontend (Version: 2026-04.1) 2026-04-23 08:26:32 +00:00