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" (spoilers: they didn't kill it after all). inter.tube is an online music storage locker service with Subsonic API support.

Note that none of this code was originally 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.

Architecture

  • Database: DynamoDB
  • Storage: S3 or S3-compatible
  • Backend: Go, server-side rendering + SubSonic API support
  • Frontend: HTML and sprinkles of vanilla JS
  • Runs as a regular webserver or serverless via AWS Lambda (serverless docs coming soon)

Running it locally

Here's a way to run this easily, using DynamoDB local and MinIO.

Install these things:

# git clone this project, then from the root directory:
docker compose up -d
go build
./intertube --cfg=config.example.toml

Then access the site at http://localhost:8000.

When running in local mode, you can edit the HTML templates and they should reload without having to restart the server.

Running it on The Cloud

Docs coming soon :-)

Configuration

See config.example.toml. It matches the docker-compose.yml settings.

You can specify the config file with the --cfg file/path.toml command line option.

By default it looks at config.toml in the working directory.

Roadmap

  • inter.tube launch
  • Local dev mode
  • Align latest changes with production
  • Proper self-hosting guide
  • ???
  • Profit

Contributing

Contributions, bug reports, and feature suggestions are welcome.

Please make an issue before you make a PR for non-trivial things.

You can sponsor this project on GitHub or buy an inter.tube subscription on the official site to help me out as well.

intertube's People

Contributors

guregu avatar thek3nger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

intertube's Issues

Rework track selection UX

Need some UI improvements related to track selection in the web UI

  • Be able to select multiple tracks
    • Edit multiple tracks simultaneously (the backend does support this)
    • Delete multiple tracks simultaneously
    • Select all
    • Keyboard shortcuts
  • Select a track without playing it

Local mode for easy dev / simple deployments

Let's add a flag that sets the server to "local mode" and instead of relying on Lambda / CF Workers to process/serve files, handles that stuff immediately.
I plan on adding this sometime this week, should help a lot.

Overflowing player-title for very long album names

The King Gizzard & The Wizard Lizard broke so many players with their long-ass album title :D On inter.tube, I've found this bad overflow.

CleanShot 2023-06-20 at 19 30 39@2x

Playing with the devtools of the browser, I saw that adding margin-left: 100px (more or less) to .player-title solves the problem.

(I can try to make a PR for this later, if it is okay for you.)

Document click-ops infrastructure

Here's a rough idea...

Things that you need:

  • B2 buckets
    • one for unprocessed uploads (intertube-upload)
    • one for processed tracks (directories split by user)
  • AWS account for the Lambdas
  • Cloudflare account for the Workers
  • DynamoDB tables

Lambdas

  • tube-web (env var MODE = WEB)
    • HTTP server (API gateway)
  • tube-trigger (MODE = CHANGE)
    • DynamoDB Streams trigger on Tracks table
  • tube-refresh (MODE = REFRESH)
    • Refreshes B2 API token and stores in Cloudflare KV

Workers

  • workers/dl.js - file downloader
  • workers/auth.js - maybe unused?

DynamoDB tables

  • Tracks
  • Sessions
  • Users
  • Files

I think this could be greatly simplified for self-hosting

Deduplicate tracks with multiple encodings

Currently if you upload the same track in multiple encodings (e.g. mp3 and flac) it will show both of them in the web UI and subsonic APIs.
Let's deduplicate them. For Subsonic we might be able to pick based on the client's accepted types, for the web UI we can just pick the "better" format or make it a setting.

Tracks view stuck loading

For some reason the tracks view seems to get stuck loading for me. Due to this, searching doesn't work because not every track gets indexed/cached.

Upon going to the music page, there is never any progress and it only ever says "loading..." with no percentage shown. If I switch to albums view, loading will show progress and eventually finish at which point everything can be searched. For my library it takes ~20 seconds to fully load. Then I can switch back to the tracks view to see and search all tracks.

OS: Linux
Browser: Firefox 120.0

Return placeholder image for missing album art in Subsonic API

Currently we return a subsonic API error when getCoverArt can't find any matching art, but some web-based clients such as Subplayer don't like this and display a broken image instead.

Instead, we should probably return an image always, but use a placeholder for missing art.

Example of brokenness:
Screenshot 2023-09-11 at 5 17 23

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.