<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Gatsby RSS Feed]]></title><description><![CDATA[Savin' it up for Friday night]]></description><link>https://www.papascott.de</link><generator>GatsbyJS</generator><lastBuildDate>Tue, 08 Nov 2022 19:43:27 GMT</lastBuildDate><item><title><![CDATA[papascott.de is now scotthanson.de]]></title><description><![CDATA[I'm rebranding! I'm now using my name as my digital identity. "PapaScott" arose from a whim when I started my blog on edithispage.com in…]]></description><link>https://www.papascott.de/archives/2021/12/14/papascott-de-is-now-scotthanson-de/</link><guid isPermaLink="false">https://www.papascott.de/archives/2021/12/14/papascott-de-is-now-scotthanson-de/</guid><pubDate>Tue, 14 Dec 2021 12:09:09 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;m rebranding! I&apos;m now using my name as my digital identity.&lt;/p&gt;
&lt;p&gt;&quot;PapaScott&quot; arose from a whim when I &lt;a href=&quot;https://www.papascott.de/archives/1999/12/05/it-worked/&quot;&gt;started my blog&lt;/a&gt; on &lt;a href=&quot;http://scripting.com/davenet/1999/12/08/editthispagecom.html&quot;&gt;edithispage.com&lt;/a&gt; in December 1999, since we were going to become parents that very month. My wife and I were calling each other PapaScott and MamaMaus, as silly expectant parents will do. I ended up using PapaScott as my handle for most services when signing up.&lt;/p&gt;
&lt;p&gt;I&apos;ve been changing my handles to &lt;a href=&quot;https://twitter.com/ScottHansonDE&quot;&gt;&quot;ScottHansonDE&quot;&lt;/a&gt; over the past few months. I&apos;ve been reviving my blog over the past few weeks, and I&apos;ve done the same here. The new blog has a new &lt;a href=&quot;https://github.com/yinkakun/eleventy-duo&quot;&gt;design&lt;/a&gt; (&lt;a href=&quot;https://yinkakun.vercel.app/&quot;&gt;thanks yinka!&lt;/a&gt;) and a new back end (&lt;a href=&quot;https://www.11ty.dev/&quot;&gt;eleventy&lt;/a&gt;). I&apos;ve put my posts from 2021 there to get started. So from now on follow me on &lt;a href=&quot;https://scotthanson.de&quot;&gt;scotthanson.de&lt;/a&gt;, if you like!&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Use Caddy to map HTTPS to PagePark]]></title><description><![CDATA[I've started a GitHub repository at papascott/DrummerNotes for my notes and code about Drummer. I'm cross-posting my first note on using…]]></description><link>https://www.papascott.de/archives/2021/11/30/use-caddy-to-map-https-to-pagepark/</link><guid isPermaLink="false">https://www.papascott.de/archives/2021/11/30/use-caddy-to-map-https-to-pagepark/</guid><pubDate>Tue, 30 Nov 2021 10:15:11 GMT</pubDate><content:encoded>&lt;p&gt;&lt;i&gt;I&apos;ve started a GitHub repository at &lt;a href=&quot;https://github.com/papascott/DrummerNotes&quot;&gt;papascott/DrummerNotes&lt;/a&gt; for my notes and code about Drummer. I&apos;m cross-posting my first note on &lt;a href=&quot;https://github.com/papascott/DrummerNotes/blob/main/caddy.md&quot;&gt;using Caddy with PagePark&lt;/a&gt; here. &lt;a href=&quot;https://github.com/scripting/pagePark&quot;&gt;PagePark&lt;/a&gt; is a&quot;simple Node.js folder-based HTTP server that serves static and dynamic pages for domains&quot;. It isn&apos;t about Drummer per se, but would be a possible path for &lt;a href=&quot;http://scripting.com/drummer/blog/2021/11/14/145810.html?title=pageparkUsersASimplerPathToHttps&quot;&gt;Drummer itself to run under HTTPS&lt;/a&gt;. This post is also a test of uploading Markdown from Drummer directly to a Gatsby blog. &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://caddyserver.com/&quot;&gt;Caddy&lt;/a&gt; is a very easy way to implement HTTPS for your PagePage domains. It is a web server that can do &lt;a href=&quot;https://caddyserver.com/docs/automatic-https&quot;&gt;automatic HTTPS&lt;/a&gt;, automatically provisioning TLS certificates (from &lt;a href=&quot;https://letsencrypt.org/&quot;&gt;Let&apos;s Encrypt&lt;/a&gt;) for a domain and keep them renewed. It can even obtain TLS certificates on demand for your PagePark domains, without out having to configure the domains in Caddy.&lt;/p&gt;
&lt;h2&gt;How to&lt;/h2&gt;
&lt;p&gt;Here is an example of setting up Caddy on an existing PagePark installation on a Digital Ocean server running Ubuntu (assuming you have domains in your domains folder and have &lt;a href=&quot;https://github.com/scripting/pagePark#mapping-port-80-to-1339&quot;&gt;mapped port 80 to PagePark&lt;/a&gt; using iptables as in the instructions).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the official Caddy package für Ubuntu &lt;a href=&quot;https://caddyserver.com/docs/install#debian-ubuntu-raspbian&quot;&gt;per their instructions&lt;/a&gt;.  This automatically starts and runs Caddy as a systemd service.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open the Caddy configuration file in the nano editor with &lt;code&gt;sudo nano /etc/caddy/Caddyfile&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Replace the entire contents with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  on_demand_tls {
    ask http://localhost:1339/isdomainvalid
    interval 2m
    burst    5
  }
}
https:// {
  tls {
    on_demand
  }
  reverse_proxy localhost:1339
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart the Caddy service with &lt;code&gt;sudo service caddy restart&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test https for one of your domains in the terminal with curl: e.g. &lt;code&gt;curl https://www.example.com&lt;/code&gt;. This first time it will take several seconds for Caddy to request and obtain a certificate. It may even fail the first time, but then try again. The content of the index page of your domain should be printed to the terminal. That means it works!&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This configuration means that both HTTP (over iptables) and HTTPS (over Caddy) will work for your domains!&lt;/p&gt;
&lt;h2&gt;Further cases and questions&lt;/h2&gt;
&lt;h3&gt;Running Caddy without iptables mapping&lt;/h3&gt;
&lt;p&gt;If you have not mapped port 80 to PagePark, the configuration above will also listen to port 80 and redirect HTTP requests to HTTPS.&lt;/p&gt;
&lt;p&gt;If you&apos;d rather not redirect port 80, you can add a section for HTTP and disable redirects like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
  auto_https disable_redirects
  on_demand_tls {
    ask http://localhost:1339/isdomainvalid
    interval 2m
    burst    5
  }
}
http:// {
  reverse_proxy localhost:1339
}
https:// {
  tls {
    on_demand
  }
  reverse_proxy localhost:1339
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Removing iptables mapping so Caddy can handle HTTP&lt;/h3&gt;
&lt;p&gt;To delete an iptables rule you have to know the rule number. You can list the nat rules with&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo iptables -t nat -v -L -n --line-number&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The output will look something like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/papascott/image/upload/v1637840426/TujSanB1nu0Bdelbge96Lr4UlGgFO7jV6D5Jc9VX.jpg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;The number in front of the rule is the rule number. To delete these two rules, we need two commands&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo iptables -t nat -D PREROUTING 1
sudo iptables -t nat -D OUTPUT 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(changing the 1 at the end if your rule number is different).&lt;/p&gt;
&lt;h3&gt;What are the &apos;ask&apos;, &apos;interval&apos; and &apos;burst&apos; in the configuration?&lt;/h3&gt;
&lt;p&gt;They are for security purposes. They limit certificate requests to only domains configured in PagePage, and limits the rate of those requests. Otherwise an attacker can bombard your server with certificate requests for domains you don&apos;t even serve.&lt;/p&gt;
&lt;h3&gt;What about default domains?&lt;/h3&gt;
&lt;p&gt;Domains that are not explicitly in the domains directory will not be served automatic certificates. You can check the &lt;a href=&quot;https://caddyserver.com/docs/&quot;&gt;Caddy documentation&lt;/a&gt; for adding domains explicitly to the Caddy configuration.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Push an Outline with Github Actions]]></title><description><![CDATA[I've never worked with Github Actions before, but when thinking about how to push an outline from Drummer to GitHub I thought I'd take a…]]></description><link>https://www.papascott.de/archives/2021/11/05/push-an-outline-with-github-actions/</link><guid isPermaLink="false">https://www.papascott.de/archives/2021/11/05/push-an-outline-with-github-actions/</guid><pubDate>Fri, 05 Nov 2021 10:00:23 GMT</pubDate><content:encoded>&lt;p&gt;I&apos;ve never worked with &lt;a href=&quot;https://github.com/features/actions&quot;&gt;Github Actions&lt;/a&gt; before, but when thinking about how to push an outline from Drummer to GitHub I thought I&apos;d take a look.&lt;/p&gt;
&lt;p&gt;Actions are in &lt;a href=&quot;https://yaml.org/&quot;&gt;YAML&lt;/a&gt; files saved in a special directory &lt;code&gt;.github/workflows&lt;/code&gt;in your repository. They can run when something happens in the repository (like a push or a pull request) or can be triggered externally (with an &lt;a href=&quot;https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event&quot;&gt;API call&lt;/a&gt;). The action starts a virtual machine, runs commands, then shuts down.&lt;/p&gt;
&lt;p&gt;Fetching an outline from Drummer and committing it to the repository was pretty easy...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;name: fetch-opml
on: [workflow_dispatch]
jobs:
  fetch-opml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - shell: bash
          run: |
            git config --global user.name &quot;GitHub Action&quot;
            git config --global user.email &quot;papascott@gmail.com&quot;
            curl http://drummer.scripting.com/ScottHansonDE/papascott-de.opml -o papascott-de.opml
            git add papascott-de.opml
            git commit -m &quot;Fetched at `date`&quot; --allow-empty
            git push origin main
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;NB: This post was written in Markdown, not Drummer, since I don&apos;t know yet how to render code blocks from OPML. &lt;em&gt;Still diggin&apos;!&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Correction: Do NOT hide your secrets in the root outline]]></title><description><![CDATA[Correction 13 November: you shouldn't use this for real secrets, since the root outline is not really hidden or secure. But for global…]]></description><link>https://www.papascott.de/archives/2021/11/03/correction-do-not-hide-your-secrets-in-the-root-outline/</link><guid isPermaLink="false">https://www.papascott.de/archives/2021/11/03/correction-do-not-hide-your-secrets-in-the-root-outline/</guid><pubDate>Wed, 03 Nov 2021 10:37:27 GMT</pubDate><content:encoded>&lt;p&gt;Correction 13 November: you shouldn&apos;t use this for real secrets, since the root outline is not really hidden or secure. But for global variables that you don&apos;t mind having exposed it should be OK. &lt;i&gt;Caveat emptor!&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;My video demo yesterday revealed the URL of my Netlify build hook for all to see. It&apos;s now been changed, but I need not have revealed. &lt;a href=&quot;http://docserver.scripting.com/drummer/about.opml&quot;&gt;Drummer&lt;/a&gt; has a &lt;a href=&quot;http://docserver.scripting.com/drummer/scripting.opml#1629216924000&quot;&gt;root outline &lt;/a&gt;where global variables can be defined.&lt;/p&gt;
&lt;p&gt;So in the root outIine I can create an &lt;code&gt;env&lt;/code&gt; object, and define an entry for &lt;code&gt;netlifyBuildHook&lt;/code&gt; for the URL. (You have to &lt;a href=&quot;http://docserver.scripting.com/drummer/scripting.opml#1629218924000&quot;&gt;use proper JavaScript object syntax&lt;/a&gt;, with brackets, colons and quotes.)&lt;/p&gt;
&lt;p&gt;The xhr.open line of my build script can then be &lt;br /&gt;&lt;code&gt;xhr.open(&quot;POST&quot;, root.env.netlifyBuildHook, true);&lt;/code&gt;&lt;br /&gt; without revealing the actual URL.&lt;/p&gt;</content:encoded></item><item><title><![CDATA[Video Demo of Posting to Gatsby]]></title><description><![CDATA[Dave Winer asked me to make a quick video of how it looks for a user to post to Gatsby from Drummer. I'm more than happy to oblige!]]></description><link>https://www.papascott.de/archives/2021/11/02/video-demo-of-posting-to-gatsby/</link><guid isPermaLink="false">https://www.papascott.de/archives/2021/11/02/video-demo-of-posting-to-gatsby/</guid><pubDate>Tue, 02 Nov 2021 07:43:48 GMT</pubDate><content:encoded>&lt;p&gt;Dave Winer asked me to make a quick video of how it looks for a user to post to Gatsby from Drummer. I&apos;m more than happy to oblige!&lt;/p&gt;
&lt;iframe width=&quot;701&quot; height=&quot;388&quot; src=&quot;https://www.youtube.com/embed/9Y4cn-GPamY&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;</content:encoded></item></channel></rss>