~akarle/euchre-live

make: Fix release recipe on OpenBSD

The regex was failing, so I swapped it out for just egrep. Similarly,
openrsync can be used with rsync with just RSYNC=openrsync
deps: Update carbon via `npm audit fix`
deploy: Modify rc.d service to only listen on localhost

Previously, it was possible to hit http://euchre.live:3000 . I don't
want to encourage HTTP usage, so this patch modifies the rc.d script to
only listen on localhost:3000 so that external users cannot access via
the plaintext port (must go through relayd on 443).
doc: Use https:// in euchre.live link :)
frontend: Use websockets over TLS and https if connection secure

This is super exciting! I finally got around to configuring relayd(1)
(an OpenBSD base relay that I'm using to distribute load between
alexkarle.com and euchre.live) to do full TLS acceleration/termination
so that euchre.live can be run over HTTPS!

To handle this properly (without changing the dev workflow), the
frontend now needs to inspect the protocol and choose wss+https or
ws+http accordingly. This patch does just that.
doc: Fix path to build.sh in README
deps: Bump esbuild to 0.11.18 for OpenBSD support

Pretty amazing! Within 2hrs of my first trying to use esbuild on
OpenBSD (and finding there was no package for it), 0.11.18 was released
due to no action on my part to add OpenBSD support!

Huge kudos to Evan Wallace, this tool is awesome :)
doc: Add note about perl5 OpenBSD packages to README

This is mostly for my future self (since I seem to go long spurts
without touching the code and hop OS installations frequently...),
but it may help someone else too!
build: Add sourcemaps to developer build

sourcemaps allow browsing the source (which is otherwise bundled) in
browser dev tools, which is super helpful! They aren't needed for prod,
since it'll be just more bytes to serve... (the repo is linked if they
want to browse it!)
ci: Update sr.ht build to use OBSD packages over cpanminus

Since the esbuild migration removed the need for
Mojolicious::Plugin::Webpack, all of the cpan modules we need to run
euchre-live are packaged by OpenBSD! This means we can drop the cpanm
step, which shaves 2min off of our 2.5m build time (down to 30s).

Tested via the web UI :)
build: Replace webpack with esbuild for fast, lean, builds!

Wow. Just wow. Who knew that an hour of hacking could produce SUCH a
huge quality of life improvement. Not only did we reduce the number of
packages by 10x (1100 -> 113), but the build happens in under a second
rather than 2-3 min! And my X220 cpu fans never even spin up!

Just wow :)

Direct stats:

* esbuild bundles:

    633K euchre-live.development.css
    1.6M euchre-live.development.js
    551K euchre-live.production.css
    440K euchre-live.production.js

* webpack bundles:

    479K euchre-live.development.css
     14M euchre-live.development.js
    401K euchre-live.production.css
    393K euchre-live.production.js

* esbuild time:

    dev: 760ms
    prod: 643ms

* webpack time:

    prod: 2.25m

(all on my X220)
style: Refactor SCSS style to CSS in prep for esbuild
doc: Link LICENSE file in README.md

Also a test commit for builds.sr.ht; ironing out some strange double-job
starting when mirrored via post-receive on git.alexkarle.com
doc: Fix builds.sr.ht badge in README

I think this moved to /commits/ some time ago..
deps: Lock in Mojolicious at v8.67

This is the version we're using in production, and I noticed a fresh
build failed to install Mojo::Webpack::Plugin .13 with Mojolicious 9.17,
so this patch should fix the versioning issues and ensure the code is
installable on a fresh machine!
ci: Update build.yml to use OpenBSD & new email address

I've been running euchre.live on an OpenBSD server for the better part
of a year now, so the CI should ideally reflect that!
deps: Lock in Mojolicious::Plugin::Webpack at v 0.13

Each upgrade of this plugin trashes our webpack.config.js (as found out
by ~ckarle), and is hard to diagnose.

I'm ratcheting down the version here in hopes that (1) an initial cpanm
--installdeps "just works" and (2) if it doesn't we at least remember
the version matters :)
doc: Add note about deamonization to README

This is truly something I forgot about (and worth documenting), but I'm
also making this change to test my git.alexkarle.com mirroring to GitHub
and sr.ht :)
make: Update release target to use rc.d init script

The whole restart.sh model was... well, clever but also pretty wacky!

I've been running under the rc.d script for a while now, which has many
advantages (but most importantly means I can reboot the server and have
the service come back online...).

So this patch removes the whole concept of preprod vs prod (we aren't editing
the code much these days!) as well as restart.sh. Ah. Much simpler.
deps: Update node dependencies, Mojo::Webpack

The Mojo::Webpack upgrade was accidental (new machine, new release in that
time frame). With it came some changes to the generated webpack.config.js
that threw me for a loop for a good while.

Most importantly, a newer version of node-sass was needed. As such, this
patch updates all dependencies.
Next