
[NodeJS] Google Authenticator 2FA 구현
2023. 7. 20. 23:16
개발/NodeJS
순서 개요 Secret key 및 QR 코드 생성 Google Authenticator 앱에서 QR 코드로 계정 생성 인증 번호 검증 패키지 설치 npm install speakeasy qrcode Secret Key 및 QR 코드 생성 index.js 생성 const speakeasy = require('speakeasy'); const qrcode = require('qrcode'); // Secret Key 생성 var secret = speakeasy.generateSecret({ name: "onestone-test" }); console.log(secret); // 생성한 Secret Key를 기반으로 QR 코드 생성(URL) qrcode.toDataURL(secret.otpauth_url, ..

Jenkins Email 보내기 (with 파일 첨부, 이메일 템플릿)
2023. 5. 29. 18:46
인프라/Jenkins
Jenkins SMTP 설정 Jenkins 관리 > Configure System > Extended E-mail Notification SMTP server : STMP 도메인 or IP (Gmail) smtp.gmail.com SMTP Port : SMTP 포트 (Gmail) 465 Credential : SMTP 계정 정보 Use SSL 체크 Jenkins 파이프라인 attachmentsPattern : '**/test*.txt' ( {jenkins_home}/workspace/{job_name} 디렉토리 내에서 test*.txt 형식의 파일을 찾아 첨부함 ) pipeline { agent any stages { stage('Approval') { steps { script { def html = ..

Jenkins Redmine 이슈 티켓 연동 (Redmine REST API, Jenkins input multiselect)
2023. 5. 29. 13:54
인프라/Jenkins
개요 만들어볼 프로세스는 아래와 같습니다. 젠킨스 파이프라인 실행 레드마인 티켓 선택 (multi select) 선택한 티켓 제목 및 설명 출력 파이프라인 curl -X GET API 호출 부분에서 한글로 된 부분을 사용하시는 레드마인 정보에 맞게 입력하셔야 합니다. API를 호출하여 응답받은 json은 JsonSlurper 플러그인을 통해 파싱합니다. input ExtendedChoice 구문을 이용해 레드마인 티켓을 다중 선택 할 수 있도록 합니다. import groovy.json.JsonSlurper pipeline { agent any environment { issues = "" } stages { stage('GET Redmine REST API') { steps { script { def ..

Jenkins 배포 승인 프로세스 구성 3 - Jenkins 파이프라인
2023. 5. 28. 23:46
인프라/Jenkins
사전 필요사항 Gmail SMTP 세팅 (잘 설명된 포스트가 많아 생략합니다.) Jenkins SMTP 세팅 : https://onestone-note.tistory.com/155 Jenkins Email 보내기 (with 파일 첨부, 이메일 템플릿) Jenkins SMTP 설정 Jenkins 관리 > Configure System > Extended E-mail Notification SMTP server : STMP 도메인 or IP (Gmail) smtp.gmail.com SMTP Port : SMTP 포트 (Gmail) 465 Credential : SMTP 계정 정보 Use SSL 체크 Jenkins 파이프라인 attach onestone-note.tistory.com Jenkins Email ..

Jenkins 배포 승인 프로세스 구성 2 - API (Python Flask)
2023. 5. 28. 23:05
인프라/Jenkins
API 개요 이메일 또는 슬랙에서 "승인하기", "반려하기" 버튼을 누르면 잠시 Pause가 된 젠킨스 파이프라인을 다시 진행시킬 것인지, 아니면 진행을 멈출 것인지 젠킨스 REST API를 날려 줄 파이썬 Flask API를 만들어 줄 것입니다. 소스코드 requests, flask 패키지 설치가 필요합니다. (pip install flask requests) 변수 설명 approval : 승인하기이면 yes를, 반려하기이면 no를 API에 넘겨줄 예정입니다. jobName : 파이프라인 이름입니다. 젠킨스 파이프라인 스크립트에서 자신의 파이프라인 이름을 가져올 수 있습니다. buildNumber : 진행 중인 파이프라인의 빌드 번호입니다. 젠킨스 파이프라인 스크립트에서 현재 진행 중인 빌드 번호를 가..