Giter VIP home page Giter VIP logo

stremio-beamup's Introduction

stremio-beamup

๐Ÿ› ๏ธ A platform as a service (PaaS) hosting for Stremio addons: as easy a Heroku/Now.sh, but DYI and without the restrictions.

It is based on Dokku, but with two significant differences:

  • It's designed with public use in mind - you can authenticate yourself using your GitHub account and push addons
  • It only supports Stremio addons and it's optimized for them (by using specific caching policies)

To deploy this yourself, you'll need:

Deployment

WARNING: this only refers to deploying stremio-beamup itself, not deploying addons to it

  1. Run ssh-keygen -t ed25519 -f id_deploy
  2. Register on Cherryservers and fund your account
  3. Create an API key and paste it into a new file: creds/cherryservers; paste your numeric project ID into creds/cherryservers-project-id
  4. Start an ssh-agent & load the key from step 1 into the agent - ssh-add id_deploy
  5. Create an 'authorized_keys' containing the public keys of users who should access the deployment.
  6. Run touch id_ed25519_deployer_sync.pub to workaround a TF0.12 issue
  7. Run terraform apply

By default, this will bootstrap a single server called deployer that can be used to deploy addons too and a docker swarm with two nodes where the addons will be deployed.

CAVEAT: Depending on the Cherryservers node setup, the first ansible playbook execution might fail with "E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable" error. This is due to server setup scripts on the Cherryservers, simply restart the terraform apply command.

Deploying an addon

Use beamup-cli to deploy addons.

Setting environment variables

Setting/getting environment variables is similar to the way Dokku does it, however you do it through ssh, and you need to pass the same addon slug that's used in the git remote that ./cli/beamup adds.

For example: ssh [email protected] config:set 768c7b2546f2/hello NODE_ENV=production

Addon application logs

Logs of deployed addons can easily be fetched in way, similar to the way Dokku does it, however through ssh

For example: ssh [email protected] logs 768c7b2546f2/hello

Architecture decisions

  • Why Dokku: it supports both Heroku buildpacks and Docker images, and it's super easy to configure and use
  • Why we're using container ports rather than container IPs: so we can make use of the swarm routing for zero downtime

FAQ

Why Cherryservers?

Because they have a Terraform provider and you can pay with Bitcoin.

Can I use this as a general purpose PaaS?

No - it performs addon-specific checks/optimizations. You can easily modify it for general-purpose usage though, by tweaking NGINX configs and Dokku CHECKS.

Does it only support nodejs?

No, it supports every stack that there's a heroku buildpack for, as well as any repo that has a Dockerfile.

stremio-beamup's People

Contributors

jaruba avatar maormagori avatar shteryana 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.