본문 바로가기
728x90

전체 글520

docker compose 설치 도커 컴포즈 설치 도커만 설치하면 다가 아닙니다. 도커 컴포즈라는것도 설치해주는게 좋습니다. 여러개의 컨테이너를 실행할 수 있도록 해주는 툴이라고 보면 됩니다. 도커 컴포즈의 최신버전 확인은 https://github.com/docker/compose/releases docker/compose Define and run multi-container applications with Docker - docker/compose github.com 에서 확인하고 다운받으세요. 아래 한줄입니다. sudo curl -L https://github.com/docker/compose/releases/download/1.25.0-rc2/docker-compose-`uname -s`-`uname -m` -o /usr/lo.. 2022. 4. 11.
Docker none 삭제 Docker none : none 삭제 Docker 를 사용하다 보면 위와 같이 : 이미지들이 쌓이는데 ( 이미지 생성과정에서 에러가 발생되면 쓸모없는 none 이미지가 남게됩니다. ) 이러한 이미지들을 한번에 정리할려고 하면 아래와 같이 명령어를 입력하면 됩니다. docker rmi $(docker images -f "dangling=true" -q) 혹은 단 prune 를 사용할 경우 -a 옵션을 붙이면 사용하지 않는 이미지를 전부 삭제하기 때문에 -a 옵션 주의하시기 바랍니다. 또한 prune 명령어는 Docker API 1.25 이상부터 지원됩니다. docker image prune https://web-front-end.tistory.com/102 [ Docker ] dangling image .. 2022. 4. 11.
Spring boot Dockerfile 작성 프로젝트 최상위 경로에 작성 Dockerfile FROM adoptopenjdk/openjdk11 RUN mkdir /srv/docker-spring COPY . /srv/docker-spring WORKDIR /srv/docker-spring RUN ./gradlew build RUN mv build/libs/*SNAPSHOT.jar app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "app.jar"] 1. docker build -t docker/spring . ( "." 필수!) 2. docker image list 3. docker run -d -p 8080:8080 docker/spring -d : 백그라운드 실행 2022. 4. 10.
Ubuntu Java 11 설치 (Open JDK) https://codechacha.com/ko/ubuntu-install-open-jdk11/ Ubuntu 20.04 - OpenJDK 11 설치, 삭제 Ubuntu 20.04에 OpenJdk 11을 설치하는 방법을 소개합니다. apt 명령어로 쉽게 설치할 수 있습니다. 만약 apt로 설치할 수 없다면 설치 파일을 다운로드하여 직접 설치하는 방법이 있습니다. 두가지 방법 codechacha.com 2022. 4. 10.
Spring Gradle 빌드 (인텔리제이 방법 포함) 우측 Graddle -> 프로젝트 -> Tasks -> build -> build 클릭 [터미널로 빌드] gradlew 유닉스용 실행 스크립트이다. > gradle build 위와 같이 하면 로컬에 설치된 gradle을 사용. 이 경우에 Java나 Gradle이 설치되어 있어야하고, 새로받은 프로젝트의 Gradle 버전과 로컬에 설치된 Gradle 버전이 호환되지 않으면 문제가 발생할 수 있다. > ./gradlew build 위와 같이 하면 Gradle Wrapper를 사용해서 위에서 언급한 문제가 발생하지 않는다. 참고 https://jobc.tistory.com/202 Gradle & Build 그리고 IntelliJ의 Build gradle을 알아보기 전에 컴파일, 빌드의 개념을 알아보자 컴파일과.. 2022. 4. 10.
Git SSH 키 등록 1. ssh-keygen -t rsa -C "깃허브이메일주소" 2. passphrase 설정 3. cat ~/.ssh/id_rsa.pub 4. 값 복사 후 Git 계정 설정에 들어가서 설정 * (SSH and GPG keys -> New SSH key -> 복사한 값 등록) 5. Git Clone (HTTPS x, SSH o) , [2]에서 해준 passphrase 입력 2022. 4. 10.
타임리프 문자열 조합 https://blog.leocat.kr/notes/2018/11/21/thymeleaf-string-concatenation [Thymeleaf] 문자열 조합(합치기) (까먹을까봐 기록차) blog.leocat.kr 2022. 4. 5.
스프링부트 타임리프 라이브 reload https://easybrother0103.tistory.com/62 [Spring Boot] 인텔리제이 Live Reload 설정 템플릿엔진이나, js css등 수정이 잦은 것들을 매번 새로 빌드 하는 것은 매로 번거로운 일이다. SpringBoot Devtools를 통해 새로고침 만으로 resources 밑의 파일들의 실시간 반영을 할 수 있다. 1. Gradle c easybrother0103.tistory.com 2021.2 버전부터 Registry가 아니라 Advacned Settings에서 설정한다고 한다! Registry에서 compiler.automake.allow.when.app.running을 계속 찾다가.. 없어서 기록한다 Setting > Advanced Settings Allow .. 2022. 4. 5.
Jira , Confluence export import - export confluence n https://confluence.atlassian.com/doc/export-content-to-word-pdf-html-and-xml-139475.html n https://confluence.curvc.com/pages/viewpage.action?pageId=33326787 - export jira https://appfluence.com/help/article/export-jira-project/ 2022. 3. 31.
wsl2 파일 옮기기 https://velog.io/@dom_hxrdy/wsl2-%EC%9C%88%EB%8F%84%EC%9A%B0-%ED%83%90%EC%83%89%EC%B0%BD%EC%9C%BC%EB%A1%9C-wsl-home-%EB%94%94%EB%A0%89%ED%86%A0%EB%A6%AC%EC%97%90-%EC%9E%88%EB%8A%94-%ED%8C%8C%EC%9D%BC-%EC%97%B4%EA%B8%B0 [wsl2] 윈도우 탐색창으로 wsl root 디렉토리에 있는 파일 열기 windows 운영체제 안에서 linux shell 명령어를 쓰기 위해서 wsl2 를 설치해서 mnt/c/... 경로에서 작업을 보통 하고 있었다. 그런데 vscode extension 중에 하나인 remote-wsl 을 설치하고 나니까 성능상의 .. 2022. 3. 31.
aws 네트워크 인터페이스 추가 https://aws.amazon.com/ko/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/ Ubuntu EC2 인스턴스에서 작동하는 보조 네트워크 인터페이스 구성 중요: 이전 예제에서 주 인터페이스에는 eth0, eth1 등의 이름이 지정됩니다. 그러나, m4 및 m5 패밀리 형식 등의 향상된 네트워킹을 지원하는 인스턴스의 경우 명명 규칙이 일관되지 않을 수도 있습 aws.amazon.com 18.04는 이거 보고 작업 2022. 3. 29.
AWS EC2 생성 후 로그인 MobaXterm 로그인 참고 https://minjii-ya.tistory.com/23 2022. 3. 28.
SpringBoot Eureka 서버 설정 설정 build.gradle dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server' implementation 'com.sun.jersey.contribs:jersey-apache-client4:1.19.4' testImplementation 'org.springframework.boot:spring-boot-starter-test' } 설정 @EableEurekaServer 설정 application.yml server: port: 8761 eureka: instance: hostname: localhost client: # 해당 두 속서은 유레카와 성호작용하는 방법을 알려주기 .. 2022. 3. 25.
헤로쿠 간단하게 스프링부트 배포 프로젝트 루트 경로에 Procfile, system.properties 파일 생성 설정 파일 작성 빌드 작성 2022. 3. 22.
스프링 시큐리티 OAuth 2.0 https://loosie.tistory.com/300 [Spring] 스프링으로 OAuth2 로그인 구현하기1 - 구글 스프링 시큐리티와 스프링 시큐리티 OAuth2 클라이언트 많은 서비스에서 로그인 기능을 id/password 방식 보다는 써드파티 방식으로 구글, 네이버과 같은 소셜 로그인 기능을 사용한다. 이는 서비스 loosie.tistory.com 참고 그대로 따라 했는데 Thread 에러남 (HttpSession) 빈 등록 후 해결 @Bean public RequestContextListener requestContextListener(){ return new RequestContextListener(); } 2022. 3. 17.
스프링 Rest Template RestTemplate restTemplate = new RestTemplate(); HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.set("myheader",token); HttpEntity request = new HttpEntity(payload, httpHeaders); ResponseEntity response = restTemplate.postForEntity(dppURI + "/api/pay/full", request, String.class); return response; 2022. 3. 16.
QueryDsl, data jpa 하나의 레포지토리 사용 클래스, 인터페이스 구조 최종 사용하는 레포지토리 (MemberDataRepository) import java.util.Optional; @EnableJpaRepositories /** * 실제 사용하는 리포지토리 * 단순한 CRUD 쿼리는 여기서 작성 */ public interface MemberDataRepository extends JpaRepository, MemberCustomRepository { Member findMemberByEmail(String email); } MemberCustomRepository import java.util.List; @Repository //커스텀 인터페이스 쿼리 작성 public interface MemberCustomRepository { Long e.. 2022. 3. 10.
크롬 시큐리티 모드 해제 Chrome의 설정 자체를 변경하는 방법이다. Chrome에서는 web security의 비활성화를 지원한다. Chrome의 바로가기에서 마우스 오른쪽 단추를 누르고, 대상 경로에 명령어를 추가해주면 된다. CMD에서 관리자 모드로 명령어 실행 "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/tmp "C:\Program Files ~... "는 사용자의 경로이고, --user-data-dir는 Chrome에서 발생할 user data의 저장 폴더를 지정해주면 된다. 2022. 3. 10.
Spring Swagger에서 Pageable 사용 Swagger 에서 Pageable 이용하기 @RequestMapping("/stores") @Api(tags = "store") @RestController public class StoreController { @ApiOperation(value = "메뉴 조회 with paging", notes="store의 id를 이용하여 가맹점의 메뉴를 페이징 처리하여 조회합니다.") @GetMapping(value="/{storeId}/menus") public Map findAllMenuByMenuId(@ApiParam(name="storeId", value="store 테이블 id", required=true) @PathVariable("storeId") long storeId, @PageableDefau.. 2022. 3. 7.
Spring Data Jpa repository 통합 @Repsository 어노테이션 안 붙여줘도 빈 등록한다. 2022. 2. 23.
InitDB 하는 법 package com.danal.chatting.util; import com.danal.chatting.Role.Role; import com.danal.chatting.entity.Authority; import com.danal.chatting.entity.member.Member; import com.danal.chatting.member.service.MemberService; import lombok.RequiredArgsConstructor; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Component; import javax.annotation.. 2022. 2. 22.
swagger 파라미터 안보이게 하기 SwaggerConfig.java 파일 설정 2022. 1. 21.
Spring HTTPS 설정 인증서 생성 keytool -genkeypair -alias ssafy -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore ssafy.p12 -validity 3650 keytool -export -alias ssafy -keystore ssafy.p12 -rfc -file ssafy.cer keytool -import -alias ssafy -file ssafy.cer -keystore ssafy.ts 모든 패스워드 설정을 123456으로 해줌 server: port: 8443 ssl: enabled: true key-store-type: PKCS12 key-store: classpath:keystore/ssafy.p12 key-store-password: .. 2022. 1. 18.
JPA Auditing으로 생성일/수정일 자동화하기 현재 진행중인 프로젝트에서 해당 데이터의 생성시간과 수정시간을 관리해야 할 부분이 있었습니다. 예를 들어, 주문 도메인에서 주문한 시간과 주문 내용을 수정한 시간이 필요했습니다. 그리고 결제 도메인에서는 결제 요청한 시간과 결제 내용을 수정하는 시간이 필요했습니다. 현재 개발 초기 단계이지만 벌써 두 곳에서 생성시간/수정시간이 필요했습니다. 언제 만들어졌는지, 언제 수정되었는지 등은 차후 더 필요해질 것이라 생각 생각했습니다. 여기저기 찾아보다가 책에 해당 내용이 있었습니다. 이제 그 내용을 읽고 적용한 것을 같이 공유하고자 합니다. JPA Auditing으로 생성시간/수정시간 자동화하기 보통 엔티티는 해당 데이터의 생성시간과 수정시간을 포함합니다. 그렇다 보니 매번 DB에 insert하기 전, upda.. 2021. 12. 29.
spring security WebIgnore @Override public void configure(WebSecurity web) throws Exception { web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations()); } 2021. 12. 3.
spring security user생성 inMemory 방식 user 생성 package io.security.corespringsecurity.security.configs; import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecur.. 2021. 12. 3.
spring security 필터 다중 설정 @Order로 순서 설정 package io.security.basicsecurity; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configur.. 2021. 12. 2.
spring security csrfFilter 2021. 12. 2.
spring security 예외처리 package io.security.basicsecurity; import org.springframework.context.annotation.Configuration; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.anno.. 2021. 12. 2.
spring security 인가 antMatcher(경로) 생략하면 모든경로 권한 확인한다. 2021. 12. 1.
728x90