FTS3 banner

FTS3

7 devlogs
13h 4m 58s

A file uploader that allows for files of any size to be uploaded to it via chunking, then a small url is returned for the file to be accessed and previewed. Any issues DM me on slack. Issues are hard to reproduce

This project uses AI

I used copilot autocomplete in some parts. CSS was done by @SeradedStripes

Demo Repository

Loading README...

jam06452

Shipped this project!

Hours: 13.08
Cookies: 🍪 321
Multiplier: 24.55 cookies/hr

I made a file uploader using a locally hosted S3 bucket. Cloudflare only allows 100MB uploads, I had to chunk the uploaded files into smaller chunks and then send them to my server. The server then resembles them and uploads them to the local S3 bucket. This allows me to have files of unlimited size to be uploaded. The server then gives the user a shortened URL using my previous project’s API to shrink the long url, the url leads the user to the file they can easily download or preview

The most challenging bit was chunking the files from the frontend and then streaming them back to the server. This was painful and challenging since I had not done this before.

I made this project entirely in elixir & Phoenix.

I am most proud of chunking the files in order to circumvent cloudflare limits, hard to implement but very rewarding.

jam06452

Added another node thanks to seraded stripes allowing for cross region backup. If u wanna help DM me :)

Attachment
0
jam06452

I know, I know, a 3 hour devlog

  • I will be honest I just forgot

We got some MASSIVE changes

  • Migrated 100% to garage
  • Custom SDK no heavy (AWS S3) SDKs
  • Fast
  • Unlimited file size depending on ur internet speed
  • Shortened URLs from previous project reported over with APIs
  • No CSS @Tom needs to do another PR
  • GH Workflow for publishing arm64 via selfhosted runner, GH hosted runner for x86/

Issues

  • Had many enospc errors, (server kept running out of memory and space)
  • Phoenix Liveview, had issues coordinating events in the correct sequence leading to crashing randomly
  • URL API was weird, sometimes nothing being returned, my fault with json bodies.

PS a lot of this was backend work dont complain it doesnt look “pretty”. It took a long time for all of this

Changelog

Attachment
Attachment
Attachment
0
jam06452

UI Addition & bug fixes with in it. Thanks to @Tom.

Custom SDK is underway

  • get_bucket_info(client, bucket) returns all bucket info in xml
  • get_object(client, bucket, file_name) returns the file contents
  • put_object(client, bucket, file_name, file_contents) uploads file to S3.

Added DB.ex

  • Test scripts

Env vars are secure

  • runtime.ex
config :fts3, :S3,
  base_url: System.get_env("S3_BASE_URL"),
  region: System.get_env("S3_REGION"),
  access_key_id: System.get_env("S3_ACCESS_KEY_ID"),
  secret_access_key: System.get_env("S3_SECRET_ACCESS_KEY")

Todo

  • Complete SDK
  • Simple UI of garage S3 branch
  • Docker workflows for garage etc

Changelog

Attachment
Attachment
0
jam06452

Finally got garage setup. Took me a while to do in docker, but I eventually moved to bare metal locally. Just tried a test upload to the API from another device to the domain. It Worked!.

Time to do more testing in python and then make an SDK in elixir

Attachment
Attachment
0
jam06452

Working PoC with any file size

Added working PoC.
Lots of work within supabase site including configuring buckets,testing etc.

Workflow

  • Upload file
  • File is sharded and uploading in chunks to bypass cloudflare limits
  • File is reassembled then uploaded to a local supabase S3 bucket
  • I make the address where the file will live, then take that address and pass it through my url shortener and return that instead.
  • When the link is followed, you are taken directly the file in supabase.

Features

  • Data & Time are appended to all uploaded files, this is to ensure files are not overwritten by other users.

  • Chunking to bypass CF limits

  • Custom bucket support, if I wanted to run two of these services on two different buckets I can change which bucket through env vars.

and more

To do

Get a better UI with more CSS

Changelog

Attachment
0