Commit Graph
17 Commits
Author SHA1 Message Date
john-okeefe 286d0b5e06 feat(scanner): convert scan poll interval from minutes to seconds
- Rename SCAN_POLL_INTERVAL_MINUTES to SCAN_POLL_INTERVAL_SECONDS in config
- Update MediaScanner to accept interval in seconds instead of minutes
- Adjust default polling interval from 3 minutes to 30 seconds for faster response
- Add debug logging for fsnotify events to aid troubleshooting file watching

This change improves media file detection responsiveness by reducing the
polling interval from minutes to seconds, while maintaining the file
watcher as the primary detection mechanism.
2026-02-28 01:59:35 -05:00
john-okeefe 037e7c1189 feat(scanner): add debounced file watching with polling fallback
- Implement event queue with 3-second debouncing for file system events
- Add configurable polling fallback (default 3 min) via SCAN_POLL_INTERVAL_MINUTES
- Add SyncFilesystemWithDatabase to detect orphaned DB entries and new files
- Integrate utils.ResolveMediaURL for consistent media file path resolution
- Add COOKIE_SECURE env var with SameSite=LaxMode for session cookies
- Update media handler to properly decode URL paths for file serving
- Refactor scanner initialization to accept poll interval configuration
2026-02-28 01:16:27 -05:00
john-okeefe b55e5df251 chore: Add BASE_URL environment variable documentation
- Add comment about BASE_URL in docker-compose.yml
- Document that BASE_URL should include protocol (http:// or https://)
- Provides guidance for users setting up device sync
- Kobo devices require actual network IP, not localhost
2026-02-13 10:13:29 -05:00
john-okeefe 11070fbf25 Improve test infrastructure and organization
- Add test-runner stage to Dockerfile for isolated test execution
- Refactor Makefile test targets: separate unit and integration tests
- Unit tests now run on host (fast, no containers required)
- Integration tests run in containers matching production environment
- Add dedicated 'tests' service to docker-compose.yml
- Update test-integration target to use containerized test runner
- Improve service health checks and wait conditions
- Add test environment variables for consistent testing

This change separates unit tests (fast, local) from integration tests
(full environment, containerized) for better developer experience
and more reliable CI/CD pipelines.
2026-02-09 10:13:32 -05:00
john-okeefe fc45b32ec0 fix: add missing newline to docker-compose.yml
- Ensure proper file formatting with trailing newline
2026-02-06 17:05:06 -05:00
john-okeefe 91456d118a fix: restore essential database configuration for self-hosted deployment
Restore 4 critical lines removed in commit 6ebe974:

1. postgres_data:/var/lib/postgresql/data - Persist database across container recreations
2. ./database/schema:/docker-entrypoint-initdb.d - Auto-load schema on first startup
3. ports: - "5432:5432" - Expose DB to host for integration tests and direct access
4. env_file: - .env - Load environment configuration

These are required for:
- Self-hosted production deployments
- Data persistence across docker-compose up -d --build
- Automatic database initialization on new machines
- Integration test execution (localhost:5432 access)

Fixes integration tests that fail with "connection refused"
2026-02-06 12:49:36 -05:00
john-okeefe 2a7338200c feat: add health check and restore frontend routes
Health check endpoint:
- Add /health endpoint that pings database with 2-second timeout
- Returns 200 when DB connected, 503 when unavailable
- Provides true end-to-end health verification

Frontend routes restoration (routes removed in c5f327b):
- Add public routes: /, /login, /register with smart auth detection
- Add redirect routes: /bookshelf, /dashboard
- Add admin routes: /admin, /admin/profile, /admin/library
- Add SSR routes: /api/devices-page, /api/conflicts-page
- Add 'FRONTEND ROUTES - DO NOT DELETE' comment block to prevent future removal

Docker Compose healthcheck:
- Update to use curl on /health endpoint (pg_isready not in Alpine)
- Add 10s start_period for app initialization
- Accurately reflects app + database health status

All changes maintain backward compatibility and existing API behavior.
2026-02-06 10:52:54 -05:00
john-okeefe 7d1fc546a8 config: move operational defaults to docker-compose.yml
- Add conversion service configuration with sensible defaults
  - BOOKHOARD_CONVERSION_CACHE_DIR: /app/cache/kepub
  - BOOKHOARD_CONVERSION_TOOL: /usr/bin/kepubify
  - BOOKHOARD_CONVERSION_CACHE_TTL: 24h
  - Add named volume for conversion cache
- Add rate limiting configuration with defaults
  - TEST_MODE: false
  - RATE_LIMIT_ENABLED: true
  - REQUESTS_PER_MINUTE: 10
- Simplify .env.example to only required secrets (JWT_SECRET, DBPASS)
- Add section comments to docker-compose.yml for better organization
- Document optional overrides in .env.example comments

This change separates secrets (in .env) from operational configuration
(in docker-compose.yml), following security best practices while
maintaining flexibility for custom deployments.
2026-02-01 17:34:00 -05:00
john-okeefe 033271d267 Update project configuration for Bookhoard organization rename
Phase 1 of Gitea repository migration:
- Rename docker containers: bookmann_db → bookhoard_db, bookmann → bookhoard
- Update database name: bookmann → bookhoard
- Rename environment variables: BOOKMANN_* → BOOKHOARD_*
- Update documentation references to new project name

This prepares the codebase for migration to Bookhoard organization.
2026-02-01 16:10:29 -05:00
john-okeefe 6ebe974927 Simplify docker-compose healthcheck configuration
Remove redundant volumes and env_file, simplify healthcheck to use pg_isready for both services
2026-01-31 11:45:58 -05:00
john-okeefe 4b8cb58c84 feat: add configurable test mode and rate limiting
- Add TestMode, RateLimitEnabled, RequestsPerMinute to Config
- Add getEnvBool() and getEnvInt() helper functions
- Update rate limiter to support enabled/disabled state
- Pass test environment variables through docker-compose
- Configure rate limiter dynamically in main.go

This allows disabling rate limiting for integration testing while
maintaining security in production environments.
2026-01-29 13:33:18 -05:00
john-okeefe cdee6a1aef fix: Update database configuration for proper container naming
- Fix database name reference in docker-compose.yml
- Update config.go to use consistent database name
- Ensure database connection string matches container setup
2026-01-26 21:19:34 -05:00
john-okeefe 08e80ae84b refactor: reorganize project structure and update configurations
- Move migrations/ to database/schema/ for clarity on database schema definitions
- Move sqlc.yaml to internal/database/ to group with database code
- Move static/ to cmd/server/static/ to co-locate with server
- Update all configuration files and documentation
- Follow Go project conventions for better organization
2026-01-24 23:40:31 -05:00
john-okeefe c3769fe7f1 refactor: rename project back from shelf to bookmann
- Change Go module name back from 'shelf' to 'bookmann'
- Update all import paths back to 'bookmann' module
- Update README.md project name back to 'Bookmann'
- Update docker-compose.yml container names back to 'bookmann' and 'bookmann_db'
- Regenerate database code with restored module imports
2026-01-23 09:08:59 -05:00
john-okeefe 4318f8624b refactor: restructure project from bookmann to shelf
- Rename project from 'bookmann' to 'shelf'
- Move all backend/ contents to root level (flatten structure)
- Update Go module name from 'bookmann' to 'shelf'
- Update all import paths to use new 'shelf' module
- Update Dockerfile to work without backend/ subdirectory
- Update docker-compose.yml to use new structure and rename containers
- Update .gitignore for new file paths
- Update README.md with new project name and structure
- Regenerate database code with new module imports
2026-01-23 09:08:04 -05:00
john-okeefe 9efae205a2 Rename containers: backend -> bookmann, db -> bookmann_db 2026-01-22 17:19:57 -05:00
john-okeefe 55c42f1f99 feat: Add comprehensive backend validation, toast notifications, and Tokyo Night theme
- Backend: Add server-side validation with go-playground/validator/v10
- Frontend: Add toast notifications for API errors with @zerodevx/svelte-toast
- UI: Complete Tokyo Night theme redesign with modern animations
- Docs: Update COMPLETE_DOCUMENTATION.md and README.md with all enhancements
- Validation: Email format, password strength, and input sanitization
- UX: Real-time error feedback, loading states, and responsive design
2026-01-21 20:01:18 -05:00