<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Caddy on Miek Gieben</title>
    <link>https://miek.nl/tags/caddy/</link>
    <description>Recent content in Caddy on Miek Gieben</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>© Copyright 2007-2024 Miek Gieben</copyright>
    <lastBuildDate>Fri, 18 Mar 2016 20:50:21 +0000</lastBuildDate>
    <atom:link href="https://miek.nl/tags/caddy/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Announcing CoreDNS</title>
      <link>https://miek.nl/2016/march/18/announcing-coredns/</link>
      <pubDate>Fri, 18 Mar 2016 20:50:21 +0000</pubDate>
      <guid>https://miek.nl/2016/march/18/announcing-coredns/</guid>
      <description>&lt;p&gt;After some soul searching and help on twitter, I settled on &amp;ldquo;CoreDNS&amp;rdquo; as&#xA;a name &lt;a href=&#34;https://miek.nl/2016/march/14/first-light/&#34;&gt;for my Caddy fork&lt;/a&gt;.&#xA;CoreDNS, as it is just a shell to run middleware.&lt;/p&gt;&#xA;&lt;p&gt;The code is up on &lt;a href=&#34;https://github.com/miekg/coredns&#34;&gt;Github.com&lt;/a&gt;. A little warning: The zone&#xA;implementation is poor, the current middleware is lightly tested, etc., etc. The one thing it does&#xA;well is chaining the middleware, currently implemented:&lt;/p&gt;&#xA;&lt;dl&gt;&#xA;&lt;dt&gt;errors:&lt;/dt&gt;&#xA;&lt;dd&gt;log errors, not tested, it compiles, no idea if it actually works.&lt;/dd&gt;&#xA;&lt;dt&gt;log:&lt;/dt&gt;&#xA;&lt;dd&gt;same story as &lt;code&gt;errors.&lt;/code&gt;&lt;/dd&gt;&#xA;&lt;dt&gt;proxy:&lt;/dt&gt;&#xA;&lt;dd&gt;proxy request to a remote server, works, although flaky (prolly).&lt;/dd&gt;&#xA;&lt;dt&gt;prometheus:&lt;/dt&gt;&#xA;&lt;dd&gt;metrics; works. Not tested (i.e. full scraping with Prometheus).&lt;/dd&gt;&#xA;&lt;dt&gt;reflect:&lt;/dt&gt;&#xA;&lt;dd&gt;reflection service whenever you query for &lt;code&gt;who.&amp;lt;domain&amp;gt;&lt;/code&gt;. Mainly used&#xA;for testing.&lt;/dd&gt;&#xA;&lt;dt&gt;rewrite:&lt;/dt&gt;&#xA;&lt;dd&gt;can rewrite types in the request. Lightly tested.&lt;/dd&gt;&#xA;&lt;dt&gt;file:&lt;/dt&gt;&#xA;&lt;dd&gt;horrendous implementation that sort of works (some of the time).&lt;/dd&gt;&#xA;&lt;dt&gt;etcd:&lt;/dt&gt;&#xA;&lt;dd&gt;etcd backend (ala &lt;a href=&#34;https://github.com/skynetservices/skydns/&#34;&gt;SkyDNS&lt;/a&gt;): not implemented.&lt;/dd&gt;&#xA;&lt;/dl&gt;&#xA;&lt;p&gt;Also the tests don&amp;rsquo;t compile :) This seems like a large list, but it is mostly fixing&#xA;the details (a proper zone implementation will take some time though). In other words:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Caddy DNS update</title>
      <link>https://miek.nl/2016/march/17/caddy-dns-update/</link>
      <pubDate>Thu, 17 Mar 2016 22:13:29 +0000</pubDate>
      <guid>https://miek.nl/2016/march/17/caddy-dns-update/</guid>
      <description>&lt;p&gt;More &lt;a href=&#34;https://miek.nl/2016/march/14/first-light/&#34;&gt;light&lt;/a&gt;!&lt;/p&gt;&#xA;&lt;p&gt;My &amp;ldquo;Port Caddy to be a DNS server&amp;rdquo;-project is alive and kicking. Code will be published soon-ish,&#xA;mostly waiting for actually naming the bloody thing. Code is also littered with TODOs.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve implemented the following middlewares, the all need tests and actual use, but here we go:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;log&lt;/code&gt;, for logging (as in Caddy)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;error&lt;/code&gt;, for error logging (as in Caddy). These both include the &lt;code&gt;{{placeholder}}&lt;/code&gt; syntax, so you&#xA;can use &lt;code&gt;{{port}}&lt;/code&gt; and even &lt;code&gt;{&amp;gt;}&lt;/code&gt; for logging header bits.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;file&lt;/code&gt;, really, really stupid zone file backed zone implementation, more a proof of concept&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;reflect&lt;/code&gt;, reflect (test) middleware&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;proxy&lt;/code&gt;, proxy requests to an upstream nameserver/resolver&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I also want to add a &lt;code&gt;rewrite&lt;/code&gt; middleware that will, for instance, rewrite ANY queries to HINFO&#xA;ones.&lt;/p&gt;</description>
    </item>
    <item>
      <title>First Light</title>
      <link>https://miek.nl/2016/march/14/first-light/</link>
      <pubDate>Mon, 14 Mar 2016 21:31:01 +0000</pubDate>
      <guid>https://miek.nl/2016/march/14/first-light/</guid>
      <description>&lt;p&gt;So I &lt;a href=&#34;https://miek.nl/2016/march/10/caddy-dns/&#34;&gt;did fork Caddy&lt;/a&gt;, and converted it into&#xA;something that almost resembles a DNS server.&lt;/p&gt;&#xA;&lt;p&gt;This is Caddy DNS (need an name!) without any configuration, i.e. an empty Caddyfile.&#xA;It will then fallback and be a reflection server (couldn&amp;rsquo;t think of something better&amp;hellip;). It will&#xA;respond to queries that ask for &lt;code&gt;who.&amp;lt;name&amp;gt;&lt;/code&gt; and will respond with your IP, port and transport.&lt;/p&gt;&#xA;&lt;p&gt;So the &lt;a href=&#34;https://en.wikipedia.org/wiki/First_light_%28astronomy%29&#34;&gt;first light&lt;/a&gt; query and answer would&#xA;be:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;dig @localhost -p 1053 A who.miek.nl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 62561&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;; QUESTION SECTION:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;who.miek.nl.&#x9;&#x9;&#x9;IN&#x9;A&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;; ANSWER SECTION:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;who.miek.nl.&#x9;&#x9;0&#x9;IN&#x9;AAAA&#x9;::1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;;; ADDITIONAL SECTION:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;who.miek.nl.&#x9;&#x9;0&#x9;IN&#x9;TXT&#x9;&amp;#34;Port: 1234 (udp)&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And slightly later with the port number properly fixed:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Caddy DNS</title>
      <link>https://miek.nl/2016/march/10/caddy-dns/</link>
      <pubDate>Thu, 10 Mar 2016 21:41:08 +0000</pubDate>
      <guid>https://miek.nl/2016/march/10/caddy-dns/</guid>
      <description>&lt;p&gt;Lately I&amp;rsquo;m thinking to use &lt;a href=&#34;https://github.com/miekg/dns&#34;&gt;Go DNS&lt;/a&gt; to create a DNS server that is&#xA;completely modelled after &lt;a href=&#34;https://caddyserver.com&#34;&gt;Caddy&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There is no code and no name, nothing. Just an idea.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So this magical new DNS server would be billed similar to Caddy, which has the tag line &amp;ldquo;Serve The&#xA;Web Like It&amp;rsquo;s 2016&amp;rdquo;. Caddy for instance will &lt;em&gt;automatically&lt;/em&gt; fetch certs from &lt;a href=&#34;https://letsencrypt.org/&#34;&gt;Let&amp;rsquo;s&#xA;Encrypt&lt;/a&gt; and configure HTTP/2 and HTTPS. In the case of a DNS server that&#xA;would translate to good core functionally, support for DNSSEC and key rotation, ala &lt;a href=&#34;https://www.knot-dns.cz/&#34;&gt;Knot&#xA;DNS&lt;/a&gt;. Also note that now that DNS over TLS is&#xA;a &lt;a href=&#34;https://datatracker.ietf.org/doc/draft-ietf-dprive-dns-over-tls/&#34;&gt;thing&lt;/a&gt; one could even image&#xA;this server &lt;em&gt;doing the exact same thing as Caddy&lt;/em&gt; and automatically getting certs from Let&amp;rsquo;s&#xA;Encrypt. Same thing for the above mentioned DNSSEC key maintenance, &lt;code&gt;&amp;lt;unamed server&amp;gt;&lt;/code&gt; will take care&#xA;of it. (This is a non-trivial amount of work, I might add)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Enable Prometheus metrics in Caddy</title>
      <link>https://miek.nl/2016/march/02/enable-prometheus-metrics-in-caddy/</link>
      <pubDate>Wed, 02 Mar 2016 07:53:58 +0000</pubDate>
      <guid>https://miek.nl/2016/march/02/enable-prometheus-metrics-in-caddy/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://caddyserver.com/&#34;&gt;Caddy webserver&lt;/a&gt; is a modern webserver written in Go.&#xA;I like it because I can easily extend it by writing some middleware (in&#xA;Go). One of the things missing is&#xA;&lt;a href=&#34;https://github.com/mholt/caddy/issues/577&#34;&gt;metrics&lt;/a&gt;, which prompted me&#xA;to implement &lt;a href=&#34;https://github.com/miekg/caddy-prometheus/&#34;&gt;enough metrics&lt;/a&gt; to make me happy.&lt;/p&gt;&#xA;&lt;p&gt;Using this is relatively straight forward, but you&amp;rsquo;ll need to compile Caddy yourself and add this&#xA;middleware.&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup&#34;&gt;Setup&lt;/h2&gt;&#xA;&lt;p&gt;(Assuming you have Go installed), first get the goodies:&lt;/p&gt;&#xA;&lt;dl&gt;&#xA;&lt;dt&gt;Caddy:&lt;/dt&gt;&#xA;&lt;dd&gt;&lt;code&gt;go get github.com/mholt/caddy&lt;/code&gt;&lt;/dd&gt;&#xA;&lt;dt&gt;Caddyext:&lt;/dt&gt;&#xA;&lt;dd&gt;This is needed to compile in the new middleware, &lt;code&gt;go get github.com/caddyserver/caddyext&lt;/code&gt;&lt;/dd&gt;&#xA;&lt;dt&gt;Caddy-prometheus:&lt;/dt&gt;&#xA;&lt;dd&gt;&lt;code&gt;go get github.com/miekg/caddy-prometheus&lt;/code&gt;&lt;/dd&gt;&#xA;&lt;/dl&gt;&#xA;&lt;p&gt;Then, with &lt;code&gt;caddyext&lt;/code&gt; register the new middleware:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
