<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Minuscule_space</title>
    <link>https://minuscule.space/</link>
    <description>A little corner of calamity</description>
    <pubDate>Fri, 23 Feb 2024 07:55:57 +0000</pubDate>
    <item>
      <title>One Year of Self-Hosting in Review, Pt. 1</title>
      <link>https://minuscule.space/one-year-of-self-hosting-in-review-pt</link>
      <description>&lt;![CDATA[It has been a year since I decided to start my journey in self-hosting. No, it is not a fancy homelab with AMD EPYC processor, or the newest shiny GPU, or even a beefy VM. I&#39;ll admit, those beefy homelabs look sexy as hell and it seems you can do anything (legal) with it.&#xA;!--more--&#xA;&#xA;That was my perception years ago, that made me timid with starting my journey because everyone starts big! A minimum newest on-the-line quadcore processor along with 8GB memory, and to top it off, 1TB SSD. I simply can&#39;t afford it, and that&#39;s where my interest stopped.&#xA;&#xA;Exactly a year ago, I decided to buy a meagre VPS with 1 CPU, 1GB memory, and 20GB storage, intending to learn more about Linux, Docker, Kubernetes, and clouds in general. My thought was always in doubt, is this enough to do the job i wanted it to do?&#xA;&#xA;Boy, I could never be so wrong.&#xA;&#xA;That meagre VPS was more capable than I could give credit for, hosting this site, my Akkoma instance, and tons of other services I used for myself.&#xA;&#xA;Now, what could I learn to do better?&#xA;&#xA;Failure&#xA;It has been a year since I dabbled in self-hosting, but the truth is, this site and others services of mine has only started running on March, or at least three months since the journey started.&#xA;&#xA;You guess it correctly. It failed the first few times. From losing the SSH passkey (I&#39;m dumb), messed up my server with botched installation of several services at once, struggling with the concept of reverse proxy, load balancer, and web server (what are the difference), premature use of Docker, and from just sheer frustation of the immense things you need to set up before you can enjoy it.&#xA;&#xA;The early set up after frustrations took me almost a month, from setting up Docker properly (and the fact that Docker opened up the port immediately if you don&#39;t specify in the Docker-compose file), installing Caddy and its configurations, Wireguard to access over internal services, setting up Traefik to use TLS for internal services (this by far is the hardest hurdle along with Wireguard).&#xA;&#xA;In all of that, it was a fun hurdle. Figuring out why Wireguard doesn&#39;t need you to open ports, why Docker images are usually not auto-updated, why Traefik won&#39;t work when Wireguard is not on container but on the host (haven&#39;t found the answer to this one).&#xA;&#xA;In short, be prepared for the difficulty and frustration ahead, if you never had the experience. It is part of the learning. And use Google a lot. Like a lot. Also, there are things that you can understand just yet and b&#xA;&#xA;Cost&#xA;In my case, it costs me around IDR120,000 ($8) a month for my hosting (2-core, 2GB memory, and 40GB storage), and another $16 a year for this domain. So roughly $10 a month.&#xA;&#xA;At the start, the hosting only costs me $3.5, with 1-core, 1GB memory, and 20GB storage.&#xA;&#xA;It depends on your hosting provider, and the domain extension you use. My point is, you don&#39;t need fancy hardwares worth thousands of dollars or a beefy VPS that costs more than fifty dollars a month. You can always start small and scale your resources based on usage. Though this might not apply for those that wants self-hosted media server, since it needs more powers and storage that a web service does. Again, adjust to your needs, not wants.&#xA;&#xA;Why? Because usually your host will let you upgrade for free, but not the reverse.&#xA;&#xA;Horsepower&#xA;As pointed out in the cost, and in the intros, you don&#39;t need massive homelab or a dedicated server to run your Nextcloud instances, this is a common misconception among first-timers.&#xA;&#xA;&#34;I mean, my laptop has 8GB RAM and it can barely runs Chrome! That means my media server needs to run on 16 or even 32GB RAM! And who knows, it might need the latest GPU as well.&#34;&#xA;&#xA;Well, if you are hosting a media server for your entire neighbourhood, you are in the right track. But if you need it just for your family, or just for yourself, try less.&#xA;&#xA;I did doubt that I could run as many services as I did now when I bought the 1-core and 1GB memory VPS. But it didn&#39;t last long as I installed services after services until I reach 100% memory usage (CPU isn&#39;t as much used in my case, probably only Akkoma did use CPU). That&#39;s when I upgraded. Looking back, for my needs, the current 2-core and 2GB memory is well enough for my need. Though as others may note, the feelings of needing more is never gone.&#xA;&#xA;Maintenance and Stability&#xA;Seeing i&#39;m using this services by myself, my failure tolerance is much higher, since i&#39;m doing all for myself. But all in all, most of my services never failed me in the whole year I&#39;ve been hosting them, even during major upgrade.&#xA;&#xA;Docker made upgrading as easy as docker pull, though it has its own caveats.&#xA;&#xA;Looking back, my server is actually pretty stable, at least for my standard. Measuring uptime from Fediverse.Observer of my Akkoma instance, it has yet to fell down to below 95%.&#xA;&#xA;Now, I&#39;ve been doing a hands-down approach to my server, upgrading services and OS when updates come out, without much thinking. Yeah, I did upgrade my services without doing some tests. But my YOLO has yet to fail me so far (maybe I&#39;m going to run out of luck soon, finger crossed), and from maintenance point, it&#39;s pretty lax, especially when you have set up alerting services.&#xA;&#xA;That said, maintainability really depends on how you set up your services and tools you can use to help make your life better.&#xA;&#xA;That&#39;s it for now, I guess. I will write more when I have time.]]&gt;</description>
      <content:encoded><![CDATA[<p>It has been a year since I decided to start my journey in self-hosting. No, it is not a fancy homelab with AMD EPYC processor, or the newest shiny GPU, or even a beefy VM. I&#39;ll admit, those beefy homelabs look sexy as hell and it seems you can do anything (legal) with it.
</p>

<p>That was my perception years ago, that made me timid with starting my journey because everyone starts big! A minimum newest on-the-line quadcore processor along with 8GB memory, and to top it off, 1TB SSD. I simply can&#39;t afford it, and that&#39;s where my interest stopped.</p>

<p>Exactly a year ago, I decided to buy a meagre VPS with 1 CPU, 1GB memory, and 20GB storage, intending to learn more about Linux, Docker, Kubernetes, and clouds in general. My thought was always in doubt, is this enough to do the job i wanted it to do?</p>

<p>Boy, I could never be so wrong.</p>

<p>That meagre VPS was more capable than I could give credit for, hosting this site, my Akkoma <a href="https://sun.minuscule.space">instance</a>, and tons of other services I used for myself.</p>

<p>Now, what could I learn to do better?</p>

<h2 id="failure" id="failure">Failure</h2>

<p>It has been a year since I dabbled in self-hosting, but the truth is, this site and others services of mine has only started running on March, or at least three months since the journey started.</p>

<p>You guess it correctly. It failed the first few times. From losing the SSH passkey (I&#39;m dumb), messed up my server with botched installation of several services at once, struggling with the concept of reverse proxy, load balancer, and web server (what are the difference), premature use of Docker, and from just sheer frustation of the immense things you need to set up before you can enjoy it.</p>

<p>The early set up after frustrations took me almost a month, from setting up Docker properly (and the fact that Docker opened up the port immediately if you don&#39;t specify in the Docker-compose file), installing Caddy and its configurations, Wireguard to access over internal services, setting up Traefik to use TLS for internal services (this by far is the hardest hurdle along with Wireguard).</p>

<p>In all of that, it was a fun hurdle. Figuring out why Wireguard doesn&#39;t need you to open ports, why Docker images are usually not auto-updated, why Traefik won&#39;t work when Wireguard is not on container but on the host (haven&#39;t found the answer to this one).</p>

<p>In short, be prepared for the difficulty and frustration ahead, if you never had the experience. It is part of the learning. And use Google a lot. Like a lot. Also, there are things that you can understand just yet and b</p>

<h2 id="cost" id="cost">Cost</h2>

<p>In my case, it costs me around IDR120,000 ($8) a month for my hosting (2-core, 2GB memory, and 40GB storage), and another $16 a year for this domain. So roughly $10 a month.</p>

<p>At the start, the hosting only costs me $3.5, with 1-core, 1GB memory, and 20GB storage.</p>

<p>It depends on your hosting provider, and the domain extension you use. My point is, you don&#39;t need fancy hardwares worth thousands of dollars or a beefy VPS that costs more than fifty dollars a month. You can always start small and scale your resources based on usage. Though this might not apply for those that wants self-hosted media server, since it needs more powers and storage that a web service does. Again, adjust to your needs, not wants.</p>

<p>Why? Because usually your host will let you upgrade for free, but not the reverse.</p>

<h2 id="horsepower" id="horsepower">Horsepower</h2>

<p>As pointed out in the cost, and in the intros, you don&#39;t need massive homelab or a dedicated server to run your Nextcloud instances, this is a common misconception among first-timers.</p>

<p>“I mean, my laptop has 8GB RAM and it can barely runs Chrome! That means my media server needs to run on 16 or even 32GB RAM! And who knows, it might need the latest GPU as well.”</p>

<p>Well, if you are hosting a media server for your entire neighbourhood, you are in the right track. But if you need it just for your family, or just for yourself, try less.</p>

<p>I did doubt that I could run as many services as I did now when I bought the 1-core and 1GB memory VPS. But it didn&#39;t last long as I installed services after services until I reach 100% memory usage (CPU isn&#39;t as much used in my case, probably only Akkoma did use CPU). That&#39;s when I upgraded. Looking back, for my needs, the current 2-core and 2GB memory is well enough for my need. Though as others may note, the feelings of needing more is never gone.</p>

<h2 id="maintenance-and-stability" id="maintenance-and-stability">Maintenance and Stability</h2>

<p>Seeing i&#39;m using this services by myself, my failure tolerance is much higher, since i&#39;m doing all for myself. But all in all, most of my services never failed me in the whole year I&#39;ve been hosting them, even during major upgrade.</p>

<p>Docker made upgrading as easy as <code>docker pull</code>, though it has its own caveats.</p>

<p>Looking back, my server is actually pretty stable, at least for my standard. Measuring uptime from <a href="https://fediverse.observer/sun.minuscule.space">Fediverse.Observer</a> of my Akkoma instance, it has yet to fell down to below 95%.</p>

<p>Now, I&#39;ve been doing a hands-down approach to my server, upgrading services and OS when updates come out, without much thinking. Yeah, I did upgrade my services without doing some tests. But my YOLO has yet to fail me so far (maybe I&#39;m going to run out of luck soon, finger crossed), and from maintenance point, it&#39;s pretty lax, especially when you have set up alerting services.</p>

<p>That said, maintainability really depends on how you set up your services and tools you can use to help make your life better.</p>

<p>That&#39;s it for now, I guess. I will write more when I have time.</p>
]]></content:encoded>
      <guid>https://minuscule.space/one-year-of-self-hosting-in-review-pt</guid>
      <pubDate>Fri, 27 Jan 2023 15:16:48 +0000</pubDate>
    </item>
    <item>
      <title>Enable HTTP/3 on Caddy with Docker</title>
      <link>https://minuscule.space/enable-http-3-on-caddy-with-docker</link>
      <description>&lt;![CDATA[TL;DR Explicitly expose port 443/udp on your Docker command/docker-compose file.&#xA;&#xA;On September 20th 2022, Caddy 2.6 was released and HTTP/3 became default settings. Well, now you don&#39;t need an obscure option to enable it! However, when I checked my (this) website on http3check, it seems HTTP/3 wasn&#39;t supported. I read that HTTP/3 is enabled automatically and no new settings is needed on Caddy. And that HTTP/3 is using UDP too.&#xA;!--more--&#xA;&#xA;Enabling UDP on port 443 with ufw, I checked again. Still doesn&#39;t support HTTP/3. What&#39;s wrong?&#xA;&#xA;Turns out you need to explicitly forward UDP to the Docker container, and the bare port option 443:443 only opens the TCP port.&#xA;&#xA;Here&#39;s the port config:&#xA;    ports:&#xA;      &#34;80:80&#34;&#xA;      &#34;443:443&#34;&#xA;      &#34;443:443/udp&#34;&#xA;&#xA;The 443:443/udp is the one config you need to explicitly write. Afterwards, checking again this site supports HTTP/3!&#xA;&#xA;A note, you need to have at least Caddy version 2.6.0 for default HTTP/3 support.&#xA;&#xA;P.S. http3check still mentioned that QUIC is not supported. But somehow when I scanned caddyserver.com, http3check mentioned it doesn&#39;t support QUIC as well. I guess I need to dive again to see what&#39;s wrong.]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="tl-dr-explicitly-expose-port-443-udp-on-your-docker-command-docker-compose-file" id="tl-dr-explicitly-expose-port-443-udp-on-your-docker-command-docker-compose-file">TL;DR Explicitly expose port 443/udp on your Docker command/docker-compose file.</h2>

<p>On September 20th 2022, Caddy 2.6 was released and HTTP/3 became default settings. Well, now you don&#39;t need an obscure option to enable it! However, when I checked my (this) website on <a href="https://http3check.net">http3check</a>, it seems HTTP/3 wasn&#39;t supported. I read that HTTP/3 is enabled automatically and no new settings is needed on Caddy. And that HTTP/3 is using UDP too.
</p>

<p>Enabling UDP on port 443 with ufw, I checked again. Still doesn&#39;t support HTTP/3. What&#39;s wrong?</p>

<p>Turns out you need to explicitly forward UDP to the Docker container, and the bare port option <code>443:443</code> only opens the TCP port.</p>

<p>Here&#39;s the port config:</p>

<pre><code>    ports:
      - &#34;80:80&#34;
      - &#34;443:443&#34;
      - &#34;443:443/udp&#34;
</code></pre>

<p>The <code>443:443/udp</code> is the one config you need to explicitly write. Afterwards, checking again this site supports HTTP/3!</p>

<p>A note, you need to have at least Caddy version 2.6.0 for default HTTP/3 support.</p>

<p>P.S. http3check still mentioned that QUIC is not supported. But somehow when I scanned caddyserver.com, http3check mentioned it doesn&#39;t support QUIC as well. I guess I need to dive again to see what&#39;s wrong.</p>
]]></content:encoded>
      <guid>https://minuscule.space/enable-http-3-on-caddy-with-docker</guid>
      <pubDate>Thu, 22 Sep 2022 15:34:31 +0000</pubDate>
    </item>
    <item>
      <title>Migrating Pleroma to Akkoma with Docker</title>
      <link>https://minuscule.space/migrating-pleroma-to-akkoma-with-docker</link>
      <description>&lt;![CDATA[My Pleroma, now Akkoma, instance relies heavily on sn0w&#39;s pleroma-docker repo, as you know in my previous post, since i personally preferred for applications to be dockerised for easy management.&#xA;&#xA;But then, last month, i read something in my timeline, there is a new fork of Pleroma named Akkoma. Interesting! !--more--&#xA;&#xA;It&#39;s never that easy in migrating your instance, so i asked @sn0w@cofe.rocks again for help! Thankfully they are willing to help me quite a bit! I have outlined the steps here for my future reference, and might be of some help for others.&#xA;&#xA;The Steps&#xA;First of all, backup your configuration and database. You&#39;ll never know what mistakes you are going to make (i have certainly made some embarassing mistakes).&#xA;&#xA;Current Akkoma doesn&#39;t include any frontends by default, including the Admin-FE. So i&#39;m going to edit my docker-compose.yml file to mount the frontends folder to host.&#xA;&#xA;Add this under volumes:&#xA;$DOCKERDATADIR/frontends:/home/pleroma/pleroma/instance/static/frontends&#xA;&#xA;And edit the config.exs mount from :ro to :rw for both occassions.&#xA;&#xA;After this, you need to edit the .env file on two lines:&#xA;&#xA;PLEROMAVERSION=stable-2022.07&#xA;.&#xA;.&#xA;.&#xA;.&#xA;PLEROMAGITREPO=https://akkoma.dev/AkkomaGang/akkoma.git&#xA;&#xA;stable-2022.07 is as-of-now the most recent release of Akkoma, which should be changed should newer versions got released, or you can use stable if you prefer. The repo referred to the new Akkoma official repo.&#xA;&#xA;Then you can run ./pleroma.sh build and wait a bit.&#xA;&#xA;When you are done, you should run ./pleroma.sh down and ./pleroma.sh up to use the newly built image.&#xA;&#xA;Congratulation, you have migrated to Akkoma! But wait, there is no frontends?&#xA;&#xA;Installing Frontends&#xA;&#xA;Thankfully, we can install a frontend by our own. This official guide comprehensively explains the technical details.&#xA;&#xA;But for those lazy one, and assuming you want your default Pleroma frontend along with your admin frontend back, you should run this command&#xA;&#xA;./pleroma.sh mix pleroma.frontend install pleroma-fe&#xA;./pleroma.sh mix pleroma.frontend install admin-fe&#xA;&#xA;You should check your frontends folder, there would be your frontends folder inside it, named respectively.&#xA;&#xA;Done? Not quite.&#xA;&#xA;You should edit your config.exs file, and add this line anywhere:&#xA;&#xA;Configure Akkoma Frontends&#xA;config :pleroma, :frontends,&#xA;  primary: %{&#xA;    &#34;name&#34; =  &#34;pleroma-fe&#34;,&#xA;    &#34;ref&#34; =  &#34;stable&#34;&#xA;  },&#xA;  admin: %{&#xA;    &#34;name&#34; =  &#34;admin-fe&#34;,&#xA;    &#34;ref&#34; =  &#34;stable&#34;&#xA;  }&#xA;&#xA;This ensures that Akkoma knows your frontends preference. Run ./pleroma.sh restart to apply changes, and you are dandy!&#xA;&#xA;You can check your current running version of Akkoma by visiting this address on your instance:&#xA;&#xA;https://$YOURINSTANCE_ADDRESS/nodeinfo/2.0.json&#xA;&#xA;The Impression&#xA;The migration went smoother than expected, so much that i feared i have messed everything up. Turns out that&#39;s not the case.&#xA;&#xA;On the surface, Akkoma differs little from Pleroma, but there are definitely some QoL improvements. One thing that stucks is the fact that you can install another frontend from your Admin-FE. Haven&#39;t tried that, but it&#39;s a nice addition.&#xA;&#xA;The fact that development seems to be active is good indication that it is not abandoned. There are even a feature to-do list!&#xA;&#xA;Overall, i&#39;m thankful for sn0w&#39;s responsive help in guiding me and the docker templates, and for the whole Akkoma dev teams for this superb software!]]&gt;</description>
      <content:encoded><![CDATA[<p>My Pleroma, now Akkoma, instance relies heavily on <a href="https://git.ehlxr.me/ehlxr/pleroma-docker">sn0w&#39;s pleroma-docker repo</a>, as you know in my previous post, since i personally preferred for applications to be dockerised for easy management.</p>

<p>But then, last month, i read something in my timeline, there is a <a href="https://coffee-and-dreams.uk/development/2022/06/24/akkoma.html">new fork of Pleroma named Akkoma</a>. Interesting! </p>

<p>It&#39;s never that easy in migrating your instance, so i asked <a href="https://minuscule.space/@/sn0w@cofe.rocks" class="u-url mention">@<span>sn0w@cofe.rocks</span></a> again for help! Thankfully they are willing to help me quite a bit! I have outlined the steps here for my future reference, and might be of some help for others.</p>

<h2 id="the-steps" id="the-steps">The Steps</h2>

<p>First of all, backup your configuration and database. You&#39;ll never know what mistakes you are going to make (i have certainly made some embarassing mistakes).</p>

<p>Current Akkoma doesn&#39;t include any frontends by default, including the Admin-FE. So i&#39;m going to edit my <code>docker-compose.yml</code> file to mount the frontends folder to host.</p>

<p>Add this under volumes:</p>

<pre><code>$DOCKER_DATADIR/frontends:/home/pleroma/pleroma/instance/static/frontends
</code></pre>

<p>And edit the config.exs mount from :ro to :rw for both occassions.</p>

<p>After this, you need to edit the <code>.env</code> file on two lines:</p>

<pre><code>PLEROMA_VERSION=stable-2022.07
.
.
.
.
PLEROMA_GIT_REPO=https://akkoma.dev/AkkomaGang/akkoma.git
</code></pre>

<p><code>stable-2022.07</code> is as-of-now the most recent release of Akkoma, which should be changed should newer versions got released, or you can use <code>stable</code> if you prefer. The repo referred to the new Akkoma official repo.</p>

<p>Then you can run <code>./pleroma.sh build</code> and wait a bit.</p>

<p>When you are done, you should run <code>./pleroma.sh down</code> and <code>./pleroma.sh up</code> to use the newly built image.</p>

<p>Congratulation, you have migrated to Akkoma! But wait, there is no frontends?</p>

<h2 id="installing-frontends" id="installing-frontends">Installing Frontends</h2>

<p>Thankfully, we can install a frontend by our own. <a href="https://docs.akkoma.dev/main/backend/administration/CLI_tasks/frontend/">This official guide</a> comprehensively explains the technical details.</p>

<p>But for those lazy one, and assuming you want your default Pleroma frontend along with your admin frontend back, you should run this command</p>

<pre><code>./pleroma.sh mix pleroma.frontend install pleroma-fe
./pleroma.sh mix pleroma.frontend install admin-fe
</code></pre>

<p>You should check your frontends folder, there would be your frontends folder inside it, named respectively.</p>

<p>Done? Not quite.</p>

<p>You should edit your config.exs file, and add this line anywhere:</p>

<pre><code># Configure Akkoma Frontends
config :pleroma, :frontends,
  primary: %{
    &#34;name&#34; =&gt; &#34;pleroma-fe&#34;,
    &#34;ref&#34; =&gt; &#34;stable&#34;
  },
  admin: %{
    &#34;name&#34; =&gt; &#34;admin-fe&#34;,
    &#34;ref&#34; =&gt; &#34;stable&#34;
  }
</code></pre>

<p>This ensures that Akkoma knows your frontends preference. Run <code>./pleroma.sh restart</code> to apply changes, and you are dandy!</p>

<p>You can check your current running version of Akkoma by visiting this address on your instance:</p>

<p>https://$YOUR<em>INSTANCE</em>ADDRESS/nodeinfo/2.0.json</p>

<h2 id="the-impression" id="the-impression">The Impression</h2>

<p>The migration went smoother than expected, so much that i feared i have messed everything up. Turns out that&#39;s not the case.</p>

<p>On the surface, Akkoma differs little from Pleroma, but there are definitely some QoL improvements. One thing that stucks is the fact that you can install another frontend from your Admin-FE. Haven&#39;t tried that, but it&#39;s a nice addition.</p>

<p>The fact that development seems to be active is good indication that it is not abandoned. There are even a <a href="https://meta.akkoma.dev/t/the-bigge-to-do-list/25">feature to-do list</a>!</p>

<p>Overall, i&#39;m thankful for sn0w&#39;s responsive help in guiding me and the docker templates, and for the whole Akkoma dev teams for this superb software!</p>
]]></content:encoded>
      <guid>https://minuscule.space/migrating-pleroma-to-akkoma-with-docker</guid>
      <pubDate>Sat, 23 Jul 2022 10:45:15 +0000</pubDate>
    </item>
    <item>
      <title>Adding Custom Analytics Script to HEAD in WriteFreely</title>
      <link>https://minuscule.space/adding-custom-analytics-script-to-head-in-writefreely</link>
      <description>&lt;![CDATA[This morning, I wanted to add self-hosted analytic script, Umami, to this site. I always liked the colourful graph and stats of a website traffic, and this should be a privacy-respecting way to do it without giving into the dreaded Google Analytics.&#xA;&#xA;One of the joy of hosting your own blog is that you can customise it to your own liking. It should be noted, however, that you need some expertise to do what you want.!--more--&#xA;&#xA;Customising WriteFreely isn&#39;t a well documented feature, so you would need to scour the web a bit for a way to do it. I have done it before, albeit by awkwardly editing the files, with the Fediring footer down below.&#xA;&#xA;However, I wondered if there are simpler way to do it?&#xA;&#xA;Turns out WriteAs Discourse has the answer.&#xA;&#xA;I tried the method explained here, inserting it in the easy-to-access Custom CSS in the Dashboard.&#xA;&#xA;This method works by dissecting the custom CSS, that is conveniently placed in HEAD by inserting a /style, thus closing the CSS. Then you insert your custom script there, and opened a new style again so it doesn&#39;t break your site.&#xA;&#xA;A crude method, but it does work. There is a more elegant way explained here, but i haven&#39;t made it work. It threw no such template &#34;umami&#34; everytime i tried it, so I must&#39;ve made some mistake. If have made it work, please do contact me!&#xA;&#xA;Until WriteFreely provides a documentation for customising the site, it should serve as a shortcut, since i believe for all WriteFreely simplicity, it doesn&#39;t intend to cater to everyone&#39;s need.]]&gt;</description>
      <content:encoded><![CDATA[<p>This morning, I wanted to add self-hosted analytic script, <a href="https://umami.is">Umami</a>, to this site. I always liked the colourful graph and stats of a website traffic, and this should be a privacy-respecting way to do it without giving into the dreaded Google Analytics.</p>

<p>One of the joy of hosting your own blog is that you can customise it to your own liking. It should be noted, however, that you need some expertise to do what you want.</p>

<p>Customising WriteFreely isn&#39;t a well documented feature, so you would need to scour the web a bit for a way to do it. I have done it before, albeit by awkwardly editing the files, with the Fediring footer down below.</p>

<p>However, I wondered if there are simpler way to do it?</p>

<p>Turns out <a href="https://discuss.write.as">WriteAs Discourse</a> has the answer.</p>

<p>I tried the method explained <a href="https://discuss.write.as/t/custom-javascript-in-writefreely-0-81/348/14">here</a>, inserting it in the easy-to-access Custom CSS in the Dashboard.</p>

<p>This method works by dissecting the custom CSS, that is conveniently placed in <code>&lt;HEAD&gt;</code> by inserting a <code>&lt;/style&gt;</code>, thus closing the CSS. Then you insert your custom script there, and opened a new <code>&lt;style&gt;</code> again so it doesn&#39;t break your site.</p>

<p>A crude method, but it does work. There is a more elegant way explained <a href="https://discuss.write.as/t/matomo-integration/694/2">here</a>, but i haven&#39;t made it work. It threw <code>no such template &#34;umami&#34;</code> everytime i tried it, so I must&#39;ve made some mistake. If have made it work, please do contact me!</p>

<p>Until WriteFreely provides a documentation for customising the site, it should serve as a shortcut, since i believe for all WriteFreely simplicity, it doesn&#39;t intend to cater to everyone&#39;s need.</p>
]]></content:encoded>
      <guid>https://minuscule.space/adding-custom-analytics-script-to-head-in-writefreely</guid>
      <pubDate>Sat, 16 Jul 2022 14:16:15 +0000</pubDate>
    </item>
    <item>
      <title>One-month Journey in Self-Hosting Pleroma</title>
      <link>https://minuscule.space/one-month-journey-in-self-hosting-pleroma</link>
      <description>&lt;![CDATA[It has been two years since i joined the Fediverse, and in the spirit of self-hosting everything i can, i have set up my own Pleroma instance on my VPS.&#xA;&#xA;!--more--&#xA;Technical Aspect&#xA;Since i have been setting up everything as a Docker container, i was looking for guides to install Pleroma on Docker. Surprisingly, Pleroma doesn&#39;t officially support Docker installation, or at least doesn&#39;t recommended it on their docs.&#xA;&#xA;I turn to look for a guide elsewhere, it seems improbable that no-one has tried it.&#xA;&#xA;First i stumbled upon angristan&#39;s repo and immediately shot up a docker-compose file.&#xA;&#xA;And the fact that i need to build it first those scared me a bit. I&#39;ve been enjoying ready-to-use image from Docker Hub for my container, and compling or building sounds too technicaly for my grasp.&#xA;&#xA;But actually the provided Dockerfile does most of the job, i just need to add&#xA;&#xA;      context: .&#xA;&#xA;on my docker-compose file, and it builds itself.&#xA;&#xA;That parts done, and now i stumbled upon error. (To be honest, if i didn&#39;t encounter any error during my first try, i&#39;d have been suspicious. At this point, error and failure are the norms, and troubleshooting is the learning path.)&#xA;&#xA;If i remembered correctly, there was two configuration files, and i was confused between the two. And thus it failed to build. (I have take a look at the repo again and it seems clearer now, but in retrospect i just don&#39;t understand much about Pleroma.) Took me another three days to pour over reading Pleroma docs. It is quite simple, but arcane for me then. Well, am i not qualified enough to host my own Fediverse instance?&#xA;&#xA;My second try was when i stumbled upon @sn0w@cofe.rocks repo.&#xA;&#xA;Upon first look, it&#39;s noob friendly. They have prepared a script to manage your installation. First, i need to edit provided .env.dist and config.dist.exs and rename them to remove the &#39;dist&#39;.&#xA;&#xA;The .env file doesn&#39;t need tweaking, maybe just the UID and GID to match your current user.&#xA;&#xA;The config.exs file though, is a different matter. For reference here is the entire config cheat sheet.&#xA;&#xA;The provided file is enough, you just need to tweak the database part, web endpoint (along with the secret key that you can generate), instance part.&#xA;&#xA;I added a few of my tweaks based on reading the Cheat Sheet:&#xA;&#xA;config :pleroma, Pleroma.Web.Endpoint,&#xA;  url: [host: &#34;sun.minuscule.space&#34;, scheme: &#34;https&#34;, port: 443],&#xA;  secretkeybase: &#34;v3ry/seCre7-keY-8as3&#34;,&#xA;Configure cookie flag and CSP policy&#xA;  securecookieflag: true,&#xA;  extracookieattrs: [&#xA;    &#34;SameSite=Lax&#34;&#xA;  ]&#xA;&#xA;Enabling settings from web admin&#xA;config :pleroma, configurablefrom_database: true&#xA;&#xA;Disabling shoutbox feature&#xA;config :pleroma, :shout,&#xA;  enabled: false&#xA;&#xA;Afterwards, the build process is quite seamless once you figured out the quirk on the config file.&#xA;&#xA;Once then, you are good to go to dwelve into your own corner of Fediverse!&#xA;&#xA;Not-so-technical Aspect and Post-Install&#xA;&#xA;This is a must read article for Pleroma or maybe any Fediverse instance out there:&#xA;&#xA;https://blog.soykaf.com/post/how-federation-works/&#xA;&#xA;In short, it explains your new and barren instance. The blogpost explains the concept of federation in Fediverse quite simple. To make your instance more lively, you can follow more people, or you can use relay instead.&#xA;&#xA;Note that there are some caveats in using public relay, that i learnt only thanks to others.&#xA;&#xA;1. What it does is repeating posts all over following instances. &#xA;So if there are some offensive or malicious instances on the relay, it would be relayed to your instance and your federated timeline. You will need to spend extra time curating the right instances and the right relay. It might be worth your case, but for mine it doesn&#39;t.&#xA;&#xA;2. Federation works like email. &#xA;Your instance store a local copy of the others&#39; posts, this might need to be taken into consideration for those who have limited storage, like i do in my VPS. This is the dealbreaker for my timid 30GB storage.&#xA;&#xA;In my opinion, the best way to populate your instance is still to follow quality people all over the Fediverse. @FediFollows@mastodon.online is a very good reference to start.&#xA;&#xA;The Downside&#xA;&#xA;After one month of self-hosting, i would like to state that it is not a smooth journey. There are, in my observation, some downsides.&#xA;&#xA;1. Lower Exposure&#xA;For people who cared a lot about exposure, self-hosting a single-user instance might not suit them well. The fact that your post propagates to a lesser extent than in bigger instances, due to technical factor, is enough for me to rethink again about my position.&#xA;&#xA;The solution seems to use relay and have people following you. So, if you already have a big following, it might not bother you much. If there&#39;s an existing solution for better exposure on small instance, please leave a reply!&#xA;&#xA;2. Not So Easy Finding New Accounts to Follow&#xA;In the same vein as point one, looking for new accounts to follow is harder. At first, you need to enter the handle of the account to your searchbar to follow them, since most likely you haven&#39;t federated with their instances. This forces you to rely on external service (or visiting other instances) to discover accounts to follow.&#xA;&#xA;Also, the fact that you can only see their posts from the moment you follow them (and some pinned posts along with assortment of few posts if you are lucky).&#xA;&#xA;tusky logo: &#34;server can we have data at home?&#34; mastodon logo: &#34;we already have data at home&#34; the data at home: &#34;0 posts 0 follow 0 followers&#34; &#xA;A highly accurate image depicting newly discovered account. Credit goes to @ella@transmom.love&#xA;&#xA;Solutions might be to follow @FediFollows@mastodon.online to discover new accounts, or creating an account on bigger instance just for account discovery.&#xA;&#xA;3. Higher Maintenance Cost&#xA;Cost doesn&#39;t only mean money, but also time. There is bound to be some quirks along the way, and you need to be ready to troubleshoot them. Of course, some might relish in their journey to troubleshoot problems, but for some this is a no-go.&#xA;&#xA;Alternatives might be using hosted solution, such as masto.host or spacebear.ee (spacebear have revamped their landing page, it&#39;s nice). Thus you only need to spend money and no maintenance hassle.&#xA;&#xA;Closing Remarks&#xA;Self-hosting is not everyone of course. Maintaining an instance is not an easy work. For those in bigger instance, you should thank and support your instance admin for their hard work. The less you see them working, the better they are at their job.&#xA;&#xA;But for those who dared to venture into the land of unknowns, Pleroma is simple enough to install, even without Docker. Why not Mastodon? It&#39;s a different entity, designed to scale to hundreds of thousands of users and thus, more complex than Pleroma.&#xA;&#xA;For my usage, a VPS with 2-core, 2 GB of memory, and 30 GB of storage is enough. Most of the time Pleroma is only using around 10-20% of the CPU and at around 200-400 MB of memory. I&#39;m hosting my Pleroma instance along with all other services (including this federated WriteFreely blog!), so it should be light on resource. Though it should be better if you have more cores, since it would make the building process faster.&#xA;&#xA;Storage is one you should watch if you have limited space.&#xA;&#xA;Anyway, this is how my journey has been so far. Not the smoothest experience ever, but it is manageable enough. Thanks for all the people who made self-hosting Pleroma possible, i would never reach this far without you!&#xA;&#xA;P.S. If you spot some mistake, please @ me and i&#39;ll rectify it. I&#39;m no way expert in Pleroma, Docker, or Fediverse, i&#39;m still learning along the way!&#xA;&#xA;----------&#xA;Note: I&#39;ve migrated my Pleroma instance to Akkoma due to faster development pace. See here.]]&gt;</description>
      <content:encoded><![CDATA[<p>It has been two years since i joined the Fediverse, and in the spirit of self-hosting everything i can, i have set up my own Pleroma instance on my VPS.</p>



<h2 id="technical-aspect" id="technical-aspect">Technical Aspect</h2>

<p>Since i have been setting up everything as a Docker container, i was looking for guides to install Pleroma on Docker. Surprisingly, Pleroma doesn&#39;t officially support Docker installation, or at least doesn&#39;t recommended it on their <a href="https://docs.pleroma.social/backend/installation/otp_en/">docs</a>.</p>

<p>I turn to look for a guide elsewhere, it seems improbable that no-one has tried it.</p>

<p>First i stumbled upon <a href="https://github.com/angristan/docker-pleroma">angristan&#39;s repo</a> and immediately shot up a docker-compose file.</p>

<p>And the fact that i need to build it first those scared me a bit. I&#39;ve been enjoying ready-to-use image from Docker Hub for my container, and <em>compling</em> or <em>building</em> sounds too technicaly for my grasp.</p>

<p>But actually the provided Dockerfile does most of the job, i just need to add</p>

<pre><code class="language-build:">      context: .
</code></pre>

<p>on my docker-compose file, and it builds itself.</p>

<p>That parts done, and now i stumbled upon error. (To be honest, if i didn&#39;t encounter any error during my first try, i&#39;d have been suspicious. At this point, error and failure are the norms, and troubleshooting is the learning path.)</p>

<p>If i remembered correctly, there was two configuration files, and i was confused between the two. And thus it failed to build. (I have take a look at the repo again and it seems clearer now, but in retrospect i just don&#39;t understand much about Pleroma.) Took me another three days to pour over reading Pleroma docs. It is quite simple, but arcane for me then. Well, am i not qualified enough to host my own Fediverse instance?</p>

<p>My second try was when i stumbled upon <a href="https://minuscule.space/@/sn0w@cofe.rocks" class="u-url mention">@<span>sn0w@cofe.rocks</span></a> <a href="https://memleak.eu/sn0w/pleroma-docker">repo</a>.</p>

<p>Upon first look, it&#39;s noob friendly. They have prepared a script to manage your installation. First, i need to edit provided <code>.env.dist</code> and <code>config.dist.exs</code> and rename them to remove the &#39;dist&#39;.</p>

<p>The <code>.env</code> file doesn&#39;t need tweaking, maybe just the UID and GID to match your current user.</p>

<p>The <code>config.exs</code> file though, is a different matter. For reference <a href="https://docs-develop.pleroma.social/backend/configuration/cheatsheet/">here</a> is the entire config cheat sheet.</p>

<p>The provided file is enough, you just need to tweak the database part, web endpoint (along with the secret key that you can generate), instance part.</p>

<p>I added a few of my tweaks based on reading the Cheat Sheet:</p>

<pre><code>config :pleroma, Pleroma.Web.Endpoint,
  url: [host: &#34;sun.minuscule.space&#34;, scheme: &#34;https&#34;, port: 443],
  secret_key_base: &#34;v3ry/seCre7-keY-8as3&#34;,
## Configure cookie flag and CSP policy
  secure_cookie_flag: true,
  extra_cookie_attrs: [
    &#34;SameSite=Lax&#34;
  ]

## Enabling settings from web admin
config :pleroma, configurable_from_database: true

## Disabling shoutbox feature
config :pleroma, :shout,
  enabled: false
</code></pre>

<p>Afterwards, the build process is quite seamless once you figured out the quirk on the config file.</p>

<p>Once then, you are good to go to dwelve into your own corner of Fediverse!</p>

<h2 id="not-so-technical-aspect-and-post-install" id="not-so-technical-aspect-and-post-install">Not-so-technical Aspect and Post-Install</h2>

<p>This is a must read article for Pleroma or maybe any Fediverse instance out there:</p>

<p><a href="https://blog.soykaf.com/post/how-federation-works/">https://blog.soykaf.com/post/how-federation-works/</a></p>

<p>In short, it explains your new and barren instance. The blogpost explains the concept of federation in Fediverse quite simple. To make your instance more lively, you can follow more people, or you can use relay instead.</p>

<p>Note that there are some caveats in using public relay, that i learnt only thanks to others.</p>

<h3 id="1-what-it-does-is-repeating-posts-all-over-following-instances" id="1-what-it-does-is-repeating-posts-all-over-following-instances">1. What it does is repeating posts all over following instances.</h3>

<p>So if there are some offensive or malicious instances on the relay, it would be relayed to your instance and your federated timeline. You will need to spend extra time curating the right instances and the right relay. It might be worth your case, but for mine it doesn&#39;t.</p>

<h3 id="2-federation-works-like-email" id="2-federation-works-like-email">2. Federation works like email.</h3>

<p>Your instance store a local copy of the others&#39; posts, this might need to be taken into consideration for those who have limited storage, like i do in my VPS. This is the dealbreaker for my timid 30GB storage.</p>

<p>In my opinion, the best way to populate your instance is still to follow quality people all over the Fediverse. <a href="https://minuscule.space/@/FediFollows@mastodon.online" class="u-url mention">@<span>FediFollows@mastodon.online</span></a> is a very good reference to start.</p>

<h2 id="the-downside" id="the-downside">The Downside</h2>

<p>After one month of self-hosting, i would like to state that it is not a smooth journey. There are, in my observation, some downsides.</p>

<h3 id="1-lower-exposure" id="1-lower-exposure">1. Lower Exposure</h3>

<p>For people who cared a lot about exposure, self-hosting a single-user instance might not suit them well. The fact that your post propagates to a lesser extent than in bigger instances, due to technical factor, is enough for me to rethink again about my position.</p>

<p>The solution seems to use relay and have people following you. So, if you already have a big following, it might not bother you much. If there&#39;s an existing solution for better exposure on small instance, please leave a reply!</p>

<h3 id="2-not-so-easy-finding-new-accounts-to-follow" id="2-not-so-easy-finding-new-accounts-to-follow">2. Not So Easy Finding New Accounts to Follow</h3>

<p>In the same vein as point one, looking for new accounts to follow is harder. At first, you need to enter the handle of the account to your searchbar to follow them, since most likely you haven&#39;t federated with their instances. This forces you to rely on external service (or visiting other instances) to discover accounts to follow.</p>

<p>Also, the fact that you can only see their posts from the moment you follow them (and some pinned posts along with assortment of few posts if you are lucky).</p>

<p><img src="https://minuscule.space/media/server-has-no-data.png" alt="tusky logo: &#34;server can we have data at home?&#34; mastodon logo: &#34;we already have data at home&#34; the data at home: &#34;0 posts 0 follow 0 followers&#34; ">
A highly accurate image depicting newly discovered account. Credit goes to <a href="https://minuscule.space/@/ella@transmom.love" class="u-url mention">@<span>ella@transmom.love</span></a></p>

<p>Solutions might be to follow <a href="https://minuscule.space/@/FediFollows@mastodon.online" class="u-url mention">@<span>FediFollows@mastodon.online</span></a> to discover new accounts, or creating an account on bigger instance just for account discovery.</p>

<h3 id="3-higher-maintenance-cost" id="3-higher-maintenance-cost">3. Higher Maintenance Cost</h3>

<p>Cost doesn&#39;t only mean money, but also time. There is bound to be some quirks along the way, and you need to be ready to troubleshoot them. Of course, some might relish in their journey to troubleshoot problems, but for some this is a no-go.</p>

<p>Alternatives might be using hosted solution, such as <a href="https://masto.host/">masto.host</a> or <a href="https://federation.spacebear.ee/">spacebear.ee</a> (spacebear have revamped their landing page, it&#39;s nice). Thus you only need to spend money and no maintenance hassle.</p>

<h2 id="closing-remarks" id="closing-remarks">Closing Remarks</h2>

<p>Self-hosting is not everyone of course. Maintaining an instance is not an easy work. For those in bigger instance, you should thank and support your instance admin for their hard work. The less you see them working, the better they are at their job.</p>

<p>But for those who dared to venture into the land of unknowns, Pleroma is simple enough to install, even without Docker. Why not Mastodon? It&#39;s a different entity, designed to scale to hundreds of thousands of users and thus, more complex than Pleroma.</p>

<p>For my usage, a VPS with 2-core, 2 GB of memory, and 30 GB of storage is enough. Most of the time Pleroma is only using around 10-20% of the CPU and at around 200-400 MB of memory. I&#39;m hosting my Pleroma instance along with all other services (including this federated WriteFreely blog!), so it should be light on resource. Though it should be better if you have more cores, since it would make the building process faster.</p>

<p>Storage is one you should watch if you have limited space.</p>

<p>Anyway, this is how my journey has been so far. Not the smoothest experience ever, but it is manageable enough. Thanks for all the people who made self-hosting Pleroma possible, i would never reach this far without you!</p>

<p>P.S. If you spot some mistake, please @ me and i&#39;ll rectify it. I&#39;m no way expert in Pleroma, Docker, or Fediverse, i&#39;m still learning along the way!</p>

<hr>

<p><strong>Note</strong>: I&#39;ve migrated my Pleroma instance to Akkoma due to faster development pace. <a href="https://minuscule.space/migrating-pleroma-to-akkoma-with-docker">See here.</a></p>
]]></content:encoded>
      <guid>https://minuscule.space/one-month-journey-in-self-hosting-pleroma</guid>
      <pubDate>Tue, 03 May 2022 15:03:54 +0000</pubDate>
    </item>
    <item>
      <title>Calibre and Calibre-Web are Two Different Things</title>
      <link>https://minuscule.space/calibre-and-calibre-web-are-two-different-things</link>
      <description>&lt;![CDATA[First of all, shoutout to you guys on Linuxserver for maintaining such a high-quality list of Docker images.&#xA;&#xA;Books always have a special place in my heart. And following my self-hosting excitement, naturally i&#39;m interested in managing my (e-)books. Folks over on Linuxserver Awesome List have recommendation to manage your e-book collection, that is, Calibre and Calibre-web.&#xA;&#xA;!--more--&#xA;&#xA;When comparing the two, i see that Calibre-web has a much modern interface, compared to Calibre website which honestly looks like a antique website. Naturally i choose Calibre-web.&#xA;&#xA;Install went okay, since the fact that to start the container it took almost full two minutes that made me frantically looking at my compose file looking for mistakes. It works at the end, so no worries. After logging in, it prompts path to Calibre database. Looking at documentation, it recommends &#xA;But it founds nothing. Turns out you need to generate one on the Calibre container. Which is weird, since Calibre-web is just a pretty looking Calibre right?&#xA;&#xA;Well, not really. Calibre-web is actually just a nicer front-end that you can expose to web browser, while Calibre is a desktop app to manage your e-book collection. Yes, a desktop app, not a web app.&#xA;&#xA;Compounding the fact, Readarr, an automatic e-book downloader, specified the needs for Calibre Content Server, which is only availabe in Calibre, the desktop app.&#xA;&#xA;Linuxserver.io does provide images for both Calibre and Calibre-web, which i haven&#39;t tried. Maybe i should in near future.&#xA;&#xA;Closing&#xA;&#xA;In short, Calibre-web is just a nice frontend for Calibre. Calibre is a e-book management app for desktop use.]]&gt;</description>
      <content:encoded><![CDATA[<p>First of all, shoutout to you guys on Linuxserver for maintaining such a high-quality list of Docker images.</p>

<p>Books always have a special place in my heart. And following my self-hosting excitement, naturally i&#39;m interested in managing my (e-)books. Folks over on Linuxserver <a href="https://docs.linuxserver.io/general/awesome-lsio">Awesome List</a> have recommendation to manage your e-book collection, that is, Calibre <em>and</em> Calibre-web.</p>



<p>When comparing the two, i see that Calibre-web has a much modern interface, compared to Calibre website which honestly looks like a antique website. Naturally i choose Calibre-web.</p>

<p>Install went okay, since the fact that to start the container it took almost full two minutes that made me frantically looking at my compose file looking for mistakes. It works at the end, so no worries. After logging in, it prompts path to Calibre database. Looking at documentation, it recommends <code>/book</code> path as the location of the database.</p>

<p>But it founds nothing. Turns out you need to generate one on the Calibre container. Which is weird, since Calibre-web is just a pretty looking Calibre right?</p>

<p>Well, not really. Calibre-web is actually just a nicer front-end that you can expose to web browser, while Calibre is a desktop app to manage your e-book collection. Yes, a desktop app, not a web app.</p>

<p>Compounding the fact, Readarr, an automatic e-book downloader, specified the needs for Calibre Content Server, which is only availabe in Calibre, the desktop app.</p>

<p>Linuxserver.io does provide images for both Calibre and Calibre-web, which i haven&#39;t tried. Maybe i should in near future.</p>

<h2 id="closing" id="closing">Closing</h2>

<p>In short, Calibre-web is just a nice frontend for Calibre. Calibre is a e-book management app for desktop use.</p>
]]></content:encoded>
      <guid>https://minuscule.space/calibre-and-calibre-web-are-two-different-things</guid>
      <pubDate>Sat, 02 Apr 2022 15:38:01 +0000</pubDate>
    </item>
    <item>
      <title>Self-hosting, Easy or Complicated?</title>
      <link>https://minuscule.space/self-hosting-easy-or-complicated</link>
      <description>&lt;![CDATA[Well, i have finally rented a server to tinker with. Self-hosting has been on the back of my mind for the few years, and i&#39;m excited. But now, how do i do it? !--more--&#xA;&#xA;First Steps&#xA;I often visit r/selfhosted, and it&#39;s a good point to start if you are lost. First, i tried self-hosting on bare metal, i.e. no virtualisation or docker. And it starts to get confusing, as a first timer. OnTrack was the first app i tried to install, and truth be told, it wasn&#39;t a wise decision. The documentation assumes you have prior knowledge of Ruby and installing Postgresql, which i don&#39;t. Managed to get it installed after a few grueling days, and exposed it on localhost:3000, but another problem came. I can&#39;t access it from outside! Turned out OnTrack only listened on 127.0.01, and after searching a bit, i found that i need a reverse proxy to forward it to internet.&#xA;&#xA;Immediately i turned to Caddy, which i heard often due to its automatic TLS provision out-of-the-box. So i installed one. But again, my lack of experience with anything Linux hits me. I don&#39;t know where to put the Caddyfile, beside, what should i put on the Caddyfile so i can access localhost:3000 from outside? Reverse proxying example doesn&#39;t work, and i threw my hands in exasperated sigh. You know what? Self-hosting is not as easy as it looked like. (In hindsight, it was just my lack of knowledge rather than anything, or perhaps i should&#39;ve tried something easier like Wordpress)&#xA;&#xA;Took almost two-weeks off to cool my mind before deciding to give another shot.&#xA;&#xA;Docker, the saviour.&#xA;Then Docker took away my attention. I have been avoiding it since the beginning since i don&#39;t know much about Docker, and it looked complicated. Containers? Docker-compose? Swarm? Docker network? It was just a buzzword in my ears. But i figure that it shouldn&#39;t be that complicated as my previous attempt. And so i jumped.&#xA;&#xA;I&#39;m a pretty paranoid person, so i searched for &#39;best security practice for Docker&#39;, in case i did the worst. The major things i learned was that Docker &#39;bypassed&#39; UFW, and it&#39;s best to never expose your Docker socket (/var/run/docker.sock).&#xA;&#xA;Fortunately, i stumbled upon this wonderful Docker-selfhosted-apps guide by BaptisteBdn on Github. (You are a lifesafer, truly.) I learned that you can fix &#39;Docker bypassing UFW&#39; with this nice guide by Chaifeng. The fundamental of Docker is explained succinctly there by BaptisteBdn, and it was at this point i was wondering, &#39;Maybe i can do it.&#39;&#xA;&#xA;Interestingly, i didn&#39;t tried one of his apps first, but i was trying installing Caddy Docker Proxy by lucaslorentz. Honestly, i just fell in love with Caddy for its out-of-the-box simplicity, compared to Traefik labels at first sight. (After installing both at later point in time, i can say at my scale both are pretty much easy to use and install.) I failed a few times here, took me almost a week to get a Grav site, this site, running. I realised that most of my mistake is basically just typos here and there, which is actually quite significant when it comes to configuration. For example, i was trying &#34;{{upstream}}&#34; when trying to reverse proxy a container, and i missed the &#39;s&#39; in &#34;{{upstreams}}&#34; there. Another example was that i kept forgetting the &#39;s&#39; in docker-compose networks and environments configuration. As English is not my native language, i think i can get a pass here (hopefully).&#xA;&#xA;Down the Rabbithole&#xA;&#xA;Afterwards, i tried installing a more &#39;complex&#39; apps, with database and such. Typing passwords and sensitive information on a plain docker-compose file always made me nervous, and fortunately i learned that you can pass it as a secret file! This MySQL installation guide helped me a lot, after i learned that you don&#39;t actually need Docker swarm for secrets to be passed. Bonus point i learned you can use openssl rand command to generate a random password and pipe it to a file. No more copy paste!&#xA;&#xA;That taken care of, at this point i&#39;m starting to consider VPN to access my service. Exposing a private apps to the internet seems like a major risk, and beside, i get to set up a VPN. Really cool. Both Wirehole guide and BaptisdeBdn&#39;s wireguard-unbound-pihole guide made it a breeze, and i&#39;m really thankful for that. The headache came when i tried to install a Wireguard client on Ubuntu, and found out that Wireguard has no client apps? Just wg-quick, and guides out there pointed out you need to generate a private and public key for you to exchange with your server. Turned out, the Wireguard images have provided a ready-to-use conf file (and QR code) for you to use directly on your devices. Put it on &#xA;And i went crazy after that. Installed note-taking apps, automation tools, Gotify, and so on. I must say it&#39;s really a breeze in self-hosting with Docker once you got past the initial confusion. I might need to run a nmap scan on my server again to find rogue open port, and pen testing it i guess so it&#39;s safe. Or am i overdoing this stuffs? Eh, i guess no one know at this point.]]&gt;</description>
      <content:encoded><![CDATA[<p>Well, i have finally rented a server to tinker with. Self-hosting has been on the back of my mind for the few years, and i&#39;m excited. But now, how do i do it? </p>

<h2 id="first-steps" id="first-steps">First Steps</h2>

<p>I often visit r/selfhosted, and it&#39;s a good point to start if you are lost. First, i tried self-hosting on bare metal, i.e. no virtualisation or docker. And it starts to get confusing, as a first timer. <a href="https://github.com/inoda/ontrack">OnTrack</a> was the first app i tried to install, and truth be told, it wasn&#39;t a wise decision. The documentation assumes you have prior knowledge of Ruby and installing Postgresql, which i don&#39;t. Managed to get it installed after a few grueling days, and exposed it on localhost:3000, but another problem came. I can&#39;t access it from outside! Turned out OnTrack only listened on 127.0.01, and after searching a bit, i found that i need a reverse proxy to forward it to internet.</p>

<p>Immediately i turned to Caddy, which i heard often due to its automatic TLS provision out-of-the-box. So i installed one. But again, my lack of experience with anything Linux hits me. I don&#39;t know where to put the Caddyfile, beside, what should i put on the Caddyfile so i can access localhost:3000 from outside? Reverse proxying example doesn&#39;t work, and i threw my hands in exasperated sigh. You know what? Self-hosting is not as easy as it looked like. (In hindsight, it was just my lack of knowledge rather than anything, or perhaps i should&#39;ve tried something easier like Wordpress)</p>

<p>Took almost two-weeks off to cool my mind before deciding to give another shot.</p>

<h2 id="docker-the-saviour" id="docker-the-saviour">Docker, the saviour.</h2>

<p>Then Docker took away my attention. I have been avoiding it since the beginning since i don&#39;t know much about Docker, and it looked complicated. Containers? Docker-compose? Swarm? Docker network? It was just a buzzword in my ears. But i figure that it shouldn&#39;t be that complicated as my previous attempt. And so i jumped.</p>

<p>I&#39;m a pretty paranoid person, so i searched for &#39;best security practice for Docker&#39;, in case i did the worst. The major things i learned was that Docker &#39;bypassed&#39; UFW, and it&#39;s best to never expose your Docker socket (/var/run/docker.sock).</p>

<p>Fortunately, i stumbled upon this wonderful <a href="https://github.com/BaptisteBdn/docker-selfhosted-apps">Docker-selfhosted-apps</a> guide by BaptisteBdn on Github. (You are a lifesafer, truly.) I learned that you can fix &#39;Docker bypassing UFW&#39; with this <a href="https://github.com/chaifeng/ufw-docker">nice guide</a> by Chaifeng. The fundamental of Docker is explained succinctly there by BaptisteBdn, and it was at this point i was wondering, &#39;Maybe i can do it.&#39;</p>

<p>Interestingly, i didn&#39;t tried one of his apps first, but i was trying installing <a href="https://github.com/lucaslorentz/caddy-docker-proxy">Caddy Docker Proxy</a> by lucaslorentz. Honestly, i just fell in love with Caddy for its out-of-the-box simplicity, compared to Traefik labels at first sight. (After installing both at later point in time, i can say at my scale both are pretty much easy to use and install.) I failed a few times here, took me almost a week to get a Grav site, this site, running. I realised that most of my mistake is basically just typos here and there, which is actually quite significant when it comes to configuration. For example, i was trying “{{upstream}}” when trying to reverse proxy a container, and i missed the &#39;s&#39; in “{{upstreams}}” there. Another example was that i kept forgetting the &#39;s&#39; in docker-compose networks and environments configuration. As English is not my native language, i think i can get a pass here (hopefully).</p>

<h2 id="down-the-rabbithole" id="down-the-rabbithole">Down the Rabbithole</h2>

<p>Afterwards, i tried installing a more &#39;complex&#39; apps, with database and such. Typing passwords and sensitive information on a plain docker-compose file always made me nervous, and fortunately i learned that you can pass it as a secret file! This <a href="https://blog.ruanbekker.com/blog/2017/11/23/use-docker-secrets-with-mysql-on-docker-swarm/">MySQL installation guide</a> helped me a lot, after i learned that you don&#39;t actually need Docker swarm for secrets to be passed. Bonus point i learned you can use openssl rand command to generate a random password and pipe it to a file. No more copy paste!</p>

<p>That taken care of, at this point i&#39;m starting to consider VPN to access my service. Exposing a private apps to the internet seems like a major risk, and beside, i get to set up a VPN. Really cool. Both <a href="https://github.com/IAmStoxe/wirehole">Wirehole guide</a> and BaptisdeBdn&#39;s wireguard-unbound-pihole guide made it a breeze, and i&#39;m really thankful for that. The headache came when i tried to install a Wireguard client on Ubuntu, and found out that Wireguard has no client apps? Just wg-quick, and guides out there pointed out you need to generate a private and public key for you to exchange with your server. Turned out, the Wireguard images have provided a ready-to-use conf file (and QR code) for you to use directly on your devices. Put it on <code>/etc/wireguard/wg0.conf</code>, run <code>sudo wg-quick up wg0</code>, <code>sudo systemctl enable wg-quick@wg0.service</code>, <code>sudo systemctl start wg-quick@wg0.service</code>, and you are good to go! People said it&#39;s easier than setting an OpenVPN client, but i couldn&#39;t attest that since Wireguard is my first experience in dealing with VPN.</p>

<p>And i went crazy after that. Installed note-taking apps, automation tools, Gotify, and so on. I must say it&#39;s really a breeze in self-hosting with Docker once you got past the initial confusion. I might need to run a nmap scan on my server again to find rogue open port, and pen testing it i guess so it&#39;s safe. Or am i overdoing this stuffs? Eh, i guess no one know at this point.</p>
]]></content:encoded>
      <guid>https://minuscule.space/self-hosting-easy-or-complicated</guid>
      <pubDate>Sat, 26 Feb 2022 10:43:02 +0000</pubDate>
    </item>
  </channel>
</rss>