I use the following script (activated by a system-level shortcut key) to take a screenshot, upload to S3 bucket (using the minio client[0]) and place the URL in the X selection buffer, ready to be pasted:
#!/bin/bash
set -e
dbus-update-activation-environment DISPLAY XAUTHORITY
FNAME=`cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32`.png
flameshot gui --raw > /tmp/$FNAME
~/go/bin/mc -q cp --attr x-amz-acl=public-read /tmp/$FNAME s3/your.s3.bucket/dir/$FNAME
echo -n https://s3-us-west-2.amazonaws.com/your.s3.bucket/dir/$FNAME | xsel
[0] https://min.io/docs/minio/linux/reference/minio-mc.html
I forget, do you pay for bandwidth serving from S3 in this case? I have been looking for a good screenshot hosting solution to replace Cloudup, which was perfect and still usually works but I figure it might stop any day now. My only worry would be the unlikely case of a surprise high bill from a screenshot gone viral or something along those lines.
My workflow uses SFTP to upload to a cheap webhost, with cloudflare in front acting as a cdn. Easy peasy
Doesn't R2 have no egress fee?
Implement a cloudflare cache infront?
I have a similar setup but with SHA256 hash of the file as the object key.
In mine the hash is encoded as z-base-32 and namespaced with an uncommon first character:
And for when it matters, the filename can optionally be attached:You may want to modernise your script because Bucket ACLs are disabled by default these days: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-...
I wonder: if we set a TTL on the image, and also make it require a signed link that gets copied the same way, is it now a secure & ephemeral service?