diff --git a/api/monitoring/grafana/provisioning/datasources/datasources.yml b/api/monitoring/grafana/provisioning/datasources/datasources.yml index 8347c19b..ceb83d7c 100644 --- a/api/monitoring/grafana/provisioning/datasources/datasources.yml +++ b/api/monitoring/grafana/provisioning/datasources/datasources.yml @@ -4,7 +4,7 @@ datasources: type: prometheus access: proxy orgId: 1 - url: http://prometheus:9090 + url: http://20.199.84.5:9090 basicAuth: false isDefault: true editable: true \ No newline at end of file diff --git a/api/monitoring/prometheus/Dockerfile b/api/monitoring/prometheus/Dockerfile index 0e465edc..9f9e3f6f 100644 --- a/api/monitoring/prometheus/Dockerfile +++ b/api/monitoring/prometheus/Dockerfile @@ -7,4 +7,4 @@ COPY ./configuration /etc/prometheus EXPOSE 9090 # Run Prometheus in the foreground -CMD ["prometheus"] +CMD ["--config.file=/etc/prometheus/prometheus.yml"] diff --git a/api/monitoring/prometheus/configuration/prometheus.yml b/api/monitoring/prometheus/configuration/prometheus.yml index 8a5f0486..6d3883d4 100644 --- a/api/monitoring/prometheus/configuration/prometheus.yml +++ b/api/monitoring/prometheus/configuration/prometheus.yml @@ -2,7 +2,8 @@ scrape_configs: - job_name: 'WiqMetrics' metrics_path: '/actuator/prometheus' scrape_interval: 10s + scheme: https static_configs: - - targets: ['host.docker.internal:8443'] + - targets: ['kiwiq.run.place:8443'] labels: application: 'WIQ API' \ No newline at end of file diff --git a/api/src/main/java/lab/en2b/quizapi/auth/config/SecurityConfig.java b/api/src/main/java/lab/en2b/quizapi/auth/config/SecurityConfig.java index aa965a08..46be4f1b 100644 --- a/api/src/main/java/lab/en2b/quizapi/auth/config/SecurityConfig.java +++ b/api/src/main/java/lab/en2b/quizapi/auth/config/SecurityConfig.java @@ -58,6 +58,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http, Authentication .cors(Customizer.withDefaults()) .sessionManagement(configuration -> configuration.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authorizeHttpRequests(authorize -> authorize + .requestMatchers(HttpMethod.GET, "/actuator/**").permitAll() + .requestMatchers(HttpMethod.POST, "/actuator/**").permitAll() .requestMatchers(HttpMethod.POST,"/questions/**").permitAll() .requestMatchers(HttpMethod.GET,"/questions/**").permitAll() .requestMatchers(HttpMethod.GET,"/users/details").authenticated() diff --git a/docker-compose.yml b/docker-compose.yml index e587ec0a..86adc28d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,6 +95,9 @@ - "9090:9090" networks: mynetwork: + environment: + - API_URI=${API_URI} + volumes: - prometheus_data:/prometheus - /certs:/etc/letsencrypt/kiwiq.run.place:ro @@ -114,7 +117,7 @@ - "9091:9091" environment: - GF_SERVER_HTTP_PORT=9091 - - GF_AUTH_DISABLE_LOGIN_FORM=true + #- GF_AUTH_DISABLE_LOGIN_FORM=true depends_on: - prometheus volumes: