<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>I think you made a wrong turn somewhere...</title>
  <subtitle>Personal development blog for a somewhat intelligent but not that intelligent coder trying making a living by coding but sometimes not knowing what I&apos;m coding but somehow also get the job done.</subtitle>
  <link href="https://www.jerhemy.com/feed.xml" rel="self" type="application/atom+xml"/>
  <link href="https://www.jerhemy.com/" rel="alternate" type="text/html"/>
  <updated>2026-11-16T03:47:19+00:00</updated>
  <id>https://www.jerhemy.com/</id>
  <author>
    <name>Jerhemy Waldon</name>
  </author>
  <entry>
    <title type="html">RunCS: a scratchpad for C#</title>
    <link href="https://www.jerhemy.com/article/2026/11/15/introducing-runcs/" rel="alternate" type="text/html" title="RunCS: a scratchpad for C#"/>
    <published>2026-11-15T07:00:00+00:00</published>
    <updated>2026-11-15T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2026/11/15/introducing-runcs/</id>
    <summary type="html">RunCS is a small desktop app for trying out C#. Code on the left, output on the right, and no project file in sight.</summary>
    <content type="html">&lt;p&gt;I love &lt;a href=&quot;https://runjs.app/&quot;&gt;RunJS&lt;/a&gt;. When I want to check how a bit of JavaScript behaves, I open it, type, and the answer is right there beside the code. No project, no setup, no ceremony. I wanted exactly that for C#, and I couldn’t find it.&lt;/p&gt;

&lt;p&gt;The options I looked at each missed in a different direction. &lt;a href=&quot;https://github.com/tareqimbasher/NetPad&quot;&gt;NetPad&lt;/a&gt; is a capable tool, but it’s far more than I needed for a quick check. &lt;a href=&quot;https://dotnetfiddle.net/&quot;&gt;.NET Fiddle&lt;/a&gt; is the opposite: it’s web based and does too little, without the editor features and packages I’d want once a test grows past a few lines. I wanted something in between, a small desktop app that opens fast and does the common things well.&lt;/p&gt;

&lt;p&gt;So I built RunCS, a desktop scratchpad for C#. You type code on the left, press &lt;strong&gt;Ctrl+Enter&lt;/strong&gt;, and the output shows up on the right. No solution, no project file, no &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Program.cs&lt;/code&gt; boilerplate: just the code you wanted to try.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/runcs/run.png&quot; alt=&quot;The RunCS window: a short C# script on the left that groups words by length, and its output on the right. The last line is a bare expression, and its value, 5, appears in the output labelled L10.&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;built-on-file-based-apps&quot;&gt;Built on file-based apps&lt;/h2&gt;

&lt;p&gt;.NET 10 added file-based apps: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet run hello.cs&lt;/code&gt; runs a single &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.cs&lt;/code&gt; file with no project around it. That’s what made RunCS small enough to be worth building. Every run is a plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet run yourfile.cs&lt;/code&gt;, so anything a file-based app supports works in RunCS too, including NuGet packages pulled in with a directive at the top of the file:&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Humanizer&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2.14&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Humanizer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;&quot;RunCS_is_a_scratchpad&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;Humanize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Because a script is just a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.cs&lt;/code&gt; file, nothing is locked inside RunCS. Save it, and you can run it from a terminal, check it into a repo, or hand it to someone who has never heard of RunCS.&lt;/p&gt;

&lt;h2 id=&quot;seeing-values-without-consolewriteline&quot;&gt;Seeing values without Console.WriteLine&lt;/h2&gt;

&lt;p&gt;The feature I use most: a top-level expression shows its value. A line like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Add(2, 3);&lt;/code&gt; or just &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;total;&lt;/code&gt; prints its result in the output pane, tagged with the line it came from. Assignments, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;void&lt;/code&gt; calls and un-awaited tasks stay quiet.&lt;/p&gt;

&lt;p&gt;For values deeper in the code there are &lt;strong&gt;log points&lt;/strong&gt;. Click the strip left of the line numbers (or press &lt;strong&gt;F9&lt;/strong&gt;) to drop a diamond on a line, and on the next run that line reports what it did:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Line&lt;/th&gt;
      &lt;th&gt;Shows&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;var x = ...;&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x = ...;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the variable’s new value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;an expression or call&lt;/td&gt;
      &lt;td&gt;its value&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;return ...;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the value returned&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;if (...)&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;while (...)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;whether the test was true&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;foreach&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;for&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the loop variable, each time round&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a method with a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;{ }&lt;/code&gt; body&lt;/td&gt;
      &lt;td&gt;the arguments of each call&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a method written with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;=&amp;gt;&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;what it returns&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Log points never touch your script. RunCS compiles a temporary copy beside it with the logging added, and deletes the copy when the run ends.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/runcs/logpoints.png&quot; alt=&quot;A script with blue diamonds beside five line numbers. The output lists what each of those lines produced: the arguments of a method call, a test that was false, a returned value, and a running total from inside a loop, each labelled with its line number.&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;an-editor-that-knows-c&quot;&gt;An editor that knows C#&lt;/h2&gt;

&lt;p&gt;RunCS uses Roslyn for IntelliSense: a completion list as you type, parameter hints after &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;,&lt;/code&gt;, type and documentation on hover, and error squiggles while you type. Types from a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:package&lt;/code&gt; line get completion too, once the package has been downloaded.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/runcs/intellisense.png&quot; alt=&quot;A completion list open after typing words.Mi, offering Min and MinBy, with the signature and summary of Min shown beside it.&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Compile errors show up in the editor rather than the output pane: a red badge beside the line number and a squiggle under the code. A crash marks the line it came from the same way, with its stack trace left in the output.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/runcs/errors.png&quot; alt=&quot;A line that assigns a string to an int, with a red badge in the margin, a red underline, and a popup reading CS0029: cannot implicitly convert type string to int.&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;packages-and-settings&quot;&gt;Packages and settings&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ctrl+P&lt;/strong&gt; opens the Packages window: search every feed, double-click to add a package to the script, add a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.nupkg&lt;/code&gt; from a link or a file, or add a GitHub Packages feed. Feeds live in RunCS’s own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nuget.config&lt;/code&gt;, so your machine-wide NuGet sources are neither used nor changed, and the packages scripts pull in are kept in their own folder, apart from your global cache.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ctrl+,&lt;/strong&gt; opens Script settings: Native AOT, nullable reference types, implicit usings, unsafe code, warnings as errors, the C# language version, console or web project, and any other MSBuild property, plus the switch for showing top-level values. Each build setting is saved as a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:property&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:sdk&lt;/code&gt; line at the top of the file and hidden from the editor, so the settings travel with the script without cluttering it.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/runcs/settings.png&quot; alt=&quot;The Script settings window, with checkboxes for Native AOT, nullable reference types, implicit usings, unsafe code and warnings as errors, choices for language version and project type, and a switch for showing the value of top-level expressions.&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;the-little-things&quot;&gt;The little things&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Tabs, with &lt;strong&gt;Ctrl+T&lt;/strong&gt; / &lt;strong&gt;Ctrl+W&lt;/strong&gt;, and open tabs come back next time.&lt;/li&gt;
  &lt;li&gt;New tabs live in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.runcs&lt;/code&gt; until you save them somewhere.&lt;/li&gt;
  &lt;li&gt;With several .NET SDKs installed, pick which one runs your scripts from the toolbar.&lt;/li&gt;
  &lt;li&gt;One Run/Stop button: a green arrow while idle, a red square while running (&lt;strong&gt;Shift+F5&lt;/strong&gt; to stop).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A couple of honest limits: scripts run with your own permissions, with no sandbox, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Console.ReadLine()&lt;/code&gt; returns &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;null&lt;/code&gt; because there’s no input box.&lt;/p&gt;

&lt;h2 id=&quot;how-its-built&quot;&gt;How it’s built&lt;/h2&gt;

&lt;p&gt;RunCS is about 5,000 lines of C#, and most of it is glue between a few good libraries.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The window&lt;/strong&gt; is &lt;a href=&quot;https://avaloniaui.net/&quot;&gt;Avalonia&lt;/a&gt; 11, so the same app runs on Windows, Linux and macOS. The editor is AvaloniaEdit, with TextMate grammars for syntax highlighting.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;IntelliSense&lt;/strong&gt; comes from Roslyn. RunCS keeps the script in an in-memory Roslyn workspace, parsed with the option that accepts file-based apps’ &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:&lt;/code&gt; lines, and asks it for completions, parameter hints, hover text and errors as you type. It points Roslyn at the reference assemblies of the SDK that will actually run the script, so what the editor tells you matches what the compiler will say.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Running&lt;/strong&gt; is just the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet&lt;/code&gt; CLI: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet run yourfile.cs&lt;/code&gt;, with output streamed back into the right-hand pane. When you pick an SDK, RunCS calls that SDK’s own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet.dll&lt;/code&gt; directly, which pins it no matter which one &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dotnet&lt;/code&gt; would choose.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Values without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Console.WriteLine&lt;/code&gt;&lt;/strong&gt; work by compiling a rewritten copy of the script. RunCS finds the top-level expressions and log points, wraps each one in a call to a small helper class appended to the end of the file, and writes the result between marker characters. The output pane picks the markers out of the stream, which can arrive split across chunks, and pins each value to its line. Every insertion goes inside an existing line, so line numbers in errors and stack traces still match your code.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Settings and packages&lt;/strong&gt; are plain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:property&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:sdk&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;#:package&lt;/code&gt; lines in the file. RunCS hides the settings lines from the editor and edits them through the Script settings window, and restores packages through its own &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nuget.config&lt;/code&gt; so your machine-wide NuGet setup is never touched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Releases are built by GitHub Actions: changing the version in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.csproj&lt;/code&gt; and pushing to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;main&lt;/code&gt; builds Windows, Linux and macOS packages and attaches them to a new GitHub release.&lt;/p&gt;

&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;/h2&gt;

&lt;p&gt;RunCS needs the .NET 10 SDK. Downloads for Windows, Linux and macOS are on the &lt;a href=&quot;https://github.com/jerhemy/RunCS/releases&quot;&gt;releases page&lt;/a&gt;, and there’s more on the &lt;a href=&quot;https://jerhemy.github.io/RunCS/&quot;&gt;RunCS website&lt;/a&gt;.&lt;/p&gt;</content>
    <category term="csharp"/>
    <category term="dotnet"/>
    <category term="avalonia"/>
    <category term="roslyn"/>
    <category term="tools"/>
    <category term="runcs"/>
  </entry>
  <entry>
    <title type="html">The Afterburner Engine: an overview</title>
    <link href="https://www.jerhemy.com/article/2026/11/13/introducing-afterburner-engine/" rel="alternate" type="text/html" title="The Afterburner Engine: an overview"/>
    <published>2026-11-13T07:00:00+00:00</published>
    <updated>2026-11-13T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2026/11/13/introducing-afterburner-engine/</id>
    <summary type="html">A look at the Afterburner Engine, the C++ game engine and studio behind Secrets of Wyrdmar, and what it can do so far.</summary>
    <content type="html">&lt;p&gt;This whole thing started small. Honest. I wanted to build something like the Daggerfall engine, using the tricks games leaned on back in the day: a 3D world full of flat sprites that turn to face you, so the NPCs look 3D right up until you think about it too hard. I built it, and it was cool.&lt;/p&gt;

&lt;p&gt;Then I made the mistake of asking a question: how hard could it be to add real 3D models? (Famous last words.) That worked, so naturally I asked another one, and then another. Every answer came with two new questions attached, and somewhere along the way my little side project quietly stopped being little.&lt;/p&gt;

&lt;p&gt;The funny part is that none of this was supposed to be an engine. I just wanted to make a fantasy game. But making a game means doing the same tedious things over and over, and I’m a programmer, so instead of doing them I built tools to do them for me. Then, looking at the pile of tools, one more question: could this run other games too?&lt;/p&gt;

&lt;p&gt;Somewhere in the middle of all that, I remembered there was supposed to be a game. I threw darts at a board of words and they landed on &lt;strong&gt;Secrets of Wyrdmar&lt;/strong&gt;. As you can tell, I suck at naming things. By then the idea had outgrown “Daggerfall clone” and turned into a fantasy project inspired by Daggerfall, EverQuest and Ultima Online. If you recognise all three, congratulations: we’re both old.&lt;/p&gt;

&lt;p&gt;So that’s how we got here. The &lt;strong&gt;Afterburner Engine&lt;/strong&gt; is the C++ engine that powers Secrets of Wyrdmar, and &lt;strong&gt;Afterburn Studio&lt;/strong&gt; is the editor where its world, items, spells, NPCs and quests get made. This post is the grand tour of what’s in it so far.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/afterburner/title-screen.webp&quot; alt=&quot;The Secrets of Wyrdmar title screen: a cloaked warrior on a cliff looks out over a sea with sailing ships, an airship and a walled city, with the game&apos;s logo above menu buttons for Play, Join Game, Host Game, Settings and Quit.&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;engine-and-game-kept-apart&quot;&gt;Engine and game, kept apart&lt;/h2&gt;

&lt;p&gt;Confession: it wasn’t always like this. For a while the engine and the game were one big tangle, and it was already turning into a nightmare by the time I caught it. Pulling them apart early is one of the best calls I’ve made on this project, if only because future me would have come looking for present me otherwise. These days the code builds as a stack of static libraries, and each one may only use the ones beneath it:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Library&lt;/th&gt;
      &lt;th&gt;What’s in it&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;afterburner_core&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;assets (sprites, 3D models and animations, CPU side only) and the world: maps, streaming, overworld, sea, buildings, dungeons&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;afterburner&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the rest of the engine: rendering and audio&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wyrdmar_content&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the game’s data: items, spells, NPCs, quests, dialog&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wyrdmar_sim&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the game’s rules and simulation, with nothing that draws or plays a sound&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wyrdmar_net&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the multiplayer transport&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;wyrdmar_game&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;the game’s looks: first-person view, UI, in-game editor&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A check script runs in CI and fails the build if the engine ever includes game code, or the content includes the game. Keeping the simulation free of rendering means a dedicated server can link it on its own.&lt;/p&gt;

&lt;p&gt;The real goal is simple: when I eventually get distracted by the next shiny idea, the engine should come along for the ride without dragging Wyrdmar behind it. The engine half never includes anything from the game, so reusing it for something else later should be a lot less painful. Hopefully. Ask me again in a year.&lt;/p&gt;

&lt;h2 id=&quot;built-with&quot;&gt;Built with&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;C++&lt;/strong&gt; with &lt;strong&gt;CMake&lt;/strong&gt; and &lt;strong&gt;Ninja&lt;/strong&gt;; Visual Studio on Windows, no Xcode needed for Mac builds.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;SDL3&lt;/strong&gt; for windows, input and loading OpenGL at runtime.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;OpenGL 3.3&lt;/strong&gt; for rendering.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ENet&lt;/strong&gt; for networking, &lt;strong&gt;SQLite&lt;/strong&gt; for saves.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Dear ImGui&lt;/strong&gt; (docking branch) for Afterburn Studio.&lt;/li&gt;
  &lt;li&gt;GitHub Actions builds Windows, macOS (universal) and Linux on every push.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;the-world&quot;&gt;The world&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;One big overworld&lt;/strong&gt; of continents, oceans, lakes and rivers, streamed in chunks on a background thread as you move.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Towns, castles and buildings&lt;/strong&gt; made from house templates, with walls, towers, gatehouses, round rooms and curved or diagonal walls.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Dungeons&lt;/strong&gt; built from modules, plus hand-made static dungeons.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Forests&lt;/strong&gt;, including the elves’ treetop town.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Props and furniture&lt;/strong&gt; with levels of detail.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;rendering&quot;&gt;Rendering&lt;/h2&gt;

&lt;p&gt;Each loaded chunk is turned into 3D triangles and drawn with OpenGL 3.3. (An early software raycaster has since been removed.)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Materials&lt;/strong&gt; with albedo, height, normal and alpha maps, shine, and a PBR material library.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Culling&lt;/strong&gt; against the view and the fog, with care not to drop anything that would change the picture (skylines, lit windows at night). In a town it cuts the triangles drawn by 45-75%.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A sky&lt;/strong&gt; with two layers of stars, the Milky Way, and a moon that goes through its phases and lights the land to match.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Time of day&lt;/strong&gt;, lights and fog.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Particle effects&lt;/strong&gt; for spells, fire and weather.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;weather-seasons-and-the-sea&quot;&gt;Weather, seasons and the sea&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Weather&lt;/strong&gt; by region and climate: rain, storms and snow that settles on the ground, roofs and walls after a few cold days.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Seasons&lt;/strong&gt;: autumn colours, falling leaves, bare winter branches, pines that stay green.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Waves and storms at sea.&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Ships&lt;/strong&gt; built from sections laid end to end (stern, middle, bow), with decks, holds and rooms you can walk, plus &lt;strong&gt;airships&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;audio&quot;&gt;Audio&lt;/h2&gt;

&lt;p&gt;The engine has its own small audio stack with no sound fonts or extra libraries for music:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A &lt;strong&gt;MIDI player&lt;/strong&gt; with a built-in synthesiser for background music.&lt;/li&gt;
  &lt;li&gt;Music per screen, ambience, and sound effects (decoded from files or synthesised).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;afterburn-studio&quot;&gt;Afterburn Studio&lt;/h2&gt;

&lt;p&gt;This is the pile of tools from the intro, all in one window. Afterburn Studio is docked and tabbed like a desktop editor and styled after Unity’s dark skin, and every tool is a page that keeps what you were doing while you look at another.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/afterburner/afterburn-studio.webp&quot; alt=&quot;Afterburn Studio&apos;s start page: a Tools panel down the left grouped into World, Assets, Data and Game, and a description of each tool beside its button.&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;The tools come in four groups:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;World:&lt;/strong&gt; the world editor for the overworld (continents, seas, rivers, props, people and portals), buildings, dungeon modules, hand-made dungeons, traps and textures.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Assets:&lt;/strong&gt; character models, 3D sprites, equipment models, a keyframe animation editor, doors, static models, item icons, and the game’s UI skin, windows and font. Even the game’s UI windows are built here rather than in code.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Data:&lt;/strong&gt; items, spells, abilities, dialog (a node graph), quests, creatures, encounters, NPCs and particle effects.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Game:&lt;/strong&gt; races, classes, skills, stats, factions, levels, camps, death and the rest of the rules that make it Wyrdmar.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The game has editors of its own too: the house editor (F4) and the dungeon workshop (F3) run inside the game itself.&lt;/p&gt;

&lt;h2 id=&quot;multiplayer&quot;&gt;Multiplayer&lt;/h2&gt;

&lt;p&gt;Multiplayer is still a work in progress, but progress is being made. Slowly, the way all good netcode is made: one desync at a time. You can already spot it peeking out of the title screen, in the Join Game and Host Game buttons.&lt;/p&gt;

&lt;p&gt;The plan is an authoritative server: it owns the truth, and each client predicts its own movement and quietly corrects itself when the server disagrees. A lot of the groundwork is already in:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;The simulation is its own library&lt;/strong&gt;, with nothing that draws, plays a sound or opens a window, so a headless server can run it alone.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Connections run over ENet&lt;/strong&gt;, with a handshake that checks the protocol and game versions, a hash of the game’s content, the server password and the player’s key.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;LAN discovery&lt;/strong&gt;, so games on your network show up without typing in an address.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A network-conditions simulator&lt;/strong&gt; (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--net-lag&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--net-jitter&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--net-loss&lt;/code&gt;), so I can find out how badly things break on a terrible connection without needing a terrible connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;tools-for-testing&quot;&gt;Tools for testing&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;An &lt;strong&gt;admin console&lt;/strong&gt; in debug builds for jumping around, spawning items, setting weather and seasons.&lt;/li&gt;
  &lt;li&gt;A &lt;strong&gt;test mode&lt;/strong&gt; that runs scripted keys and takes screenshots, used for checking changes and render timings.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--render-stats&lt;/code&gt; for frame times, GPU time and triangle counts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;whats-next&quot;&gt;What’s next&lt;/h2&gt;

&lt;p&gt;More questions, probably. My desk is covered in post-it notes with ideas on them: finishing multiplayer, pets, dungeon instances, moving platforms, and a level of detail for the ground so distant hills stop eating the frame budget. And, someday, an actual release.&lt;/p&gt;

&lt;p&gt;If you want to follow along, &lt;a href=&quot;https://wyrdmar.com&quot;&gt;wyrdmar.com&lt;/a&gt; is where Secrets of Wyrdmar lives, with news from the workshop as things land.&lt;/p&gt;</content>
    <category term="cpp"/>
    <category term="gamedev"/>
    <category term="opengl"/>
    <category term="sdl3"/>
    <category term="cmake"/>
    <category term="game-engine"/>
    <category term="afterburner"/>
  </entry>
  <entry>
    <title type="html">Notfi Tunnels: self-hosted tunnels to your local services</title>
    <link href="https://www.jerhemy.com/article/2026/11/06/introducing-notfi-tunnels/" rel="alternate" type="text/html" title="Notfi Tunnels: self-hosted tunnels to your local services"/>
    <published>2026-11-06T07:00:00+00:00</published>
    <updated>2026-11-06T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2026/11/06/introducing-notfi-tunnels/</id>
    <summary type="html">Notfi Tunnels gives a web app on your laptop, an SSH port on a field device, or a service inside your app a public address, on a server you run yourself.</summary>
    <content type="html">&lt;p&gt;I like &lt;a href=&quot;https://ngrok.com/&quot;&gt;ngrok&lt;/a&gt;. Run one command and the app on your laptop has a public URL you can send to a client, point a webhook at, or open on your phone. What I didn’t like was paying for it. The features I actually wanted, like addresses that don’t change every time and more than a tunnel or two, sit behind a subscription.&lt;/p&gt;

&lt;p&gt;I wanted an ngrok I didn’t need to pay for. I already had a server, and the core idea isn’t magic, so I built my own.&lt;/p&gt;

&lt;p&gt;As for the name: Notfi is “notify” with a couple of letters squeezed out. Naming things is hard, and dropping vowels is a time-honoured shortcut. You say it “No-T-Fi”.&lt;/p&gt;

&lt;p&gt;Notfi Tunnels gives something running on your own machine a public address. It works for a web app on your laptop, an SSH port on a device out in the field, or a service inside your own app. It runs on a server you control, and one command opens a tunnel:&lt;/p&gt;

&lt;div class=&quot;language-text highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ notfi-tunnel http 3000
Signed in as &apos;alice&apos;
Inspector:  http://127.0.0.1:4040/?key=Qm9…
Forwarding: https://vya6ib2n.tunnels.notfi.io -&amp;gt; http://localhost:3000   [http-3000]
00:21:28.654  GET     /api/orders                                        200      39 ms
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;what-it-does&quot;&gt;What it does&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;HTTP(S) tunnels&lt;/strong&gt;, routed by subdomain, including WebSockets, streaming and large uploads.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Raw TCP tunnels&lt;/strong&gt; for SSH, databases and anything else that speaks TCP.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;A request inspector&lt;/strong&gt; at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost:4040&lt;/code&gt; with a live request list, headers and bodies, replay, and copy as curl.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Automatic reconnects&lt;/strong&gt; that keep the same address. The server holds a random address for its owner for 15 minutes after the tunnel drops, so nobody else gets it in the meantime.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Fixed subdomains&lt;/strong&gt; assigned to an account, so &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--subdomain myapp&lt;/code&gt; works for you and is refused for everyone else.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Several tunnels at once&lt;/strong&gt; from a config file with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notfi-tunnel start tunnels.json&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Self-updating client&lt;/strong&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notfi-tunnel update&lt;/code&gt; checks the download against the release’s checksums and test-runs the new executable before swapping it in.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;how-it-works&quot;&gt;How it works&lt;/h2&gt;

&lt;p&gt;The client only ever makes outbound connections, so it works from behind NAT and corporate firewalls. Rather than build a stream multiplexer, I gave each proxied connection its own connection back to the server:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The client opens a long-lived &lt;strong&gt;control connection&lt;/strong&gt; and signs in with its token.&lt;/li&gt;
  &lt;li&gt;It asks for a tunnel, and the server registers a subdomain (or a TCP port) and replies with the public URL.&lt;/li&gt;
  &lt;li&gt;When a public request arrives, the server sends a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dial&lt;/code&gt; message down the control connection.&lt;/li&gt;
  &lt;li&gt;The client opens a &lt;strong&gt;new connection&lt;/strong&gt; for it, joins it to the session, and from then on that connection carries raw bytes both ways.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Frames on the control connection are a 4-byte length followed by JSON. The client sends a heartbeat every 15 seconds, and either side drops the session after 45 seconds of silence.&lt;/p&gt;

&lt;p&gt;The part I’m happiest with is the HTTP side on the server. &lt;a href=&quot;https://github.com/dotnet/yarp&quot;&gt;YARP&lt;/a&gt; forwards each request through an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HttpMessageInvoker&lt;/code&gt; that belongs to the tunnel, and its &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ConnectCallback&lt;/code&gt; hands back a dialled-back data connection instead of a socket. That one hook gives HTTP/1.1 keep-alive pooling, WebSocket upgrades, HTTP/2 on the public side and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;X-Forwarded-*&lt;/code&gt; headers without any extra code.&lt;/p&gt;

&lt;p&gt;On the client, HTTP data connections are spliced into a loopback Kestrel server that records each request for the inspector, then forwards it to your app with YARP. TCP connections go straight to the target.&lt;/p&gt;

&lt;h2 id=&quot;the-web-ui&quot;&gt;The web UI&lt;/h2&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/notfi-tunnels/dashboard-tunnels.png&quot; alt=&quot;The Notfi Tunnels web UI: the Your tunnels page, with counters for open tunnels, requests and traffic, and a card for each connected client showing its tunnels and their throughput.&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;The server has a web UI at its root domain, written in React and TypeScript. People see their live tunnels with request and traffic counters and a throughput graph, open a tunnel or show its QR code, browse their history, and manage their token and fixed subdomains. Admins get an overview with daily charts, every live session and device (with a disconnect button), users, subdomains, all history, and an activity log of sign-ins and changes. It has light and dark themes.&lt;/p&gt;

&lt;p&gt;Accounts are email based. An admin invites someone by email, and they choose their own password. Each account has one token for its clients and devices. Only hashes are stored, plus the token encrypted with the server’s master key so its owner can see it again with their password. Admins can replace a token but never see it.&lt;/p&gt;

&lt;h2 id=&quot;devices-open-a-tunnel-only-when-you-need-it&quot;&gt;Devices: open a tunnel only when you need it&lt;/h2&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/notfi-tunnels/dashboard-devices.png&quot; alt=&quot;The Devices page of the Notfi Tunnels web UI, listing connected devices and the services each one offers.&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Run the client as an agent on a device, and nothing is exposed until someone asks for it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;notfi-tunnel agent &lt;span class=&quot;nt&quot;&gt;--service&lt;/span&gt; tcp:22 &lt;span class=&quot;nt&quot;&gt;--service&lt;/span&gt; http:8080 &lt;span class=&quot;nt&quot;&gt;--name&lt;/span&gt; gateway-01
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The agent keeps one outbound connection open and sends a tiny keepalive every minute, a few hundred bytes an hour. On the &lt;strong&gt;Devices&lt;/strong&gt; page the device’s owner or an admin picks a service and a time limit, from 15 minutes to 24 hours or none, and clicks &lt;strong&gt;Open&lt;/strong&gt;. The device opens that tunnel itself, and the server closes it when the time is up. The device decides what can be opened: only the services it lists are offered.&lt;/p&gt;

&lt;p&gt;The point of agent mode is to set a computer up once and be able to reach it whenever it’s running. On Linux the installer sets the agent up as a systemd service (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo sh install.sh --agent&lt;/code&gt;), so it starts with the machine, connects on its own, and runs as its own unprivileged user in a sandbox.&lt;/p&gt;

&lt;h2 id=&quot;tunnels-inside-your-app&quot;&gt;Tunnels inside your app&lt;/h2&gt;

&lt;p&gt;For .NET apps there’s a NuGet package, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Notfi.Tunnels.Client&lt;/code&gt;, so the app can host the tunnel itself with no separate process to spawn:&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Notfi.Tunnels.Client&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tunnel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;await&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NotfiTunnel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;StartHttpAsync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NotfiTunnelOptions&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Token&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;token&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tunnel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PublicUrl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;   &lt;span class=&quot;c1&quot;&gt;// https://k3j9x0ab.tunnels.notfi.io&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;tunnel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;RequestCompleted&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;LogInformation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{Method} {Path} -&amp;gt; {Status}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Method&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The tunnel reconnects by itself after that. For anything that isn’t .NET, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;notfi-tunnel http 3000 --json&lt;/code&gt; prints one JSON event per line on stdout, so any language can drive it.&lt;/p&gt;

&lt;h2 id=&quot;built-with&quot;&gt;Built with&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;.NET 10&lt;/strong&gt;, with &lt;strong&gt;Kestrel&lt;/strong&gt; and &lt;strong&gt;YARP&lt;/strong&gt; for the server and the client.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;EF Core&lt;/strong&gt; on &lt;strong&gt;SQLite&lt;/strong&gt; or &lt;strong&gt;PostgreSQL&lt;/strong&gt;, with migrations for both.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;React&lt;/strong&gt; and &lt;strong&gt;TypeScript&lt;/strong&gt; (Vite) for the web UI.&lt;/li&gt;
  &lt;li&gt;End-to-end tests that run the server, the client and a backend in one process.&lt;/li&gt;
  &lt;li&gt;Deployment as a systemd service or in Docker on any Linux server, with a step-by-step guide for DigitalOcean.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;try-it&quot;&gt;Try it&lt;/h2&gt;

&lt;p&gt;Clients for Windows, Linux and macOS are on the &lt;a href=&quot;https://github.com/jerhemy/notfi-tunnels/releases/latest&quot;&gt;releases page&lt;/a&gt;. The hosted server at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tunnels.notfi.io&lt;/code&gt; is in a closed beta for now while I test everything out, but I may open it up later.&lt;/p&gt;

&lt;p&gt;As for what’s next for Notfi Tunnels? Whatever tickles my fancy I guess…&lt;/p&gt;</content>
    <category term="dotnet"/>
    <category term="aspnetcore"/>
    <category term="yarp"/>
    <category term="networking"/>
    <category term="self-hosted"/>
    <category term="react"/>
    <category term="notfi-tunnels"/>
  </entry>
  <entry>
    <title type="html">Secure Docker Management with Traefik, Portainer and LetsEncrypt</title>
    <link href="https://www.jerhemy.com/article/2021/08/17/setup-traefik-portainer-letsencrypt/" rel="alternate" type="text/html" title="Secure Docker Management with Traefik, Portainer and LetsEncrypt"/>
    <published>2021-08-17T07:00:00+00:00</published>
    <updated>2021-08-17T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2021/08/17/setup-traefik-portainer-letsencrypt/</id>
    <summary type="html">How to use Traefik, Portainer, LetsEncrypt and DigitalOcean to manage and secure your docker containers.</summary>
    <content type="html">&lt;p&gt;I recently picked up a ‘renewed’ &lt;a href=&quot;https://www.amazon.com/High-End-Dell-PowerEdge-R720-2-60Ghz/dp/B075Z3F37Z&quot;&gt;Dell Poweredge R720&lt;/a&gt;
because a colleague had gotten one and been telling me about his setup. He was running ESXi and was running multiple
services through Traefik and since I wanted to set up a couple of services for myself (Wiki.js, GitLab, and Jenkins) decided
to copy his setup. Over a couple of days, we went back and forth with him helping me get the initial setup running and working
through issues, and me sharing some additional configurations to make the overall process easier to setup. In the end,
we came up with a pretty robust and secure configuration.&lt;/p&gt;

&lt;p&gt;In the end of this, you will have robust and easy method to deploy and manage new containers, which will automatically
be configured with SSL certificate provided by LetsEncrypt and be accessible via your specified domain.&lt;/p&gt;

&lt;p&gt;This specific implementation is running on a private server on a home network, but can be easily applied to a DigitalOcean
droplet.&lt;/p&gt;

&lt;h1 id=&quot;requirements&quot;&gt;Requirements&lt;/h1&gt;
&lt;hr /&gt;
&lt;ol&gt;
  &lt;li&gt;Ubuntu Server 20.04&lt;/li&gt;
  &lt;li&gt;pfSense 2.7.0 Appliance routing your network (&lt;a href=&quot;https://www.amazon.com/Qotom-Q555G6-S05-Qotom-Industrial-Barebone-Computer/dp/B07KLZJBSZ/ref=sr_1_11?dchild=1&amp;amp;keywords=pfsense&amp;amp;qid=1629252137&amp;amp;sr=8-11&amp;amp;th=1&quot;&gt;I currently use this from Amazon&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;Docker&lt;/li&gt;
  &lt;li&gt;Own the domain that you plan on using&lt;/li&gt;
  &lt;li&gt;Domain’s DNS servers are set up to use &lt;a href=&quot;https://www.digitalocean.com/&quot;&gt;DigitalOcean&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;A DigitalOcean API Key&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;what-is-traefik&quot;&gt;What is Traefik&lt;/h1&gt;
&lt;hr /&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;a href=&quot;#traefik-image&quot;&gt;
        &lt;img src=&quot;/assets/img/traefik-portainer/traefik-flow.png&quot; alt=&quot;Package Manager&quot; /&gt;
    &lt;/a&gt;
&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Traefik is a leading modern reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates 
with your existing infrastructure components and configures itself automatically and dynamically.&lt;/p&gt;

  &lt;p&gt;Traefik is designed to be as simple as possible to operate, but capable of handling large, highly-complex deployments 
across a wide range of environments and protocols in public, private, and hybrid clouds. It also comes with a powerful 
set of middlewares that enhance its capabilities to include load balancing, API gateway, orchestrator ingress, as well 
as east-west service communication and more. &lt;a href=&quot;#1&quot;&gt;[1]&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It also provides a useful dashboard for monitoring and debugging routes and services registered with the traefik service.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/traefik-portainer/traefik-dashboard.png&quot; alt=&quot;Package Manager&quot; /&gt;
&lt;/p&gt;

&lt;h1 id=&quot;what-is-portainer&quot;&gt;What is Portainer&lt;/h1&gt;
&lt;hr /&gt;

&lt;blockquote&gt;
  &lt;p&gt;Portainer is an open source tool for managing containerized applications. It works with Kubernetes, Docker, Docker Swarm, 
Azure ACI in both data centres and at the edge.
Portainer removes the complexity associated with orchestrators so anyone can manage containers. It can be used to 
deploy and manage applications, observe the behavior of containers and provide the security and governance necessary 
to deploy containers widely. &lt;a href=&quot;#2&quot;&gt;[2]&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/traefik-portainer/portainer-dashboard.png&quot; alt=&quot;Package Manager&quot; /&gt;
&lt;/p&gt;

&lt;h1 id=&quot;getting-started&quot;&gt;Getting Started&lt;/h1&gt;
&lt;hr /&gt;
&lt;h3 id=&quot;install-docker&quot;&gt;Install Docker&lt;/h3&gt;

&lt;p&gt;First, update your existing list of packages:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to install a few prerequisite packages which let apt use packages over HTTPS:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt install apt-transport-https ca-certificates curl software-properties-common&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then add the GPG key for the official Docker repository:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add the Docker repository to APT sources:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable&quot;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Update the package database with the Docker packages from the repository we just added:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Make sure you are about to install from the Docker repository otherwise we will get it from the default Ubuntu repository:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-cache policy docker-ce&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We should get something similar to the output below:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Output of apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 5:19.03.9~3-0~ubuntu-focal
Version table:
5:19.03.9~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, install Docker:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo apt install docker-ce&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;With everything completed, we should have Docker installed and can check the status:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl status docker&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Which should output something similar:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-05-19 17:00:41 UTC; 17s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 24321 (dockerd)
Tasks: 8
Memory: 46.4M
CGroup: /system.slice/docker.service
└─24321 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;creating-the-docker-compose-file&quot;&gt;Creating the Docker Compose file&lt;/h3&gt;
&lt;p&gt;Lets start by setting up our skeleton &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker-compose.yml&lt;/code&gt; file.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;3.3&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;traefik&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;traefik:v2.4&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;traefik&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This sets up the image and the container name for Traefik as well as its restart policy.&lt;/p&gt;

&lt;h4 id=&quot;network&quot;&gt;Network&lt;/h4&gt;
&lt;hr /&gt;

&lt;p&gt;We will need to define a network that allows Traefik to proxy to all of our other containers. Because these containers will
not be exposed on their own, every container that Traefik will route to needs to use this network.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;traefik-network&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;ports&quot;&gt;Ports&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;Here we define what ports Traefik will listen on. Even though we will only be using https, we still listen on port 80 to
respond to http requests and forward them to https.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;80:80&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;443:443&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;environments&quot;&gt;Environments&lt;/h3&gt;
&lt;hr /&gt;

&lt;p&gt;There are a couple of ways to set up the API token for DigitalOcean. This way is the most secure especially when using
Portainer as you would be able to see the API Key in plan text when looking at the container settings. Once obtaining a
API Key from DigitalOcean, you would place it in a file named ` digitalocean_api_key` in the same directory as your
docker-compose file.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;digitalocean_api_key&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DO_AUTH_TOKEN_FILE=/run/secrets/digitalocean_api_key&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;digitalocean_api_key&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./digitalocean_api_key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you create the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;digitalocean_api_key&lt;/code&gt; file and then &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$ sudo chmod 600&lt;/code&gt; you will additionally secure the
api key from any other users on the computer.&lt;/p&gt;

&lt;p&gt;The simpler but less secure way is to just add a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DO_AUTH_TOKEN&lt;/code&gt; key and value.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;DO_AUTH_TOKEN=&amp;lt;key&amp;gt;&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you do use this method, be aware that anyone with access to the Portainer dashboard will be able to see this key
in the containers’ configuration window.&lt;/p&gt;

&lt;h3 id=&quot;volumes&quot;&gt;Volumes&lt;/h3&gt;
&lt;hr /&gt;

&lt;p&gt;Not much to mention here, each of these volumes is bound to the Traefik container to facilitate automatic discovery
of new containers, store Traefik specific data and LetsEncrypt certificates.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/localtime:/etc/localtime:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./letsencrypt:/letsencrypt&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/run/docker.sock:/var/run/docker.sock:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./traefik-data/traefik.yml:/traefik.yml:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./traefik-data/acme.json:/acme.json\&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;command&quot;&gt;Command&lt;/h3&gt;
&lt;hr /&gt;

&lt;p&gt;These lines set up a couple of things, the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;api.dashboard&lt;/code&gt; command will enabled the dashboard so we can see the routes t
hat have been configured.&lt;/p&gt;

&lt;p&gt;The provider options allow us to define additional Traefik routing for non-docker container services. This give you the
ability to have traefik secure and route to an existing service on your network.&lt;/p&gt;

&lt;h4 id=&quot;traefik-providers-settings&quot;&gt;Traefik Providers settings&lt;/h4&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--api.dashboard=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.docker=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.directory=/dynamic&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.watch=true&quot;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;strong&gt;entrypoints&lt;/strong&gt; commands define the different protocols that we want the services to use. In this case, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;web&lt;/code&gt; and
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;websecure&lt;/code&gt; will be used when defining other containers to specify the ports to route too.&lt;/p&gt;

&lt;h4 id=&quot;setup-entry-points&quot;&gt;Setup Entry Points&lt;/h4&gt;
&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;      &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.address=:80&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.to=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.scheme=https&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.websecure.address=:443&quot;&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;letsencrypt-options&quot;&gt;LetsEncrypt Options&lt;/h4&gt;

&lt;p&gt;Finally we want to setup LetsEncrypt.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;This defines DigitalOcean as the provider we want LetsEncrypt to use to verify domain ownership.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;delaybeforecheck&lt;/strong&gt; does exactly what it says, and will provide a delay between the resolver making the update
to your DNS records and LetsEncrypt verifying that the records have been added.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Email that you wish too received renewal notices from LetsEncrypt&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Where we will store the LetsEncrypt data&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;What DNS servers LetsEncrypt should use when verifying DNS verification. Without this, you may run into issues
where it is using your local DNS cache and not find the records correctly.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;      &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=digitalocean&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.delaybeforecheck=0&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.email=admin@example.com&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All together we should end up with something like this,&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--api.dashboard=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.docker=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.directory=/dynamic&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.watch=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.docker.exposedbydefault=false&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--serversTransport.insecureSkipVerify=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.address=:80&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.to=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.scheme=https&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.websecure.address=:443&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=digitalocean&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.delaybeforecheck=0&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.email=admin@example.com&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;labels&quot;&gt;Labels&lt;/h1&gt;

&lt;p&gt;This line sets up the user credentials to log into the Traefik dashboard. There isn’t much you can do in the interface
but it is a good place to start if you are having issues resolving a host.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;...&lt;/span&gt;
      &lt;span class=&quot;s&quot;&gt;- &quot;traefik.http.middlewares.api-auth.basicauth.users=user:pass&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To get the password hash use the following. You will need to install &lt;strong&gt;apache2-utils&lt;/strong&gt; to be able to use this command.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    $ sudo apt install apache2-utils
    $ htpasswd -n username
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The other options are pretty straight forward and the only other thing to change is the &lt;strong&gt;Host&lt;/strong&gt; to be whatever URL you
want to be able to access the Traefik dashboard (ie. traefik.example.com)&lt;/p&gt;

&lt;p&gt;All together we should end up with something like this,&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.enable=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.api-auth.basicauth.users=user:pass&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.entrypoints=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.rule=Host(`traefik.domain.tld`)&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.tls=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.tls.certresolver=letsencrypt&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.service=api@internal&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.middlewares=secured&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.traefik-redirect-web-secure.redirectscheme.scheme=https&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.secured.chain.middlewares=traefik-redirect-web-secure,api-auth&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;network-setup&quot;&gt;Network Setup&lt;/h1&gt;
&lt;hr /&gt;

&lt;p&gt;Both my colleague and I run a pfSense appliance for our network and it provides a very convenient way to route all domain
traffic to a specific IP without having to set up a separate DNS server.&lt;/p&gt;

&lt;p&gt;In your pfSense dashboard you will want to go to Services -&amp;gt; DNS Resolver and near the bottom, you will find an area
labeled &lt;strong&gt;Custom options&lt;/strong&gt;. If you don’t see that, look for the &lt;strong&gt;Display Custom Options&lt;/strong&gt; button to toggle them on.&lt;/p&gt;

&lt;p&gt;In the Custom options text field, you will want to enter the following&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;server:
local-zone: &quot;example.com&quot; redirect
local-data: &quot;example.com 3600 IN A &amp;lt;ip addr of docker server&amp;gt;&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;dynamic-traefik-routes-optional&quot;&gt;Dynamic Traefik Routes (optional)&lt;/h1&gt;
&lt;hr /&gt;

&lt;p&gt;Another great feature of Traefik is dynamic routes. When you run docker-compose, Traefik will create a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dyanmic&lt;/code&gt; folder
setup by these lines in our config.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.directory=/dynamic&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.watch=true&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;this tells Traefik to look in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dynamic&lt;/code&gt; folder for any route files, and load them on the fly.  By placing a 
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;service-name.yaml&lt;/code&gt; file in this directory, you can specify an external service that is running on the network to route
through Traefik and still get a valid certificate.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;http&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;routers&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;to-demo-service&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;                      &lt;span class=&quot;c1&quot;&gt;# this is the label for the router&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;rule&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Host(`service.domain.tld`)&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;demo-service&lt;/span&gt;               &lt;span class=&quot;c1&quot;&gt;# this needs to match the name defined under `services`&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;entryPoints&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;https&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;tls&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;certResolver&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;letsencrypt&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;demo-service&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;                         &lt;span class=&quot;c1&quot;&gt;# this needs to match the name defined under `routers`&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;loadBalancer&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;servers&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http://[ip&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;address]&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once you’ve added the file, you will be able to go into your Traefik dashboard and see the new route created under &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Routes&lt;/code&gt;&lt;/p&gt;

&lt;h1 id=&quot;portainer-setup-optional&quot;&gt;Portainer Setup (optional)&lt;/h1&gt;
&lt;hr /&gt;

&lt;p&gt;Here is the configuration for setting up Portainer. This is also a template for any other services that you want to set up
through Traefik.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;na&quot;&gt;portainer&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;portainer/portainer:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;portainer&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;local-network&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/localtime:/etc/localtime:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/run/docker.sock:/var/run/docker.sock:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./portainer-data:/data&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.enable=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.rule=Host(`portainer.domain.tld`)&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.service=portainer&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.entrypoints=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.tls.certresolver=letsencrypt&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.services.portainer.loadbalancer.server.port=80&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When configuring the labels for the service be sure to replace the &lt;strong&gt;labels&lt;/strong&gt; and &lt;strong&gt;values&lt;/strong&gt; with the correct entries.&lt;/p&gt;

&lt;p&gt;This template should be sufficient enough to copy &amp;amp; paste and replace &lt;strong&gt;SERVICE_NAME&lt;/strong&gt; and &lt;strong&gt;HOST.DOMAIN.TLD&lt;/strong&gt; to your specific
implementation and get it running.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.&amp;lt;SERVICE_NAME&amp;gt;.rule=Host(`HOST.DOMAIN.TLD`)&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.&amp;lt;SERVICE_NAME&amp;gt;.service=&amp;lt;SERVICE_NAME&amp;gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.&amp;lt;SERVICE_NAME&amp;gt;.entrypoints=websecure&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.&amp;lt;SERVICE_NAME&amp;gt;.tls.certresolver=letsencrypt&quot;&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.services.&amp;lt;SERVICE_NAME&amp;gt;.loadbalancer.server.port=80&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;upgrading-optional&quot;&gt;Upgrading (optional)&lt;/h1&gt;

&lt;p&gt;When new versions of Traefik or Portainer have been released you may want to upgrade to the latest version. 
This can be accomplished by using the following steps.&lt;/p&gt;

&lt;p&gt;1) Pull the latest images&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker-compose pull&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;2) Restart containers&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker-compose up -d --remove-orphans&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;3) Remove obsolete images (optional)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker image prune&lt;/code&gt;&lt;/p&gt;

&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h1&gt;
&lt;hr /&gt;
&lt;p&gt;Once that your docker-compose file has been finalized and you have your DigitalOcean API key, you should be able to
simply run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo docker-compose up -d&lt;/code&gt; and after a few moments be able to go to both &lt;strong&gt;traefik.domain.tld&lt;/strong&gt; and
&lt;strong&gt;portainer.domain.tld&lt;/strong&gt; and see both sites are secured.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;figure style=&quot;text-align: center;&quot;&gt;
        &lt;img src=&quot;/assets/img/success.jpg&quot; alt=&quot;Success&quot; /&gt;
        &lt;figcaption&gt;&quot;`Sucess!` by go digital is licensed under CC BY-SA 2.0&quot;&lt;/figcaption&gt;
    &lt;/figure&gt;
&lt;/p&gt;

&lt;h3 id=&quot;tldr&quot;&gt;TL;DR&lt;/h3&gt;
&lt;hr /&gt;
&lt;p&gt;Here is the full &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker-compose&lt;/code&gt; for your copy and paste pleasure, be sure to either create the &lt;strong&gt;digitalocean_api_key&lt;/strong&gt;
file or switch it out with the less secure &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DO_AUTH_TOKEN&lt;/code&gt; environment option.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;3.3&apos;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;services&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;traefik&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;traefik:v2.4&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;traefik&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;local-network&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ports&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;80:80&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;443:443&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;digitalocean_api_key&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;environment&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;DO_AUTH_TOKEN_FILE=/run/secrets/digitalocean_api_key&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/localtime:/etc/localtime:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./letsencrypt:/letsencrypt&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/run/docker.sock:/var/run/docker.sock:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./traefik-data/traefik.yml:/traefik.yml:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./traefik-data/acme.json:/acme.json&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.docker=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.directory=/dynamic&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.file.watch=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--api.dashboard=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--providers.docker.exposedbydefault=false&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.address=:80&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.to=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.web.http.redirections.entryPoint.scheme=https&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--entrypoints.websecure.address=:443&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--serversTransport.insecureSkipVerify=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=digitalocean&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.delaybeforecheck=0&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.email=admin@example.com&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--certificatesresolvers.letsencrypt.acme.dnschallenge.resolvers=1.1.1.1:53,8.8.8.8:53&quot;&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.enable=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.api-auth.basicauth.users=user:pass&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.entrypoints=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.rule=Host(`traefik.domain.tld`)&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.tls=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.tls.certresolver=myresolver&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.service=api@internal&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.traefik-router.middlewares=secured&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.traefik-redirect-web-secure.redirectscheme.scheme=https&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.middlewares.secured.chain.middlewares=traefik-redirect-web-secure,api-auth&quot;&lt;/span&gt;

  &lt;span class=&quot;na&quot;&gt;portainer&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;portainer/portainer:latest&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;container_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;portainer&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;restart&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;unless-stopped&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;local-network&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;volumes&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/localtime:/etc/localtime:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/var/run/docker.sock:/var/run/docker.sock:ro&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./portainer-data:/data&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;labels&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.enable=true&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.rule=Host(`portainer.domain.tld`)&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.service=portainer&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.entrypoints=websecure&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.routers.portainer.tls.certresolver=letsencrypt&quot;&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;traefik.http.services.portainer.loadbalancer.server.port=80&quot;&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;networks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;local-network&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;external&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;true&lt;/span&gt;

&lt;span class=&quot;na&quot;&gt;secrets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;digitalocean_api_key&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./digitalocean_api_key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;p&gt;&lt;a id=&quot;1&quot;&gt;[1]&lt;/a&gt;
“Traefik, The Cloud Native Application Proxy | Traefik Labs.” Traefik Labs: Makes Networking Boring, 2021, &lt;a href=&quot;https://traefik.io/traefik&quot;&gt;traefik.io/traefik&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a id=&quot;2&quot;&gt;[2]&lt;/a&gt;
“Portainer | Open Source Container Management GUI for Kubernetes, Docker, Swarm.” Portaine.Io, 2021, &lt;a href=&quot;https://www.portainer.io&quot;&gt;www.portainer.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a id=&quot;traefik-image&quot;&gt;[3]&lt;/a&gt;
Traefik. (n.d.). [Architecture]. Retrieved August 17, 2021, from https://doc.traefik.io/traefik/&lt;/p&gt;</content>
    <category term="docker"/>
    <category term="letsencrypt"/>
    <category term="traefik"/>
    <category term="portainer"/>
    <category term="tutorials"/>
    <category term="devops"/>
  </entry>
  <entry>
    <title type="html">Setup Oculus Quest 2 and Oculus Link to run in Unity Play Mode</title>
    <link href="https://www.jerhemy.com/article/2021/05/18/unity-oculus-setup/" rel="alternate" type="text/html" title="Setup Oculus Quest 2 and Oculus Link to run in Unity Play Mode"/>
    <published>2021-05-18T07:00:00+00:00</published>
    <updated>2021-05-18T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2021/05/18/unity-oculus-setup/</id>
    <summary type="html">How to set up Unity and Oculus Link for Oculus Quest 2 Development</summary>
    <content type="html">&lt;p&gt;The best tool in any developer’s belt when creating something new is having the ability to run and test changes as they go.
Initially, I was only able to test my games by running Build and Run in Unity, but that got a bit tedious, and wanted a
better way to check my work as I went along. It took going through a number of tutorials scattered around the internet to 
finally get my Oculus Quest 2 working in Unity Play Mode. This is that story…&lt;/p&gt;

&lt;h1 id=&quot;requirements&quot;&gt;Requirements&lt;/h1&gt;
&lt;hr /&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://unity.com&quot;&gt;Unity&lt;/a&gt; (We are using 2020.3.5f)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.oculus.com/setup/&quot;&gt;Oculus Link Software&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.oculus.com/accessories/oculus-link/&quot;&gt;Oculus Link Cable&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;oculus-link&quot;&gt;Oculus Link&lt;/h1&gt;
&lt;hr /&gt;
&lt;p&gt;The first thing you will want to do is install the Oculus Link application and configure your device.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Open the Oculus app on your PC.&lt;/li&gt;
  &lt;li&gt;Turn on your Quest.&lt;/li&gt;
  &lt;li&gt;Plug your USB 3 cable into a USB 3.0 port on your PC, then plug the other end into your headset.&lt;/li&gt;
  &lt;li&gt;If you are prompted with ‘Allow access to data’, select Deny.&lt;/li&gt;
  &lt;li&gt;Next, you’ll be prompted to Enable Oculus Link (beta), select Enable to begin remote rendering via Oculus Link.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;common-issues&quot;&gt;Common Issues&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Make sure cable is secure on both computer and headset&lt;/li&gt;
  &lt;li&gt;Make sure that the Oculus Quest headset is powered on&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;unity&quot;&gt;Unity&lt;/h1&gt;
&lt;hr /&gt;

&lt;h2 id=&quot;create-project&quot;&gt;Create Project&lt;/h2&gt;

&lt;p&gt;When creating a new VR project, it is best to select the VR template from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Create a new Porject&lt;/code&gt; window. This will install
the default packages we will need to interact with our VR environment. If you do not, it is ok since we will be going
over what packages to install in the next section.&lt;/p&gt;

&lt;p&gt;Provide and Name and Location for your project and click &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Create&lt;/code&gt;.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
  &lt;img src=&quot;/assets/img/unity-oculus-setup/00.png&quot; alt=&quot;New Project&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;install-necessary-packages&quot;&gt;Install necessary packages&lt;/h2&gt;

&lt;p&gt;One of the packages we will be using is currently in Preview, so it will not show up in the Package Manager on its own.
In order to enable preview packages, we need to enable these types of packages.&lt;/p&gt;

&lt;p&gt;Under Edit -&amp;gt; Project Settings -&amp;gt; Package Manager we will find the option ‘Enable Preview Package’ which will allow us
to see these additional options.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/unity-oculus-setup/05.png&quot; alt=&quot;Package Manager&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;Next need to set up the XR Integration. If you have used the VR Package when creating your project you should already 
have the necessary packages installed, but it might be beneficial to check if for anything to see if there are any 
updated available.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/unity-oculus-setup/03.png&quot; alt=&quot;Package Manager&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;The main package that is required is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Oculus XR Plugin&lt;/code&gt; while the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;XR Integration Toolkit&lt;/code&gt; is purely optional
it does provide some additional functionality to make development easier. Select each of these options and click ‘Install’
in the lower right-hand corner.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/unity-oculus-setup/04.png&quot; alt=&quot;Markdown Monster icon&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;setup-unity-oculus-integration&quot;&gt;Setup Unity Oculus Integration&lt;/h2&gt;

&lt;p&gt;We need to now make sure that the Unity project is set up to use the Oculus for the environment.&lt;/p&gt;

&lt;p&gt;Back under ‘Edit -&amp;gt; Project Settings -&amp;gt; XR Plug-in Management’ we want to make sure that ‘Initialize XR on Startup’ is checked and 
‘Oculus’ is checked under ‘Plug-in Providers’. Be sure that you have enabled Oculus for whatever build environment you are working
with. As displayed, we are current set up for PC &amp;amp; Standalone, but if your application is set for Android, you would want to go 
to the Android Tab and make sure Oculus is selected as well.&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/unity-oculus-setup/08.png&quot; alt=&quot;XR Plug-in Management&quot; /&gt;
&lt;/p&gt;

&lt;h2 id=&quot;run-scene&quot;&gt;Run Scene&lt;/h2&gt;
&lt;p&gt;Once everything is set up, you will need to put on your headset and open your settings menu.
On this screen you should be able to see an option labeled ‘Oculus Link’ (it may say also say ‘Rift’ underneath
but that is ok).&lt;/p&gt;

&lt;p align=&quot;center&quot;&gt;
    &lt;img src=&quot;/assets/img/unity-oculus-setup/07.png&quot; alt=&quot;Markdown Monster icon&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;At this point, you will be presented with a new interface and menu bar. You can now enter Unity Play Mode and be able to explore
your scene in VR. You will also want to make sure you’ve allowed any device connections between your headset and 
computer by responding to any prompts on the Oculus Quest 2.&lt;/p&gt;</content>
    <category term="unity"/>
    <category term="oculus"/>
    <category term="quest 2"/>
    <category term="game dev"/>
  </entry>
  <entry>
    <title type="html">It&apos;s a New Year</title>
    <link href="https://www.jerhemy.com/article/2021/01/01/happy-new-year/" rel="alternate" type="text/html" title="It&apos;s a New Year"/>
    <published>2021-01-01T07:00:00+00:00</published>
    <updated>2021-01-01T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2021/01/01/happy-new-year/</id>
    <summary type="html">Let&apos;s see how this one goes...</summary>
    <content type="html">&lt;p&gt;It’s a New Year… yay&lt;/p&gt;

&lt;p&gt;2020 started off with so many aspirations… I’m not even going to try to make excuses. At this point the plan
is still the same but instead of setting all these goals, lets just play this one by ear.&lt;/p&gt;</content>
    <category term="Personal"/>
  </entry>
  <entry>
    <title type="html">React Component - Modal</title>
    <link href="https://www.jerhemy.com/article/2020/01/15/react-component-modal/" rel="alternate" type="text/html" title="React Component - Modal"/>
    <published>2020-01-15T07:00:00+00:00</published>
    <updated>2020-01-15T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2020/01/15/react-component-modal/</id>
    <summary type="html">A simple react modal component</summary>
    <content type="html">&lt;p&gt;Throughout the course of my career in Web Development there has always been a need for modal dialog boxes, but also more importantly
the need to support accessibility. While working on a current project, the team decided to use a 3rd party modal component
to keep things moving quickly. Like with all easy things through, we ran into problems later. We discovered that the version
of the component we were using did NOT support accessibility. This was something that had been corrected since we initially 
added the component to the project, but again, like all easy things, you pay the price later. There were breaking changes in
updating the component. With all that, I held true to my philosophy of “Sometimes it is just better to write it yourself”.&lt;/p&gt;

&lt;p&gt;So here we go…&lt;/p&gt;

&lt;p&gt;This component renders a Modal component, controllable through events. 
To use the component, import Modal only once and then display it by passing a boolean value to the isVisible attribute.&lt;/p&gt;

&lt;h4 id=&quot;create-the-component&quot;&gt;Create the component&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot; data-lang=&quot;jsx&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// modal.js&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Modal&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;isVisible&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;onClose&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;useEffect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;keydown&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;keydownHandler&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeEventListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;keydown&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;keydownHandler&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]);&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;keydownHandler&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Escape&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;onClose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;nl&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isVisible&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onClick&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onClose&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-dialog&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onClick&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stopPropagation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-header&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-title&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-close&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onClick&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onClose&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;ni&quot;&gt;&amp;amp;times;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;span&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-body&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-content&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;footer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;modal-footer&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;footer&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;useEffect&lt;/code&gt; to setup an event listener on the document to listen for the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;esc&lt;/code&gt; key to be pressed.
This is acting much like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;componentDidMount&lt;/code&gt; on a class-based component. Since we do not want this event listener
lingering after we are done using the component, return a function that removes the event listen which will
called when the component is destroyed.&lt;/p&gt;

&lt;h4 id=&quot;style-the-modal&quot;&gt;Style the modal&lt;/h4&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;modal&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.css&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;fixed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;z-index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;9999&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;justify-content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.25&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;animation-name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;appear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;animation-duration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;300ms&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.modal-dialog&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;550px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;calc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100vh&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.19&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;-webkit-animation-name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;animatetop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;-webkit-animation-duration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;animation-name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slide-in&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;animation-duration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.5s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.modal-header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-header&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dbdbdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;justify-content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;space-between&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dbdbdb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;justify-content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex-end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-close&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1rem&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1rem&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1rem&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.modal-content&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@keyframes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;appear&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@keyframes&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;slide-in&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translateY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-150px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translateY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;inset&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-3px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;7px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#29bbff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#2dabf9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#0b0e07&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;inline-block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#ffffff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Arial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#263666&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.btn&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:hover&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#0688fa&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.btn&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:active&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nl&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

       &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;see-it-in-action&quot;&gt;See it in action&lt;/h4&gt;

&lt;p class=&quot;codepen&quot; data-height=&quot;265&quot; data-theme-id=&quot;default&quot; data-default-tab=&quot;js,result&quot; data-user=&quot;jswaldon&quot; data-slug-hash=&quot;jOEGoWb&quot; style=&quot;height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;&quot; data-pen-title=&quot;React Component: Modal&quot;&gt;
  &lt;span&gt;See the Pen &lt;a href=&quot;https://codepen.io/jswaldon/pen/jOEGoWb&quot;&gt;
  React Component: Modal&lt;/a&gt; by Jerhemy Waldon (&lt;a href=&quot;https://codepen.io/jswaldon&quot;&gt;@jswaldon&lt;/a&gt;)
  on &lt;a href=&quot;https://codepen.io&quot;&gt;CodePen&lt;/a&gt;.&lt;/span&gt;
&lt;/p&gt;
&lt;script async=&quot;&quot; src=&quot;https://static.codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;</content>
    <category term="Web Development"/>
    <category term="React"/>
  </entry>
  <entry>
    <title type="html">Happy New Year</title>
    <link href="https://www.jerhemy.com/article/2020/01/01/happy-new-year/" rel="alternate" type="text/html" title="Happy New Year"/>
    <published>2020-01-01T07:00:00+00:00</published>
    <updated>2020-01-01T07:00:00+00:00</updated>
    <id>https://www.jerhemy.com/article/2020/01/01/happy-new-year/</id>
    <summary type="html">A New Year and a New Blog</summary>
    <content type="html">&lt;p&gt;Happy New Year!&lt;/p&gt;

&lt;p&gt;Like many of us, I too try to come up with new years resolutions that I will most likely end up giving up on in the first quarter of the new year. But I’m still going to go through the motions and say I’m going to commit to this. I’ve had this empty blog with this new layout going for months but always got distracted and never finished. But today I’m finally pushing that last commit and getting this all running.&lt;/p&gt;

&lt;p&gt;I’ve been spending a lot of the year working on building some experience in Unity, mostly with projects I end up scrapping and starting over on and want to start documenting those lessons learned. I’ve found that I’ve been starting too big like many developers do and have realized that taking a step back and starting with smaller projects will probably produce more satisfying results.&lt;/p&gt;

&lt;p&gt;Hopefully, this will be something that benefits me in the future to provide some kind of portfolio of my work and in turn also help others who are interested in learning.&lt;/p&gt;

&lt;p&gt;This is 2020!&lt;/p&gt;

&lt;div class=&quot;video-responsive&quot;&gt;
  &lt;iframe src=&quot;https://www.youtube-nocookie.com/embed/NDmgsV8aL9s&quot; title=&quot;YouTube video&quot; loading=&quot;lazy&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;</content>
    <category term="Personal"/>
  </entry>
</feed>
