<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://subinsong.com/feed.xml" rel="self" type="application/atom+xml"/><link href="https://subinsong.com/" rel="alternate" type="text/html"/><updated>2026-03-02T17:35:14+00:00</updated><id>https://subinsong.com/feed.xml</id><title type="html">blank</title><entry><title type="html">Paperless-ngx에서 한글파일 지원하도록 설정하기</title><link href="https://subinsong.com/blog/2025/paperless-ngx%EC%97%90%EC%84%9C-%ED%95%9C%EA%B8%80%ED%8C%8C%EC%9D%BC-%EC%A7%80%EC%9B%90%ED%95%98%EB%8F%84%EB%A1%9D-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0/" rel="alternate" type="text/html" title="Paperless-ngx에서 한글파일 지원하도록 설정하기"/><published>2025-07-10T00:00:00+00:00</published><updated>2025-07-10T00:00:00+00:00</updated><id>https://subinsong.com/blog/2025/paperless-ngx%EC%97%90%EC%84%9C-%ED%95%9C%EA%B8%80%ED%8C%8C%EC%9D%BC-%EC%A7%80%EC%9B%90%ED%95%98%EB%8F%84%EB%A1%9D-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0</id><content type="html" xml:base="https://subinsong.com/blog/2025/paperless-ngx%EC%97%90%EC%84%9C-%ED%95%9C%EA%B8%80%ED%8C%8C%EC%9D%BC-%EC%A7%80%EC%9B%90%ED%95%98%EB%8F%84%EB%A1%9D-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0/"><![CDATA[<p><a href="https://docs.paperless-ngx.com/">Paperless-ngx</a>는 셀프호스팅할수 있는 문서 관리 시스템으로, pdf, docx, odt 등 다양한 문서 형식을 지원한다. <br/> 하지만 대한민국에서 많이 사용하는 한글파일(.hwp, .hwpx)은 기본적으로 지원하지 않는다. <br/> 나는 Paperless-ngx의 email rule을 이용하여 받은 이메일의 첨부파일들을 자동으로 아카이빙하고 있는데,<br/> 많은 문서들이 한글 파일로 오고가는 상황에서 Paperless-ngx에서 처리할 수 없어 불편함이 많았다.</p> <p>그래서 Paperless-ngx에서 한글파일을 지원하도록 설정을 해 보았고, 이 글에서는 그 방법을 공유하고자 한다.<br/> ChatGPT의 많은 도움을 받았다. ChatGPT에게 많은 영광을 돌린다.</p> <h2 id="사전-준비-사항">사전 준비 사항</h2> <p>본 튜토리얼은 Paperless-ngx + Tika + Gotenberg의 Docker stack을 기준으로 설명한다.<br/> 해당 <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> 파일은 Paperless-ngx 공식 레포지토리에서 확인할 수 있다: <a href="https://github.com/paperless-ngx/paperless-ngx/blob/main/docker/compose/docker-compose.postgres-tika.yml">https://github.com/paperless-ngx/paperless-ngx/blob/main/docker/compose/docker-compose.postgres-tika.yml</a><br/> (위 <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> 파일은 PostgreSQL을 사용하지만 데이터베이스의 종류는 상관없다. SQLite를 사용해도 무방하다.)</p> <p>본 튜토리얼은 Paperless-ngx 버전 <code class="language-plaintext highlighter-rouge">v2.17.1</code>을 기준으로 작성되었다.</p> <h2 id="1-tika-gotenberg-커스텀-이미지-작성하기">1. Tika, Gotenberg 커스텀 이미지 작성하기</h2> <p>본 튜토리얼에서는 Tika와 Gotenberg의 도커 이미지를 약간 수정하여 사용한다.<br/> 말이 빌드이지 사실상 아주 가벼운 dependency 추가 정도만 하기 때문에, Raspberry Pi와 같은 저사양 머신에서도 충분히 빌드할 수 있다.<br/> 아래 두 dockerfile들을 각각 <code class="language-plaintext highlighter-rouge">docker-compose.yml</code>과 같은 폴더에 파일을 생성하여 저장한다.</p> <h3 id="tikadockerfile"><code class="language-plaintext highlighter-rouge">tika.dockerfile</code></h3> <div class="language-dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">ARG</span><span class="s"> TIKA_VERSION=3.2.0.0       # 필요하면 빌드 시 --build-arg 로 바꿀 수 있음</span>

<span class="k">FROM</span><span class="w"> </span><span class="s">apache/tika:${TIKA_VERSION}</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="s">tika-hwp</span>
<span class="k">ARG</span><span class="s"> TIKA_VERSION</span>
<span class="k">USER</span><span class="s"> root</span>

<span class="c"># 1) 다운로드 도구</span>
<span class="k">RUN </span>apt-get update <span class="nt">-qq</span> <span class="o">&amp;&amp;</span> <span class="se">\
</span>    apt-get <span class="nb">install</span> <span class="nt">-y</span> <span class="nt">--no-install-recommends</span> curl

<span class="c"># 2) HWP parser JAR 추가</span>
<span class="k">RUN </span><span class="nb">mkdir</span> <span class="nt">-p</span> /opt/tika-extra <span class="o">&amp;&amp;</span> <span class="se">\
</span>    curl <span class="nt">-L</span> <span class="nt">-o</span> /opt/tika-extra/tika-parser-hwp-<span class="k">${</span><span class="nv">TIKA_VERSION</span><span class="k">}</span>.jar <span class="se">\
</span>      https://repo1.maven.org/maven2/org/apache/tika/tika-parser-hwp/<span class="k">${</span><span class="nv">TIKA_VERSION</span><span class="k">}</span>/tika-parser-hwp-<span class="k">${</span><span class="nv">TIKA_VERSION</span><span class="k">}</span>.jar

<span class="c"># 3) tika-server 가 읽을 CLASSPATH 설정</span>
<span class="k">ENV</span><span class="s"> TIKA_CLASSPATH="/opt/tika-extra/*"</span>
</code></pre></div></div> <p>Tika는 제일 처음 문서를 업로드받았을 때, 문서에서 메타데이터와 텍스트를 추출하는 역할을 한다.<br/> 본 Dockerfile은 Apache Tika의 공식 이미지를 기반으로 하며, <code class="language-plaintext highlighter-rouge">tika-parser-hwp</code> JAR 파일을 추가하여 한글 파일(.hwp, .hwpx)을 처리할 수 있도록 한다.</p> <h3 id="gotenbergdockerfile"><code class="language-plaintext highlighter-rouge">gotenberg.dockerfile</code></h3> <div class="language-dockerfile highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">ARG</span><span class="s"> GOTENBERG_VERSION=8      # 필요하면 빌드 시 --build-arg 로 바꿀 수 있음</span>

<span class="k">FROM</span><span class="s"> gotenberg/gotenberg:${GOTENBERG_VERSION}</span>
<span class="k">USER</span><span class="s"> root</span>

<span class="c"># 1) Java runtime + wget (unchanged)</span>
<span class="k">RUN </span>apt-get update <span class="nt">-qq</span> <span class="o">&amp;&amp;</span> <span class="se">\
</span>    apt-get <span class="nb">install</span> <span class="nt">-y</span> <span class="nt">--no-install-recommends</span> openjdk-17-jre-headless 

<span class="c"># 2) LibreOffice Java bridge - make sure we pull it from backports</span>
<span class="k">RUN </span><span class="nb">echo</span> <span class="s2">"deb http://deb.debian.org/debian bookworm-backports main"</span> <span class="se">\
</span>       <span class="o">&gt;&gt;</span> /etc/apt/sources.list <span class="o">&amp;&amp;</span> <span class="se">\
</span>    apt-get update <span class="nt">-qq</span> <span class="o">&amp;&amp;</span> <span class="se">\
</span>    apt-get <span class="nb">install</span> <span class="nt">-y</span> <span class="nt">--no-install-recommends</span> <span class="nt">-t</span> bookworm-backports <span class="se">\
</span>        libreoffice-java-common

<span class="c"># 3) Register the H2Orestart filter</span>
<span class="k">RUN </span>wget <span class="nt">-qO</span> /tmp/H2Orestart.oxt <span class="se">\
</span>        https://github.com/ebandal/H2Orestart/releases/download/v0.7.4/H2Orestart.oxt <span class="o">&amp;&amp;</span> <span class="se">\
</span>    <span class="nv">JAVA_HOME</span><span class="o">=</span>/usr/lib/jvm/java-17-openjdk-amd64 <span class="se">\
</span>    unopkg add <span class="nt">--shared</span> <span class="nt">--suppress-license</span> /tmp/H2Orestart.oxt 

<span class="k">RUN </span><span class="nb">rm</span> <span class="nt">-rf</span> /var/lib/apt/lists/<span class="k">*</span> /tmp/<span class="k">*</span> /var/tmp/<span class="k">*</span>

<span class="k">USER</span><span class="s"> gotenberg</span>
</code></pre></div></div> <p>Gotenberg는 문서 파일을 PDF로 변환하는 역할을 한다.<br/> 특히나 docx, odt 등의 파일을 변환하기 위해 LibreOffice를 사용하는데,<br/> <a href="https://github.com/ebandal/H2Orestart">LibreOffice에서 hwp 및 hwpx 파일을 열 수 있는 Extension</a>이 있다는 것에 영감을 받아, 기본 Gotenberg 이미지의 Libreoffice에 이 Extension을 설치하는 Dockerfile을 작성했다.<br/> 기본 Gotenberg 이미지에는 Libreoffice Java bridge가 포함되어 있지 않기 때문에, 이를 설치하는 약간 번거로운 작업이 필요하다.</p> <h2 id="2-django-앱-작성">2. Django 앱 작성</h2> <p>기본적으로 Paperless-ngx에서 문서를 업로드하면 document consumer가 파일 형식을 판별하여, 지원하지 않는 파일이면 먼저 오류를 띄워 버린다.<br/> 이를 수정하기 위해, HWP 파일을 정상적으로 받아들이도록 작은 Django 앱을 작성하여 Paperless-ngx에 등록한다.</p> <p><code class="language-plaintext highlighter-rouge">docker-compose.yml</code>이 있는 폴더에 <code class="language-plaintext highlighter-rouge">hwp_tika</code>라는 폴더를 생성하고, 그 안에 <code class="language-plaintext highlighter-rouge">apps.py</code>, <code class="language-plaintext highlighter-rouge">__init__.py</code>, <code class="language-plaintext highlighter-rouge">signals.py</code> 파일을 생성한다.<br/> 즉, 다음과 같은 구조가 된다:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.
├── docker-compose.yml
├── tika.dockerfile
├── gotenberg.dockerfile
└── hwp_tika
    ├── apps.py
    ├── __init__.py
    └── signals.py
</code></pre></div></div> <p><code class="language-plaintext highlighter-rouge">apps.py</code>, <code class="language-plaintext highlighter-rouge">__init__.py</code>, <code class="language-plaintext highlighter-rouge">signals.py</code> 파일의 내용은 다음과 같다:</p> <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># apps.py
</span><span class="kn">from</span> <span class="n">django.apps</span> <span class="kn">import</span> <span class="n">AppConfig</span>

<span class="k">class</span> <span class="nc">HwpTikaConfig</span><span class="p">(</span><span class="n">AppConfig</span><span class="p">):</span>
    <span class="n">name</span> <span class="o">=</span> <span class="sh">"</span><span class="s">hwp_tika</span><span class="sh">"</span>

    <span class="k">def</span> <span class="nf">ready</span><span class="p">(</span><span class="n">self</span><span class="p">):</span>
        <span class="kn">from</span> <span class="n">documents.signals</span> <span class="kn">import</span> <span class="n">document_consumer_declaration</span>
        <span class="kn">from</span> <span class="n">.signals</span> <span class="kn">import</span> <span class="n">hwp_consumer_declaration</span>

        <span class="n">document_consumer_declaration</span><span class="p">.</span><span class="nf">connect</span><span class="p">(</span><span class="n">hwp_consumer_declaration</span><span class="p">)</span>
</code></pre></div></div> <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># __init__.py
</span><span class="n">default_app_config</span> <span class="o">=</span> <span class="sh">"</span><span class="s">hwp_tika.apps.HwpTikaConfig</span><span class="sh">"</span>
</code></pre></div></div> <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># signals.py
</span><span class="kn">from</span> <span class="n">paperless_tika.parsers</span> <span class="kn">import</span> <span class="n">TikaDocumentParser</span>

<span class="k">def</span> <span class="nf">_get_parser</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
    <span class="k">return</span> <span class="nc">TikaDocumentParser</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">hwp_consumer_declaration</span><span class="p">(</span><span class="n">sender</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
    <span class="sh">"""</span><span class="s">
    Tell Paperless how to deal with Hangul Word Processor files.
    </span><span class="sh">"""</span>
    <span class="k">return</span> <span class="p">{</span>
        <span class="sh">"</span><span class="s">parser</span><span class="sh">"</span><span class="p">:</span> <span class="n">_get_parser</span><span class="p">,</span>
        <span class="sh">"</span><span class="s">weight</span><span class="sh">"</span><span class="p">:</span> <span class="mi">11</span><span class="p">,</span>                    <span class="c1"># &gt;10 so it wins over the stock entry set
</span>        <span class="sh">"</span><span class="s">mime_types</span><span class="sh">"</span><span class="p">:</span> <span class="p">{</span>
            <span class="sh">"</span><span class="s">application/x-hwp</span><span class="sh">"</span><span class="p">:</span> <span class="sh">"</span><span class="s">.hwp</span><span class="sh">"</span><span class="p">,</span>
            <span class="sh">"</span><span class="s">application/hwp</span><span class="sh">"</span><span class="p">:</span>   <span class="sh">"</span><span class="s">.hwp</span><span class="sh">"</span><span class="p">,</span>
        <span class="p">},</span>
    <span class="p">}</span>
</code></pre></div></div> <p>위 코드는 Paperless-ngx의 문서 consumer에 한글 파일을 처리할 수 있는 커스텀 consumer를 등록하는 역할을 한다.</p> <h2 id="3-docker-compose-파일-및-환경변수-수정">3. Docker Compose 파일 및 환경변수 수정</h2> <p>이제 위에서 작성한 Tika, Gotenberg 이미지를 Paperless-ngx의 <code class="language-plaintext highlighter-rouge">docker-compose.yml</code>에 통합한다.<br/> <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> 파일을 열고, 다음과 같이 수정한다:</p> <div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="na">gotenberg</span><span class="pi">:</span>
<span class="pi">-</span>    <span class="na">image</span><span class="pi">:</span> <span class="s">docker.io/gotenberg/gotenberg</span>
<span class="na">+    build</span><span class="pi">:</span>
<span class="na">+        context</span><span class="pi">:</span> <span class="s">.</span>
<span class="na">+        dockerfile</span><span class="pi">:</span> <span class="s">gotenberg.dockerfile</span>

 <span class="s">tika</span><span class="err">:</span>
<span class="pi">-</span>    <span class="na">image</span><span class="pi">:</span> <span class="s">docker.io/apache/tika</span>
<span class="na">+    build</span><span class="pi">:</span>
<span class="na">+        context</span><span class="pi">:</span> <span class="s">.</span>
<span class="na">+        dockerfile</span><span class="pi">:</span> <span class="s">tika.dockerfile</span>
</code></pre></div></div> <p>다음으로 환경변수를 수정하여 위에서 작성한 커스텀 Django 앱을 등록한다.<br/> <code class="language-plaintext highlighter-rouge">docker-compose.env</code> 파일을 열고, 다음 줄을 추가한다 (혹은 <code class="language-plaintext highlighter-rouge">docker-compose.yml</code> 파일의 <code class="language-plaintext highlighter-rouge">environment</code> 섹션에 추가한다):</p> <pre><code class="language-env">PAPERLESS_APPS=hwp_tika.apps.HwpTikaConfig
</code></pre> <p>OIDC와 같이 다른 앱이 이미 등록되어 있었다면, 콤마(<code class="language-plaintext highlighter-rouge">,</code>)로 구분하여 추가한다.</p> <h2 id="4-빌드-및-실행">4. 빌드 및 실행</h2> <p>이제 모든 준비가 끝났다. 다음 명령어로 Docker 이미지를 빌드하고 실행한다:</p> <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker compose build
docker compose up <span class="nt">-d</span>
</code></pre></div></div> <p>이제 Paperless-ngx가 실행되고, 한글 파일(.hwp, .hwpx)을 업로드할 수 있으며, 자동으로 PDF/A로 아카이빙된다.</p>]]></content><author><name></name></author><category term="homeserver"/><category term="self-hosting"/><category term="paperless-ngx"/><summary type="html"><![CDATA[Paperless-ngx에서 한글파일(.hwp, .hwpx)을 지원하도록 설정하는 방법에 대한 가이드]]></summary></entry><entry><title type="html">Setting up GitLab OAuth for Mattermost using Authentik</title><link href="https://subinsong.com/blog/2025/configuring-gitlab-oauth-for-mattermost-with-authentik/" rel="alternate" type="text/html" title="Setting up GitLab OAuth for Mattermost using Authentik"/><published>2025-07-09T00:00:00+00:00</published><updated>2025-07-09T00:00:00+00:00</updated><id>https://subinsong.com/blog/2025/configuring-gitlab-oauth-for-mattermost-with-authentik</id><content type="html" xml:base="https://subinsong.com/blog/2025/configuring-gitlab-oauth-for-mattermost-with-authentik/"><![CDATA[<p>Currently, we (<a href="https://mmlab.snu.ac.kr/">MMLAB</a>) use <a href="https://mattermost.com/">Mattermost</a> as a collaboration tool.<br/> Recently, we’ve introduced <a href="https://goauthentik.io/">Authentik</a> to unify accounts across our website, webmail, wiki, and Mattermost.</p> <p>We successfully configured the website, webmail, and wiki using Authentik’s OIDC provider. However, Mattermost’s OIDC integration requires a paid license.</p> <p>The only SSO provider supported by Mattermost’s free Team Edition is GitLab OAuth (see: <a href="https://docs.mattermost.com/onboard/sso-gitlab.html">https://docs.mattermost.com/onboard/sso-gitlab.html</a>).</p> <p>Thus, we configured Authentik’s OIDC provider to mimic GitLab OAuth for integration with Mattermost.<br/> Although some online resources existed, differences in Mattermost and Authentik versions made the setup challenging.</p> <p>This tutorial is based on Mattermost version 10.9.1 and Authentik version 2025.6.3.<br/> Also, you <strong>must use a reverse proxy</strong> in front of Authentik (in order to configure path rewrites).<br/> We use <a href="https://caddyserver.com/">Caddy</a> v2 as our reverse proxy; instructions in this tutorial assume that.<br/> If you use another proxy like Traefik or Nginx, adjust your configuration accordingly.</p> <p>Note: This tutorial uses Authentik OAuth2 provider’s <a href="https://docs.goauthentik.io/docs/add-secure-apps/providers/oauth2/github-compatibility">GitHub-compatible endpoint</a>.</p> <h2 id="1-authentik-configuration">1. Authentik Configuration</h2> <h3 id="create-application">Create Application</h3> <p>In the admin interface, select “Applications” from the sidebar, then click “Create,” and fill in:</p> <ul> <li><strong>Name</strong>: Mattermost</li> <li><strong>Slug</strong>: mattermost</li> </ul> <p>Click “Create” at the bottom to finish.</p> <p><img src="/assets/img/image-20250709171158672.png" alt="image-20250709171158672" width="100%"/></p> <h3 id="create-provider">Create Provider</h3> <p>Next, go to “Providers” in the sidebar, click “Create,” and select “OAuth2/OpenID Provider.” Click “Finish.”</p> <p>On the next screen, enter and save the following:</p> <ul> <li><strong>Name</strong>: Provider for Mattermost (or any descriptive name)</li> <li><strong>Authorization Flow</strong>: Choose freely; I used <code class="language-plaintext highlighter-rouge">default-provider-authorization-explicit-consent (Authorize Application)</code></li> <li><strong>Redirect URI/Origin (Regex)</strong>: <ul> <li><code class="language-plaintext highlighter-rouge">https://mattermost.my.domain/signup/gitlab/complete</code></li> <li><code class="language-plaintext highlighter-rouge">https://mattermost.my.domain/login/gitlab/complete</code></li> <li>Replace <code class="language-plaintext highlighter-rouge">mattermost.my.domain</code> with your actual Mattermost server domain.</li> </ul> </li> <li><strong>Advanced Protocol Settings &gt; Scopes</strong>: You may remove all scopes (including <code class="language-plaintext highlighter-rouge">openid</code>, <code class="language-plaintext highlighter-rouge">profile</code>, <code class="language-plaintext highlighter-rouge">email</code>) because we’ll use Authentik’s GitHub-compatible endpoint, which uses <a href="https://docs.goauthentik.io/docs/add-secure-apps/providers/oauth2/github-compatibility#special-scopes-for-github-compatibility">special scopes</a>.</li> <li>Note down <strong>Client ID</strong> and <strong>Client Secret</strong> for the next steps.</li> </ul> <p><img src="/assets/img/Screenshot%20From%202025-07-09%2017-22-42-obfuscated.png" alt="Screenshot From 2025-07-09 17-22-42-obfuscated" width="100%"/></p> <h3 id="link-provider-to-application">Link Provider to Application</h3> <p>Again, go to Applications -&gt; select Mattermost -&gt; edit -&gt; select “Provider for Mattermost.”</p> <h2 id="2-configure-gitlab-auth-in-mattermost">2. Configure GitLab Auth in Mattermost</h2> <p>In Mattermost’s admin UI, navigate to Authentication -&gt; GitLab.</p> <ul> <li><strong>Enable authentication with GitLab:</strong> True</li> <li><strong>Application ID:</strong> Client ID noted in step 1</li> <li><strong>Application Secret Key:</strong> Client Secret noted in step 1</li> <li><strong>GitLab Site URL:</strong> Authentik URL (e.g., <code class="language-plaintext highlighter-rouge">https://sso.my.domain</code>)</li> </ul> <p>Save.</p> <h2 id="3-configure-reverse-proxy">3. Configure Reverse Proxy</h2> <p>Modify your Authentik reverse proxy config file, adding path rewrite rules.</p> <p>Here’s an example Caddyfile for Caddy reverse proxy:</p> <pre><code class="language-caddyfile">sso.my.domain {
    uri replace /api/v4/user /user  1                         # User API Endpoint
    uri replace /oauth/authorize /login/oauth/authorize 1     # Auth Endpoint
    uri replace /oauth/token /login/oauth/access_token 1      # Token Endpoint
    uri replace /login/login/oauth /oauth 1
    reverse_proxy localhost:9000
}
</code></pre> <h2 id="4-logging-into-mattermost-via-gitlab-oauth">4. Logging into Mattermost via GitLab OAuth</h2> <p>Login procedure differs based on whether the user is new or existing in Mattermost.</p> <h3 id="new-mattermost-users">New Mattermost Users</h3> <p>Click “Log in with GitLab” on Mattermost’s login page. Authentik will prompt for login (or registration), after which you’ll be redirected to Mattermost. A Mattermost account is automatically created.</p> <h3 id="existing-mattermost-users">Existing Mattermost Users</h3> <p>Mattermost doesn’t provide an admin feature to bulk switch existing users to SSO, unlike most SSO-compatible apps. Each user must individually switch their accounts.</p> <p>Below are instructions I shared with our lab members:</p> <ol> <li>Log in to your Mattermost account in the browser. (Not mobile, not the desktop app.)</li> <li>Click your profile image (top-right) -&gt; Profile.</li> <li>Click “Security.”</li> <li>At bottom, click “Edit” next to “Sign-in Method.”</li> <li>Click “Switch to Using GitLab SSO.”</li> <li>Enter your current Mattermost password, then click “Switch Account to Gitlab SSO.”</li> <li>Upon redirect, log in with your Authentik SSO credentials.</li> <li>After switching, always log into Mattermost using the “Log In with SSO” option. (Previous username/password will no longer work.)</li> </ol> <h2 id="tips">Tips</h2> <h3 id="changing-gitlab-button-text-or-hiding-the-icon-in-login-page">Changing GitLab Button Text or Hiding the Icon in Login Page</h3> <p>To modify the GitLab button text in the Mattermost login page, edit Mattermost’s <code class="language-plaintext highlighter-rouge">config.json</code>:<br/> Change <code class="language-plaintext highlighter-rouge">GitLabSettings.ButtonText</code> to your preferred text.</p> <p>There’s no direct setting to hide the GitLab icon, but I hid it with custom CSS. Because Mattermost lacks custom CSS support, I created a plugin following instructions <a href="https://github.com/discourse/mattermost-css-hacks">in this repository</a>.</p> <p>The CSS I used:</p> <div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">svg</span><span class="o">[</span><span class="nt">aria-label</span><span class="o">=</span><span class="s1">"Gitlab Icon"</span><span class="o">]</span> <span class="p">{</span>
    <span class="nl">display</span><span class="p">:</span> <span class="nb">none</span> <span class="cp">!important</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div> <h3 id="disable-idpassword-login">Disable ID/Password Login</h3> <p>Once all users have switched to SSO, disable standard login methods via Mattermost admin UI -&gt; Authentication -&gt; Email:</p> <ul> <li><strong>Enable account creation with email:</strong> False</li> <li><strong>Enable sign-in with email:</strong> False</li> <li><strong>Enable sign-in with username:</strong> False</li> </ul> <h2 id="wrapping-up">Wrapping Up</h2> <p>I’m unsure how best to conclude this post.<br/> In the future, I’ll continue to share lab server administration logs and other tips that seem too useful to keep to myself.<br/> Thanks!</p>]]></content><author><name></name></author><category term="mmlab-webmaster"/><category term="self-hosting"/><category term="mattermost"/><category term="authentik"/><category term="oauth"/><summary type="html"><![CDATA[Currently, we (MMLAB) use Mattermost as a collaboration tool. Recently, we’ve introduced Authentik to unify accounts across our website, webmail, wiki, and Mattermost.]]></summary></entry></feed>