<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>selfhosting &amp;mdash; Nat Knight</title>
    <link>http://natknight.xyz/tag:selfhosting</link>
    <description>Reflections, diversions, and opinions from a progressive ex-physicist programmer dad with a sore back.</description>
    <pubDate>Sun, 22 Nov 2026 10:17:19 -0700</pubDate>
    <item>
      <title>Self-hosting a Software Factory: Part 2, It&#39;s the error states, stupid!</title>
      <link>http://natknight.xyz/self-hosting-a-software-factory-part-2-its-the-error-states-stupid</link>
      <description>&lt;![CDATA[#project #selfhosting #llms #agents&#xA;&#xA;My self-hosted software factory is coming along!&#xA;&#xA;!--more--&#xA;&#xA;After a bit of research I settled on Incus as my sandboxing technology (it&#39;s not unlike Docker, but uses actual VMs instead of containers).&#xA;I&#39;ve figured out how to use the EYG CLI as an &#34;oracle&#34; in my containers and tests.&#xA;I&#39;ve figured out how to safely store and manage code (with git-bundle).&#xA;I&#39;m using a Django app (hey, I said it could be janky) as my coordinator.&#xA;&#xA;As I build out the coordinator I&#39;m finding the places where the complexity was hiding, and as usual it&#39;s mostly in the error cases.&#xA;&#xA;A naive model of how this system should work is tantalizingly simple: work goes in one end, the agent does the work, commits land on main:&#xA;&#xA;Diagram: Tickets / Specs flow into Agent Runs, which produce Commits.&#xA;&#xA;But of course, sometimes the agent won&#39;t converge, or commits will introduce bugs:&#xA;&#xA;Diagram: the same flow, with arrows looping back to Tickets / Specs from Agent Runs (non-convergence or ambiguity) and from Commits (bugs).&#xA;&#xA;That&#39;s fine, part of how the factory works is by catching and automatically fixing bugs.&#xA;&#xA;But then, of course, there are the cases where jobs fail for exogenous reasons: expired keys, resource limitations, home server networking hiccups or power outages. These introduce a lot of possible corrupt states, and often necessitate human intervention:&#xA;&#xA;Diagram: the previous flow, plus arrows from Tickets / Specs and Agent Runs down to a Human Intervention box (infra errors, elevated permissions).&#xA;&#xA;And, oh yeah, we were going to have a bunch of tests here. What if the agent finishes but the CI or holdout tests fail?&#xA;&#xA;Diagram: the previous flow with a Tests stage between Agent Runs and Commits; failing tests loop back to Tickets / Specs as bugs or escalate to Human Intervention.&#xA;&#xA;I&#39;m sure there are other failure modes I haven&#39;t thought of.&#xA;&#xA;Once this project is over I look forward to seeing how others have tackled this:&#xA;&#xA;Is it irreducible complexity? Do you just need to deal with it?&#xA;Is there a re-framing, a fundamental abstraction, or a different set of primitives that makes the problem dramatically simpler?&#xA;Is it way more efficient to just sandbox and manually manage an agent powered by a high-end model? (I suspect it may be.)&#xA;Do I learn enough that I want to tear this factory apart and re-build it?&#xA;&#xA;Only time will tell!&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:project" class="hashtag"><span>#</span><span class="p-category">project</span></a> <a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:llms" class="hashtag"><span>#</span><span class="p-category">llms</span></a> <a href="http://natknight.xyz/tag:agents" class="hashtag"><span>#</span><span class="p-category">agents</span></a></p>

<p>My <a href="https://natknight.xyz/self-hosting-a-software-factory-part-1">self-hosted software factory</a> is coming along!</p>


<ul><li>After a bit of research I settled on <a href="https://linuxcontainers.org/incus/">Incus</a> as my sandboxing technology (it&#39;s not unlike Docker, but uses actual VMs instead of containers).</li>
<li>I&#39;ve figured out how to use the <a href="https://eyg.run/guides/install-a-prebuilt-binary">EYG CLI</a> as an “oracle” in my containers and tests.</li>
<li>I&#39;ve figured out how to safely store and manage code (with <a href="https://git-scm.com/docs/git-bundle"><code>git-bundle</code></a>).</li>
<li>I&#39;m using a Django app (hey, I said it could be janky) as my coordinator.</li></ul>

<p>As I build out the coordinator I&#39;m finding the places where the complexity was hiding, and as usual it&#39;s mostly in the error cases.</p>

<p>A naive model of how this system should work is tantalizingly simple: work goes in one end, the agent does the work, commits land on <code>main</code>:</p>

<p><img src="https://natknight.xyz/static/factory2/factory-1-naive.svg" alt="Diagram: Tickets / Specs flow into Agent Runs, which produce Commits."></p>

<p>But of course, sometimes the agent won&#39;t converge, or commits will introduce bugs:</p>

<p><img src="https://natknight.xyz/static/factory2/factory-2-bugs.svg" alt="Diagram: the same flow, with arrows looping back to Tickets / Specs from Agent Runs (non-convergence or ambiguity) and from Commits (bugs)."></p>

<p>That&#39;s fine, part of how the factory works is by catching and automatically fixing bugs.</p>

<p>But then, of course, there are the cases where jobs fail for exogenous reasons: expired keys, resource limitations, home server networking hiccups or power outages. These introduce a <em>lot</em> of possible corrupt states, and often necessitate human intervention:</p>

<p><img src="https://natknight.xyz/static/factory2/factory-3-human.svg" alt="Diagram: the previous flow, plus arrows from Tickets / Specs and Agent Runs down to a Human Intervention box (infra errors, elevated permissions)."></p>

<p>And, oh yeah, we were going to have a bunch of tests here. What if the agent finishes but the CI or holdout tests fail?</p>

<p><img src="https://natknight.xyz/static/factory2/factory-4-tests.svg" alt="Diagram: the previous flow with a Tests stage between Agent Runs and Commits; failing tests loop back to Tickets / Specs as bugs or escalate to Human Intervention."></p>

<p>I&#39;m sure there are other failure modes I haven&#39;t thought of.</p>

<p>Once this project is over I look forward to seeing how others have tackled this:</p>
<ul><li>Is it irreducible complexity? Do you just need to deal with it?</li>
<li>Is there a re-framing, a fundamental abstraction, or a different set of primitives that makes the problem dramatically simpler?</li>
<li>Is it way more efficient to just sandbox and manually manage an agent powered by a high-end model? (I suspect it may be.)</li>
<li>Do I learn enough that I want to tear this factory apart and re-build it?</li></ul>

<p>Only time will tell!</p>
]]></content:encoded>
      <guid>http://natknight.xyz/self-hosting-a-software-factory-part-2-its-the-error-states-stupid</guid>
      <pubDate>Wed, 11 Nov 2026 03:41:27 +0000</pubDate>
    </item>
    <item>
      <title>Self-Hosting Obsidian Backups</title>
      <link>http://natknight.xyz/self-hosting-obsidian-backups</link>
      <description>&lt;![CDATA[#selfhosting #guide #backups #obsidian&#xA;&#xA;I use Obsidian to store all my notes (not because I&#39;m a Zettelkasten sicko, I just like having a nice Markdown editor that syncs to my phone). But I want my own copy outside the app, just in case.&#xA;&#xA;!--more--&#xA;&#xA;I&#39;m not rebuilding their paid sync service (I&#39;m happy to pay for them to store and sync my notes), but I want to guard against:&#xA;&#xA;extended network outage&#xA;data loss or ransomware attacks&#xA;me losing my end-to-end encryption password&#xA;&#xA;It turns out it&#39;s fairly easy to take offline backups of your Obsidian vaults.&#xA;&#xA;First, you&#39;ll need a host for this to run on. I run mine on my home server with direct-attached storage where all my files live (and get encrypted and backed up to the cloud nightly).&#xA;&#xA;Install obsidian-headless, a command-line client for Obsidian Sync (I happen to use mise; you could use npm or Nix or whatever you prefer). Note that this requires an Obsidian Sync account, so it won&#39;t work if you&#39;re not paying for one of those.&#xA;&#xA;mise use --global node@24 npm:obsidian-headless&#xA;&#xA;You should now have a command called ob; use it to log in and set up the sync. If $VAULTNAME is the name of the vault you&#39;re backing up and $BACKUPDIR is the path to the directory where you want to store your notes locally:&#xA;&#xA;ob login  # this takes your Obsidian account password&#xA;ob sync-setup --vault &#34;$VAULTNAME&#34; --path &#34;$BACKUPDIR&#34;  # this takes your E2EE password&#xA;ob sync-config --path &#34;$BACKUPDIR&#34; --mode pull-only&#xA;&#xA;I set it to pull-only to prevent my backup from interfering with the vault (e.g. a disk fails, the vault looks empty, and syncing deletes the remote).&#xA;&#xA;Finally, set up a recurring job (I used a systemd timer; again, you could use any number of things) to run the sync regularly.&#xA;&#xA;The sync command is:&#xA;&#xA;mise exec -- ob sync --path &#34;$BACKUPDIR&#34;&#xA;&#xA;Check that it runs automatically and you&#39;re set: you now have a backup copy of your notes that gets updated in the background.&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:guide" class="hashtag"><span>#</span><span class="p-category">guide</span></a> <a href="http://natknight.xyz/tag:backups" class="hashtag"><span>#</span><span class="p-category">backups</span></a> <a href="http://natknight.xyz/tag:obsidian" class="hashtag"><span>#</span><span class="p-category">obsidian</span></a></p>

<p>I use <a href="https://obsidian.md">Obsidian</a> to store all my notes (not because I&#39;m a Zettelkasten sicko, I just like having a nice Markdown editor that syncs to my phone). But I want my own copy outside the app, just in case.</p>



<p>I&#39;m not rebuilding their paid sync service (I&#39;m happy to pay for them to store and sync my notes), but I want to guard against:</p>
<ul><li>extended network outage</li>
<li>data loss or ransomware attacks</li>
<li>me losing my end-to-end encryption password</li></ul>

<p>It turns out it&#39;s fairly easy to take offline backups of your Obsidian vaults.</p>

<p>First, you&#39;ll need a host for this to run on. I run mine on my home server with direct-attached storage where all my files live (and get encrypted and backed up to the cloud nightly).</p>

<p>Install <a href="https://www.npmjs.com/package/obsidian-headless"><code>obsidian-headless</code></a>, a command-line client for Obsidian Sync (I happen to use <code>mise</code>; you could use npm or Nix or whatever you prefer). Note that this requires an Obsidian Sync account, so it won&#39;t work if you&#39;re not paying for one of those.</p>

<pre><code class="language-sh">mise use --global node@24 npm:obsidian-headless
</code></pre>

<p>You should now have a command called <code>ob</code>; use it to log in and set up the sync. If <code>$VAULTNAME</code> is the name of the vault you&#39;re backing up and <code>$BACKUP_DIR</code> is the path to the directory where you want to store your notes locally:</p>

<pre><code class="language-sh">ob login  # this takes your Obsidian account password
ob sync-setup --vault &#34;$VAULTNAME&#34; --path &#34;$BACKUP_DIR&#34;  # this takes your E2EE password
ob sync-config --path &#34;$BACKUP_DIR&#34; --mode pull-only
</code></pre>

<p>I set it to <code>pull-only</code> to prevent my backup from interfering with the vault (e.g. a disk fails, the vault looks empty, and syncing deletes the remote).</p>

<p>Finally, set up a recurring job (I used a <a href="https://wiki.archlinux.org/title/Systemd/Timers">systemd timer</a>; again, you could use any number of things) to run the sync regularly.</p>

<p>The sync command is:</p>

<pre><code class="language-sh">mise exec -- ob sync --path &#34;$BACKUP_DIR&#34;
</code></pre>

<p>Check that it runs automatically and you&#39;re set: you now have a backup copy of your notes that gets updated in the background.</p>
]]></content:encoded>
      <guid>http://natknight.xyz/self-hosting-obsidian-backups</guid>
      <pubDate>Tue, 20 Oct 2026 03:44:50 +0000</pubDate>
    </item>
    <item>
      <title>Self-hosting a Software Factory: Part 1</title>
      <link>http://natknight.xyz/self-hosting-a-software-factory-part-1</link>
      <description>&lt;![CDATA[#project #selfhosting #llms #agents&#xA;&#xA;One of the ways that folks are leveraging LLM-powered agents to do software development is the &#34;software factory&#34; (or [&#34;software dark factory&#34;]) pattern, where the LLMs write all the code and the humans aren&#39;t allowed to even review it.&#xA;&#xA;[&#34;software dark factory&#34;]: https://www.danshapiro.com/blog/2026/01/the-five-levels-from-spicy-autocomplete-to-the-software-factory/&#xA;&#xA;Apparently this works, though you need a good way to verify your product. I&#39;m a little skeptical that it&#39;s the best way to use these tools, but it&#39;s an interesting idea, so I&#39;m going to try to build one for myself.&#xA;&#xA;!--more--&#xA;&#xA;The Project&#xA;&#xA;I&#39;m cheating a little bit by picking a project that&#39;s embarrassingly easy to verify: a new interpreter for an extant programming language.&#xA;&#xA;The programming language is called [EYG] and has many interesting and desirable properties:&#xA;&#xA;functional style + a sound type system&#xA;immutable dependencies&#xA;deterministic execution&#xA;the editor tooling and compiler are independent of the runtime (so I don&#39;t have to implement them!)&#xA;&#xA;[EYG]: https://eyg.run&#xA;&#xA;Its only annoying drawback is that its interpreter is in JavaScript (compiled from Gleam, but running on Node). I&#39;d really prefer a native interpreter, or better still, a Rust library that can execute EYG code.&#xA;&#xA;Lucky for me, I have:&#xA;&#xA;access to LLMs that can cheaply churn out code, and&#xA;an &#34;oracle&#34; that can see if my project is working properly, i.e. the existing EYG interpreter.&#xA;&#xA;So that&#39;s the project: a Rust library + easily deployable binary that can interpret EYG code.&#xA;&#xA;The Rules&#xA;&#xA;The project will be split into two repos, each with different rules:&#xA;&#xA;eyg-rs is the actual interpreter/library:&#xA;&#xA;I&#39;m not allowed to write or review code here. I can peek in occasionally for quality control, but that should be the exception.&#xA;The work needs to be mediated by an automated system, not me manually driving an agent.&#xA;The code needs to end up correct, efficient, and clean.&#xA;All agent-driven work must happen in a sandbox on my own hardware.&#xA;&#xA;I&#39;m trying to learn about the factory pattern, so I actually have to build one. I could almost certainly just point Claude Code at the EYG spec and have it converge on a working interpreter, but that wouldn&#39;t teach me anything about the system that&#39;s managing the work.&#xA;&#xA;Keeping it sandboxed is a precaution against an agent hosing my home lab.&#xA;&#xA;Figuring out how to get it clean and efficient is, of course, part of the challenge.&#xA;&#xA;eyg-rs-factory is the system that tracks work, manages the agent, and validates the final product:&#xA;&#xA;I can read and write code here, including using agents to do it for me.&#xA;I can use my tools in whatever mode gets the job done.&#xA;This code can be arbitrarily janky as long as it works.&#xA;&#xA;This is where the learning happens, so it gets to be hands-on and sloppy if that&#39;s what it takes.&#xA;&#xA;I&#39;ve started building it, but it&#39;s not working yet. I&#39;ll let you know how it goes once it&#39;s closing tickets!]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:project" class="hashtag"><span>#</span><span class="p-category">project</span></a> <a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:llms" class="hashtag"><span>#</span><span class="p-category">llms</span></a> <a href="http://natknight.xyz/tag:agents" class="hashtag"><span>#</span><span class="p-category">agents</span></a></p>

<p>One of the ways that folks are leveraging LLM-powered agents to do software development is the “software factory” (or <a href="https://www.danshapiro.com/blog/2026/01/the-five-levels-from-spicy-autocomplete-to-the-software-factory/">“software dark factory”</a>) pattern, where the LLMs write all the code and the humans aren&#39;t allowed to even <em>review</em> it.</p>

<p>Apparently this works, though you need a good way to verify your product. I&#39;m <a href="https://natknight.xyz/link-how-strongdms-ai-team-build-serious-software-without-even-looking-at-the">a little skeptical</a> that it&#39;s the best way to use these tools, but it&#39;s an interesting idea, so I&#39;m going to try to build one for myself.</p>



<h2 id="the-project" id="the-project">The Project</h2>

<p>I&#39;m cheating a little bit by picking a project that&#39;s embarrassingly easy to verify: a new interpreter for an extant programming language.</p>

<p>The programming language is called <a href="https://eyg.run">EYG</a> and has many interesting and desirable properties:</p>
<ul><li>functional style + a sound type system</li>
<li>immutable dependencies</li>
<li>deterministic execution</li>
<li>the editor tooling and compiler are independent of the runtime (so I don&#39;t have to implement them!)</li></ul>

<p>Its only annoying drawback is that its interpreter is in JavaScript (compiled from Gleam, but running on Node). I&#39;d really prefer a native interpreter, or better still, a Rust library that can execute EYG code.</p>

<p>Lucky for me, I have:</p>
<ul><li>access to LLMs that can cheaply churn out code, and</li>
<li>an “oracle” that can see if my project is working properly, i.e. the existing EYG interpreter.</li></ul>

<p>So that&#39;s the project: a Rust library + easily deployable binary that can interpret EYG code.</p>

<h2 id="the-rules" id="the-rules">The Rules</h2>

<p>The project will be split into two repos, each with different rules:</p>

<p><a href="https://github.com/nathanielknight/eyg-rs">eyg-rs</a> is the actual interpreter/library:</p>
<ul><li>I&#39;m <strong>not allowed to write or review code</strong> here. I can peek in occasionally for quality control, but that should be the exception.</li>
<li>The work needs to be mediated by an <strong>automated system</strong>, not me manually driving an agent.</li>
<li>The code needs to end up <strong>correct, efficient, and clean</strong>.</li>
<li>All agent-driven work must happen <strong>in a sandbox</strong> on my own hardware.</li></ul>

<p>I&#39;m trying to learn about the factory pattern, so I actually have to <em>build</em> one. I could almost certainly just point Claude Code at the EYG spec and have it converge on a working interpreter, but that wouldn&#39;t teach me anything about the system that&#39;s managing the work.</p>

<p>Keeping it sandboxed is a precaution against an agent hosing my home lab.</p>

<p>Figuring out how to get it clean and efficient is, of course, part of the challenge.</p>

<p><a href="https://github.com/nathanielknight/eyg-rs-factory">eyg-rs-factory</a> is the system that tracks work, manages the agent, and validates the final product:</p>
<ul><li>I can read and write code here, including using agents to do it for me.</li>
<li>I can use my tools in whatever mode gets the job done.</li>
<li>This code can be <strong>arbitrarily janky</strong> as long as it works.</li></ul>

<p>This is where the learning happens, so it gets to be hands-on and sloppy if that&#39;s what it takes.</p>

<p>I&#39;ve started building it, but it&#39;s not working yet. I&#39;ll let you know how it goes once it&#39;s closing tickets!</p>
]]></content:encoded>
      <guid>http://natknight.xyz/self-hosting-a-software-factory-part-1</guid>
      <pubDate>Fri, 16 Oct 2026 21:10:18 +0000</pubDate>
    </item>
    <item>
      <title>Migrating Follows from GoToSocial to Mastodon</title>
      <link>http://natknight.xyz/migrating-follows-from-gotosocial-to-mastodon</link>
      <description>&lt;![CDATA[#selfhosting #fediverse #mastodon #gotosocial #sqlite&#xA;&#xA;This article describes how to migrate your subscriptions from GotoSocial] to [Mastodon]. I recently made this migration; I talk about my motivations [here.&#xA;&#xA;[Mastodon]: https://github.com/mastodon/mastodon&#xA;[GotoSocial]: https://docs.gotosocial.org/en/latest/&#xA;&#xA;This procedure doesn&#39;t handle getting folks over to your new account. It will get you a list of your subscriptions that you can import with Mastodon&#39;s data import feature so you don&#39;t have to re-follow everyone by hand.&#xA;&#xA;I&#39;m not aware of an account migration or user-facing data export feature in GotoSocial, so you&#39;ll need access to your instance&#39;s database (or help from someone who has it, anyways). With those caveats out of the way, here&#39;s the procedure.&#xA;&#xA;!--more--&#xA;&#xA;Extract your Subscriptions&#xA;&#xA;To get your subscriptions (or &#34;Follows&#34;, as the database calls them), you&#39;ll first need to get your user id:&#xA;&#xA;SELECT username, id&#xA;FROM accounts&#xA;WHERE username = &#39;YOURUSERNAMEHERE&#39;&#xA;&#xA;Once you&#39;ve got the id, you can plug it into the following query to get your follow list:&#xA;&#xA;SELECT&#xA;  accounts.username || &#39;@&#39; || accounts.domain&#xA;  AS &#39;Account address&#39;&#xA;FROM accounts&#xA;JOIN follows ON accounts.id = follows.targetaccountid&#xA;WHERE follows.accountid = &#39;YOURID_HERE&#39;&#xA;&#xA;You&#39;ll need the results of this query as a CSV file. There are lots of ways to do that; I used the CSV export feature built into Datasette because I was already using it to figure out the data.&#xA;&#xA;Upload to Mastodon&#xA;&#xA;Once you&#39;ve got your follows in a CSV file you should be able to import them using Mastodon&#39;s [data import feature]. It should be available on your Mastodon instance&#39;s Settings page under Import.&#xA;&#xA;[data import feature]: (https://blog.joinmastodon.org/2019/06/how-to-migrate-from-one-server-to-another/#importing-your-data)&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:fediverse" class="hashtag"><span>#</span><span class="p-category">fediverse</span></a> <a href="http://natknight.xyz/tag:mastodon" class="hashtag"><span>#</span><span class="p-category">mastodon</span></a> <a href="http://natknight.xyz/tag:gotosocial" class="hashtag"><span>#</span><span class="p-category">gotosocial</span></a> <a href="http://natknight.xyz/tag:sqlite" class="hashtag"><span>#</span><span class="p-category">sqlite</span></a></p>

<p>This article describes how to migrate your subscriptions from <a href="https://docs.gotosocial.org/en/latest/">GotoSocial</a> to <a href="https://github.com/mastodon/mastodon">Mastodon</a>. I recently made this migration; I talk about my motivations <a href="migrating-to-hachyderm.html">here</a>.</p>

<p>This procedure doesn&#39;t handle getting folks over to your new account. It will get you a list of your subscriptions that you can import with Mastodon&#39;s data import feature so you don&#39;t have to re-follow everyone by hand.</p>

<p>I&#39;m not aware of an account migration or user-facing data export feature in GotoSocial, so you&#39;ll need access to your instance&#39;s database (or help from someone who has it, anyways). With those caveats out of the way, here&#39;s the procedure.</p>



<h2 id="extract-your-subscriptions" id="extract-your-subscriptions">Extract your Subscriptions</h2>

<p>To get your subscriptions (or “Follows”, as the database calls them), you&#39;ll first need to get your user id:</p>

<pre><code class="language-sql">SELECT username, id
FROM accounts
WHERE username = &#39;YOUR_USERNAME_HERE&#39;
</code></pre>

<p>Once you&#39;ve got the <code>id</code>, you can plug it into the following query to get your follow list:</p>

<pre><code class="language-sql">SELECT
  accounts.username || &#39;@&#39; || accounts.domain
  AS &#39;Account address&#39;
FROM accounts
JOIN follows ON accounts.id = follows.target_account_id
WHERE follows.account_id = &#39;YOUR_ID_HERE&#39;
</code></pre>

<p>You&#39;ll need the results of this query as a CSV file. There are lots of ways to do that; I used the CSV export feature built into <a href="https://datasette.io/">Datasette</a> because I was already using it to figure out the data.</p>

<h2 id="upload-to-mastodon" id="upload-to-mastodon">Upload to Mastodon</h2>

<p>Once you&#39;ve got your follows in a CSV file you should be able to import them using Mastodon&#39;s data import feature. It should be available on your Mastodon instance&#39;s <code>Settings</code> page under <code>Import</code>.</p>
]]></content:encoded>
      <guid>http://natknight.xyz/migrating-follows-from-gotosocial-to-mastodon</guid>
      <pubDate>Wed, 22 Feb 2023 08:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Migrating to Hachyderm</title>
      <link>http://natknight.xyz/migrating-to-hachyderm</link>
      <description>&lt;![CDATA[#selfhosting #mastodon #fediverse #hachyderm&#xA;&#xA;As the trajectory of the bird site got clearer and nastier late last year I decided to migrate to the fediverse. I didn&#39;t want to end up on another platform controlled by a petulant tinpot dictator, so I decided to see if I could host my own [ActivityPub] server. [Mastodon] looked pretty intimidating, but [GotoSocial] is a smaller, lighter, program that (approximately) inter-operates with Mastodon (yay, federation!).&#xA;&#xA;[Mastodon]: https://github.com/mastodon/mastodon&#xA;[GotoSocial]: https://docs.gotosocial.org/en/latest/&#xA;[ActivityPub]: https://en.wikipedia.org/wiki/ActivityPub&#xA;&#xA;!--more--&#xA;&#xA;I ran that server for a couple of months, but eventually decided to shut it down and migrate to [Hachyderm.io]. I did this for a couple of reasons:&#xA;&#xA;[Hachyderm.io]: https://hachyderm.io&#xA;&#xA;GotoSocial ended up being the most resource-intensive thing running on my home-server, and the architecture of ActivityPub meant I was putting (proportionally) more load on other servers than I needed to. This isn&#39;t to say that GotoSocial was doing anything outlandish, but ActivityPub is a chatty protocol and I try to be mindful about spending compute.&#xA;&#xA;Hachyderm has an explicit governance structure, one developed by folks who know what they&#39;re doing a lot better than I do. Holding safe, communal online space seems like a really valuable skill, and I&#39;ll learn it better hanging out on a shared instance  than I will in a private silo.&#xA;&#xA;Atomizing all web hosting into parochial little home-servers isn&#39;t sustainable or desirable, and Hachyderm is a cool project blazing a different trail, so I made a donation to help pay for hosting and made the leap.&#xA;&#xA;I had accumulated a pretty lovely feed of subscriptions, and that kept me locked in for a while, but the beauty of self-hosting is that I had the SQLite database with all my data in it, so I was able to figure out a procedure for migrating (which is described here).&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:mastodon" class="hashtag"><span>#</span><span class="p-category">mastodon</span></a> <a href="http://natknight.xyz/tag:fediverse" class="hashtag"><span>#</span><span class="p-category">fediverse</span></a> <a href="http://natknight.xyz/tag:hachyderm" class="hashtag"><span>#</span><span class="p-category">hachyderm</span></a></p>

<p>As the trajectory of the bird site got clearer and nastier late last year I decided to migrate to the fediverse. I didn&#39;t want to end up on another platform controlled by a petulant tinpot dictator, so I decided to see if I could host my own <a href="https://en.wikipedia.org/wiki/ActivityPub">ActivityPub</a> server. <a href="https://github.com/mastodon/mastodon">Mastodon</a> looked pretty intimidating, but <a href="https://docs.gotosocial.org/en/latest/">GotoSocial</a> is a smaller, lighter, program that (approximately) inter-operates with Mastodon (yay, federation!).</p>



<p>I ran that server for a couple of months, but eventually decided to shut it down and migrate to <a href="https://hachyderm.io">Hachyderm.io</a>. I did this for a couple of reasons:</p>
<ul><li><p>GotoSocial ended up being the most resource-intensive thing running on my home-server, and the architecture of ActivityPub meant I was putting (proportionally) more load on other servers than I needed to. This isn&#39;t to say that GotoSocial was doing anything outlandish, but ActivityPub is a chatty protocol and I try to be mindful about spending compute.</p></li>

<li><p>Hachyderm has an explicit <a href="https://nivenly.org/">governance structure</a>, one developed by folks who know what they&#39;re doing a lot better than I do. Holding safe, communal online space seems like a really valuable skill, and I&#39;ll learn it better hanging out on a shared instance  than I will in a private silo.</p></li></ul>

<p>Atomizing all web hosting into parochial little home-servers isn&#39;t sustainable or desirable, and Hachyderm is a cool project blazing a different trail, so I made a donation to help pay for hosting and made the leap.</p>

<p>I had accumulated a pretty lovely feed of subscriptions, and that kept me locked in for a while, but the beauty of self-hosting is that I had the SQLite database with all my data in it, so I was able to figure out a procedure for migrating (which is described <a href="/migrating-follows-from-gotosocial-to-mastodon">here</a>).</p>
]]></content:encoded>
      <guid>http://natknight.xyz/migrating-to-hachyderm</guid>
      <pubDate>Wed, 22 Feb 2023 08:00:00 +0000</pubDate>
    </item>
    <item>
      <title>A TiddlyWiki Server in Rust</title>
      <link>http://natknight.xyz/a-tiddlywiki-server-in-rust</link>
      <description>&lt;![CDATA[#tiddlywiki #rust #selfhosting #release&#xA;&#xA;I just published the first (v0.1.0) release of tiddly-wiki-server, which implements the TiddlyWiki WebServer API in Rust using Axum, SerDe, and TiddlyWiki.&#xA;&#xA;!--more--&#xA;&#xA;Motivation&#xA;&#xA;One might ask why a new TiddlyWiki server is necessary, since&#xA;&#xA;TiddlyWiki5 includes a first-party NodeJS web server, and&#xA;one of TiddlyWiki&#39;s beautiful features is that it works as as static HTML file.&#xA;&#xA;These are valid points. I confess, this project fulfills quite a narrow use case: I like to self-host my tools on a small, cheap VPS, and the first-party NodeJS server consumes about 100MB of RAM. This isn&#39;t huge, but it&#39;s a decent chunk of my available resources. This server consumes much less (about 10MB, and that&#39;s before I&#39;ve done anything to optimize it).&#xA;&#xA;This was also a project that let me combine two technologies that I like an awful lot, so if it seems self-indulgent, well... maybe it is. &#xA;&#xA;Components&#xA;&#xA;The server makes use of some very nice Crates; I&#39;ll mention some of the big ones:&#xA;&#xA;dl&#xA;dt&#xA;  a href=&#34;https://crates.io/crates/axum&#34;axum/a, a web framework&#xA;/dt&#xA;dd&#xA;I&#39;ve tried a number of Rust web frameworks (Tide, Rocket, simple-http-server); this one&#39;s the first one I feel like I really understood and was productive with (though that might also just be that I&#39;m slowly getting better at Rust). Of particular note is that Axum is compatible with a href=&#34;https://crates.io/crates/tower-http&#34;tower-http/a , so many services and middlewares that you might want already exist.&#xA;/dd&#xA;&#xA;dt&#xA;  a href=&#34;https://crates.io/crates/rusqlite&#34;rusqlite/a, a SQLite binding/a&#xA;/dt&#xA;dd&#xA;I use SQLite for most of my tiny side projects; this one&#39;s no exception. The TiddlyWiki back end mostly treats tiddlers as opaque bags of objects, so the database is little more than a key-value store.&#xA;/dd&#xA;&#xA;dt&#xA;  a href=&#34;https://crates.io/crates/serdejson&#34;serdejson/a, a loosely-typed JSON interface&#xA;/dt&#xA;dd&#xA;If you&#39;re reading about Rust you&#39;re probably familiar with serde, but since I wanted to retain TiddlyWiki&#39;s fairly open schema I needed an ergonomic way to work with un-typed JSON objects.&#xA;/dd&#xA;&#xA;/dl&#xA;&#xA;Future Work&#xA;&#xA;There are lots of ways this project could be added or improved:&#xA;&#xA;More testing; I want this server to be feature-compatible with the first party server.&#xA;User authentication and access control&#xA;Streaming large responses to keep memory small&#xA;&#xA;If any of that sounds interesting to you, pull requests and bug reports are very much welcome!&#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="http://natknight.xyz/tag:tiddlywiki" class="hashtag"><span>#</span><span class="p-category">tiddlywiki</span></a> <a href="http://natknight.xyz/tag:rust" class="hashtag"><span>#</span><span class="p-category">rust</span></a> <a href="http://natknight.xyz/tag:selfhosting" class="hashtag"><span>#</span><span class="p-category">selfhosting</span></a> <a href="http://natknight.xyz/tag:release" class="hashtag"><span>#</span><span class="p-category">release</span></a></p>

<p>I just published the first (v0.1.0) release of <a href="https://github.com/nathanielknight/tiddly-wiki-server">tiddly-wiki-server</a>, which implements the <a href="https://tiddlywiki.com/#WebServer%20API">TiddlyWiki WebServer API</a> in Rust using Axum, SerDe, and TiddlyWiki.</p>



<h2 id="motivation" id="motivation">Motivation</h2>

<p>One might ask why a new TiddlyWiki server is necessary, since</p>
<ul><li>TiddlyWiki5 includes a first-party NodeJS web server, and</li>
<li>one of TiddlyWiki&#39;s beautiful features is that it works as as static HTML file.</li></ul>

<p>These are valid points. I confess, this project fulfills quite a narrow use case: I like to self-host my tools on a small, cheap VPS, and the first-party NodeJS server consumes about 100MB of RAM. This isn&#39;t huge, but it&#39;s a decent chunk of my available resources. This server consumes much less (about 10MB, and that&#39;s before I&#39;ve done anything to optimize it).</p>

<p>This was also a project that let me combine two technologies that I like an awful lot, so if it seems self-indulgent, well... maybe it is.</p>

<h2 id="components" id="components">Components</h2>

<p>The server makes use of some very nice Crates; I&#39;ll mention some of the big ones:</p>

<dl>
<dt>
  <a href="https://crates.io/crates/axum">axum</a>, a web framework
</dt>
<dd>
I&#39;ve tried a number of Rust web frameworks (Tide, Rocket, simple-http-server); this one&#39;s the first one I feel like I really understood and was productive with (though that might also just be that I&#39;m slowly getting better at Rust). Of particular note is that Axum is compatible with <a href="https://crates.io/crates/tower-http">tower-http</a> , so many services and middlewares that you might want already exist.
</dd>

<dt>
  <a href="https://crates.io/crates/rusqlite">rusqlite</a>, a SQLite binding</a>
</dt>
<dd>
I use SQLite for most of my tiny side projects; this one&#39;s no exception. The TiddlyWiki back end mostly treats tiddlers as opaque bags of objects, so the database is little more than a key-value store.
</dd>

<dt>
  <a href="https://crates.io/crates/serde_json">serde_json</a>, a loosely-typed JSON interface
</dt>
<dd>
If you&#39;re reading about Rust you&#39;re probably familiar with serde, but since I wanted to retain TiddlyWiki&#39;s fairly open schema I needed an ergonomic way to work with un-typed JSON objects.
</dd>

</dl>

<h2 id="future-work" id="future-work">Future Work</h2>

<p>There are lots of ways this project could be added or improved:</p>
<ul><li>More testing; I want this server to be feature-compatible with the first party server.</li>
<li>User authentication and access control</li>
<li>Streaming large responses to keep memory small</li></ul>

<p>If any of that sounds interesting to you, pull requests and bug reports are very much welcome!</p>
]]></content:encoded>
      <guid>http://natknight.xyz/a-tiddlywiki-server-in-rust</guid>
      <pubDate>Mon, 27 Jun 2022 07:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>