<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/rss.xsl" type="text/xsl" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Gmnisrv | Bacardi55&#39;s Web Cave</title>
    <link>https://bacardi55.io/tags/gmnisrv/</link>
    <description>Recent content in Gmnisrv on Bacardi55&#39;s Web Cave</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>bac@rdi55.pl (bacardi55)</managingEditor>
    <webMaster>bac@rdi55.pl (bacardi55)</webMaster>
    <copyright>2010-2025 bacardi55</copyright>
    <lastBuildDate>Sun, 04 Apr 2021 00:00:00 +0200</lastBuildDate>
    <atom:link href="https://bacardi55.io/tags/gmnisrv/index.xml" rel="self" type="application/rss+xml" />
    <item>
      
      <title>Moving gmnisrv to my swarm cluster</title><link>https://bacardi55.io/2021/04/04/moving-gmnisrv-to-my-swarm-cluster/</link><pubDate>Sun, 04 Apr 2021 00:00:00 +0200</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2021/04/04/moving-gmnisrv-to-my-swarm-cluster/</guid><description>&lt;h2 id=&#34;context&#34;&gt;Context&lt;/h2&gt;&#xA;&lt;p&gt;Based on my previous post about&#xA;&lt;a href=&#34;https://bacardi55.io/2021/03/29/home-lab-part-8-create-a-local-docker-registry-to-manage-your-own-images/&#34;&gt;managing&#xA;a local docker registry&lt;/a&gt;, as promised let&amp;rsquo;s use it to create a useful&#xA;image and deploy it on &lt;a href=&#34;https://bacardi55.io/pages/home-lab/&#34;&gt;my swarm&#xA;cluster homelab&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For this example, I&amp;rsquo;ve decided to use the latest image I&amp;rsquo;ve created:&#xA;&lt;a href=&#34;https://git.sr.ht/~sircmpwn/gmnisrv&#34;&gt;gmnisrv&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Wait what? Gmnisrv running on a docker swarm? Why??&lt;/p&gt;&#xA;&lt;p&gt;There are no real good reason to have the gemini server as a docker&#xA;service&amp;hellip; So why? Well the real reasons? Because: - I can :p; - I have&#xA;this docker swarm working very smoothly, so let&amp;rsquo;s use it; - I could have&#xA;just installed it directly on one of the node, but that made not much&#xA;sens; - I can manage it as all the other services^^.&lt;/p&gt;&#xA;&lt;p&gt;Last week, I made the change from the local installation on a test pi to&#xA;the cluster, smoothly from what I&amp;rsquo;ve seen, without certificate change.&#xA;But that&amp;rsquo;s not the point of this article^^ (and TBH, I failed&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; the&#xA;weekend before :D).&lt;/p&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;&#xA;&lt;h3 id=&#34;creating-the-image-for-the-cluster&#34;&gt;Creating the image for the cluster&lt;/h3&gt;&#xA;&lt;p&gt;So first thing first, we need to create the image on the registry before&#xA;being able to use it on the cluster. Feel free to refer to my post about&#xA;&lt;a href=&#34;https://bacardi55.io/2021/03/29/home-lab-part-8-create-a-local-docker-registry-to-manage-your-own-images/&#34;&gt;managing&#xA;a local docker registry&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;On the registry (in my case named &lt;code&gt;freeza&lt;/code&gt;), let&amp;rsquo;s create the image.&#xA;Let&amp;rsquo;s create a working directory:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    mkdir ~/dockerfiles/gmnisrv &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; cd ~/dockerfiles/gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, create the very simple &lt;code&gt;Dockerfile&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    FROM alpine:3.12&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    RUN apk add --no-cache git make scdoc openssl-dev build-base mailcap &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        cd /tmp &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        git clone https://git.sr.ht/~sircmpwn/gmnisrv &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        cd gmnisrv &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        mkdir build &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        cd build &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        ../configure --prefix&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/usr &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        make &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;&lt;/span&gt;        make install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    VOLUME /certs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    VOLUME /config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    VOLUME /data&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    CMD &lt;span style=&#34;color:#f92672&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;gmnisrv&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;-C&amp;#34;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;/config/gmnisrv.ini&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Very simple :-).&lt;/p&gt;&#xA;&lt;p&gt;Then, let&amp;rsquo;s try and build the image:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    docker build .&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If this works correctly, you can tag the image (I always prefix their&#xA;name with &lt;code&gt;b55-&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    docker build . -t registry.local:5000/b55-gmnisrv:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Adapt with your registry hostname and port.&lt;/p&gt;&#xA;&lt;p&gt;Push the image to the directory:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    docker push registry.local:5000/b55-gmnisrv:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To test the image, you can either use &lt;code&gt;docker run&lt;/code&gt; or &lt;code&gt;docker-compose&lt;/code&gt;.&#xA;Because I&amp;rsquo;m will use a docker-compose file on my cluster, I prefer&#xA;testing it with a docker-compose file, buit this doesn&amp;rsquo;t matter.&lt;/p&gt;&#xA;&lt;p&gt;In my case, the local docker-compose.yml file is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    version: &amp;#39;3&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    services:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      gmnisrv:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        image: registry.local:5000/b55-gmnisrv:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        ports:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - 1965:1965&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        volumes:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/testdir/gmnisrv/data/:/data&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/testdir/gmnisrv/config/:/config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/testdir/gmnisrv/certs:/certs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then the usual &lt;code&gt;docker-compose up&lt;/code&gt; to see if this works correctly (be&#xA;sure to create the volumes if you want to try with it).&lt;/p&gt;&#xA;&lt;p&gt;If you want to run a full test before deploying on your cluster, you can&#xA;create a simple .gmi file in the &lt;em&gt;data&lt;/em&gt; directory, create a dev host in&#xA;the gmnisrv config file (and edit your host file).&lt;/p&gt;&#xA;&lt;h3 id=&#34;deploying-it-to-the-cluster&#34;&gt;Deploying it to the cluster&lt;/h3&gt;&#xA;&lt;p&gt;If everything work, we can use it on the cluster. Adapt a bit the docker&#xA;file to have:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    version: &amp;#39;3&amp;#39;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    services:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      server:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        image: registry.local:5000/b55-gmnisrv:latest&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        ports:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - &amp;#34;1965:1965&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        deploy:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          placement:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            constraints:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;              - node.hostname == ptitcell2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        volumes:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/containers-data/gmnisrv/data/:/data&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/containers-data/gmnisrv/certs/:/certs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;          - /path/to/services-config/gmnisrv/config/:/config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Main difference the placement constraints to a specific node of the&#xA;cluster. I could have use &lt;a href=&#34;https://traefik.io/traefik/&#34;&gt;traefik&lt;/a&gt; for&#xA;load balancing the entry like I do for all services&amp;hellip; But I didn&amp;rsquo;t^^. I&#xA;didn&amp;rsquo;t see the point of adding load to traefik and the node manager for&#xA;gmnisrv that works on a port that will only be used by gmnisrv. Gmnisrv&#xA;support multi hosts anyway if I want to add capsules in the future (I&amp;rsquo;m&#xA;planing to have a feed type of capsule).&lt;/p&gt;&#xA;&lt;p&gt;So, long story short, I force the container to only work on the&#xA;&lt;code&gt;ptitcell2&lt;/code&gt; node. And I forward the 1965 port on my router to the&#xA;&lt;code&gt;ptitcell2&lt;/code&gt; node. I thus save a bit on the manager.&lt;/p&gt;&#xA;&lt;p&gt;If you don&amp;rsquo;t care by recreating new certs (if your capsule wasn&amp;rsquo;t live&#xA;yet), you can just start it like this, otherwise just copy/paste the&#xA;certificates in the right folder before starting the stack with&#xA;&lt;code&gt;docker stack deploy gmnisrv -c /path/to/services-config/gmnisrv/docker-compose.yml&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And voilà :] Granted that I have close to no reader on my capsule, I can&#xA;still say it has worked perfectly since then!&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;In reality I failed for multiple reasons, but also discovered a&#xA;bug in the latest version of gmnisrv. I fixed it with the help of&#xA;&lt;a href=&#34;https://drewdevault.com&#34;&gt;Drew Devault&lt;/a&gt;. Since then my patch&#xA;has been accepted so even if what I wrote was the&#xA;&lt;a href=&#34;https://git.sr.ht/~sircmpwn/gmnisrv/commit/8b65e303b01fc573cb1c40a365fb5db166146a37&#34;&gt;simplest&#xA;patch&lt;/a&gt; in the history of patch, I&amp;rsquo;m still happy about it^^.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description></item>
    <item>
      
      <title>Deploying my own Gemini capsule with gmnisrv</title><link>https://bacardi55.io/2021/02/10/deploying-my-own-gemini-capsule-with-gmnisrv/</link><pubDate>Wed, 10 Feb 2021 00:00:00 +0100</pubDate><author>bac@rdi55.pl (bacardi55)</author><guid>https://bacardi55.io/2021/02/10/deploying-my-own-gemini-capsule-with-gmnisrv/</guid><description>&lt;p&gt;I&amp;rsquo;ve been following Gemini for a bit of time and as I liked the concept and I love to play with new things, I decided to launch my own gemini capsule (aka, my own &amp;ldquo;site&amp;rdquo; on the gemini &amp;ldquo;web&amp;rdquo;).&lt;/p&gt;&#xA;&lt;p&gt;You can access it here: &lt;a href=&#34;&#34;&gt;gemini://gmi.bacardi55.io&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;&lt;/strong&gt;: The result is not perfect yet. For now I&amp;rsquo;ve only put my blog posts but internal links to other content or images do not fully work yet but I&amp;rsquo;ll fix this later.&lt;/p&gt;&#xA;&lt;p&gt;I do plan to create specific content on gmi at some point, for things that are not really &amp;ldquo;blog post&amp;rdquo; material but still worth typing for my future self :D.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;d like to highlight and thanks some posts that convince me of doing it:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://samsai.eu/post/introduction-to-gemini/&#34;&gt;Samsai introduction to gemini&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been following Gemini for a bit of time and as I liked the concept&#xA;and I love to play with new things, I decided to launch my own gemini&#xA;capsule (aka, my own &amp;ldquo;site&amp;rdquo; on the gemini &amp;ldquo;web&amp;rdquo;).&lt;/p&gt;&#xA;&lt;p&gt;You can access it here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: The result is not perfect yet. For now I&amp;rsquo;ve only put my&#xA;blog posts but internal links to other content or images do not fully&#xA;work yet but I&amp;rsquo;ll fix this later.&lt;/p&gt;&#xA;&lt;p&gt;I do plan to create specific content on gmi at some point, for things&#xA;that are not really &amp;ldquo;blog post&amp;rdquo; material but still worth typing for my&#xA;future self :D.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;d like to highlight and thanks some posts that convince me of doing&#xA;it: - &lt;a href=&#34;https://samsai.eu/post/introduction-to-gemini/&#34;&gt;Samsai&#xA;introduction to gemini&lt;/a&gt; -&#xA;&lt;a href=&#34;https://sylvaindurand.org/discovering-the-gemini-protocol/&#34;&gt;Sylvain&#xA;Durand blog post&lt;/a&gt; (and his other post around using hugo to generate gmi&#xA;file, but more on that in another article) -&#xA;&lt;a href=&#34;https://lottalinuxlinks.com/my-gemini-capsule-has-launched/&#34;&gt;totallinuxlinks&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;And others that I&amp;rsquo;ve seen in my RSS feeds or on mastodon :).&lt;/p&gt;&#xA;&lt;h2 id=&#34;gemini-you-say&#34;&gt;Gemini you say ?&lt;/h2&gt;&#xA;&lt;p&gt;For those that don&amp;rsquo;t know, as said on the&#xA;&lt;a href=&#34;https://gemini.circumlunar.space/&#34;&gt;gemini website&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Gemini is a new, collaboratively designed internet protocol, which&#xA;explores the space inbetween gopher and the web, striving to address&#xA;(perceived) limitations of one while avoiding the (undeniable)&#xA;pitfalls of the other.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I suggest you read more about it on the&#xA;&lt;a href=&#34;https://gemini.circumlunar.space/docs/faq.html&#34;&gt;FAQ page&lt;/a&gt; that&#xA;contains all the necessary informations :).&lt;/p&gt;&#xA;&lt;h2 id=&#34;gemini-server-setup&#34;&gt;Gemini server setup&lt;/h2&gt;&#xA;&lt;p&gt;I was looking for an extra lightweight server and trying to avoid Go or&#xA;Rust for server part. In the end, I I selected&#xA;&lt;a href=&#34;https://git.sr.ht/~sircmpwn/gmnisrv&#34;&gt;gmnisrv&lt;/a&gt;, developed by&#xA;&lt;a href=&#34;https://drewdevault.com/&#34;&gt;Drew Devault&lt;/a&gt; in C. Easy to install, self&#xA;manage certificate and very light to run on an old raspberry pi.&lt;/p&gt;&#xA;&lt;h3 id=&#34;installation&#34;&gt;Installation&lt;/h3&gt;&#xA;&lt;p&gt;You should already have openssl installed, but if not, install it with&#xA;your packet manager.&lt;/p&gt;&#xA;&lt;p&gt;Also, on the &lt;a href=&#34;https://git.sr.ht/~sircmpwn/gmnisrv&#34;&gt;project page&lt;/a&gt; it&#xA;says that &lt;a href=&#34;https://git.sr.ht/~sircmpwn/scdoc&#34;&gt;scdoc&lt;/a&gt; is optional, but&#xA;I couldn&amp;rsquo;t install without it, so I ended up installing it too.&lt;/p&gt;&#xA;&lt;p&gt;To install scdoc:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    git clone https://git.sr.ht/~sircmpwn/scdoc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cd scdoc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    make&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo make install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, to install gmnisrv:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    git clone https://git.sr.ht/~sircmpwn/gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cd gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    mkdir build&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cd build&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ../configure --prefix&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;/usr&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    make&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo make install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;configuring-the-server&#34;&gt;Configuring the server&lt;/h3&gt;&#xA;&lt;p&gt;Copy the default config file at the right place:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cp /usr/share/gmnisrv/gmnisrv.ini /etc/gmnisrv.ini&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And edit it as needed for the certificate path and the files path.&lt;/p&gt;&#xA;&lt;p&gt;I use &lt;code&gt;/srv/gemini/gmi.bacardi55.io&lt;/code&gt; as the path where my *.gmi files&#xA;will be.&lt;/p&gt;&#xA;&lt;p&gt;For now, let&amp;rsquo;s create a default hellowolrd page:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    echo &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;hellowolrd55!&amp;#34;&lt;/span&gt; &amp;gt; /srv/gemini/gmi.bacardi55.io/index.gmi&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;creating-a-systemd-service&#34;&gt;Creating a systemd service&lt;/h3&gt;&#xA;&lt;p&gt;To automate the (re)start of the server, I created a systemd service. To&#xA;do so, I created &lt;code&gt;/etc/systemd/system/gmnisrv.service&lt;/code&gt; with the&#xA;following content:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [Unit]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Description=Gemini Server gminisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    After=network.target&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [Service]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Type=simple&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    # Another Type: forking&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    User=gemini&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ExecStart=/usr/bin/gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    Restart=always&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    [Install]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    WantedBy=multi-user.target&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As you can see, I use a dedicated &lt;code&gt;gemini&lt;/code&gt; user on my system to run it&#xA;as a limited users.&lt;/p&gt;&#xA;&lt;p&gt;Then, enable the service and then start it:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo systemctl enable gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sudo systemctl start gmnisrv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Remember also that it uses port 1965, so if you selfhost at home, don&amp;rsquo;t&#xA;forget to open the port and redirect flow on this port on the right&#xA;server.&lt;/p&gt;&#xA;&lt;p&gt;To test locally first, edit your &lt;code&gt;/etc/hosts&lt;/code&gt; to map the domain config&#xA;in the server file and the IP of the server in a gemini client.&lt;/p&gt;&#xA;&lt;p&gt;You can find a list of clients on&#xA;&lt;a href=&#34;https://github.com/kr1sp1n/awesome-gemini&#34;&gt;this page&lt;/a&gt;. On my side, I&#xA;used &lt;a href=&#34;https://git.sr.ht/~sircmpwn/gmni&#34;&gt;gmni&lt;/a&gt; but any client will do.&lt;/p&gt;&#xA;&lt;p&gt;To test it works from the outside, either install a cli/tui client on an&#xA;external server or test it via an online portal like&#xA;&lt;a href=&#34;https://portal.mozz.us/gemini/gemini.circumlunar.space/&#34;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And voilà, you should see your hellowolrd page :)&lt;/p&gt;&#xA;&lt;p&gt;In the next post, I talk about how I use my blog generator&#xA;&lt;a href=&#34;https://portal.mozz.us/gemini/gemini.circumlunar.space/&#34;&gt;Hugo&lt;/a&gt; to&#xA;generate both this blog and the gemini pages.&lt;/p&gt;&#xA;</description></item>
  </channel>
</rss>
