Code Monkey home page Code Monkey logo

intertube's Introduction

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.

intertube's People

Contributors

guregu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.