How to change Atlassian Product BaseURL

개요

사용중이던 서비스에서 Jira 및 Confluence에서는 Jira Issue의 Description 또는 Comment에 정적인 링크가 작성되어있을 때가 많습니다.
Confluence에서도 Page Body 또는 Comment에도 마찬가지죠.

이런 부분은 BaseURL 변경 시 DataBase에 직접 쿼리를 실행하여 수동으로 변경해주는 작업을 해주어야합니다. (왜 이런걸 웹 콘솔 기능으로 만들어두지 않았을까요...)

당신이 Atlassian Product를 운영중이고 가까운 시일내에 BaseURL을 변경해야하는 요구사항이 있다면 이 글은 무엇보다도 당신에게 도움이 될 것입니다!

환경

  • Atlassian Product on Docker(Crowd, Jira, Confluence)
  • BaseURL은 서브도메인 포함 전체 Domain Name이 변경

Docker 환경에서는 Docker Image에 Atlassian Product Engine이 탑재되어있어 server.xml에 들어가는 proxyName은 ATL_PROXY_NAME이라는 환경변수로 작성됩니다.

따라서 Docker 환경이 아닌 설치형 Atlassian Product에서는 ATL_PROXY_NAME 변경 부분에서는 server.xml을 변경해주시면 됩니다.

문서에 작성되어있는 "Shutdown" 부분은 docker stop으로 컨테이너를 "Stop" 시키는 것과 동일하게 이해하시면 됩니다.

Atlassian Engineer로 근무하며 실제 BaseURL 변경 작업에 대한 작업을 그대로 나열하였으며 제가 겪은 문제에 대해서는 아래에 추가로 기술합니다.

작업 순서

Crowd -> Jira or Confluence

Crowd

  1. Crowd Shutdown
  2. Crowd DB 백업
  3. Crowd Start
  4. Crowd Console에서 BaseURL 변경, Single Sign-On cookie settings.(SSO domain) 제거
    + Proxy 설정 신규 도메인으로 변경
  5. Crowd Shutdown 및 Start
    + 시작시 ATL_PROXY_NAME 변경(https://hub.docker.com/r/atlassian/crowd 참고)
  6. 변경된 BaseURL로 접속확인
  7. 변경된 BaseURL로 Crowd Console 접속 및 확인
  8. (Confluence, Jira의 Crowd BaseURL 정보 수정 후 진행) Single Sign-On cookie settings.(SSO domain) 정보 입력(신규도메인)

Confluence

  1. Confluence Shutdown
  2. Confluence DB 백업
  3. Confluence Start
  4. Confluence Administrator-user 생성(confluence-administrator 계정) 및 그룹 매핑
  5. User Directory 설정 변경
    + 생성한 Confluence 계정이 Crowd보다 우선순위를 갖게 설정
  6. Confluence Shutdown
  7. seraph-config.xml 및 crowd.properties 설정 변경
    + Docker 환경에서는 /opt/atlassian/etc 에 파일을 넣어 별도로 적용이 가능함(현재 가이드에서는 seraph-config.xml만 해당)
    + crowd.properties는 docker cp 로 파일 복사 후 docker restart
  8. Confluence Start
  9. Confluence - Crowd 설정 변경(Console에서 진행, 변경된 Crowd BaseURL 설정으로 수정)
  10. Confluence BaseURL 변경
  11. Confluence Shutdown 및 Start(seraph-config.xml 원상복구)
    + ATL_PROXY_NAME 변경(https://hub.docker.com/r/atlassian/confluence-server 참고)
  12. 변경된 BaseURL로 접속 확인 및 DB 쿼리문 결과 확인할 Page 확인
  13. Confluence Shutdown
  14. DB 쿼리 실행
    (https://confluence.atlassian.com/confkb/how-to-replace-all-hard-coded-links-after-a-base-url-change-in-confluence-284366235.html)
  15. Confluence Start
  16. 쿼리 결과 확인(테스트 페이지) 및 CRUD 테스트 진행

Jira

  1. Jira Shutdown
  2. Jira DB 백업
  3. Jira Start
  4. Jira Administrator-user 생성(jira-administrator 계정) 및 그룹 매핑
  5. User Directory 설정 변경
    + 생성한 Jira 계정이 Crowd보다 우선순위를 갖게 설정
  6. Jira Shutdown
  7. seraph-config.xml 및 crowd.properties 설정 변경
    + Docker 환경에서는 /opt/atlassian/etc 에 파일을 넣어 별도로 적용이 가능함(현재 가이드에서는 seraph-config.xml만 해당)
    + crowd.properties는 docker cp 로 파일 복사 후 docker restart
  8. Jira Start
  9. Jira - Crowd 설정 변경(Console에서 진행, 변경된 Crowd BaseURL 설정으로 수정)
  10. Jira BaseURL 변경
  11. Jira Shutdown 및 Start(seraph-config.xml 원상복구)
    + ATL_PROXY_NAME 변경(https://hub.docker.com/r/atlassian/jira-software 참고)
  12. 변경된 BaseURL로 접속 확인 및 DB 쿼리문 결과 확인할 Issue 확인
  13. Jira Shutdown
  14. DB 쿼리 실행(https://confluence.atlassian.com/jirakb/how-to-update-or-change-outgoing-links-from-jira-issues-and-dashboards-1005786896.html)
  15. Jira Start
  16. 쿼리 결과 확인(테스트 이슈) 및 CRUD 테스트 진행

Config 변경

Jira & Confluence - crowd.properties

application.name                        jira
application.password                    jira
application.login.url                   http://crowd.hons.io/crowd/console/

crowd.server.url                        http://crowd.hons.io/crowd/services/
crowd.base.url                          http://crowd.hons.io/crowd/

session.isauthenticated                 session.isauthenticated
session.tokenkey                        session.tokenkey
session.validationinterval              2
session.lastvalidation                  session.lastvalidation
Crowd BaseURL을 적용시켜줍니다.

Jira - seraph-config.xml

Crowd를 통해 SSO를 사용중이었다면 기존 사용하던 seraph-config.xml 내용을 변경해야 Jira 내부 계정을 통하여 로그인 할 수 있습니다.

Jira 계정을 사용할 때

    <!-- CROWD:START - If enabling Crowd SSO integration uncomment the following SSOSeraphAuthenticator and comment out the JiraSeraphAuthenticator below -->
    <!--
    <authenticator class="com.atlassian.jira.security.login.SSOSeraphAuthenticator"/>
    -->
    <!-- CROWD:END -->

    <!-- CROWD:START - The authenticator below here will need to be commented out for Crowd SSO integration -->
    <authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/>
    <!-- CROWD:END -->
주석에 설명되어있는 것 처럼 주석 해제 및 주석 처리를 진행합니다.

Crowd를 통해 SSO를 사용할 때

    <!-- CROWD:START - If enabling Crowd SSO integration uncomment the following SSOSeraphAuthenticator and comment out the JiraSeraphAuthenticator below -->
    <authenticator class="com.atlassian.jira.security.login.SSOSeraphAuthenticator"/>
    <!-- CROWD:END -->

    <!-- CROWD:START - The authenticator below here will need to be commented out for Crowd SSO integration -->
    <!--
    <authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/>
    -->
    <!-- CROWD:END -->
주석에 설명되어있는 것 처럼 주석 해제 및 주석 처리를 진행합니다.

Confluence - seraph-config.xml

Crowd를 통해 SSO를 사용중이었다면 Jira와 마찬가지로 기존 사용하던 seraph-config.xml 내용을 변경해야 Confluence 내부 계정을 통하여 로그인 할 수 있습니다.

Confluence 계정을 사용할 때

    <!-- Default Confluence authenticator, which uses the configured user management for authentication. -->
    <authenticator class="com.atlassian.confluence.user.ConfluenceAuthenticator"/>

    <!-- Custom authenticators appear below. To enable one of them, comment out the default authenticator above and uncomment the one below. -->

    <!-- Authenticator with support for Crowd single-sign on (SSO). -->
    <!-- <authenticator class="com.atlassian.confluence.user.ConfluenceCrowdSSOAuthenticator"/> -->

Crowd를 통해 SSO를 사용할 때

    <!-- Default Confluence authenticator, which uses the configured user management for authentication. -->
    <!-- 
    <authenticator class="com.atlassian.confluence.user.ConfluenceAuthenticator"/>
    -->

    <!-- Custom authenticators appear below. To enable one of them, comment out the default authenticator above and uncomment the one below. -->

    <!-- Authenticator with support for Crowd single-sign on (SSO). -->
    <authenticator class="com.atlassian.confluence.user.ConfluenceCrowdSSOAuthenticator"/>

Troubleshooting

Confluence DataBase Data too long Issue

상태

Confluence DB 쿼리 실행 중 Data Too Long 이슈가 있어서 DB 클라이언트(DBeaver에서 작업) 대신 직접 DB에 접근하여 쿼리를 날려보았으나 동일한 에러가 발생

원인

테이블내의 특정 스키마의 문자열 제한으로 인해 트랜잭션 에러 발생(참고)

해결

destpagetitlelowerdestpagetitle 을 VARCHAR(255)에서 VARCHAR(400)으로 조정하여 해결

Unable to login through changed crowd baseurl

상태

Crowd BaseURL 변경 후 Crowd에 로그인이 안되는 현상(로그도 발생하지 않음)

원인

Crowd - general - SSO Domain 설정에 이전 도메인 값을 지우지 않아 발생

해결

SSO Domain 설정을 아예 빼버리고 Jira 및 Confluence의 BaseURL 변경이 완료된 이후에 변경된 URL을 SSO Domain에 입력