Commit Graph

1466 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 6a967051ba fix: address code review feedback
- Use astimezone() instead of replace() for timezone conversion in is_token_expired
- Log cleanup exceptions with logger.exception() in signup
- Add security warning when STRIPE_WEBHOOK_SECRET is not configured
- Increase Stripe price ID column length from 64 to 128 characters
- Replace alert() with aria-live assertive region in pricing.html
- Convert auth() login tests to use pytest.mark.asyncio and await

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-07 13:18:33 +00:00
copilot-swe-agent[bot] 52e3852129 feat(auth): add local user signup, email verification, and Stripe billing
- Add LocalUser model with bcrypt password hashing, email verification
  tokens, and password reset tokens
- Add ALLOW_LOCAL_SIGNUP config flag (requires SMTP to be configured)
- Add Stripe billing config fields (STRIPE_SECRET_KEY, etc.)
- Add stripe_customer_id to UserProfile and stripe_price_id_monthly/
  stripe_price_id_yearly to SubscriptionPlan
- Create migration 018_add_local_users_and_billing
- Add app/utils/local_auth.py: hash_password, verify_password,
  generate_token, is_token_expired, send_verification_email,
  send_password_reset_email, build_session_user
- Add app/api/local_auth.py: signup, email verification, password reset
  endpoints plus signup/verify-email-sent/reset-password page routes
- Add app/api/billing.py: Stripe Checkout, Customer Portal, and webhook
  endpoints; syncs subscription tier from webhook events
- Update auth() to check LocalUser table before admin credentials fallback
- Update login() to pass allow_signup context variable to template
- Add signup.html, verify_email_sent.html, password_reset_form.html,
  billing_success.html templates (Alpine.js, Tailwind, WCAG 2.1 AA)
- Update login.html to show 'Create account' link when signup enabled
- Update pricing.html CTA buttons to use Stripe Checkout for paid tiers
- Add docs/BillingSetup.md with setup guide, webhook config, compliance
- Add tests/test_local_auth.py (42 tests) and tests/test_billing.py
  (31 tests); all 106 tests in the modified test suite pass
- Add stripe>=7.0.0,<15.0.0 to requirements.txt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-07 13:15:15 +00:00
copilot-swe-agent[bot] e0de0fd6fb feat: add multi-step user onboarding wizard
- 5-step wizard: Welcome → Profile → Plan → Storage → All Set!
- New migration 017: onboarding_completed, contact_email, preferred_destination fields
- REST API at /api/onboarding/{status,profile,plan,storage,complete}
- GET /onboarding view with configured-destinations helper
- OAuth callback redirects first-time users to onboarding
- 16 unit tests for all endpoints; 65 total tests pass

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-07 11:12:21 +00:00
copilot-swe-agent[bot] 99df0816b0 feat(onboarding): add multi-step user onboarding wizard
Add a 5-step onboarding flow for new users:
- Migration 017: adds onboarding_completed, onboarding_completed_at,
  contact_email, preferred_destination to user_profiles
- app/api/onboarding.py: REST endpoints (status, profile, plan, storage,
  complete) with session-based auth using sub/preferred_username/email/id
  priority chain
- app/views/onboarding.py: GET /onboarding view with configured-destination
  detection helper for all 8 supported storage providers
- frontend/templates/onboarding.html: Alpine.js wizard with progress
  indicator, tier cards (server-rendered), storage destination cards,
  accessible markup (WCAG AA), and all fetch() API calls
- app/auth.py: redirect first-time OAuth users (onboarding_completed=False)
  to /onboarding after login
- 16 unit tests covering all endpoints, auth enforcement, and edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-07 11:04:53 +00:00
copilot-swe-agent[bot] dd207eef9b fix: pricing page toggle and user auto-creation on OAuth login
- Fix monthly/annual price toggle by moving x-data scope to outer div
- Auto-create UserProfile in DB on first Authentik OAuth login
- Update and expand tests for oauth_callback and _ensure_user_profile

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-07 10:52:26 +00:00
copilot-swe-agent[bot] 48092c98e7 Initial plan 2026-03-07 10:36:58 +00:00
github-actions[bot] 7bc8bb428e chore(release): update build metadata files [skip ci] 2026-03-07 09:59:23 +00:00
semantic-release fb43e24a3e 0.80.0
Automatically generated by python-semantic-release
2026-03-07 09:59:20 +00:00
Christian Krakau-Louis 10bb533f64 Merge pull request #490 from christianlouis/copilot/add-subscription-page
fix: add subscription_overage_percent to SETTING_METADATA and document in ConfigurationGuide/.env.demo
2026-03-07 10:59:01 +01:00
copilot-swe-agent[bot] 9853a27d82 fix: add subscription_overage_percent to SETTING_METADATA and docs
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 21:29:44 +00:00
copilot-swe-agent[bot] 45949f34c6 fix(api): move quota check before file write in ui-upload endpoint
Subscription quota is now checked before the file is written to disk,
so users who have exceeded their quota do not waste bandwidth or disk
I/O. The post-write cleanup path for quota rejections is no longer
needed and has been removed.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 21:22:46 +00:00
copilot-swe-agent[bot] ab532b55dc fix: resolve mypy and djlint CI failures
- app/utils/subscription.py: add Any type annotation to _scalar_count()
  query parameter (mypy no-untyped-def error at line 316)
- frontend/templates/admin_plans.html: remove empty <div></div> at line 344
  (djlint H020 empty tag pair error)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 21:09:44 +00:00
copilot-swe-agent[bot] ea7fffa3a1 feat(subscriptions): database-backed plan designer with admin CRUD and overage buffer
- Add SubscriptionPlan model and subscription_plans table (migration 015)
- Add billing cycle/period/allow_overage fields to UserProfile (migration 016)
- Add subscription_overage_percent config field (replaces overage_factor)
- Rewrite check_upload_allowed: use overage_percent, yearly carry-over, no daily cap
- Add seed_default_plans(), _plan_to_dict(), get_year_file_count(), _months_elapsed()
- Update get_tier/get_all_tiers to be DB-first with TIER_DEFAULTS fallback
- Add TIER_DEFAULTS alias (TIERS kept for backward compat)
- New /api/plans/ CRUD endpoints (admin-only except list/get)
- New /admin/plans Plan Designer page with Alpine.js UI
- Add Plan Designer link to admin navigation in base.html
- Remove 'Files per day' row from pricing comparison table
- Add billing cycle + period start to admin users edit modal
- Seed default plans on startup in lifespan handler
- Rewrite docs/SubscriptionTiers.md with full plan/overage/API docs
- Fix all tests in test_subscription.py (remove daily cap tests, add overage/carry-over tests)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 18:48:27 +00:00
github-actions[bot] 4277e5ed5d docs(changelog): update changelog [skip ci] 2026-03-06 18:24:48 +00:00
Christian Krakau-Louis 59f1c46b94 Merge pull request #489 from christianlouis/copilot/combine-quick-and-integration-tests
ci: consolidate quick and integration tests into a single test run
2026-03-06 19:24:27 +01:00
copilot-swe-agent[bot] d439d9afdd chore: plan dynamic plan designer feature
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 18:21:04 +00:00
copilot-swe-agent[bot] 5351d82275 chore: plan pricing/limits overhaul with cost analysis
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 18:09:45 +00:00
copilot-swe-agent[bot] 7f521eb755 fix(subscriptions): address code review feedback
- Use shared _require_admin from admin_users in subscriptions API endpoint
- Remove unnecessary Alpine.js hidden-div workaround in pricing.html
- Replace fragile string replace for OCR page count with proper Jinja {:,} format
- Improve comment wording in upload quota cleanup code
- Extract _scalar_count() helper in subscription.py to reduce repetition
- Add aria-valuemin='0' to all progressbar elements in subscription/index templates

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 16:10:00 +00:00
copilot-swe-agent[bot] 179f6125e8 feat(subscriptions): add SaaS subscription tiers, pricing page, and enforced upload quotas
- Add Free / Starter / Professional / Business tiers with lifetime, daily, and monthly
  file limits (app/utils/subscription.py)
- Add subscription_tier column to UserProfile model + migration 014
- Enforce quotas at upload time (HTTP 402 on violation) in /api/ui-upload
- New REST API: GET /api/subscriptions/tiers, /my, /platform (admin)
- New pages: /pricing (marketing, public) and /subscription (per-user status)
- Enhanced dashboard: SaaS stats (files today/month, OCR count, active users)
  in multi-user mode; original single-user layout preserved
- Admin users page: show Plan badge, allow tier editing via dropdown
- Navigation: add Pricing link + subscription icon in user header
- Tests: 23 unit tests for subscription tier logic
- Docs: docs/SubscriptionTiers.md

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 15:53:12 +00:00
copilot-swe-agent[bot] 9670e84862 ci: merge quick and integration tests into a single test step
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 15:32:43 +00:00
copilot-swe-agent[bot] 70dd35dec4 Initial plan 2026-03-06 15:32:27 +00:00
github-actions[bot] 0c3b8d0556 chore(release): update build metadata files [skip ci] 2026-03-06 15:28:57 +00:00
semantic-release fe36974b5b 0.79.0
Automatically generated by python-semantic-release
2026-03-06 15:28:53 +00:00
Christian Krakau-Louis 2e75b3f726 Merge pull request #488 from christianlouis/copilot/add-user-admin-dashboard
feat(auth): add admin user management dashboard
2026-03-06 16:28:33 +01:00
copilot-swe-agent[bot] 3392d941ee Initial plan 2026-03-06 15:28:23 +00:00
copilot-swe-agent[bot] a00e67b01f fix(ui): apply code review feedback on admin_users template accessibility
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 13:48:44 +00:00
copilot-swe-agent[bot] 56f7f2351f feat(auth): add admin user management dashboard
- Add UserProfile model (app/models.py) with per-user settings: display_name, daily_upload_limit, notes, is_blocked
- Add Alembic migration 013_add_user_profiles for the new table
- Add REST API at /api/admin/users/ with list, get, upsert (PUT), delete endpoints (admin-only)
- Add HTML template admin_users.html with Alpine.js: filterable user list, paginated table, edit/create modal, delete confirmation modal
- Add view handler at /admin/users (admin-only redirect guard)
- Register routers in app/api/__init__.py and app/views/__init__.py
- Add 'Users' link to admin nav dropdown in base.html (desktop + mobile)
- Add 27 tests covering auth, list, get, upsert, delete, and model constraints
- Register UserProfile in conftest.py model imports
- Document new endpoints in docs/API.md

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 13:45:35 +00:00
copilot-swe-agent[bot] 4cf93dc16e Initial plan 2026-03-06 13:30:23 +00:00
github-actions[bot] 17b0f3762c docs(changelog): update changelog [skip ci] 2026-03-06 11:45:25 +00:00
Christian Krakau-Louis e0352b1223 Refactor CI workflow for efficiency and clarity
Consolidate test stages and improve dependency management.
2026-03-06 12:45:05 +01:00
github-actions[bot] 299ae98ebd docs(changelog): update changelog [skip ci] 2026-03-06 11:26:42 +00:00
Christian Krakau-Louis 891ce4bf70 Merge pull request #483 from christianlouis/copilot/improve-test-coverage-step-manager
test: improve step_manager coverage from 89% to 99%
2026-03-06 12:26:21 +01:00
Christian Krakau-Louis 82aee1cd0f Merge pull request #484 from christianlouis/copilot/improve-test-coverage-files
test: improve app/views/files.py coverage from 59.67% to 99.35%
2026-03-06 12:26:08 +01:00
Christian Krakau-Louis 681bc77803 Merge pull request #486 from christianlouis/copilot/improve-test-coverage-similarity
test(similarity): raise coverage for app/utils/similarity.py from 62% to 100%
2026-03-06 12:25:54 +01:00
github-actions[bot] 158b113ac9 docs(changelog): update changelog [skip ci] 2026-03-06 11:22:00 +00:00
Christian Krakau-Louis e7a8582799 Merge pull request #485 from christianlouis/copilot/improve-test-coverage-gpt-file
test: improve coverage for extract_metadata_with_gpt to 100%
2026-03-06 12:21:21 +01:00
github-actions[bot] 2c02d33a28 chore(release): update build metadata files [skip ci] 2026-03-06 11:21:10 +00:00
semantic-release 0f5680b86c 0.78.1
Automatically generated by python-semantic-release
2026-03-06 11:21:07 +00:00
Christian Krakau-Louis a4af6323ab Merge pull request #487 from christianlouis/copilot/fix-mypy-error-templates
Fix mypy TemplateResponse annotation in db_wizard and harden owner fallback in process_document
2026-03-06 12:20:46 +01:00
copilot-swe-agent[bot] aab1c5fda9 test: improve coverage for app/views/files.py from 59.67% to 99.35%
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 11:15:11 +00:00
copilot-swe-agent[bot] 575b4e088e fix(views): resolve mypy TemplateResponse typing and owner fallback
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 10:47:46 +00:00
copilot-swe-agent[bot] ed404b4661 test: improve test coverage for app/utils/step_manager.py
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 10:42:09 +00:00
copilot-swe-agent[bot] 7acac4225b test(similarity): improve test coverage for app/utils/similarity.py to 100%
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 10:40:58 +00:00
copilot-swe-agent[bot] b9015764c5 test: improve coverage for extract_metadata_with_gpt to 100%
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-06 10:38:58 +00:00
copilot-swe-agent[bot] 7991ddb5bd Initial plan 2026-03-06 10:33:43 +00:00
copilot-swe-agent[bot] b958537adf Initial plan 2026-03-06 10:32:34 +00:00
copilot-swe-agent[bot] e056c54bdb Initial plan 2026-03-06 10:32:17 +00:00
copilot-swe-agent[bot] 58d0fccaa0 Initial plan 2026-03-06 10:31:52 +00:00
copilot-swe-agent[bot] 8ccb5e73e0 Initial plan 2026-03-06 10:31:36 +00:00
github-actions[bot] fef66b16a9 chore(release): update build metadata files [skip ci] 2026-03-06 10:29:07 +00:00