소개글
Github 주소
https://github.com/outline/outline
outline wiki의 github 주소입니다. outline을 docker로 세팅하는 방법이 간단하게 기술되어 있는데 db나 redis와 같은 설정들을 추가로 해줘야 하기 때문에 공식 가이드를 보고 설치하는 게 쉽지 않습니다. 때문에 필자는 다음 docker-compose를 이용해서 세팅해봤습니다.
Docker compose용 github 주소
https://github.com/chsasank/outline-wiki-docker-compose
소스 다운로드
$ git clone https://github.com/chsasank/outline-wiki-docker-compose
세팅
SSL 인증기반으로 테스트하려는 경우 make https 명령을 사용합니다.
$ make https
$ make https Enter hostname [localhost]: Enter http port number [80]: Enter bucket name to store images [outline-bucket]: mkdir -p data/certs openssl dhparam -out data/certs/dhparam.pem 2048 Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time
https 설정을 마치면 data 디렉토리가 생깁니다. 여기서 nginx의 proxy.conf를 수정해줍니다.
$ vi data/nginx/include/proxy.conf
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_connect_timeout 300; # Default is HTTP/1, keepalive is only enabled in HTTP/1.1 proxy_http_version 1.1; proxy_set_header Connection "upgrade"; chunked_transfer_encoding off; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Upgrade $http_upgrade;
위 두 문구를 수정해주면 됩니다.
이 설정을 해주는 이유는 Websocket 이 동작해야하는데 위 설정을 안하면 websocket이 정상 동작하지 않기 때문입니다.
다음으로는 Docker들을 띄우기 위해 make start 명령을 사용합니다.
$ make start
$ sudo make start => Open https://api.slack.com/apps and Create New App => After creating, scroll down to 'Add features and functionality' -> 'Permissions' => 'https://localhost/auth/slack.callback' Copy the above to Redirect URLs. Press Enter to continue... => Save, go back and scroll down to 'App Credentials' Enter App ID [A0XXXXXXX] : Enter Client ID [get_a_key_from_slack] : Enter Client Secret [get_the_secret_of_above_key]: Enter Verification Token (*not* Signing Secret) [PLxk6OlXXXXXVj3YYYY]: =>run 'make start' and your server should be ready shortly. docker-compose up -d Creating network "outlinewikidockercompose_default" with the default driver
Outline wiki는 기본적으로 Slack 계정을 이용해서 인증을 하기 때문에 slack App ID, Client ID, Client Secret, Verification Token 등의 정보가 필요합니다. 위 정보들을 입력해주면 docker-compose 명령으로 outline wiki를 동작시키기 위한 docker container가 생성됩니다.
정상적으로 docker들이 동작하면 localhost로 접속할 수 있습니다. 사이트에 접속하면 위와 같은 로그인 창을 확인할 수 있습니다.
문제해결
Error Looks like something broke!
위와 같은 에러가 발생하는 경우 log를 봐야 정확하겠지만, 필자의 경우 SSL 인증키가 비정상적으로 설정되어 있을 때 발생했다.