forked from Hithomelabs/CFTunnels
Compare commits
No commits in common. "a1275ec06cf9a6e20f2096d6c1ac430cdb11b09f" and "b804cc978fc428dec16c089e547f36ed62201beb" have entirely different histories.
a1275ec06c
...
b804cc978f
@ -19,13 +19,13 @@ services:
|
||||
restart: unless-stopped
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: cftunnel-db-${ENV}
|
||||
container_name: cftunnel-db
|
||||
environment:
|
||||
POSTGRES_DB: cftunnel
|
||||
POSTGRES_USER: ${POSTGRES_USERNAME}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${DB_PORT}:5432"
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ${DB_PATH}:/var/lib/postgresql/data
|
||||
@ -11,12 +11,12 @@ import java.util.ArrayList;
|
||||
@Configuration
|
||||
public class OpenApiConfig {
|
||||
|
||||
@Value("${api.baseUrl}")
|
||||
private String baseUrl;
|
||||
@Value("${api.corsResolveUrl}")
|
||||
private String corsResolveUrl;
|
||||
|
||||
@Bean
|
||||
public OpenAPI openAPI(){
|
||||
Server httpsServer = new Server().url(baseUrl);
|
||||
Server httpsServer = new Server().url(corsResolveUrl);
|
||||
OpenAPI openApi = new OpenAPI();
|
||||
ArrayList<Server> servers = new ArrayList<>();
|
||||
servers.add(httpsServer);
|
||||
|
||||
@ -16,8 +16,8 @@ import org.springframework.security.web.SecurityFilterChain;
|
||||
@EnableWebSecurity
|
||||
@EnableMethodSecurity(
|
||||
prePostEnabled = true,
|
||||
securedEnabled = true,
|
||||
jsr250Enabled = true
|
||||
securedEnabled = true,
|
||||
jsr250Enabled = true
|
||||
)
|
||||
public class SecuirtyConfig {
|
||||
|
||||
@ -29,9 +29,8 @@ public class SecuirtyConfig {
|
||||
http
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.anyRequest().authenticated()
|
||||
).csrf(csrf -> csrf.disable())
|
||||
.with(new OAuth2LoginConfigurer<>(),
|
||||
oauth2 -> oauth2.userInfoEndpoint(u -> u.oidcUserService(customOidcUserConfiguration)));
|
||||
)
|
||||
.with(new OAuth2LoginConfigurer<>(), oauth2 -> oauth2.userInfoEndpoint(u -> u.oidcUserService(customOidcUserConfiguration)));
|
||||
|
||||
|
||||
return http.build();
|
||||
|
||||
@ -87,7 +87,7 @@ public class TunnelController implements ErrorController {
|
||||
return ResponseEntity.ok(jsonResponse);
|
||||
}
|
||||
|
||||
// 50df9101-f625-4618-b7c5-100338a57124
|
||||
// 50df9101-f625-4618-b7c5-100338a57124
|
||||
@PreAuthorize("hasAnyRole('ADMIN')")
|
||||
@PutMapping("/tunnel/{tunnelId}/add")
|
||||
public ResponseEntity<Map<String, Object>> addTunnelconfiguration(@PathVariable String tunnelId, @RequestBody Ingress ingress) throws JsonProcessingException {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
api.baseUrl=http://localhost:8080
|
||||
api.corsResolveUrl=http://localhost:8080
|
||||
|
||||
management.health.db.enabled=true
|
||||
management.endpoints.web.exposure.include=health
|
||||
|
||||
@ -1 +1 @@
|
||||
api.baseUrl=https://cftunnels.hithomelabs.com
|
||||
api.corsResolveUrl=https://cftunnels.hithomelabs.com
|
||||
@ -1 +1 @@
|
||||
api.baseUrl=https://testcf.hithomelabs.com
|
||||
api.corsResolveUrl=https://testcf.hithomelabs.com
|
||||
@ -4,12 +4,6 @@ cloudflare.apiKey=${CLOUDFLARE_API_KEY}
|
||||
cloudflare.email=${CLOUDFLARE_EMAIL}
|
||||
spring.profiles.active=${ENV}
|
||||
|
||||
# set root level
|
||||
logging.level.root=INFO
|
||||
# package-specific
|
||||
logging.level.org.springframework=TRACE
|
||||
logging.level.com.myapp=INFO
|
||||
|
||||
/ * * Masking sure app works behind a reverse proxy
|
||||
server.forward-headers-strategy=framework
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user