cors changes applied & new-gw

This commit is contained in:
sumedh
2024-09-30 19:17:01 +05:30
parent 172573d2c5
commit 0b65bcf860
5 changed files with 62 additions and 39 deletions

2
.gitignore vendored
View File

@@ -34,5 +34,5 @@ build/
##changes in filepath before deploy
#src/main/java/com/olympus/apollo/services/StorageProperties.java
#src/main/resources/application.properties
#src/main/resources/application.yml

View File

@@ -1,5 +1,6 @@
package com.olympus.apollo.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
@@ -10,10 +11,13 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Value("${apollo.fe.url}")
private String apollo_frontend_url;
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws/endpoint")
.setAllowedOrigins("http://olympus-api-gateway.olympusai.live")
.setAllowedOrigins(apollo_frontend_url)
.withSockJS();
}

View File

@@ -1,17 +1,22 @@
package com.olympus.apollo.security.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Value("${apollo.fe.url}")
private String apollo_frontend_url;
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedOrigins(apollo_frontend_url)
.allowedHeaders("*")
.allowedMethods("GET", "POST", "PUT", "DELETE");
.allowedMethods("GET", "POST", "PUT", "DELETE","OPTIONS");
}
}

View File

@@ -1,35 +0,0 @@
spring.application.name=apollo
server.port=8082
#spring.jpa.show-sql=true
#spring.jpa.hibernate.ddl-auto=update
#spring.datasource.url=jdbc:postgresql://localhost:5432/olympus
#spring.datasource.username=andreaterzani
#spring.datasource.password=26111979
#spring.datasource.driver-class-name=org.postgresql.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.ai.vectorstore.mongodb.uri=
spring.data.mongodb.uri=
spring.data.mongodb.database=
spring.data.mongodb.username=
spring.data.mongodb.password=
spring.ai.vectorstore.mongodb.indexName=vector_index
spring.ai.vectorstore.mongodb.collection-name=vector_store
spring.ai.vectorstore.mongodb.initialize-schema=false
# API key if needed, e.g. OpenAI
spring.ai.openai.api-key=
#size filter
spring.servlet.multipart.max-file-size=5000000MB
spring.servlet.multipart.max-request-size=500000MB
#path to the repository
ingestion.repository.basepath=C:\\Users\\andrea.terzani\\dev\\Olympus
gitlab.token=
#gitlab.path=C:\\repos\\olympus_ai\\gitClone
gitlab.path=/mnt/apollo_storage/repository

View File

@@ -0,0 +1,49 @@
server:
port: 8082
apollo:
fe:
url: "http://localhost:5173"
spring:
application:
name: apollo
ai:
openai:
api-key:
vectorstore:
mongodb:
uri:
indexName: vector_index
collection-name: vector_store
initialize-schema: false
data:
mongodb:
uri:
database:
username:
password:
servlet:
multipart:
max-file-size: 5000000MB
max-request-size: 500000MB
#path to the repository
ingestion:
repository:
basepath: C:\\Users\\andrea.terzani\\dev\\Olympus
gitlab:
token:
path: /mnt/apollo_storage/repository #C:\\repos\\olympus_ai\\gitClone
#spring.jpa.show-sql=true
#spring.jpa.hibernate.ddl-auto=update
#spring.datasource.url=jdbc:postgresql://localhost:5432/olympus
#spring.datasource.username=andreaterzani
#spring.datasource.password=26111979
#spring.datasource.driver-class-name=org.postgresql.Driver
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
logging:
level:
root: INFO