From 2f6983632953a462ef52d0564c10d80da5b94823 Mon Sep 17 00:00:00 2001 From: alstn113 Date: Fri, 20 Dec 2024 11:53:21 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20application=20profile=20=EA=B3=B5?= =?UTF-8?q?=ED=86=B5=20=ED=8C=8C=EC=9D=BC=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yml | 68 --------- .../src/main/resources/application-prod.yml | 67 -------- server/src/main/resources/application.yml | 143 +++++++++++++++++- web/tsconfig.app.tsbuildinfo | 2 +- 4 files changed, 142 insertions(+), 138 deletions(-) delete mode 100644 server/src/main/resources/application-local.yml delete mode 100644 server/src/main/resources/application-prod.yml diff --git a/server/src/main/resources/application-local.yml b/server/src/main/resources/application-local.yml deleted file mode 100644 index 7ffd267..0000000 --- a/server/src/main/resources/application-local.yml +++ /dev/null @@ -1,68 +0,0 @@ -spring: - h2: - console: - path: /h2-console - enabled: true - datasource: - url: jdbc:h2:mem:database - flyway: - enabled: false - jpa: - open-in-view: false - show-sql: true - properties: - hibernate: - format_sql: true - highlight_sql: true - hibernate: - ddl-auto: create-drop - data: - redis: - host: localhost - port: 6379 - mail: - host: ${MAIL_HOST} - port: 587 - username: ${MAIL_USERNAME} - password: ${MAIL_PASSWORD} - properties: - mail: - smtp: - connectiontimeout: 5000 - timeout: 3000 - writetimeout: 5000 - auth: true - starttls: - enable: true - -api-host: http://localhost:8080 -client-host: http://localhost:5173 - -auth: - jwt: - secret-key: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6 - expiration-time: 86400000 # 1 day - cookie: - access-token-key: access_token - httpOnly: true - secure: true - domain: localhost - path: / - maxAge: 86400 # 1 day - oauth2: - github: - client-id: ${OAUTH_GITHUB_CLIENT_ID} - client-secret: ${OAUTH_GITHUB_CLIENT_SECRET} - redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/github - client-uri: ${client-host} - google: - client-id: ${OAUTH_GOOGLE_CLIENT_ID} - client-secret: ${OAUTH_GOOGLE_CLIENT_SECRET} - redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/google - client-uri: ${client-host} - -logging: - level: - org.springframework.orm.jpa: DEBUG - org.springframework.orm.transaction: DEBUG - org.hibernate.orm.jdbc.bind: trace diff --git a/server/src/main/resources/application-prod.yml b/server/src/main/resources/application-prod.yml deleted file mode 100644 index d61942d..0000000 --- a/server/src/main/resources/application-prod.yml +++ /dev/null @@ -1,67 +0,0 @@ -spring: - datasource: - url: ${DB_URL} - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - flyway: - enabled: true - baseline-on-migrate: true - jpa: - open-in-view: false - show-sql: true - properties: - hibernate: - format_sql: true - highlight_sql: true - hibernate: - ddl-auto: validate - data: - redis: - host: fluffy-redis - port: 6379 - mail: - host: ${MAIL_HOST} - port: 587 - username: ${MAIL_USERNAME} - password: ${MAIL_PASSWORD} - properties: - mail: - smtp: - connectiontimeout: 5000 - timeout: 3000 - writetimeout: 5000 - auth: true - starttls: - enable: true - -api-host: https://api.fluffy.run -client-host: https://www.fluffy.run - -auth: - jwt: - secret-key: ${JWT_SECRET_KEY} - expiration-time: 86400000 # 1 day - cookie: - access-token-key: access_token - httpOnly: true - secure: true - domain: .fluffy.run - path: / - maxAge: 86400 # 1 day - oauth2: - github: - client-id: ${OAUTH_GITHUB_CLIENT_ID} - client-secret: ${OAUTH_GITHUB_CLIENT_SECRET} - redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/github - client-uri: ${client-host} - google: - client-id: ${OAUTH_GOOGLE_CLIENT_ID} - client-secret: ${OAUTH_GOOGLE_CLIENT_SECRET} - redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/google - client-uri: ${client-host} - -logging: - level: - org.springframework.orm.jpa: DEBUG - org.springframework.orm.transaction: DEBUG - org.hibernate.orm.jdbc.bind: trace diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index cb5efc7..82aced3 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -1,9 +1,148 @@ spring: profiles: - default: local + active: local --- spring: config: activate: - on-profile: local, prod + on-profile: local + h2: + console: + path: /h2-console + enabled: true + datasource: + url: jdbc:h2:mem:database + flyway: + enabled: false + jpa: + open-in-view: false + show-sql: true + properties: + hibernate: + format_sql: true + highlight_sql: true + hibernate: + ddl-auto: create-drop + data: + redis: + host: localhost + port: 6379 + mail: + host: ${MAIL_HOST} + port: 587 + username: ${MAIL_USERNAME} + password: ${MAIL_PASSWORD} + properties: + mail: + smtp: + connectiontimeout: 5000 + timeout: 3000 + writetimeout: 5000 + auth: true + starttls: + enable: true + +api-host: http://localhost:8080 +client-host: http://localhost:5173 + +auth: + jwt: + secret-key: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6 + expiration-time: 86400000 # 1 day + cookie: + access-token-key: access_token + httpOnly: true + secure: true + domain: localhost + path: / + maxAge: 86400 # 1 day + oauth2: + github: + client-id: ${OAUTH_GITHUB_CLIENT_ID} + client-secret: ${OAUTH_GITHUB_CLIENT_SECRET} + redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/github + client-uri: ${client-host} + google: + client-id: ${OAUTH_GOOGLE_CLIENT_ID} + client-secret: ${OAUTH_GOOGLE_CLIENT_SECRET} + redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/google + client-uri: ${client-host} + +logging: + level: + org.springframework.orm.jpa: DEBUG + org.springframework.orm.transaction: DEBUG + org.hibernate.orm.jdbc.bind: trace + +--- +spring: + config: + activate: + on-profile: prod + datasource: + url: ${DB_URL} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + flyway: + enabled: true + baseline-on-migrate: true + jpa: + open-in-view: false + show-sql: true + properties: + hibernate: + format_sql: true + highlight_sql: true + hibernate: + ddl-auto: validate + data: + redis: + host: fluffy-redis + port: 6379 + mail: + host: ${MAIL_HOST} + port: 587 + username: ${MAIL_USERNAME} + password: ${MAIL_PASSWORD} + properties: + mail: + smtp: + connectiontimeout: 5000 + timeout: 3000 + writetimeout: 5000 + auth: true + starttls: + enable: true + +api-host: https://api.fluffy.run +client-host: https://www.fluffy.run + +auth: + jwt: + secret-key: ${JWT_SECRET_KEY} + expiration-time: 86400000 # 1 day + cookie: + access-token-key: access_token + httpOnly: true + secure: true + domain: .fluffy.run + path: / + maxAge: 86400 # 1 day + oauth2: + github: + client-id: ${OAUTH_GITHUB_CLIENT_ID} + client-secret: ${OAUTH_GITHUB_CLIENT_SECRET} + redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/github + client-uri: ${client-host} + google: + client-id: ${OAUTH_GOOGLE_CLIENT_ID} + client-secret: ${OAUTH_GOOGLE_CLIENT_SECRET} + redirect-uri: ${api-host}/api/v1/auth/oauth2/callback/google + client-uri: ${client-host} + +logging: + level: + org.springframework.orm.jpa: DEBUG + org.springframework.orm.transaction: DEBUG + org.hibernate.orm.jdbc.bind: trace diff --git a/web/tsconfig.app.tsbuildinfo b/web/tsconfig.app.tsbuildinfo index 8c94058..9ee2c6d 100644 --- a/web/tsconfig.app.tsbuildinfo +++ b/web/tsconfig.app.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/apiclient.ts","./src/api/authapi.ts","./src/api/examapi.ts","./src/api/questionapi.ts","./src/api/submissionapi.ts","./src/components/asyncboundary.tsx","./src/components/errorfallback.tsx","./src/components/dashboard/draftexamcard.tsx","./src/components/dashboard/publishedexamcard.tsx","./src/components/exams/examsummarycard.tsx","./src/components/exams/newexambutton.tsx","./src/components/layouts/base/baselayout.tsx","./src/components/layouts/base/header.tsx","./src/components/overview/editableinput.tsx","./src/components/overview/exampublishbutton.tsx","./src/components/questions/exammanagementquestionspanel.tsx","./src/components/questions/exammanagementquestionssidebar.tsx","./src/components/questions/details/longanswerquestion.tsx","./src/components/questions/details/multiplechoicequestion.tsx","./src/components/questions/details/questiondetailtemplate.tsx","./src/components/questions/details/shortanswerquestion.tsx","./src/components/questions/details/singlechoicequestion.tsx","./src/components/questions/details/trueorfalsequestion.tsx","./src/components/questions/editor/exameditorsidebar.tsx","./src/components/questions/editor/longanswerquestioneditor.tsx","./src/components/questions/editor/multiplechoicequestioneditor.tsx","./src/components/questions/editor/questioneditortemplate.tsx","./src/components/questions/editor/questiontypeselector.tsx","./src/components/questions/editor/shortanswerquestioneditor.tsx","./src/components/questions/editor/singlechoicequestioneditor.tsx","./src/components/questions/editor/trueorfalsequestioneditor.tsx","./src/components/questions/view/examviewsidebar.tsx","./src/components/questions/view/longanswerquestionview.tsx","./src/components/questions/view/multiplechoicequestionview.tsx","./src/components/questions/view/questionviewtemplate.tsx","./src/components/questions/view/shortanswerquestionview.tsx","./src/components/questions/view/singlechoicequestionview.tsx","./src/components/questions/view/trueorfalsequestionview.tsx","./src/constants/index.ts","./src/hooks/usegetme.ts","./src/hooks/uselogout.ts","./src/hooks/useuser.ts","./src/hooks/api/types.ts","./src/hooks/api/exam/usecreateexam.ts","./src/hooks/api/exam/usegetexam.ts","./src/hooks/api/exam/usegetexamsummaries.ts","./src/hooks/api/exam/usegetexamwithanswers.ts","./src/hooks/api/exam/usegetmyexamsummaries.ts","./src/hooks/api/exam/usepublishexam.ts","./src/hooks/api/exam/useupdateexamdescription.ts","./src/hooks/api/exam/useupdateexamquestions.ts","./src/hooks/api/exam/useupdateexamtitle.ts","./src/hooks/api/submission/usecreatesubmission.ts","./src/hooks/api/submission/usegetsubmissiondetail.ts","./src/hooks/api/submission/usegetsubmissionsummaries.ts","./src/lib/formatdate.ts","./src/pages/aboutpage.tsx","./src/pages/homepage.tsx","./src/pages/notfoundpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/exams/examdetailpage.tsx","./src/pages/exams/management/exammanagementanalyticspage.tsx","./src/pages/exams/management/exammanagementoverviewpage.tsx","./src/pages/exams/management/exammanagementquestionspage.tsx","./src/pages/exams/management/exammanagementsettingspage.tsx","./src/pages/exams/management/layout/exammanagementheader.tsx","./src/pages/exams/management/layout/exammanagementlayout.tsx","./src/stores/useexameditorstore.ts","./src/stores/usesubmissionstore.ts"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/apiclient.ts","./src/api/authapi.ts","./src/api/examapi.ts","./src/api/questionapi.ts","./src/api/submissionapi.ts","./src/components/asyncboundary.tsx","./src/components/errorfallback.tsx","./src/components/analytics/multiplechoicequestionwithanswer.tsx","./src/components/analytics/singlechoicequestionwithanswer.tsx","./src/components/analytics/submissionanswers.tsx","./src/components/analytics/submissiondetails.tsx","./src/components/analytics/textanswerquestionwithanswer.tsx","./src/components/analytics/trueorfalsequestionwithanswer.tsx","./src/components/dashboard/draftexamcard.tsx","./src/components/dashboard/publishedexamcard.tsx","./src/components/exams/examsummarycard.tsx","./src/components/exams/newexambutton.tsx","./src/components/layouts/base/baselayout.tsx","./src/components/layouts/base/header.tsx","./src/components/overview/editableinput.tsx","./src/components/overview/examdescriptionoverview.tsx","./src/components/overview/exampublishbutton.tsx","./src/components/overview/examtitleoverview.tsx","./src/components/questions/exammanagementquestionspanel.tsx","./src/components/questions/exammanagementquestionssidebar.tsx","./src/components/questions/details/longanswerquestion.tsx","./src/components/questions/details/multiplechoicequestion.tsx","./src/components/questions/details/questiondetailtemplate.tsx","./src/components/questions/details/shortanswerquestion.tsx","./src/components/questions/details/singlechoicequestion.tsx","./src/components/questions/details/trueorfalsequestion.tsx","./src/components/questions/editor/exameditorsidebar.tsx","./src/components/questions/editor/longanswerquestioneditor.tsx","./src/components/questions/editor/multiplechoicequestioneditor.tsx","./src/components/questions/editor/questioneditortemplate.tsx","./src/components/questions/editor/questiontypeselector.tsx","./src/components/questions/editor/shortanswerquestioneditor.tsx","./src/components/questions/editor/singlechoicequestioneditor.tsx","./src/components/questions/editor/trueorfalsequestioneditor.tsx","./src/components/questions/view/examviewsidebar.tsx","./src/components/questions/view/longanswerquestionview.tsx","./src/components/questions/view/multiplechoicequestionview.tsx","./src/components/questions/view/questionviewtemplate.tsx","./src/components/questions/view/shortanswerquestionview.tsx","./src/components/questions/view/singlechoicequestionview.tsx","./src/components/questions/view/trueorfalsequestionview.tsx","./src/constants/index.ts","./src/hooks/usegetme.ts","./src/hooks/uselogout.ts","./src/hooks/useuser.ts","./src/hooks/api/types.ts","./src/hooks/api/exam/usecreateexam.ts","./src/hooks/api/exam/usegetexam.ts","./src/hooks/api/exam/usegetexamsummaries.ts","./src/hooks/api/exam/usegetexamwithanswers.ts","./src/hooks/api/exam/usegetmyexamsummaries.ts","./src/hooks/api/exam/usepublishexam.ts","./src/hooks/api/exam/useupdateexamdescription.ts","./src/hooks/api/exam/useupdateexamquestions.ts","./src/hooks/api/exam/useupdateexamtitle.ts","./src/hooks/api/submission/usecreatesubmission.ts","./src/hooks/api/submission/usegetsubmissiondetail.ts","./src/hooks/api/submission/usegetsubmissionsummaries.ts","./src/lib/formatdate.ts","./src/pages/aboutpage.tsx","./src/pages/homepage.tsx","./src/pages/notfoundpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/exams/examdetailpage.tsx","./src/pages/exams/management/exammanagementanalyticspage.tsx","./src/pages/exams/management/exammanagementoverviewpage.tsx","./src/pages/exams/management/exammanagementquestionspage.tsx","./src/pages/exams/management/exammanagementsettingspage.tsx","./src/pages/exams/management/layout/exammanagementheader.tsx","./src/pages/exams/management/layout/exammanagementlayout.tsx","./src/stores/useexameditorstore.ts","./src/stores/usesubmissionstore.ts"],"version":"5.6.3"} \ No newline at end of file