Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] - 프로덕션 모니터링 구축 #620

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/src/main/java/kr/touroot/TourootApplication.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package kr.touroot;

import org.springframework.boot.SpringApplication;
import com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableEnvironment;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

Expand All @@ -11,6 +12,8 @@
public class TourootApplication {

public static void main(String[] args) {
SpringApplication.run(TourootApplication.class, args);
new SpringApplicationBuilder()
.environment(new StandardEncryptableEnvironment())
.sources(TourootApplication.class).run(args);
nak-honest marked this conversation as resolved.
Show resolved Hide resolved
}
}
Copy link
Member Author

@nak-honest nak-honest Dec 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logback-spring.xml에서 jasypt 로 암호화 한 loki.loki-url 을 복호화 하지 못하는 문제가 있었습니다.

로깅은 스프링 부팅 초기에 매우 일찍 구성되기 때문에,
일반적인 설정으로는 jasypt로 복호화 된 값을 읽어오지 못한다고 합니다.

따라서 jasypt docs 에서 설명한 대로 스프링 초기화 동작을 위와 같이 재정의 하였습니다.

참고 링크

2 changes: 2 additions & 0 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,5 @@ cloud:
image-base-uri: https://touroot.kr/
origin-storage-path: touroot/

loki:
loki-url: ENC(FHJkwYBoGIuSifQd/92GjnWRS1nvcil2CPFCcWbTicu4rMe/gyFRYzQeqAMCyPkr)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 DEV profile의 loki-url은 평문 상태인데 이 부분도 암호화가 필요할까요~?
만약 필요하다면 확인 한 번 부탁드림다 🙇

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://loki:3100/loki/api/v1/push 는 IP 주소가 노출되지 않아서 괜찮을 것 같아욥!

하지만 숨겨서 나쁠거 없으니 숨겨보도록 하겠습니다!!

1 change: 1 addition & 0 deletions backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@

<springProfile name="prod">
<root level="INFO">
<appender-ref ref="LOKI"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE-INFO"/>
<appender-ref ref="FILE-WARN"/>
Expand Down
Loading