/intertube

music storage locker

Primary LanguageGoBSD 2-Clause "Simplified" LicenseBSD-2-Clause

This is the source code for inter.tube, as seen on HN's "Stripe killed my music locker service, so I'm open sourcing it". inter.tube is an online music storage locker service with Subsonic API support.

Note that none of this code was intended to be seen by anyone else, so it's rough, but I hope it is useful to someone. I was inspired to open source it by the recent Apollo debacle.

Stripe Update

I heard back from a Stripe employee and it turns out this service is OK to host! inter.tube won't die, but it will remain open source.

Architecture

This uses Backblaze B2 to host files. It uses Cloudflare Workers to access B2 so that bandwidth is free.

The backend itself is Go, using SSR (html/template) and some hairy vanilla JS for the browser music player. It runs on AWS Lambda. The data is stored in DynamoDB. There is some functionality for caching user libraries as JSON blobs in S3 (via DynamoDB Stream event handling lambdas), but it's kind of a mess.

Environment variables

B2 is Backblaze B2, CF is Cloudflare.

# used for uploading files
export B2_KEY_ID=
export B2_KEY=
# used in events/cloudflare.go to store B2 API key for the CF workers
export CF_ACCOUNT=
export CF_API_EMAIL=
export CF_API_KEY=
export CF_KV_NAMESPACE=
export STRIPE_ACCOUNT=
export TEST_STRIPE_PUBLIC=
export TEST_STRIPE_KEY=
export TEST_STRIPE_SIG=
export STRIPE_PUBLIC=
export STRIPE_KEY=
export STRIPE_SIG=

Unfortunately, there's some hardcoded bucket names and domains that need to be made configurable.

Interested?

This project is not in a good place to self-host, but I'm open to working on it more or accepting contributions. Feel free to create an issue or discussion thread.