diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..1501f44a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "backend/src/main/resources/config"] + path = backend/src/main/resources/config + url = https://github.com/cruru-dev/config.git + branch = main diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 40bd3f88..bb7b43d4 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -81,293 +81,13 @@ spring: config: activate: on-profile: dev - datasource: - read: - hikari: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - write: - hikari: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - flyway: - enabled: true - baseline-on-migrate: true - jpa: - show-sql: true - properties: - hibernate: - format_sql: true - dialect: org.hibernate.dialect.MySQL8Dialect - max_fetch_depth: 15 - hibernate: - ddl-auto: ${DDL_AUTO} - defer-datasource-initialization: false - open-in-view: false - mail: - host: smtp.gmail.com - port: 587 - username: ${EMAIL_USERNAME} - password: ${EMAIL_PASSWORD} - properties: - mail: - smtp: - auth: true - starttls: - enable: true - servlet: - multipart: - enabled: true - file-size-threshold: 2KB - max-file-size: 25MB - max-request-size: 50MB - data: - redis: - port: ${REDIS_PORT} - host: ${REDIS_HOST} - password: ${REDIS_PASSWORD} - -security: - jwt: - token: - secret-key: ${JWT_TOKEN_SECRET_KEY} - access-expire-length: ${ACCESS_TOKEN_EXPIRE_CYCLE} - refresh-expire-length: ${REFRESH_TOKEN_EXPIRE_CYCLE} - algorithm: ${JWT_SIGN_ALGORITHM} - -cookie: - access-token-key: ${COOKIE_ACCESS_TOKEN_KEY} - refresh-token-key: ${COOKIE_REFRESH_TOKEN_KEY} - http-only: ${COOKIE_HTTP_ONLY} - secure: ${COOKIE_SECURE} - domain: ${COOKIE_DOMAIN} - path: ${COOKIE_PATH} - same-site: ${COOKIE_SAME_SITE} - max-age: ${COOKIE_MAX_AGE} - -dataloader: - enable: true -server: - port: ${SERVER_PORT} - tomcat: - mbeanregistry: - enabled: true - -management: - server: - port: ${MONITORING_PORT} - endpoints: - web: - base-path: ${MONITORING_BASE_PATH} - exposure: - include: prometheus - enabled-by-default: false - jmx: - exposure: - exclude: "*" - endpoint: - prometheus: - enabled: true - -monitoring-profile: develop - ---- -spring: - config: - activate: - on-profile: test - datasource: - read: - hikari: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - maximum-pool-size: 10 - write: - hikari: - jdbc-url: ${DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - maximum-pool-size: 5 - flyway: - enabled: true - baseline-on-migrate: true - jpa: - show-sql: true - properties: - hibernate: - dialect: org.hibernate.dialect.MySQL8Dialect - max_fetch_depth: 15 - hibernate: - ddl-auto: ${DDL_AUTO} - defer-datasource-initialization: false - open-in-view: false - mail: - host: smtp.gmail.com - port: 587 - username: ${EMAIL_USERNAME} - password: ${EMAIL_PASSWORD} - properties: - mail: - smtp: - auth: true - starttls: - enable: true - servlet: - multipart: - enabled: true - file-size-threshold: 2KB - max-file-size: 25MB - max-request-size: 50MB - data: - redis: - port: ${REDIS_PORT} - host: ${REDIS_HOST} - password: ${REDIS_PASSWORD} -security: - jwt: - token: - secret-key: ${JWT_TOKEN_SECRET_KEY} - access-expire-length: ${ACCESS_TOKEN_EXPIRE_CYCLE} - refresh-expire-length: ${REFRESH_TOKEN_EXPIRE_CYCLE} - algorithm: ${JWT_SIGN_ALGORITHM} - -cookie: - access-token-key: ${COOKIE_ACCESS_TOKEN_KEY} - refresh-token-key: ${COOKIE_REFRESH_TOKEN_KEY} - http-only: ${COOKIE_HTTP_ONLY} - secure: ${COOKIE_SECURE} - domain: ${COOKIE_DOMAIN} - path: ${COOKIE_PATH} - same-site: ${COOKIE_SAME_SITE} - max-age: ${COOKIE_MAX_AGE} - -dataloader: - enable: false -server: - port: ${SERVER_PORT} - tomcat: - mbeanregistry: - enabled: true - -management: - server: - port: ${MONITORING_PORT} - endpoints: - web: - base-path: ${MONITORING_BASE_PATH} - exposure: - include: prometheus - enabled-by-default: false - jmx: - exposure: - exclude: "*" - endpoint: - prometheus: - enabled: true - -monitoring-profile: test + import: + - config/application-dev.yml --- spring: config: activate: on-profile: prod - datasource: - read: - hikari: - jdbc-url: ${READ_DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - maximum-pool-size: 10 - write: - hikari: - jdbc-url: ${WRITE_DB_URL} - driver-class-name: com.mysql.cj.jdbc.Driver - username: ${DB_USER} - password: ${DB_PASSWORD} - maximum-pool-size: 5 - flyway: - enabled: true - baseline-on-migrate: true - jpa: - properties: - hibernate: - dialect: org.hibernate.dialect.MySQL8Dialect - max_fetch_depth: 15 - hibernate: - ddl-auto: ${DDL_AUTO} - defer-datasource-initialization: false - open-in-view: false - mail: - host: smtp.gmail.com - port: 587 - username: ${EMAIL_USERNAME} - password: ${EMAIL_PASSWORD} - properties: - mail: - smtp: - auth: true - starttls: - enable: true - servlet: - multipart: - enabled: true - file-size-threshold: 2KB - max-file-size: 25MB - max-request-size: 50MB - data: - redis: - port: ${REDIS_PORT} - host: ${REDIS_HOST} - password: ${REDIS_PASSWORD} -security: - jwt: - token: - secret-key: ${JWT_TOKEN_SECRET_KEY} - access-expire-length: ${ACCESS_TOKEN_EXPIRE_CYCLE} - refresh-expire-length: ${REFRESH_TOKEN_EXPIRE_CYCLE} - algorithm: ${JWT_SIGN_ALGORITHM} - -cookie: - access-token-key: ${COOKIE_ACCESS_TOKEN_KEY} - refresh-token-key: ${COOKIE_REFRESH_TOKEN_KEY} - http-only: ${COOKIE_HTTP_ONLY} - secure: ${COOKIE_SECURE} - domain: ${COOKIE_DOMAIN} - path: ${COOKIE_PATH} - same-site: ${COOKIE_SAME_SITE} - max-age: ${COOKIE_MAX_AGE} - -dataloader: - enable: false -server: - port: ${SERVER_PORT} - tomcat: - mbeanregistry: - enabled: true - -management: - server: - port: ${MONITORING_PORT} - endpoints: - web: - base-path: ${MONITORING_BASE_PATH} - exposure: - include: prometheus - enabled-by-default: false - jmx: - exposure: - exclude: "*" - endpoint: - prometheus: - enabled: true - -monitoring-profile: production + import: + - config/application-prod.yml diff --git a/backend/src/main/resources/config b/backend/src/main/resources/config new file mode 160000 index 00000000..6fcc8d6c --- /dev/null +++ b/backend/src/main/resources/config @@ -0,0 +1 @@ +Subproject commit 6fcc8d6c263739812897bcd57b6211776ddce7f7