From 8ff4a671cfbeebaf74afb3f6821a6104adc8f5cd Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Sun, 5 Jan 2025 16:05:39 +0900 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20Docker=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=EA=B0=80=20=EB=B9=8C=EB=93=9C=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EB=AA=BB=ED=95=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Spring Application의 BootJar 생성 후 빌드 된 파일을 Dockerfile에 명시된 위치로 이동하도록 변경 --- module-presentation/build.gradle.kts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module-presentation/build.gradle.kts b/module-presentation/build.gradle.kts index 8229781..7a97dca 100644 --- a/module-presentation/build.gradle.kts +++ b/module-presentation/build.gradle.kts @@ -2,6 +2,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar val jar: Jar by tasks val bootJar: BootJar by tasks +val jarName = "app.jar" bootJar.enabled = true jar.enabled = false @@ -25,3 +26,14 @@ dependencies { tasks.getByName("bootJar") { mainClass.set("site.yourevents.YourEventsApplicationKt") } + +tasks.named("bootJar") { + archiveFileName.set(jarName) + + doLast { + copy { + from("build/libs/$jarName") + into("../build/libs") + } + } +} From c73092c22d97d59ea65438eee93cee85daca7248 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 00:57:06 +0900 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20=EB=AA=A8=EB=8B=88=ED=84=B0?= =?UTF-8?q?=EB=A7=81=20=EB=AA=A8=EB=93=88=20=EC=83=9D=EC=84=B1=20=EB=B0=8F?= =?UTF-8?q?=20Sentry=20=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/build.gradle.kts | 18 ++++++++++++++++++ settings.gradle.kts | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 module-infrastructure/monitoring/build.gradle.kts diff --git a/module-infrastructure/monitoring/build.gradle.kts b/module-infrastructure/monitoring/build.gradle.kts new file mode 100644 index 0000000..54c774f --- /dev/null +++ b/module-infrastructure/monitoring/build.gradle.kts @@ -0,0 +1,18 @@ +import org.springframework.boot.gradle.tasks.bundling.BootJar + +val jar: Jar by tasks +val bootJar: BootJar by tasks + +bootJar.enabled = false +jar.enabled = true + +plugins { + kotlin("plugin.jpa") version "2.1.0" +} + +dependencies { + + // Sentry + api("io.sentry:sentry-logback:7.17.0") + api("com.github.maricn:logback-slack-appender:1.6.1") +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 81a0392..61c0d5e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,8 @@ include("module-presentation") include("module-domain") include("module-infrastructure") +include("module-infrastructure:security") +include("module-infrastructure:monitoring") include("module-infrastructure:persistence-db") include("module-independent") -include("module-infrastructure:security") From 882df2ce7b75376ce30803bc64f4ac3d1b977ac3 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:07:08 +0900 Subject: [PATCH 03/10] =?UTF-8?q?feat:=20Sentry=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../site/yourevents/sentry/SentryConfig.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt diff --git a/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt b/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt new file mode 100644 index 0000000..36a485d --- /dev/null +++ b/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt @@ -0,0 +1,22 @@ +package site.yourevents.sentry + +import io.sentry.Sentry +import jakarta.annotation.PostConstruct +import org.springframework.beans.factory.annotation.Value +import org.springframework.context.annotation.Configuration + +@Configuration +class SentryConfig( + @Value("\${sentry.dsn}") private val sentryDsn: String, + @Value("\${sentry.environment}") private val environment: String, + @Value("\${sentry.servername}") private val serverName: String +) { + @PostConstruct + fun initSentry() { + Sentry.init { options -> + options.dsn = sentryDsn + options.environment = environment + options.serverName = serverName + } + } +} From 66009813685cfb26fec8b366b626fdc6440bd3f2 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:12:24 +0900 Subject: [PATCH 04/10] =?UTF-8?q?chore:=20Sentry=20WebHook=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/console-appender.xml | 8 +++ .../src/main/resources/logback-spring.xml | 53 +++++++++++++++++++ module-presentation/build.gradle.kts | 1 + 3 files changed, 62 insertions(+) create mode 100644 module-infrastructure/monitoring/src/main/resources/console-appender.xml create mode 100644 module-infrastructure/monitoring/src/main/resources/logback-spring.xml diff --git a/module-infrastructure/monitoring/src/main/resources/console-appender.xml b/module-infrastructure/monitoring/src/main/resources/console-appender.xml new file mode 100644 index 0000000..8f23ce1 --- /dev/null +++ b/module-infrastructure/monitoring/src/main/resources/console-appender.xml @@ -0,0 +1,8 @@ + + + + ${LOG_PATTERN} + + + diff --git a/module-infrastructure/monitoring/src/main/resources/logback-spring.xml b/module-infrastructure/monitoring/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..ca92a21 --- /dev/null +++ b/module-infrastructure/monitoring/src/main/resources/logback-spring.xml @@ -0,0 +1,53 @@ + + + + + + always + true + 1.0 + ERROR + DEBUG + + + + + + + ${SLACK_WEBHOOK_URI} + + *🚨[${ENVIRONMENT}] %d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread] %-5level %class - %msg <${SENTRY_REPOSITORY_URI}|Go-To-Sentry>* + %n + + + Error-Bot + :robot_face: + true + + + + + ERROR + + + + + + + + + + + + + + + + + + + + + + diff --git a/module-presentation/build.gradle.kts b/module-presentation/build.gradle.kts index 7a97dca..79bb9c3 100644 --- a/module-presentation/build.gradle.kts +++ b/module-presentation/build.gradle.kts @@ -9,6 +9,7 @@ jar.enabled = false dependencies { implementation(project(":module-domain")) + implementation(project(":module-infrastructure:monitoring")) implementation(project(":module-infrastructure:persistence-db")) implementation(project(":module-independent")) From 41168262339db57f1739664acfa21fc6b8376aae Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:17:19 +0900 Subject: [PATCH 05/10] =?UTF-8?q?chore:=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 외부 모듈에서 의존성을 사용할 수 없도록 변경 --- module-infrastructure/monitoring/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module-infrastructure/monitoring/build.gradle.kts b/module-infrastructure/monitoring/build.gradle.kts index 54c774f..525d837 100644 --- a/module-infrastructure/monitoring/build.gradle.kts +++ b/module-infrastructure/monitoring/build.gradle.kts @@ -13,6 +13,6 @@ plugins { dependencies { // Sentry - api("io.sentry:sentry-logback:7.17.0") - api("com.github.maricn:logback-slack-appender:1.6.1") + implementation("io.sentry:sentry-logback:7.17.0") + implementation("com.github.maricn:logback-slack-appender:1.6.1") } From 8fcb03d582ceb36502224a16d6d97f262abc5717 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 01:21:30 +0900 Subject: [PATCH 06/10] =?UTF-8?q?chore:=20Sentry=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=EC=9D=84=20=EC=9C=84=ED=95=9C=20=ED=94=84=EB=A1=9C=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EA=B0=92=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 13 +++++++++++++ .../src/main/resources/application-local.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/module-presentation/src/main/resources/application-dev.yml b/module-presentation/src/main/resources/application-dev.yml index 5450302..cd1811a 100644 --- a/module-presentation/src/main/resources/application-dev.yml +++ b/module-presentation/src/main/resources/application-dev.yml @@ -17,3 +17,16 @@ spring: app: server: url: ENC(uN3Diby1cLKgQIKPznbuLr/9mQrqzUFhTlzKRp4ZCSxovF26NNCo+A==) + +sentry: + dsn: ENC(UefOk3EHvOlzQ+99rApWCWoEMEbTlVbECMRxnRLgtNzuWJa0PmWL1pBtfGRpRK6qWsOSGlmWlJsP7PI7JVaLOnHG3CDLM2bChy61gXTkqYiTs2I1Axf8SW/rxMmcEkH7PLOqEY/TI5I= + environment: ENC(5Nbdf/7y1sF9NAU0jw0SCg==) + servername: ENC(Tf/+6HqlCb8m17xkhfHjhw==) + +logging: + config: classpath:logback-spring.xml + sentry: + repository-uri: ENC(g0Krw6t6uRDttMcJbvX50G2tfUmi+5R+jH6C40Q6Je2kLfCArJNWdSG/YBoIq0+E1zsJamVrVfqG3tOgLWqPMppT9zVlHC60z4Mw9VrXPBFzaZrkXDb+UnAL+WggMg2SzzN0iapM7xo=) + environment: ENC(GWw5mEHTRfd0Ngg/p8uZ7Q==) + slack: + webhook-url: ENC(2V14VMxtr6ga6VYnVumgqqYDdzRfcUzO0+QXJl26W0bfHoVW7APdzecmMuA6/KWENMB3M1SFw5bqwOsI0hdYtzOX6aKicOBAadZ1ESN8fcPsB7b5GaTI1TI/wUdMjTEc) diff --git a/module-presentation/src/main/resources/application-local.yml b/module-presentation/src/main/resources/application-local.yml index cb960b2..3adfc67 100644 --- a/module-presentation/src/main/resources/application-local.yml +++ b/module-presentation/src/main/resources/application-local.yml @@ -17,3 +17,16 @@ spring: app: server: url: http://localhost:8080 + +sentry: + dsn: ENC(p3USktYJhoxYtz0GFLCVpu4fki0u0eN424zqg6rE3vKH5DjjWfqFRN+Enj/rLkCFAhYwlwFtT++KW62gqtm1CnnHxeJfrAki+FdAnWO3JRj29aXea/N8xrE7h/MoZ58Tapyi+wWH5eM=) + environment: ENC(FVBHvqTsvv2ytyUnt6i2lw==) + servername: ENC(cGNqcZ4YnA0ufysvNrAyVzDz1/w6/vUi) + +logging: + config: classpath:logback-spring.xml + sentry: + repository-uri: ENC(Ql7eE0mWdzUcjepLC2Eq7e2PyXyNaG0V2onethHlafhcJ5t9pLBZmeroj3+vkM9zp88YIwxcvMks69YZrEeXBT0MX7C028pAJsxCM54G+wF/uXclw0xOXM9DgWaEkBheAuav6C5Mwqg=) + environment: ENC(qaAYY+h/ALoN3KDILvoV+g==) + slack: + webhook-url: ENC(WHEGoh730wj5KIl+MTr2LTifDVemTwX9+LimiJRRsEnynVGHb7ev0jqY55Su8FfeX6IAh17LRa6NeM42h/tJFR1trqv0iflQZFDKi0/l+VSGBhTBg39s4K0O1bjmeEHN) From d49fe8047696a02b198a25f7d6f064f15e159fc5 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:35:25 +0900 Subject: [PATCH 07/10] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=ED=94=8C=EB=9F=AC=EA=B7=B8=EC=9D=B8=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module-infrastructure/monitoring/build.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/module-infrastructure/monitoring/build.gradle.kts b/module-infrastructure/monitoring/build.gradle.kts index 525d837..6801a20 100644 --- a/module-infrastructure/monitoring/build.gradle.kts +++ b/module-infrastructure/monitoring/build.gradle.kts @@ -6,10 +6,6 @@ val bootJar: BootJar by tasks bootJar.enabled = false jar.enabled = true -plugins { - kotlin("plugin.jpa") version "2.1.0" -} - dependencies { // Sentry From 1a35e05238a83a944a3c682773540e09d0e094a5 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:37:31 +0900 Subject: [PATCH 08/10] =?UTF-8?q?style:=20=EC=BD=94=EB=93=9C=20=EC=BB=A8?= =?UTF-8?q?=EB=B2=A4=EC=85=98=EC=97=90=20=EB=A7=9E=EA=B2=8C=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/site/yourevents/sentry/SentryConfig.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt b/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt index 36a485d..24d41aa 100644 --- a/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt +++ b/module-infrastructure/monitoring/src/main/kotlin/site/yourevents/sentry/SentryConfig.kt @@ -7,9 +7,14 @@ import org.springframework.context.annotation.Configuration @Configuration class SentryConfig( - @Value("\${sentry.dsn}") private val sentryDsn: String, - @Value("\${sentry.environment}") private val environment: String, - @Value("\${sentry.servername}") private val serverName: String + @Value("\${sentry.dsn}") + private val sentryDsn: String, + + @Value("\${sentry.environment}") + private val environment: String, + + @Value("\${sentry.servername}") + private val serverName: String ) { @PostConstruct fun initSentry() { From 54bddad70616d3ff90487672f10dc8ac7389cbf4 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:23:06 +0900 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20`.xml`=EC=97=90=EC=84=9C=20Jasypt?= =?UTF-8?q?=20=EC=95=94=ED=98=B8=ED=99=94=EB=A5=BC=20=EC=9D=B8=EC=8B=9D?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EB=AA=BB=ED=95=98=EB=8A=94=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module-presentation/src/main/resources/application-dev.yml | 6 +++--- .../src/main/resources/application-local.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module-presentation/src/main/resources/application-dev.yml b/module-presentation/src/main/resources/application-dev.yml index cd1811a..4d951bb 100644 --- a/module-presentation/src/main/resources/application-dev.yml +++ b/module-presentation/src/main/resources/application-dev.yml @@ -26,7 +26,7 @@ sentry: logging: config: classpath:logback-spring.xml sentry: - repository-uri: ENC(g0Krw6t6uRDttMcJbvX50G2tfUmi+5R+jH6C40Q6Je2kLfCArJNWdSG/YBoIq0+E1zsJamVrVfqG3tOgLWqPMppT9zVlHC60z4Mw9VrXPBFzaZrkXDb+UnAL+WggMg2SzzN0iapM7xo=) - environment: ENC(GWw5mEHTRfd0Ngg/p8uZ7Q==) + repository-uri: ${SENTRY_REPOSITORY_URI} + environment: ${SENTRY_ENVIRONMENT} slack: - webhook-url: ENC(2V14VMxtr6ga6VYnVumgqqYDdzRfcUzO0+QXJl26W0bfHoVW7APdzecmMuA6/KWENMB3M1SFw5bqwOsI0hdYtzOX6aKicOBAadZ1ESN8fcPsB7b5GaTI1TI/wUdMjTEc) + webhook-url: ${SLACK_WEBHOOK_URL} diff --git a/module-presentation/src/main/resources/application-local.yml b/module-presentation/src/main/resources/application-local.yml index 3adfc67..86f4e0f 100644 --- a/module-presentation/src/main/resources/application-local.yml +++ b/module-presentation/src/main/resources/application-local.yml @@ -26,7 +26,7 @@ sentry: logging: config: classpath:logback-spring.xml sentry: - repository-uri: ENC(Ql7eE0mWdzUcjepLC2Eq7e2PyXyNaG0V2onethHlafhcJ5t9pLBZmeroj3+vkM9zp88YIwxcvMks69YZrEeXBT0MX7C028pAJsxCM54G+wF/uXclw0xOXM9DgWaEkBheAuav6C5Mwqg=) - environment: ENC(qaAYY+h/ALoN3KDILvoV+g==) + repository-uri: ${SENTRY_REPOSITORY_URI} + environment: ${SENTRY_ENVIRONMENT} slack: - webhook-url: ENC(WHEGoh730wj5KIl+MTr2LTifDVemTwX9+LimiJRRsEnynVGHb7ev0jqY55Su8FfeX6IAh17LRa6NeM42h/tJFR1trqv0iflQZFDKi0/l+VSGBhTBg39s4K0O1bjmeEHN) + webhook-url: ${SLACK_WEBHOOK_URL} From 0246e9c7f7450884788cdb1ef7cc001ccc244a61 Mon Sep 17 00:00:00 2001 From: yechan-kim <60172300+yechan-kim@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:29:54 +0900 Subject: [PATCH 10/10] =?UTF-8?q?chore:=20local=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=EC=97=90=EC=84=9C=20Sentry=20=EB=B0=8F=20WebHook=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20=ED=95=B4=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/src/main/resources/logback-spring.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module-infrastructure/monitoring/src/main/resources/logback-spring.xml b/module-infrastructure/monitoring/src/main/resources/logback-spring.xml index ca92a21..c7ea001 100644 --- a/module-infrastructure/monitoring/src/main/resources/logback-spring.xml +++ b/module-infrastructure/monitoring/src/main/resources/logback-spring.xml @@ -36,8 +36,8 @@ - - + +