Niall’s virtual diary archives – Wednesday 17 April 2019

by . Last updated .

Wednesday 17 April 2019: 20:28. Link shared: https://www.nedprod.com/editor.html.

This is the very first post using my snazzy new hand-written Markdown new post editor, which you can test for yourself at https://www.nedprod.com/editor.html. I’ve been working on this at nighttimes for a number of weeks now. It live renders the Markdown which you type into HTML. It has a fixed viewport based layout, so each editing pane always consumes half of whatever screen size your browser has, which means it works as perfectly on mobile as it does on desktop. It automatically scrolls each pane so you can see, live, exactly the rendered Markdown for what you are editing. It can insert your geolocation and any link that you want to share. It retains your in-work post in your browser, letting you leave and return to finish it later without the possibility of losing anything. The only major missing functionality is uploading images with a post, and that’s my next task.

It’s been an illuminating refresher in my web programming skills. The first major thing which I’ve learned is that jQuery is finally no longer really necessary. jQuery was amazing for so many years at papering over browser shortcomings, but all the major browsers are now sufficiently quirk-free that one can now write straight in Javascript, and everything pretty much ‘just works’, which is so different to even five years ago. The second major thing I’ve had to master is Docker, because this new nedprod.com website is served by a bunch of Docker containers made by https://mailcow.email/, and in order to ‘poke through’ the containerised security, I had to write my first Docker image and plug it into the other Docker images such that the editor can write new post files, and invoke Hugo on the server to rebuild the website (basically it’s a Docker image serving a bunch of shell scripts over FastCGI. And input is ridiculously sanitised and checked for correctness, plus what you can modify is virtually nothing, even though anything which can modify the site is behind password protection).

The third big thing I’ve learned is just how much easier web programming has become. The tooling is vastly better than it was. Web browsers work consistently, their debuggers are all excellent, you can inspect HTTP exchanges with ease, even newer PHP doesn’t suck anything like as much as it used to. Security is also vastly better than it was, more than half of all the time it took to write this editor went not on the editor, but on figuring out how to run Hugo, because running arbitrary programs on your server is super non-trivial to make work nowadays. PHP simply won’t run external executables any more, which is a very good thing. Docker is very good at preventing you escaping it. I tried many routes before I sucked down the reality that I was going to have to learn Docker, which turned out to be nothing like as bad as expected. Old dog, new tricks in the end, and I can definitely see the big advantages in containerising absolutely everything into its own almost entirely read-only container.

The next minor thing is to get new posts replicating automatically onto Diaspora and other social media. Then comes image upload. Then, I think I’m probably done here for now, barring bug fixes. I could add arbitrary post editing, but to be honest, given I have SSH access and can just go delete bad posts or whatever, I’m not sure I care enough to implement a web UI for any of that.

Someone that I still find amazing is how the world has turned full circle. I have a de-Googlified phone based on https://microg.org/. I have never given over my email to big multinationals, but Mailcow comes with full calendar and todo management, plus a web UI and it takes care of SSL certs using LetsEncrypt for you. So that let me migrate away from Google Calendar, transferring over all the stuff intact, and fully working, and my phone auto-integrates with Mailcow calendar and todos, as well as email.

Now I’ve completely left multinational social media as well. Everything I now do runs 100% on my infrastructure running 100% open source. Nobody mines me for any of my information anymore, except from what can be gleaned from web scraping bots, and tracking cell tower locations, and those are rather hard to prevent. I’m basically back to 1998 when I first started this website, in a way, except the technology is vastly, vastly, superior to what we had back then.

I mean, this stuff auto-curlys my apostrophes’, like Microsoft FrontPage used to until you disabled it. Ain’t that something!




Go back to the archive index Go back to the latest entries

Contact the webmaster: Niall Douglas @ webmaster2<at symbol>nedprod.com (Last updated: 2019-04-17 20:28:38 +0000 UTC)