-
19 votes
-
Minimal image self-hosting
In the Tildes Minecraft weekly thread a little while back, there was some discussion about self-hosting images. I've finally done the thing, and figured I'd share the results. The primary goal is...
In the Tildes Minecraft weekly thread a little while back, there was some discussion about self-hosting images. I've finally done the thing, and figured I'd share the results.
The primary goal is to make something as simple as possible: I don't really care about galleries or albums, or different file formats, or fancy automatic deduplication etc. I just want to grab an image and throw it up on a link that I can share.
I do care about easily importing images from various sources, and stripping image metadata.
The simplest solution I came up with that addresses all these while requiring minimal changes to my existing self-hosted setup is this:
- Serve a directory of static files from
/var/www/i.allemangd.devon a subdomain with a newserver {}block in my existing nginx config. - Upload images to that directory via
scp. Then access is controlled by SSH and VPN and I don't need to worry about authentication. - Convert everything to
webpand strip metadata with imagemagick. - Don't worry about albums or galleries with the automated tool. I can manually edit the folder structure or rename via ssh/sshfs, but the automated tool just dumps images to a flat directory of
$(uuidgen).webp. - Pull from the clipboard via
xclipby default (I only need to support one platform), or via stdin, path, or url on the command line. - Everything in a short autoloded zsh function, and configure destination host/dir/url by environment variables in zshrc.
The code is at https://git.allemangd.dev/me/imup. @creesch, @Durinthal, @hamstergeddon, @trim: you all participated in my call for recommendations, so have a ping here in case you're interested in the solution I've landed on.
So, with all that, I'll move some of my minecraft screenshots off of imgur via this tool:
$ imup \ 'https://i.imgur.com/ecokmB1.png' 'https://i.imgur.com/UNs1mlr.jpeg' 'https://i.imgur.com/83ChnpP.png' \ 2026-01-20_22.15.08.png 2026-01-21_23.06.18.png \ --tag mcOutput
Note the ones from the screenshots folder are skipped, since I already ran
imup * --tag mcin that directory. Also note that one of the imgur screenshots is skipped, because it came from one of those files.- https://i.allemangd.dev/8b55e76472cb.webp (uploaded https://i.imgur.com/ecokmB1.png)
https://i.allemangd.dev/mc/8b55e76472cb.webp (tagged) - https://i.allemangd.dev/b6af9608c470.webp (uploaded https://i.imgur.com/UNs1mlr.jpeg)
https://i.allemangd.dev/mc/b6af9608c470.webp (tagged) - https://i.allemangd.dev/f317c121f1ab.webp (skipped https://i.imgur.com/83ChnpP.png)
https://i.allemangd.dev/mc/f317c121f1ab.webp (skipped) - https://i.allemangd.dev/e323ce99b07b.webp (skipped 2026-01-20_22.15.08.png)
https://i.allemangd.dev/mc/e323ce99b07b.webp (skipped) - https://i.allemangd.dev/11ef9831f1cc.webp (skipped 2026-01-21_23.06.18.png)
https://i.allemangd.dev/mc/11ef9831f1cc.webp (skipped)
I expect the two workflows from here on will be one of:
Navigate to my minecraft screenshots directory and executeNow just runimup $(date -I)_*.pngto share recent updates on the weekly thread.imup *.png.Prt Sc; "Copy to Clipboard";imup; Paste the url.
Some adjustments I might make in the future are:
-
Instead of naming the file by aThis is done.uuid, name the file by a hash. This way reuploading files won't explode the size of that directory - my "weekly update" thing could just beimup *.pngin the screenshots directory. -
Synchronize viaInstead I now synchronize via temporaryrsyncinstead ofscp. It should be faster.sshfs. I think rsync in principle could be faster but this is easier. -
Set up anI think I will not do this for fear of accidentally leaking something via an automatically-uploaded file in that directory. Better to be explicit.sshfsmount with this connection so my minecraft screenshots folder links directly to the static files, likehttps://i.allemangd.dev/mc/<date>.png. Then no manual commands are necessary. I'm a little hesitant to do that, though, since I'm not sure what happens if I putsshfsto offline host in myfstab, and probably not all my screenshots need to be public.
UPDATE: I've rewritten the thing in Python. I now name the files by hash and have a simple linking scheme for "tags". Installation is as easy as
uv tool install git+https://git.allemangd.dev/me/imup, and I can carry my config around in dotfiles.39 votes - Serve a directory of static files from
-
ssh git@sr.ht is asking password and denies me
Hey guys. I'm trying to make the connection between my system and Sourcehut. I created my Ssh key and added pub key to the Sourcehut. Added the private key with the ssh-add ~/.ssh/id_ed25519 code...
Hey guys.
I'm trying to make the connection between my system and Sourcehut. I created my Ssh key and added pub key to the Sourcehut. Added the private key with the
ssh-add ~/.ssh/id_ed25519code after the "eval" thing.Whenever I try
ssh git@sr.ht, it asks for password. I do not know what password it is and I'm entering my passphrase but it says permission denied.On Github side, I managed everything without problem tho. Any hints?
EDIT: I removed Git and SSH keys completely. Reinstalled Git again. Followed the instructions step by step for the SSH keys and it worked this time. I have no idea what I did different this time but it works now after 3 hours of hell.. I suspect that I made a typo in config file in SSH directory. Thanks for comments guys! I love you all!
13 votes -
Crashing a server by charging a vape battery
While I consider this resolved at time of posting, this is one of my weirder, more unexpected tech issues I've run into and I thought y'all might enjoy it. I'd been having issues with my (Ubuntu)...
While I consider this resolved at time of posting, this is one of my weirder, more unexpected tech issues I've run into and I thought y'all might enjoy it.
I'd been having issues with my (Ubuntu) server where its services were unavailable, I couldn't SSH in, and USB devices plugged in after the issues started weren't connecting (mouse LED would light up, couldn't toggle keyboard locks or interface computer with the devices). These issues were becoming a near daily occurrence.
So after the most recent incident I decided to watch it boot. After grub, it would just hang at a black screen. So I opted for the recovery mode and after waiting some minutes for services to time out, I was given a terminal and used that to check my devices, sensors, etc and all were reading fine.
Frustrated, I started reviewing what else could have possibly changed with my setup, and I found that change in my hand. I use my server's front USBs as a low current charger and had recently got a new vape battery that was charging at that moment.
I unplugged the battery, rebooted, everything was fine. Plugged the battery in, everything locked up again immediately.
I had been using a spare cable, it had data wired. Swapping for the included power only cable, and no issues.
While I'm curious as to what exactly is happening and why, I'm satisfied enough concluding it is a cheap vape (I mean, I'm having to charge the sucker near daily after all) that is transmitting junk over data and the OS doesn't handle it appropriately. I'll pull logs or do another couple tests if other folks are curious as well though.
Oh, and the battery is a Bear Rootz Sol. Come to think of it, my other worst battery at holding a charge was also a Bear Rootz.
7 votes -
A messaging app in five lines of Bash
14 votes -
SourceHut will blocklist the Go module mirror
13 votes -
SSH server hardening
5 votes -
Hardening SSH
4 votes -
MacOS Catalina 10.15.4 has mysterious SSH issues, possibly linked to using a port greater than 8192
10 votes -
Tyranny of the Clock - Lessons we learned when debugging a scaling problem on GitLab.com
12 votes -
OpenSSH Username Enumeration Vulnerabilty
11 votes