From 86abe0f77d48c67afdd98b5f9d880ed2696c03c3 Mon Sep 17 00:00:00 2001 From: t Date: Mon, 13 Jul 2026 08:45:34 -0600 Subject: image management outside the repo the strategy for image management is to push them up to the production server early (they don't hurt anything sitting there with no tags pointing at them) to use the server itself as image storage. a new mise tasks manages the upload, moving the image into place and setting permissions on the server. the /images/ directory in the repo is git-ignored for the server's checkout, and the local dev server is switched to caddy with a reverse proxy on images paths to serve local-dev image links straight from prod. --- mise.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mise.toml') diff --git a/mise.toml b/mise.toml index 40433a8..cee16c6 100644 --- a/mise.toml +++ b/mise.toml @@ -1,3 +1,6 @@ +[tools] +caddy = "latest" + [tasks.gen] run = "weft -gitignore . https://tjp.lol" @@ -35,3 +38,17 @@ run = "jj git push -b main" [tasks.deploy] description = "Push the 'main' bookmark and update weft on the server" depends = ["deploy:weft", "deploy:site"] + +[tasks."upload:image"] +description = "Upload an image to the production server" +usage = 'arg "file" "path"' +run = ''' +set -euo pipefail + +fname=`basename $usage_file` +dirpath=`dirname $usage_path` +site_imgs=/jail/volumes/web/https/images + +scp $usage_file t@tjp.lol:/tmp/$fname +ssh t@tjp.lol "doas sh -c 'mkdir -p ${site_imgs}/${dirpath} && mv /tmp/${fname} ${site_imgs}/${usage_path} && chown root:wheel ${site_imgs}/${usage_path}'" +''' -- cgit v1.3