Posts

Certbot을 이용하여 Let's Encrypt 인증서 자동 갱신하기

이 글에서는 certbot을 통해 발급받은 Let’s Encrypt 인증서를 Webroot 플러그인을 이용해 자동 갱신 방법에 대히여 알아본다.

Prerequsites

Webroot 디렉터리를 생성한다.

이미 설정되어 있는 root 디렉터리(/usr/share/nginx/html 등)에 .well-known 디렉터리를 생성해도 되지만 관리의 편의를 위하여 별도의 디렉터리를 생성한다. 디렉터리 위치는 /var/www/certbot로 한다.

sudo mkdir -p /var/www/certbot

Nginx 설정

기본 설정 파일을 열어 server섹션에 다음 내용을 추가 한다.

location /.well-known/ {
    root /var/www/certbot/;
}

utterances: github issue as comment for Hugo

utterances: github issue as comment for Hugo

Simple method

thmem/<theme-name>/partials/ 디렉터리에 utterances.html 파일을 만들고 아래 와 같은 내용을 추가 한다.

thmem/<theme-name>/partials/utterances.html

<script src="https://utteranc.es/client.js"
        repo="<username>/<username>.github.io"
        issue-term="pathname" 
        theme="github-light"
        crossorigin="anon"
        async>
</script>

<username>/<username>.github.io은 자신의 github username으로 변경 한다.

About authentication to Github

다음과 같은 메일이 왔다.

Hi @euikook,

You recently used a password to access the repository at euikook/wiki.notes with git using git/2.30.2.

Basic authentication using a password to Git is deprecated and will soon no longer work. Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information around suggested workarounds and removal dates.

Thanks, The GitHub Team

Github Blog Token: Token authentication requirements for Git operations

보안 강화를 위하여 2021년 08월 13일 부터 Git 작업을 위한 인증 시 암호를 통한 인증을 지웒 하지 않는다고 한다. 2021년 08월 13일 이후에는 Git 작업을 위해서는 토큰 기반 인증을 사용하거나 SSH 키를 통한 인증을 사용해야 한다.

지금도 2 단계 인증을 활성화 한 사람은 암호를 통한 인증을 사용할 수 없다.

About authentication to Github

Github에 인증하는 방법은 다음과 같다.

  • (2 단계 인증을 통한) username, password
  • Personal access token
  • SSH Key

Github.com에 수정사항을 기여(Contribution)하지 않는 다면 크게 상관 없다.

2 단계 인증을 사용하고 있다면 지금도 계정 암호가 아니라 Personal Access Token을 통해서 인증 해야 하기 때문에 상관이 없다.

Continous Deployment Hugo with Github Actions

Continous Deployment Hugo with Github Actions

Github Page(이하 GH)를 사용하여 정적 사이트를 배포 하고자 한다.

jekyll 유명한 Static Site Generator가 있지만 Go를 공부할 목적으로 Hugo 를 선택했다.

Hugo는 Github Page에서 공식적으로 지원하는 jekyll과 달리 로컬에서 정적 사이트를 빌드 하여 GH 저장소에 push 해주어야 한다.

Github 에서지원하는 CI/CD 인 Github Actions을 이용하여 이를 자동화 할 수 있는데 Github Actions은 일반적은 CI/CD 와 사용법이 비슷하다.

Hugo 시작하기

Installing

ArchLinux

pacman 명령으로 설치한다.

sudo pacman -Syu hugo

Ubuntu

Ubuntu 공식 패키지로 등록 되어 있으므로 apt 명령으로 설치 한다.

sudo apt install hugo

Virtualbox에서 사용 호스트에 연결된 USB 장치가 나타나지 않을 경우

USB 장치를를 게스트에서 직업 접근 하려고 하는데 USB 설정 화면에서 사용 가능한 디바이스 목록에 장치가 하나도 없다.

아래 명령으로 vboxusers 그룹에 사용자를 추가 한다.

sudo usermod -aG vboxusers $USER

로그아웃 후 다시 로그인 하거나 시스템을 재시작 한다.

추가 가능한 USB 장치의 장치 목록이 뜬다.

자세한 내용은 The vboxusers Group 을 참고 하자.

TMI

리눅스를 포함한 유닉스 계열 시템에서 권한을 할당을 위해 자주 사용되는 방법이다. Group에 권한을 부여한다음 해당 그룹에 속한 사용자에게 권한을 부여한다. 다른 예로는 root권한 없이 시리얼 포트에 접근하기 위해서는 RedHat 계열 및 Ubuntu를 포함한 Debian 계열 배포본에서는 dialout 그룹에 속해야 하며 Arch 리눅스 계열 배포본에서는 uucp 그룹에 속해있어야 한다.