News for hackers. Stuff that matters.
Re:Flameshot – Powerful, yet simple to use open-source scree... by geoka9 on Tuesday June 11, 2024 @07:16PM (#40652761)
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
Re:Flameshot – Powerful, yet simple to use open-source scree... by wzyboy on Tuesday June 11, 2024 @07:44PM (#40652971)
I have a similar setup but with SHA256 hash of the file as the object key.
Re:Flameshot – Powerful, yet simple to use open-source scree... by aendruk on Wednesday June 12, 2024 @09:32AM (#40657973)
In mine the hash is encoded as z-base-32 and namespaced with an uncommon first character:

  $ publish example.png
  https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih
And for when it matters, the filename can optionally be attached:

  $ publish --named example.png
  https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih
  $ http --headers 'https://example.com/+umk3cm5cah5akbqeueq8914zimfktoih' | grep 'Content-Disposition'
  Content-Disposition: inline; filename="example.png"
Re:Flameshot – Powerful, yet simple to use open-source scree... by sandinmyjoints on Tuesday June 11, 2024 @08:44PM (#40653298)
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.
Re:Flameshot – Powerful, yet simple to use open-source scree... by djbusby on Tuesday June 11, 2024 @09:07PM (#40653430)
Doesn't R2 have no egress fee?
Re:Flameshot – Powerful, yet simple to use open-source scree... by byteknight on Wednesday June 12, 2024 @01:09AM (#40654747)
Implement a cloudflare cache infront?
Re:Flameshot – Powerful, yet simple to use open-source scree... by mfkp on Wednesday June 12, 2024 @05:29AM (#40656187)
My workflow uses SFTP to upload to a cheap webhost, with cloudflare in front acting as a cdn. Easy peasy
Re:Flameshot – Powerful, yet simple to use open-source scree... by AnthOlei on Tuesday June 11, 2024 @11:21PM (#40654128)
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?
Re:Flameshot – Powerful, yet simple to use open-source scree... by endgame on Wednesday June 12, 2024 @02:14AM (#40655095)
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-...