<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
  <generator uri="http://jekyllrb.com" version="4.3.2">Jekyll</generator>
  
  
  <link href="https://www.fusselkater.org/feed.xml" rel="self" type="application/atom+xml" />
  <link href="https://www.fusselkater.org/" rel="alternate" type="text/html" hreflang="de" />
  <updated>2024-03-20T18:09:27+01:00</updated>
  <id>https://www.fusselkater.org//</id>

  
    <title type="html">fusselkater.org</title>
  

  
    <subtitle>Fusselkaters Webseite und Blog</subtitle>
  

  

  
  
    <entry xml:lang="de">
      
      <title type="html">Umbau meiner Webseite auf Jekyll</title>
      
      
      <link href="https://www.fusselkater.org/2023/10/13/jekyll/" rel="alternate" type="text/html" title="Umbau meiner Webseite auf Jekyll" />
      
      <published>2023-10-13T00:00:00+02:00</published>
      <updated>2023-10-13T00:00:00+02:00</updated>
      <id>https://www.fusselkater.org/2023/10/13/jekyll</id>
      <content type="html" xml:base="https://www.fusselkater.org/2023/10/13/jekyll/">&lt;p&gt;Da ich auf meinem Blog wirklich selten etwas schreibe, war mir Wordpress schon lange ein Dorn im Auge. Deshalb habe ich mich in den letzten Wochen bemüht, meine Website auf &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; umzustellen. Jekyll ist ein statischer Seitengenerator, der auch Blogs verwalten kann. Jekyll ist in Ruby entwickelt und daher auch als Ruby-Gem verfügbar.&lt;/p&gt;

&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Ich wollte von Anfang an, dass die Build-Umgebung portabel ist, auch z.B. in einer CI/CD-Pipeline. Deshalb habe ich mich entschieden, jekyll und seine Abhängigkeiten nicht aus einem Systempaket zu installieren, sondern die entsprechenden Pakete mit &lt;a href=&quot;https://bundler.io/&quot;&gt;Bundler&lt;/a&gt; aus den Gems zu laden.&lt;/p&gt;

&lt;p&gt;Dazu habe ich ein neues Verzeichnis &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;www.fusselkater.org&lt;/code&gt; angelegt und dort &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle init&lt;/code&gt; ausgeführt. Damit der Bundler in den nächsten Schritten nicht versucht, die benötigten Gems systemweit zu installieren, habe ich danach noch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bundle&lt;/code&gt; als Pfad gesetzt:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle config &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--local&lt;/span&gt; path &lt;span class=&quot;s1&quot;&gt;&apos;.bundle&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Die Installation von Jekyll erfolgt dann über &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle add jekyll&lt;/code&gt;. Dieser Befehl schreibt jekyll auch direkt in das durch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle init&lt;/code&gt; erzeugte Gemfile, so dass später nur noch &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle install&lt;/code&gt; aufgerufen werden muss, um die Build-Umgebung aufzubauen.&lt;/p&gt;

&lt;h2 id=&quot;neues-jekyll-projekt-erstellen&quot;&gt;Neues Jekyll-Projekt erstellen&lt;/h2&gt;
&lt;p&gt;Da Jekyll im &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bundle&lt;/code&gt; Pfad installiert wird, ist der Befehl &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll&lt;/code&gt; natürlich nicht in den Systempfaden enthalten. Um die über Bundler installierten Programme trotzdem nutzen zu können, kann man einfach ein &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle exec&lt;/code&gt; vor den entsprechenden Befehl setzen.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll new src &lt;span class=&quot;nt&quot;&gt;--blank&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Da ich nicht das Standard &lt;a href=&quot;https://github.com/jekyll/minima&quot;&gt;Minima-Theme&lt;/a&gt; haben wollte, habe ich das Jekyll-Projekt mit dem Parameter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--blank&lt;/code&gt; erstellt. Dies sorgt dafür, dass nur das Gerüst für eine Jekyll-Webseite aufgebaut wird.&lt;/p&gt;

&lt;h2 id=&quot;themes&quot;&gt;Themes&lt;/h2&gt;
&lt;p&gt;Für Jekyll gibt es zahlreiche Themes. Leider lassen sich die meisten Themes nicht über Gems installieren, sondern erwarten, dass man ein Jekyll-Projekt forkt und in seine Webseite einbaut. Das fand ich sehr unsauber, weshalb ich mich bei der Theme-Auswahl auf solche Themes beschränkt habe, die &lt;a href=&quot;https://github.com/planetjekyll/awesome-jekyll-themes&quot;&gt;via Gem verfügbar sind&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Meine Wahl fiel schließlich auf das &lt;a href=&quot;https://github.com/yous/whiteglass&quot;&gt;whiteglass&lt;/a&gt; Theme, welches ich dann mittels &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle add jekyll-whiteglass&lt;/code&gt; installierte.&lt;/p&gt;

&lt;p&gt;In der Installationsanleitung des Themes wird auch beschrieben, dass noch einige Dateien aus dem Github Repository installiert werden müssen. Dies habe ich entsprechend gemacht:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;pushd &lt;/span&gt;src
&lt;span class=&quot;nb&quot;&gt;rm &lt;/span&gt;index.md
curl &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-O&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/yous/whiteglass/raw/master/{index.html,about.md,archives.md,feed.xml,robots.txt}&quot;&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--create-dirs&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; _data/#1 &lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/yous/whiteglass/raw/master/_data/{navigation.yml,i18n.yml}&quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;popd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Später habe ich die Datei &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;about.md&lt;/code&gt; in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gpg.md&lt;/code&gt; umbenannt, um eine Seite für meinen GPG-Schlüssel zu erstellen und die Datei &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_data/naviagion.yml&lt;/code&gt; entsprechend angepasst.&lt;/p&gt;

&lt;h2 id=&quot;plugins&quot;&gt;Plugins&lt;/h2&gt;
&lt;p&gt;Zum Aufbau der Seite werden noch einige Plugins benötigt. Deshalb habe ich einige Plugins mit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bundle add&lt;/code&gt; installiert:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle add &lt;span class=&quot;nt&quot;&gt;--group&lt;/span&gt; jekyll_plugins jekyll-archives jekyll-paginate jekyll-sitemap jekyll-feed
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Im weiteren Verlauf ist mir aufgefallen, dass es mit Jekyll standardmäßig nicht möglich ist, Bilder, die in den einzelnen Blogartikeln verwendet werden, im Ordner des jeweiligen Blogartikels zu speichern, sondern dass diese immer im globalen Ordner &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;assets&lt;/code&gt; abgelegt werden müssen. Da ich befürchtete, dass dies später im Chaos enden würde, habe ich nach einer Lösung gesucht und das Plugin &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll-postfiles&lt;/code&gt; gefunden. Dieses kopiert während des Build-Prozesses die statischen Daten aus den Ordnern der Blog-Artikel in die Assets.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle add &lt;span class=&quot;nt&quot;&gt;--group&lt;/span&gt; jekyll_plugins jekyll-postfiles
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;erster-test&quot;&gt;Erster Test&lt;/h2&gt;
&lt;p&gt;Nun war alles bereit, um den Entwicklungsserver zu starten:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;pushd &lt;/span&gt;src
bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll serve
&lt;span class=&quot;nb&quot;&gt;popd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Das funktionierte wunderbar. Das Grundgerüst für die neue Seite stand also.&lt;/p&gt;

&lt;h2 id=&quot;makefile&quot;&gt;Makefile&lt;/h2&gt;
&lt;p&gt;Da mir das ständige Wechseln zwischen den Verzeichnissen und das Merken der Befehle langsam lästig wurde, habe ich mir ein Makefile geschrieben, das mir diese Arbeit abnimmt:&lt;/p&gt;
&lt;div class=&quot;language-make highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;.DEFAULT_GOAL&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;help&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;BUNDLE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; bundle
&lt;span class=&quot;nv&quot;&gt;SRCDIR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; src
&lt;span class=&quot;nv&quot;&gt;DSTDIR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; out

&lt;span class=&quot;nv&quot;&gt;MINIFY_HTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; bin/minify-html
&lt;span class=&quot;nv&quot;&gt;MINIFY_HTML_URL&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; https://wilsonl.in/minify-html/bin/0.11.1-linux-x86_64

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;help&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt; Display this help message&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;Usage: make &amp;lt;command&amp;gt;&apos;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;$(&lt;/span&gt;MAKEFILE_LIST&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;^[a-zA-Z]&apos;&lt;/span&gt;  | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
	    &lt;span class=&quot;nb&quot;&gt;sort&lt;/span&gt; | &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
	    &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;:.*?## &apos;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;NF==2 {printf &quot;  %-26s%s\n&quot;, $$1, $$2}&apos;&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;setup&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;setup&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt; Install requirements&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;BUNDLE&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; config &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--local&lt;/span&gt; path &lt;span class=&quot;s1&quot;&gt;&apos;.bundle&apos;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;BUNDLE&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; bin
	curl &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;MINIFY_HTML_URL&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;MINIFY_HTML&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;chmod&lt;/span&gt; +x &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;MINIFY_HTML&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;serve&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;serve&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt; Start the development server&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;BUNDLE&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll serve &lt;span class=&quot;nt&quot;&gt;--source&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;SRCDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--destination&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;DSTDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;build&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt; Build the site for production (minify HTML/CSS/JS)&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;BUNDLE&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll build &lt;span class=&quot;nt&quot;&gt;--source&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;SRCDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--destination&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;DSTDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;MINIFY_HTML&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;--keep-closing-tags&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;--minify-css&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;--do-not-minify-doctype&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;--ensure-spec-compliant-unquoted-attribute-values&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;nt&quot;&gt;--keep-spaces-between-attributes&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;$$(&lt;/span&gt;find &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;DSTDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;nt&quot;&gt;-iname&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;*.html&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-name&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;*.css&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-name&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;*.js&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;nl&quot;&gt;.PHONY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;clean&lt;/span&gt;
&lt;span class=&quot;nl&quot;&gt;clean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt; Cleanup output and temporary files&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;DSTDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;SRCDIR&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;/.jekyll-cache
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Zusätzlich habe ich auch direkt einen HTML-Minifier in das Build-Target geschrieben, so dass die HTML-, CSS- und JS-Dateien nach dem Bau der produktiven Seite verkleinert werden.&lt;/p&gt;

&lt;h2 id=&quot;google-fonts&quot;&gt;Google Fonts&lt;/h2&gt;
&lt;p&gt;Das &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;whiteglass&lt;/code&gt;-Theme verwendet standardmäßig den Bitter-Font direkt von Google. Da mir das datenschutztechnisch nicht gefällt, habe ich mich nun darum gekümmert, den Bitter-Font auf meinem Host anzubieten. Dazu habe ich den Bitter-Font &lt;a href=&quot;https://fonts.google.com/specimen/Bitter&quot;&gt;heruntergeladen&lt;/a&gt; und die beiden Dateien &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Bitter-Italic-VariableFont_wght.ttf&lt;/code&gt; und &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Bitter-VariableFont_wght.ttf&lt;/code&gt; in das woff2-Format konvertiert.&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;woff2_compress Bitter-Italic-VariableFont_wght.ttf
woff2_compress Bitter-VariableFont_wght.ttf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(Das Programm &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;woff2_compress&lt;/code&gt; ist im Paket &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;woff2-tools&lt;/code&gt; (Fedora) enthalten)&lt;/p&gt;

&lt;p&gt;Die beiden woff2-Dateien habe ich nun nach &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/assets/fonts/Bitter/italic.woff2&lt;/code&gt; bzw. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;src/assets/fonts/Bitter/regular.woff2&lt;/code&gt; kopiert.&lt;/p&gt;

&lt;p&gt;Im nächsten Schritt war es notwendig, einige Dateien aus dem Theme zu überschreiben. Dazu habe ich folgende Dateien erstellt:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;src/_includes/fonts.html:&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/assets/fonts/Bitter/fonts.css&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;src/assets/fonts/Bitter/fonts.css:&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;c&quot;&gt;/* latin */&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@font-face&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&apos;Bitter&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(/assets/fonts/Bitter/italic.woff2)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;woff2&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;py&quot;&gt;unicode-range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0000-00&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0131&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0152-0153&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BB-02BC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DA&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0304&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0308&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0329&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2000-206&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2074&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2122&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2191&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2193&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2212&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2215&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FEFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FFFD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* latin */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@font-face&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&apos;Bitter&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(/assets/fonts/Bitter/regular.woff2)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;woff2&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;py&quot;&gt;unicode-range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0000-00&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0131&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0152-0153&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BB-02BC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DA&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0304&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0308&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0329&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2000-206&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2074&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2122&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2191&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2193&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2212&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2215&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FEFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FFFD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* latin */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@font-face&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&apos;Bitter&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;700&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(/assets/fonts/Bitter/regular.woff2)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&apos;woff2&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;py&quot;&gt;unicode-range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0000-00&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0131&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0152-0153&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BB-02BC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;C6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DA&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;02&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0304&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0308&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0329&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2000-206&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;F&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2074&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2122&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2191&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2193&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2212&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2215&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FEFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FFFD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;blog-einträge&quot;&gt;Blog-Einträge&lt;/h2&gt;
&lt;p&gt;Nun war alles bereit, um meine Blogeinträge aus Wordpress zu kopieren. Da ich nur 2 Blogeinträge hatte, habe ich das manuell gemacht. Es gibt aber ein [Projekt] (https://github.com/benbalter/wordpress-to-jekyll-exporter), das das automatisiert.&lt;/p&gt;</content>

      
      
      
      
      

      

      
        <category term="IT" />
      

      

      
        <summary type="html">Da ich auf meinem Blog wirklich selten etwas schreibe, war mir Wordpress schon lange ein Dorn im Auge. Deshalb habe ich mich in den letzten Wochen bemüht, meine Website auf Jekyll umzustellen. Jekyll ist ein statischer Seitengenerator, der auch Blogs verwalten kann. Jekyll ist in Ruby entwickelt und daher auch als Ruby-Gem verfügbar.</summary>
      

      
      
    </entry>
  
  
  
    <entry xml:lang="de">
      
      <title type="html">Nextcloud hinter einer OPNSense Firewall mit Nginx Reverse-Proxy</title>
      
      
      <link href="https://www.fusselkater.org/2021/01/16/nextcloud-hinter-einer-opensense-firewall-mit-nginx-reverse-proxy/" rel="alternate" type="text/html" title="Nextcloud hinter einer OPNSense Firewall mit Nginx Reverse-Proxy" />
      
      <published>2021-01-16T00:00:00+01:00</published>
      <updated>2021-01-16T00:00:00+01:00</updated>
      <id>https://www.fusselkater.org/2021/01/16/nextcloud-hinter-einer-opensense-firewall-mit-nginx-reverse-proxy</id>
      <content type="html" xml:base="https://www.fusselkater.org/2021/01/16/nextcloud-hinter-einer-opensense-firewall-mit-nginx-reverse-proxy/">&lt;p&gt;Heute dachte ich mir, ich möchte gerne meine Nextcloud auf meinem Heimserver betreiben. Da ich bei mir eine OpnSense als Firewall verwende und diese ein Plugin für einen Nginx Reverse-Proxy anbietet, bot sich an, dieses für diesen Zweck zu verwenden. Der Vorteil ist, ich kann SSL auf der OpnSense Terminieren, so dass ich den dort sowieso bereits eingerichteten Let’s Encrypt Client verwenden kann. Da die Konfiguration nicht ganz trivial war, zeige ich hier einmal, wie ich alles eingerichtet habe.&lt;/p&gt;

&lt;h2 id=&quot;einrichtung-der-nextcloud-auf-dem-server&quot;&gt;Einrichtung der Nextcloud auf dem Server&lt;/h2&gt;
&lt;p&gt;Um Nextcloud auf meinem Server einzurichten, habe ich das offizelle Docker-Image unter Verwendung der dort verlinkten Beispiel-Konfigurationen verwendet. Da Redhat/Fedora inzwischen auf Podman als Alternative zu Docker setzt, habe ich auch direkt Podman und Podman Compose installiert. Dies ist (mehr oder weniger) ein 1 zu 1 Ersatz für Docker, was eine Migration sehr leicht gestaltet.&lt;/p&gt;

&lt;p&gt;Um später die Compose-Dateien aller Services an einem Ort zu haben, habe den Ordner &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/containers/compose.d/nextcloud&lt;/code&gt; angelegt. Sämtliche Konfigurationsdateien in den nächsten Schritten liegen also in diesem Ordner.&lt;/p&gt;

&lt;p&gt;Nun habe ich die Compose-Datei „container-compose.yml“ angelegt:&lt;/p&gt;
&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;3&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;mariadb&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;--transaction-isolation=READ-COMMITTED --binlog-format=ROW&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;db:/var/lib/mysql&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_ROOT_PASSWORD=CHANGEME&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_PASSWORD=CHANGEME&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_DATABASE=nextcloud&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_USER=nextcloud&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;redis&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;redis:alpine&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/containers/compose.d/nextcloud/app&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;data:/var/www/html&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_PASSWORD=CHANGEME&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_DATABASE=nextcloud&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_USER=nextcloud&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;MYSQL_HOST=db&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;REDIS_HOST=redis&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;NEXTCLOUD_TRUSTED_DOMAINS=cloud.example.com&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;OVERWRITEHOST=cloud.example.org&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;OVERWRITEPROTOCOL=https&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;links&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;db&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;redis&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;db&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;redis&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;web&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/containers/compose.d/nextcloud/web&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;30000:8443&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;data:/var/www/html:ro&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;links&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;app&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;app&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;cron&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;nextcloud:fpm-alpine&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;data:/var/www/html&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;entrypoint&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/cron.sh&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;depends_on&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;db&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;redis&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Dies baut die Images für app und web und verwendet für mariadb, redis und cron die offiziellen Images aus dem Docker-Hub. Dementsprechend habe ich für app und web Unterordner angelegt, auf die ich nun eingehe:&lt;/p&gt;

&lt;h4 id=&quot;appdockerfile&quot;&gt;app/Dockerfile:&lt;/h4&gt;
&lt;div class=&quot;language-docker highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; nextcloud:fpm-alpine&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; www.conf /usr/local/etc/php-fpm.d/www.conf&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;appwwwconf&quot;&gt;app/www.conf:&lt;/h4&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[www]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;www-data&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;group&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;www-data&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;127.0.0.1:9000&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;pm&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;dynamic&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;pm.max_children&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;120&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;pm.start_servers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;pm.min_spare_servers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;pm.max_spare_servers&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;18&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Dies habe ich dafür angelegt, damit ich die Werte unter pm.max_children, pm.start_servers, usw. anpassen kann, die in der Original-Datei sehr niedrig angesetzt sind.&lt;/p&gt;

&lt;h4 id=&quot;webdockerfile&quot;&gt;web/Dockerfile:&lt;/h4&gt;
&lt;div class=&quot;language-docker highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; nginx:alpine&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; nginx.conf /etc/nginx/nginx.conf&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; cert.pem /etc/nginx/cert.pem&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;COPY&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; key.pem /etc/nginx/key.pem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;webnginxconf&quot;&gt;web/nginx.conf:&lt;/h4&gt;
&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;worker_processes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;auto&lt;/span&gt;;
&lt;span class=&quot;n&quot;&gt;error_log&lt;/span&gt;  /&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;error&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;warn&lt;/span&gt;;
&lt;span class=&quot;n&quot;&gt;pid&lt;/span&gt;        /&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;run&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pid&lt;/span&gt;;
&lt;span class=&quot;n&quot;&gt;events&lt;/span&gt; {
    &lt;span class=&quot;n&quot;&gt;worker_connections&lt;/span&gt;  &lt;span class=&quot;m&quot;&gt;1024&lt;/span&gt;;
}
&lt;span class=&quot;n&quot;&gt;http&lt;/span&gt; {
    &lt;span class=&quot;n&quot;&gt;include&lt;/span&gt;       /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;mime&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;types&lt;/span&gt;;
    &lt;span class=&quot;n&quot;&gt;default_type&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;octet&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;stream&lt;/span&gt;;
    &lt;span class=&quot;n&quot;&gt;log_format&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;  &lt;span class=&quot;s1&quot;&gt;&apos;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &apos;&lt;/span&gt;
                      &lt;span class=&quot;s1&quot;&gt;&apos;$status $body_bytes_sent &quot;$http_referer&quot; &apos;&lt;/span&gt;
                      &lt;span class=&quot;s1&quot;&gt;&apos;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&apos;&lt;/span&gt;;
    &lt;span class=&quot;n&quot;&gt;access_log&lt;/span&gt;  /&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;access&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;;
    &lt;span class=&quot;n&quot;&gt;sendfile&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
    &lt;span class=&quot;c&quot;&gt;#tcp_nopush     on;
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;keepalive_timeout&lt;/span&gt;  &lt;span class=&quot;m&quot;&gt;65&lt;/span&gt;;
    &lt;span class=&quot;c&quot;&gt;#gzip  on;
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;handler&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;:&lt;span class=&quot;m&quot;&gt;9000&lt;/span&gt;;
    }
    &lt;span class=&quot;n&quot;&gt;server&lt;/span&gt; {
        &lt;span class=&quot;n&quot;&gt;listen&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8443&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ssl&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;http2&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;ssl_certificate&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;cert&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pem&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;ssl_certificate_key&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;etc&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;nginx&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;pem&lt;/span&gt;;
        &lt;span class=&quot;c&quot;&gt;# Add headers to serve security related headers
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# Before enabling Strict-Transport-Security headers please read into this
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# topic first.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#add_header Strict-Transport-Security &quot;max-age=15768000; includeSubDomains; preload;&quot; always;
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# WARNING: Only add the preload option once you read about
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# the consequences in https://hstspreload.org/. This option
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# will add the domain to a hardcoded list that is shipped
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# in all major browsers and getting removed from this list
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# could take several months.
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Referrer&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Policy&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;no-referrer&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Content&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Type&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nosniff&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Download&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;noopen&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Frame&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;SAMEORIGIN&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Permitted&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Cross&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Domain&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Policies&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Robots&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Tag&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;XSS&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Protection&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;1; mode=block&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
        &lt;span class=&quot;c&quot;&gt;# Remove X-Powered-By, which is an information leak
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;fastcgi_hide_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Powered&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;By&lt;/span&gt;;
        &lt;span class=&quot;c&quot;&gt;# Path to the root of your installation
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;www&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;html&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; = /&lt;span class=&quot;n&quot;&gt;robots&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;txt&lt;/span&gt; {
            &lt;span class=&quot;n&quot;&gt;allow&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;all&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;log_not_found&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;access_log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
        }
        &lt;span class=&quot;c&quot;&gt;# The following 2 rules are only needed for the user_webfinger app.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# Uncomment it if you&apos;re planning to use this app.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# The following rule is only needed for the Social app.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# Uncomment it if you&apos;re planning to use this app.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; = /.&lt;span class=&quot;n&quot;&gt;well&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;known&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;carddav&lt;/span&gt; {
            &lt;span class=&quot;n&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;301&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;scheme&lt;/span&gt;://$&lt;span class=&quot;n&quot;&gt;host&lt;/span&gt;:$&lt;span class=&quot;n&quot;&gt;server_port&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;dav&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; = /.&lt;span class=&quot;n&quot;&gt;well&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;known&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;caldav&lt;/span&gt; {
            &lt;span class=&quot;n&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;301&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;scheme&lt;/span&gt;://$&lt;span class=&quot;n&quot;&gt;host&lt;/span&gt;:$&lt;span class=&quot;n&quot;&gt;server_port&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;dav&lt;/span&gt;;
        }
        &lt;span class=&quot;c&quot;&gt;# set max upload size
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;client_max_body_size&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;G&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;fastcgi_buffers&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;K&lt;/span&gt;;
        &lt;span class=&quot;c&quot;&gt;# Enable gzip but do not remove ETag headers
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;gzip&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;gzip_vary&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;gzip_comp_level&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;gzip_min_length&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;256&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;gzip_proxied&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expired&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;cache&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;store&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no_last_modified&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no_etag&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;auth&lt;/span&gt;;
        &lt;span class=&quot;n&quot;&gt;gzip_types&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;atom&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;javascript&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;ld&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;manifest&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;rss&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vnd&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;geo&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vnd&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;fontobject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;font&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;ttf&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;web&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;manifest&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;json&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;xhtml&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;application&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;font&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;opentype&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;bmp&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;svg&lt;/span&gt;+&lt;span class=&quot;n&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;icon&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;cache&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;manifest&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;css&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;plain&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vnd&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;rim&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;location&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;xloc&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;vtt&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;component&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;/&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;cross&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;domain&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;policy&lt;/span&gt;;
        &lt;span class=&quot;c&quot;&gt;# Uncomment if your server is build with the ngx_pagespeed module
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# This module is currently not supported.
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;#pagespeed off;
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; / {
            &lt;span class=&quot;n&quot;&gt;rewrite&lt;/span&gt; ^ /&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ ^\/(?:&lt;span class=&quot;n&quot;&gt;build&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;tests&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;lib&lt;/span&gt;|&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rdparty&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;templates&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;)\/ {
            &lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;all&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ ^\/(?:\.|&lt;span class=&quot;n&quot;&gt;autotest&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;occ&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;issue&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;indie&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;db_&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;console&lt;/span&gt;) {
            &lt;span class=&quot;n&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;all&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ ^\/(?:&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;public&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;cron&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;core&lt;/span&gt;\/&lt;span class=&quot;n&quot;&gt;ajax&lt;/span&gt;\/&lt;span class=&quot;n&quot;&gt;update&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;status&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;ocs&lt;/span&gt;\/&lt;span class=&quot;n&quot;&gt;v&lt;/span&gt;[&lt;span class=&quot;m&quot;&gt;12&lt;/span&gt;]|&lt;span class=&quot;n&quot;&gt;updater&lt;/span&gt;\/.+|&lt;span class=&quot;n&quot;&gt;oc&lt;/span&gt;[&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;]-&lt;span class=&quot;n&quot;&gt;provider&lt;/span&gt;\/.+)\.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;(?:$|\/) {
            &lt;span class=&quot;n&quot;&gt;fastcgi_split_path_info&lt;/span&gt; ^(.+?\.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;)(\/.*|)$;
            &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;path_info&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;fastcgi_path_info&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;try_files&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;fastcgi_script_name&lt;/span&gt; =&lt;span class=&quot;m&quot;&gt;404&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fastcgi_params&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SCRIPT_FILENAME&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;document_root&lt;/span&gt;$&lt;span class=&quot;n&quot;&gt;fastcgi_script_name&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PATH_INFO&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;path_info&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# fastcgi_param HTTPS on;
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# Avoid sending the security headers twice
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;modHeadersAvailable&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;true&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# Enable pretty urls
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;fastcgi_param&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;front_controller_active&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;true&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;fastcgi_pass&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;handler&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;fastcgi_intercept_errors&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;on&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;fastcgi_request_buffering&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ ^\/(?:&lt;span class=&quot;n&quot;&gt;updater&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;oc&lt;/span&gt;[&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;]-&lt;span class=&quot;n&quot;&gt;provider&lt;/span&gt;)(?:$|\/) {
            &lt;span class=&quot;n&quot;&gt;try_files&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;/ =&lt;span class=&quot;m&quot;&gt;404&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;;
        }
        &lt;span class=&quot;c&quot;&gt;# Adding the cache control header for js, css and map files
&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;# Make sure it is BELOW the PHP block
&lt;/span&gt;        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ \.(?:&lt;span class=&quot;n&quot;&gt;css&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;js&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;woff2&lt;/span&gt;?|&lt;span class=&quot;n&quot;&gt;svg&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;gif&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;)$ {
            &lt;span class=&quot;n&quot;&gt;try_files&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;$&lt;span class=&quot;n&quot;&gt;request_uri&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Cache&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Control&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;public, max-age=15778463&quot;&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# Add headers to serve security related headers (It is intended to
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# have those duplicated to the ones above)
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# Before enabling Strict-Transport-Security headers please read into
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# this topic first.
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;#add_header Strict-Transport-Security &quot;max-age=15768000; includeSubDomains; preload;&quot; always;
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;#
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# WARNING: Only add the preload option once you read about
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# the consequences in https://hstspreload.org/. This option
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# will add the domain to a hardcoded list that is shipped
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# in all major browsers and getting removed from this list
&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;# could take several months.
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Referrer&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Policy&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;no-referrer&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Content&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Type&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nosniff&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Download&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;noopen&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Frame&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Options&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;SAMEORIGIN&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Permitted&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Cross&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Domain&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Policies&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Robots&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Tag&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;none&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;n&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;XSS&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Protection&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;1; mode=block&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;always&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# Optional: Don&apos;t log access to assets
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;access_log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
        }
        &lt;span class=&quot;n&quot;&gt;location&lt;/span&gt; ~ \.(?:&lt;span class=&quot;n&quot;&gt;png&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;html&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;ttf&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;ico&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;jpg&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;jpeg&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;bcmap&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;mp4&lt;/span&gt;|&lt;span class=&quot;n&quot;&gt;webm&lt;/span&gt;)$ {
            &lt;span class=&quot;n&quot;&gt;try_files&lt;/span&gt; $&lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt; /&lt;span class=&quot;n&quot;&gt;index&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;php&lt;/span&gt;$&lt;span class=&quot;n&quot;&gt;request_uri&lt;/span&gt;;
            &lt;span class=&quot;c&quot;&gt;# Optional: Don&apos;t log access to other assets
&lt;/span&gt;            &lt;span class=&quot;n&quot;&gt;access_log&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;off&lt;/span&gt;;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Dies steht so nahezu identisch in den offiziellen Beispielen des Nextcloud-Images, außer dass ich auch intern SSL verwenden möchte. Dementsprechend habe ich unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;web/cert.pem&lt;/code&gt; und &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;web/key.pem&lt;/code&gt; noch SSL-Zertifikate abgelegt, die ich über die OPNSense erstellt habe.&lt;/p&gt;

&lt;h3 id=&quot;erstellung-einer-internen-ca-und-eines-internen-server-zertifikats&quot;&gt;Erstellung einer internen CA und eines internen Server-Zertifikats&lt;/h3&gt;
&lt;p&gt;In der OPNSense Weboberfläche habe ich unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System &amp;gt; Trust &amp;gt; Authorities&lt;/code&gt; eine neue interne CA angelegt. Dies ist relativ selbsterklärend daher werde ich nicht näher darauf eingehen. Anschließend habe ich für meinen Server unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System &amp;gt; Trust &amp;gt; Certificates&lt;/code&gt; ein Zertifikat erstellt, welches mit der zuvor erstellten Authority signiert wurde. Zertifikat und Schlüssel können anschließend einfach über die Weboberfläche exportiert werden und entsprechend in die o.g. stellen auf dem Server eingefügt werden.&lt;/p&gt;

&lt;h3 id=&quot;erstellen-eines-podman-benutzers&quot;&gt;Erstellen eines podman Benutzers&lt;/h3&gt;
&lt;p&gt;Da ich die Container rootless betreiben wollte, benötigte ich noch einen Benutzer, unter dem die Container laufen sollen. Ich habe mich dazu entschieden, diesen einfach podman zu nennen:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;groupadd podman
useradd &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; podman &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; /bin/bash &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;/mnt/pool/services/podman&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; podman
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Wobei mein Festplattenraid unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/mnt/pool&lt;/code&gt; eingehangen ist und ich deshalb auch die Container dort hinlegen wollte.&lt;/p&gt;

&lt;p&gt;Außerdem musste die Anzahl der User-Namespaces noch erhöht werden:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;user.max_user_namespaces=28633&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /etc/sysctl.d/userns.conf
sysctl &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /etc/sysctl.d/userns.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;systemd-zum-starten-von-nextcloud-verwenden&quot;&gt;Systemd zum Starten von Nextcloud verwenden&lt;/h3&gt;
&lt;p&gt;Nun war Nextcloud bereit, gestartet zu werden. Es fehlte nur noch eine Systemd-Unit, damit dies auch beim Reboot des Servers automatisch funktioniert. Dazu habe ich folgende Unitfile unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/system/compose@.service&lt;/code&gt; angelegt:&lt;/p&gt;
&lt;div class=&quot;language-ini highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nn&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;%i service with podman-compose&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;always&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;TimeoutStartSec&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;1200&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;podman&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;WorkingDirectory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/etc/containers/compose.d/%i&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/podman-compose down&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/podman-compose pull&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/podman-compose up&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;/usr/bin/podman-compose down&lt;/span&gt;
&lt;span class=&quot;nn&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Die Unitfile bedient sich der Interface-Funktion von Systemd, bei der &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%i&lt;/code&gt; gegen die Zeichenkette ersetzt wird, die hinter dem &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@&lt;/code&gt; des Services angegeben wird. Die Nextcloud kann nun also folgendermaßen gestartet und aktiviert werden:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;compose@nextcloud.service
systemctl start compose@nextcloud.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Damit war die Einrichtung des Servers soweit abgeschlossen und nun konnte der Nginx Reverse-Proxy auf der OPNSense eingerichtet werden.&lt;/p&gt;

&lt;h2 id=&quot;einrichtung-der-opnsense&quot;&gt;Einrichtung der OPNSense&lt;/h2&gt;
&lt;p&gt;Damit Nginx die Ports 80 und 443 nutzen kann, musste ich als erstes den Webkonfigurator auf einen anderen Port einstellen. Diese Einstellung ist in der Weboberfläche unter System &amp;gt; Settings &amp;gt; Administration zu finden:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;settings-administration.png&quot; alt=&quot;Administration overview in OPNSense&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Hier habe ich den TCP-Port auf 8443 geändert und den HTTP Redirect deaktiviert. Es zeigte sich, dass daraufhin ein Reboot der Firewall nötig ist, da die Ports ansonsten nicht freigegeben wurden.&lt;/p&gt;

&lt;p&gt;Nun habe ich das Nginx Plugin unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System &amp;gt; Firmware &amp;gt; Plugins&lt;/code&gt; installiert.&lt;/p&gt;

&lt;h3 id=&quot;nginx-einrichtung&quot;&gt;Nginx Einrichtung&lt;/h3&gt;
&lt;p&gt;Unter Services erschien nun der neue Service Nginx, auf dessen Konfiguration ich nun eingehe.&lt;/p&gt;

&lt;h4 id=&quot;upstream-server-und-upstream-konfiguration&quot;&gt;Upstream Server und Upstream Konfiguration&lt;/h4&gt;
&lt;p&gt;Im Dropdown-Menü Upstream ließen sich nun Upstream-Server und Upstreams konfigurieren. Als erstes habe ich den Upstream-Server folgendermaßen konfiguriert:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;upstream-server.png&quot; alt=&quot;Upstream-Server Konfiguration&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Anschließend habe ich folgenden Upstream eingerichtet:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;upstream.png&quot; alt=&quot;Upstream Konfigurieren&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Hier musste ich unter Trusted Certificate die CA wählen, die ich zum Signieren des Server-Zertifikats verwendet habe.&lt;/p&gt;

&lt;h4 id=&quot;security-header-konfigurieren&quot;&gt;Security Header konfigurieren&lt;/h4&gt;
&lt;p&gt;Nun bin ich unter HTTP(S) &amp;gt; Security Headers gegangen und habe dort für die Nextcloud Security Headers erstellt, die dem entsprechen, was in der Nextcloud-Dokumentation angegeben ist:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;security-headers.png&quot; alt=&quot;Security Headers&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;erstellung-einer-rewrite-regel&quot;&gt;Erstellung einer Rewrite-Regel&lt;/h4&gt;
&lt;p&gt;Nextcloud braucht standardmäßig Rewrite-Regeln für Cal- und Carddav. Deshalb habe ich dafür unter HTTP(S) &amp;gt; URL Rewriting eine Regel angelegt:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;rewrite.png&quot; alt=&quot;Rewrite Regel&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;erstellung-der-location&quot;&gt;Erstellung der Location&lt;/h4&gt;
&lt;p&gt;Nun habe ich eine Location für / erstellt:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;location.png&quot; alt=&quot;Location Konfiguration&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;erstellung-des-http-servers&quot;&gt;Erstellung des HTTP-Servers&lt;/h4&gt;
&lt;p&gt;Zuletzt war nun alles vorbereitet um den eigentlichen HTTP-Server unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HTTP(S) &amp;gt; HTTP-Server&lt;/code&gt; anzulegen:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;httpserver.png&quot; alt=&quot;HTTP Server Konfiguration&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ein entsprechendes Let’s Encrypt Zertifikat hatte ich zuvor bereits über das Let’s Encrypt Plugin erzeugt, welches ich sowieso bereits installiert und konfiguriert hatte. Dazu gibt es im Internet bereits brauchbare Anleitungen, weshalb ich darauf nicht weiter eingehe.&lt;/p&gt;

&lt;p&gt;Wichtig: Mir ist später aufgefallen, dass mein Handy, das ich via DAVx mit Card- und Caldav verbinden wollte, ständig auf der Banlist aufgetaucht ist. Scheinbar wird DAVx durch die Bot Protection als Bot erkannt. Diese ließ sich in der Server Konfiguration in den Advanced Options deaktivieren:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;botprotection.png&quot; alt=&quot;Bot Protection deaktivieren&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;firewall-regeln-erstellen&quot;&gt;Firewall Regeln erstellen&lt;/h3&gt;
&lt;p&gt;Damit der Nginx nun auch aus dem Internet erreichbar ist, müssen natürlich noch Firewall-Regeln für HTTP und HTTPS unter &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Firewall &amp;gt; Rules &amp;gt; WAN&lt;/code&gt; angelegt werden:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;firewall.png&quot; alt=&quot;Firewall Regeln&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;schlusswort&quot;&gt;Schlusswort&lt;/h2&gt;
&lt;p&gt;Nun war alles soweit fertig konfiguriert. Unter General musste ich nun noch einmal auf Apply klicken und dann den Nginx-Service restarten und dann konnte ich auf meine Nextcloud auch von außen zugreifen.&lt;/p&gt;

&lt;p&gt;Was in diesem Artikel nicht erwähnt wurde:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Ich habe zuvor für die Nextcloud einen DNS-Eintrag als CNAME auf die Adresse meiner Firewall angelegt.&lt;/li&gt;
  &lt;li&gt;Möchte man das OPNSense Webinterface weiterhin unter Port 443 erreichen, ist dies möglich, indem man im Nginx eine Proxy-Konfiguration für das Webinterface anlegt, die entsprechend auf &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;::1&lt;/code&gt; zeigt. Hier ist nur zu beachten, dass dann auf jeden Fall darauf geachtet werden muss, ACLs zu erstellen, die den Zugriff auf das Webinterface auf den lokalen Adressraum einschränken.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ich hoffe euch hilft der Artikel. Mir wird er auf jeden Fall helfen, falls ich dies irgendwann mal erneut aufsetzen muss.&lt;/p&gt;</content>

      
      
      
      
      

      

      
        <category term="IT" />
      
        <category term="Nextcloud" />
      
        <category term="OPNSense" />
      

      

      
        <summary type="html">Heute dachte ich mir, ich möchte gerne meine Nextcloud auf meinem Heimserver betreiben. Da ich bei mir eine OpnSense als Firewall verwende und diese ein Plugin für einen Nginx Reverse-Proxy anbietet, bot sich an, dieses für diesen Zweck zu verwenden. Der Vorteil ist, ich kann SSL auf der OpnSense Terminieren, so dass ich den dort sowieso bereits eingerichteten Let’s Encrypt Client verwenden kann. Da die Konfiguration nicht ganz trivial war, zeige ich hier einmal, wie ich alles eingerichtet habe.</summary>
      

      
      
    </entry>
  
  
  
    <entry xml:lang="de">
      
      <title type="html">Automatisches Löschen von Prosody-Usern</title>
      
      
      <link href="https://www.fusselkater.org/2019/07/30/automatisches-loeschen-von-prosody-usern/" rel="alternate" type="text/html" title="Automatisches Löschen von Prosody-Usern" />
      
      <published>2019-07-30T00:00:00+02:00</published>
      <updated>2019-07-30T00:00:00+02:00</updated>
      <id>https://www.fusselkater.org/2019/07/30/automatisches-loeschen-von-prosody-usern</id>
      <content type="html" xml:base="https://www.fusselkater.org/2019/07/30/automatisches-loeschen-von-prosody-usern/">&lt;p&gt;Wer einen XMPP-Dienst hostet, bei dem die öffentliche Registrierung aktiviert ist, wird auf kurz oder lang vor dem Problem stehen, dass viele registrierte Benutzer existieren, die gar nicht mehr aktiv sind, oder nie aktiv waren. Möchte man nun Benutzer nach einem gewissen Zeitfenster der Inaktivität löschen, ist dies gar nicht so leicht umzusetzen, wenn man nicht vorgesorgt hat.&lt;/p&gt;

&lt;h2 id=&quot;speicherung-von-aktivitätsdaten&quot;&gt;Speicherung von Aktivitätsdaten&lt;/h2&gt;
&lt;p&gt;Um eine solche Löschung zu ermöglichen ist es nötig, die Aktivitätsdaten der Benutzer erst einmal zu speichern und dann nach inaktiven Nutzern zu suchen. Dazu bietet Prosody zum Glück zwei passende Plugins an:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://modules.prosody.im/mod_lastlog.html&quot;&gt;mod_lastlog&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://modules.prosody.im/mod_list_inactive.html&quot;&gt;mod_list_inactiv&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;löschung-inaktiver-benutzer&quot;&gt;Löschung inaktiver Benutzer&lt;/h2&gt;
&lt;p&gt;Über mod_lastlog wird der timestamp des letzten Log-Ins der Benutzer gespeichert und über mod_list_inactive kann über diese gespeicherten Daten gesucht werden. Dazu habe ich mir folgendes Script geschrieben, das täglich via cron ausgeführt wird:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;WHITELIST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=(&lt;/span&gt; foo@fusselkater.org &lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;i &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;prosodyctl mod_list_inactive fusselkater.org 1month&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do
    if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;WHITELIST&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[@]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~ &lt;span class=&quot;s2&quot;&gt;&quot; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;then
        &lt;/span&gt;prosodyctl deluser &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;fi
done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Dieses Script sucht also alle Benutzer von der Domain fusselkater.org, die länger als 1 Monat nicht online waren. Zusätzlich prüft es, ob der Benutzer sich nicht in der Whitelist befindet, damit z.B. der ein oder andere Service-Account nicht gelöscht wird.&lt;/p&gt;</content>

      
      
      
      
      

      

      
        <category term="IT" />
      
        <category term="Linux" />
      
        <category term="Prosody" />
      
        <category term="XMPP" />
      

      

      
        <summary type="html">Wer einen XMPP-Dienst hostet, bei dem die öffentliche Registrierung aktiviert ist, wird auf kurz oder lang vor dem Problem stehen, dass viele registrierte Benutzer existieren, die gar nicht mehr aktiv sind, oder nie aktiv waren. Möchte man nun Benutzer nach einem gewissen Zeitfenster der Inaktivität löschen, ist dies gar nicht so leicht umzusetzen, wenn man nicht vorgesorgt hat.</summary>
      

      
      
    </entry>
  
  
</feed>
