About me

Music producer, (ex-)DJ, electronics tinkerer, Linux enthusiast and coder.

Showing posts with label aws. Show all posts
Showing posts with label aws. Show all posts

Context menu additions for sharing files in S3 buckets


Some time ago I wrote about mounting Amazon S3 buckets into your home directory, and I wanted to get automatic public URLs for sharing some of the files I stuff in my cloud buckets. I got it working quite effortlessly by writing a small script and adding a context menu item to my file manager.

Using systemd to mount S3 buckets into your home directory


If you do web development or use cloud storage for backups, you may have heard of Amazon S3 which offers dirt-cheap storage for both private and public use. Data in S3 is split into "buckets", which can be configured individually and may contain folder structures.
 
Then there's S3FS (S3 File System) that allows accessing S3 just as easily as local files. The few tutorials I found used /etc/fstab to auto-mount buckets, but that's not very smart on a desktop computer with multiple users, each managing buckets of their own. Besides, editing /etc/fstab can be very dangerous to newbies. That's why I looked for a way to achieve the same and more without touching any system-wide configuration. The only part that even needs sudo privileges is installing the S3FS package.

If you've used Linux servers or desktops for some time, you've probably heard of systemd, which allows creating your own background services (daemons) relatively easily. The real beauty about it is that adding user-specific services is equally easy, and in my experience they are more reliable than processes started using the classic "Startup Applications" tool.

I'll walk you through to combine those three building blocks into an automatic service that brings your S3 files right under your home directory on a Linux desktop computer. This should work as-is on any recent Debian, Ubuntu or a derivative operating system, and with some changes on others, too (forget about Windows, though).