From 038e09b202d25947fdff76253515d7279b7ad19e Mon Sep 17 00:00:00 2001 From: Roberto Hidalgo Date: Sat, 11 Feb 2023 12:01:04 -0600 Subject: [PATCH] lol, 64bit integer overflows are fun to debug specially when running a multi-arch cluster and HA with poor observability. a `time.Duration` was being casted to an `int` (because I clearly have no clue of what I'm doing). All is well on 64-bit processors, but 32-bit processors choke on the very long micro-second precision int, overflow, and turn `7d`, around `604800` seconds into `-114753536` seconds, which the browser happily (and correctly) turns into a cookie sent to /dev/null. lol. --- internal/server/admin.html | 28 ++++----- internal/server/index.html | 1 + internal/server/login.html | 7 ++- internal/server/static/index.css | 21 ++++--- internal/server/static/manifest.webmanifest | 15 +++++ internal/server/static/serviceworker.js | 3 +- internal/user/ttl.go | 4 +- internal/user/ttl_test.go | 69 +++++++++++++++++++++ 8 files changed, 120 insertions(+), 28 deletions(-) create mode 100644 internal/server/static/manifest.webmanifest create mode 100644 internal/user/ttl_test.go diff --git a/internal/server/admin.html b/internal/server/admin.html index 382bf61..f82ef80 100644 --- a/internal/server/admin.html +++ b/internal/server/admin.html @@ -130,30 +130,30 @@