본문 바로가기

전체 글16

compose.yaml파일 키값 services: // Docker Compose가 정한 예약키 nginx: // 사용자가 정한 서비스명 image: nginx:alpine // Docker Compose가 정한 예약키 (이미지이름:이미지태그명 또는 버전) 태그는 골라서 사용하면 될듯 ports: // Docker Compose가 정한 예약키 (내PC에서 80번포트로 접속하면 이서비스의 80번포트로 들어가라 라는뜻) - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro // 호스트 경로: 컨테이너 경로: 옵션 ro: read-only depends_on: backend: condition: service_heal.. 2026. 7. 21.
Security 로그인 검증 로직 및 csrf 설정 @Service public class CustomUserDetailsService implements UserDetailsService { @Autowired private UserRepository userRepository; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UserEntity userEntity = userRepository.findByUsername(username); if (userEntity != null) { //널이아니면 user가 있는것 return new CustomUserDetails(userEntity); } return null; } }.. 2024. 2. 21.
Security 로그인 검증 로직 @Service public class CustomUserDetailsService implements UserDetailsService { @Autowired private UserRepository userRepository; @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UserEntity userEntity = userRepository.findByUsername(username); if (userEntity != null) { //널이아니면 user가 있는것 return new CustomUserDetails(userEntity); } return null; } }.. 2024. 2. 21.
Security 커스텀 로그인 설정 LoginController /login경로 접근시 login폼 이동하게 작성 SecurityConfig에 다음과같이 코드를 추가한다. http .formLogin((auth) -> auth.loginPage("/login") .loginProcessingUrl("/loginProc") .permitAll() ); http .csrf((auth) -> auth.disable()); 인가되지 않은 경로로 접근시 로그인하지않은 경우 "/login" 경로로 이동, 로그인진행은 /loginProc경로로 요청하며 로그인 이후 모든경로를 모두허용(hasRole권한이 없는 경로는 제외)한다. csrf는 enable시 post요청시에 header에 토큰값을 보내주어야 하므로 임시적으로 disable 한다. // 패스워.. 2024. 2. 21.
Security Config 설정 @Configuration @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { //메소드명은 자유 http .authorizeHttpRequests((auth) -> auth .requestMatchers("/", "/login").permitAll() .requestMatchers("/admin").hasRole("ADMIN") .requestMatchers("/my/**").hasAnyRole("ADMIN", "USER") .anyRequest().authenticated() ); return http.build(); .. 2024. 2. 21.
[Docker] 명령어 모음 Image 파일 내려받기 $ docker pull docker run 은 Image 로 Container 를 생성해 실행하는 명령어입니다. $ docker run -it -d -v /d/work --name=ubuntu_20.04 ubuntu --name : 컨테이너의 Name을 지정하는 옵션 -d : 백그라운드로 동작하는 옵션 그외 옵션은 docker run 구글링해서 살펴보자 docker의 컨테이너 리스트 목록을 확인하는 명령어 $ docker ps -a $ docker ps만쓰면 현재 가동중인 컨테이너 리스트만 가져오며 -a옵션을 주면 가동중 및 멈춘 컨테이너를 모두 출력해준다. docker 컨테이너 삭제 및 컨테이너 시작과 종료 명령어 컨테이너 ID는 docker ps를 사용하여 확인한다. $ d.. 2023. 2. 1.
CSS 레이아웃 정리 position 속성 정리 종류 absolute, fixed relative static 너비 최대한 줄어든다. 그대로 유지 그대로 유지 본질 유령화, 유령의집화 유령의집화 사람화 겹침허용 겹치는게 가능 겹치는거 불가능 겹치는거 불가능 이동 top, left, right, bottom으로 이동, 기준이 부모유령 top, left, right, bottom으로 이동, 기준이 현재위치 - Margin - margin을 음수로 줘서 해당영역에서 나올때(오른쪽으로 나오게 할 경우) width: 100%; /*부모 너비 그대로!*/ margin-rigth: 100%; margin-left: auto; - 반대로 왼쪽 영역으로 나오게 할 경우 margin-left: 100%; width:100%; inline-gr.. 2022. 12. 10.
[스프링] 코드가 정상적으로 작동안하는 알수없는 에러 참고!!! 안녕하세요 스프링 개발자 입니다. 오늘 발견한 이슈?에러사항 인데 저도 처음 겪는 이슈사항이라 글적어 봅니다. 아마 저처럼 다른분들도 코드에는 문제가 없는거같은데 원하고자하는 결과를 못얻고 Exception이 발생하여 에러가 발생하는 상황을 겪어 보셨을겁니다!! System.out.println(""); 테스트 코드를 찍어봐도 동작을 안하는 경우가 있는데요 저같은경우에는 해당 프로젝트 마우스 우클릭후 Run as > Maven Install을 했을경우에 다음과같이 Build Failed가 발생했습니다. 그밑줄에 더 내용이 있는데 사진을 찍지 못한점 죄송합니다.. 사진을 찍지는 못했지만! org.apache.jasper.tagplugins.jstl.core does not exist 저런 내용이 있었습니다.. 2022. 11. 8.