Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@
- `DELETE /images/{id}` Delete my image
- `GET /images/my` My uploaded images
- `GET /images` Home / search images **_Public_**



# Spring Boot Actuator
- `GET /actuator/health`
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<version>2.0.3</version>
</dependency>

<!-- Spring Boot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>


</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.authorizeHttpRequests(auth -> auth
.requestMatchers("/auth/login", "/auth/register").permitAll() // login & register: public
.requestMatchers("/", "/*.html", "/*.css", "/*.js").permitAll()
.requestMatchers("/actuator/**").permitAll()
.anyRequest().authenticated() // everything else: must be logged in
)
.addFilterBefore(sessionAuthFilter, UsernamePasswordAuthenticationFilter.class);
Expand Down
9 changes: 8 additions & 1 deletion src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
logging.level.root=INFO
logging.level.org.springframework.jdbc.core=DEBUG
logging.level.org.springframework.jdbc.core=DEBUG


# Expose endpoints (health and metrics)
management.endpoints.web.exposure.include=health,metrics

# Show full health details (e.g., DB status, disk space)
management.endpoint.health.show-details=always
12 changes: 11 additions & 1 deletion src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
logging.level.root=WARN
logging.level.root=WARN


# Expose ONLY the health endpoint for hosting/load balancer health checks
management.endpoints.web.exposure.include=health

# Show details only when authorized, or set to 'never' to prevent information leakage
management.endpoint.health.show-details=when-authorized

# Optional: Run actuator on a separate management port for extra security (not publicly accessible)
# management.server.port=8081
Loading