Spaces:
Configuration error
Configuration error
Commit History
-
Migrate authentication from sessions to JWT
Bimo Abdul AzizReplace session-based auth with stateless JWT: add JwtUtil and JwtAuthFilter, configure SecurityConfig to use the JWT filter and STATELESS sessions, and remove/disable the old SessionAuthFilter. Controllers (AuthController, BookController, ReadingProgressController, SubscriptionController, UserSubscriptionController) now accept Authentication and extract userId from the JWT; AuthController.login generates a JWT and sets it on UserResponseDTO. Add jjwt dependencies to pom.xml and JWT configuration to application.properties and fly.toml (JWT_SECRET env). Also: add token field to UserResponseDTO, remove session/logout APIs and implementations, minor code cleanups (suppressWarnings on BookServiceImpl, formatting tweaks).efd17cd -
Configure CORS, cookies, and runtime profiles
Bimo Abdul AzizUse origin patterns and expose cookie headers for cross-origin requests, and add environment/profile-specific cookie settings. SecurityConfig: switch to allowedOriginPatterns to support wildcard Vercel subdomains, allow the Cookie header and expose Set-Cookie, and keep credentials enabled. Added application-dev.properties and application-prod.properties to configure SameSite/secure/http-only and session timeouts for local (HTTP) and production (HTTPS) environments. fly.toml: set SPRING_PROFILES_ACTIVE=prod for the Fly.io runtime. application.properties: default to dev profile so production is controlled by the environment variable.9b13d12 -
Eager-load Book.category and add transactions
Bimo Abdul AzizAdd repository queries that JOIN FETCH Book.category to eagerly load category in a single query and avoid lazy-loading issues (findAllWithCategory, findByIdWithCategory, and *WithCategory search methods). Keep original finder signatures for compatibility. Update BookServiceImpl to use the new repository methods and apply @Transactional annotations (readOnly for read operations, transactional for save/update) so entity associations are available within the persistence context and write operations are properly transactional.e70a676 -
Add wildcard Vercel origin to CORS
Bimo Abdul AzizAllow Vercel preview deployments by adding "https://tebudi-*.vercel.app" to the CORS allowed origins and remove the trailing-slash comment. This enables branch/preview subdomains (e.g., tebudi-branch.vercel.app). Note: pattern matching for origins depends on Spring version—if patterns are required, consider using setAllowedOriginPatterns instead of setAllowedOrigins.6c14d1a -
Remove @CrossOrigin from AuthController
Bimo Abdul AzizDelete the CrossOrigin import and the @CrossOrigin(origins = "http://localhost:5173", allowCredentials = "true") annotation from AuthController. This removes the per-controller hardcoded CORS setting (likely to be handled via a centralized/global CORS configuration instead).dd6d0db -
Add localhost CORS and fix production origin
Bimo Abdul AzizAdd http://localhost:5173 to allowed CORS origins for local development and remove the trailing slash from https://tebudi.vercel.app so the origin matches exactly. This prevents CORS mismatches between dev and production environments.889563a -
Update CORS allowed origin to tebudi.vercel.app
Bimo Abdul AzizReplace placeholder Vercel domain with the real production domain in SecurityConfig.allowedOrigins. This change allows the frontend hosted at https://tebudi.vercel.app to access the backend (localhost:5173 remains allowed for local development).b5fcd3f -
Add Vercel CORS origin and disable Open-In-View
Bimo Abdul AzizAllow the frontend hosted at https://nama-project-kamu.vercel.app in CORS by switching to setAllowedOrigins and including both localhost and Vercel origins. Remove unused List import. Also disable Hibernate Open Session In View (spring.jpa.open-in-view=false) to avoid lazy-loading outside transactions and promote proper transactional data access.a9f62ea -
Allow actuator health checks and config updates
Bimo Abdul AzizPoint Fly health check to /actuator/health and increase timeout; permit actuator endpoints in Spring Security so external health probes won't be redirected to login. Also change JPA ddl-auto from 'none' to 'update', expose management health endpoint, disable management security, and add dummy spring.security.user credentials. These changes ensure the platform health check succeeds during Spring Boot startup and enable runtime schema updates/configuration for the deployment environment.0910f23 -
Set server.address to 0.0.0.0
Bimo Abdul AzizExpose the Spring Boot server on all network interfaces by adding server.address=0.0.0.0 to application.properties. This allows the app to accept external connections (useful for containerized or remote deployments) while keeping the existing port configuration.4af2b52 -
Add Fly deployment config and Docker setup
Bimo Abdul AzizPrepare project for Fly.io deployment: add .dockerignore and fly.toml, plus a GitHub Actions workflow to deploy on pushes to main. Update Dockerfile to a Maven build stage and lightweight Java 21 runtime, set memory-optimizing JAVA_OPTS, and switch exposed port to 8080. Adjust application.properties to use server.port=8080. fly.toml includes internal_port, health check, region and VM resource settings.bc63b7c -
Fix: Set ddl-auto to none and enforce database cloud SSL parameters
Bimo Abdul Aziz33fbdd7 -
Initial commit: TeBuDi Spring Boot app
Bimo Abdul AzizAdd initial TeBuDi digital book subscription Spring Boot project. Includes pom.xml, Maven wrapper, .gitignore and application.properties. Adds application entry point and core configuration (Cloudinary, Security, WebMvc) plus SessionAuthFilter and global exception handler. Implements controllers (Auth, Book, Category, ReadingProgress, Subscription, User and related), DTOs, models, repositories, services and service implementations to support user auth, book management, file serving (proxying PDFs from Cloudinary), categories, subscriptions and reading progress. Basic CORS, session-based auth, password encoding, and static resource mapping for data-storage are configured.73c2e44