Implementation Summary - May 6, 2026
Historical record. This file describes the May 6 implementation state and contains obsolete paths and schema references. Use docs/README.md, current source code, and
database/init.sqlfor current instructions.
Changes Made
1. ✅ 2FA with TOTP + Authenticator App Support
Status: Already existed, enhanced with UX improvements
- TOTP-based 2FA already implemented using
two_factor_auth.php - Works with Google Authenticator, Authy, Microsoft Authenticator, 1Password, etc.
- Added “Remember Device” feature (30-day cookie)
- Added “Daily MFA” - only asks for MFA once per day per device
- Added “Trusted IPs” - admin can whitelist IPs that skip MFA entirely
New Files:
src/controllers/auth/auth_handler.php- Updated with device trust logicsrc/controllers/auth/two_factor_verify.php- Updated with device trust cookiesrc/controllers/auth/two_factor_setup.php- Added trusted device/IP managementsrc/views/pages/auth/two_factor_setup.php- Added UI for device/IP management
Database Changes (in 000_all.sql):
- Added
user_2fatable - Added
login_2fa_attemptstable - Added
trusted_devicestable (new) - Added
trusted_ipstable (new)
2. ✅ Dropbox OAuth Integration
Status: Implemented
- Replaced access token input with OAuth flow
- Supports refresh tokens for permanent connection
- Automatic token refresh when near expiration
- “Disconnect” button to revoke token
New Files:
src/controllers/settings/dropbox_oauth.php- OAuth flow handler- Updated
src/link_resolvers/auto_resolver/dropbox_link_resolver.php- Auto-refresh tokens - Updated
src/views/pages/settings/links.php- OAuth UI - Updated
src/controllers/settings/links_handler.php- Preserve OAuth credentials
3. ✅ Beta Banners
Status: Implemented
Added beta banners to:
- Documents settings page (
src/views/pages/settings/documents.php) - Notifications page (
src/views/pages/settings/notifications.php) - Links page (
src/views/pages/settings/links.php) - API Keys page (
src/views/pages/api-keys.php)
4. ✅ Cron Logging
Status: Implemented
- All cron jobs now log to unified log file:
/var/www/config/logs/cron/cron.log - Also writes to same daily log as app:
logs/YYYY-MM-DD.log - Created
cron/src/utils/cron_logger.phpwith helper functions - Updated
cron/crontabto redirect all output to unified log - Updated
cron/entrypoint.shto create log directory
New Files:
cron/src/utils/cron_logger.php
Updated Files:
cron/crontab- Unified loggingcron/entrypoint.sh- Create log directorycron/src/cron/generate_recurring_invoices.php- Use cron_loggercron/src/cron/send_invoice_reminders.php- Use cron_loggercron/src/cron/auto_terminate_contracts.php- Use cron_loggercron/src/cron/link_expiration_checker.php- Use cron_loggercron/src/cron/stripe_reconciliation.php- Use cron_logger
5. ✅ Delete Migration File
Status: Completed
- Deleted
database/migrations/001_2fa.sql(per user’s request) - Tables added directly to
database/migrations/000_all.sql
Security Improvements
- Trusted Device Cookies: HttpOnly, Secure (when HTTPS), SameSite=Lax
- Daily MFA Window: Reduces friction while maintaining security
- Trusted IPs: Admin-controlled whitelist for known networks
- OAuth over Access Tokens: More secure Dropbox integration with refresh tokens
Next Steps (Future)
- Passkeys: Modern authentication without passwords (user requested)
- Test OAuth Flow: Verify Dropbox OAuth works end-to-end
- Add OAuth for Google Drive: Similar OAuth flow for GDrive
- Device Fingerprinting: Better device identification (beyond user agent)
- Trusted Device Notifications: Alert when new device is trusted
Configuration Required
Dropbox OAuth Setup
- Create app at https://www.dropbox.com/developers/apps
- Add
dropbox_app_keyanddropbox_app_secrettoapp_configtable - Configure redirect URI:
https://yourdomain.com/?page=settings/dropbox-oauth&action=callback
Trusted IPs
- Go to Settings → 2FA → Trusted IPs (admin only)
- Add office/home IP addresses
- These IPs will skip 2FA entirely