The Federated Social Audio Platform
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Tom Scott 8fcb189622
Merge pull request #40 from weathermen/dependabot/bundler/addressable-2.8.0
3 years ago
.github Update badges and workflow names 4 years ago
app Fix Routes 4 years ago
bin Remove Travis Config and Add GitHub Workflows 4 years ago
config Fix Routes 4 years ago
db Add token to users and docs to federation methods 5 years ago
docs Remove "Architecture" page for now 4 years ago
lib Use audio analyzer from gem 4 years ago
log Initial commit 6 years ago
public Initial commit 6 years ago
test Update versions#create to use actor string 5 years ago
tmp Initial commit 6 years ago
vendor Initial commit 6 years ago
.browserslistrc Update Webpacker 5 years ago
.codeclimate.yml Add continuous deployment and linting configuration 6 years ago
.dockerignore Update build tasks and Yarn dependencies 4 years ago
.gitignore Add Documentation Site 4 years ago
.haml-lint.yml Add i18n haml-lint and run lint:haml for all files 6 years ago
.postcssrc.yml Initial commit 6 years ago
.rubocop.yml Configure RuboCop and ES for docker 6 years ago
CODE_OF_CONDUCT.md Add Code of Conduct 5 years ago
CONTRIBUTING.md Add contributing guide 5 years ago
Dockerfile Add Documentation Site 4 years ago
Dockerfile.worker Fix CMDs in Dockerfile 5 years ago
Gemfile Bump puma from 3.12.6 to 4.3.8 3 years ago
Gemfile.lock Bump addressable from 2.7.0 to 2.8.0 3 years ago
LICENSE License with GNU GPL 5 years ago
Makefile Remove Travis Config and Add GitHub Workflows 4 years ago
README.md Update badges and workflow names 4 years ago
Rakefile RuboCop auto-corrections 6 years ago
app.json Deploy application with Heroku 5 years ago
babel.config.js Update Webpacker 5 years ago
config.ru RuboCop auto-corrections 6 years ago
docker-compose.development.yml Production httpd config 5 years ago
docker-compose.production.yml Ensure asset builds do not fail 5 years ago
docker-compose.test.yml Remove Travis Config and Add GitHub Workflows 4 years ago
docker-compose.yml Remove Travis Config and Add GitHub Workflows 4 years ago
package.json Bump hls.js to 0.12 5 years ago
postcss.config.js Update Webpacker 5 years ago
yarn.lock Bump postcss from 7.0.25 to 7.0.36 3 years ago

README.md

Soundstorm

Tests Status Build Status Release Status Test Coverage Maintainability

The Federated Social Music Platform.

Soundstorm is an audio-oriented federated social network that speaks ActivityPub. Users can upload their own music, comment on others' tracks, and like/follow/mention just as in a regular social network. Since it speaks the same language as federated platforms like Mastodon, Soundstorm can send new track upload posts to users' followers on the fediverse, allowing them to gain a greater reach than a conventional social audio service.

Installation

Soundstorm is distributed as a Docker image for deployment ease. The reference instance, https://soundstorm.social, uses Amazon ECS for deployment, but the image is self-contained and can be run on any infrastructure. This image runs in RAILS_ENV=production mode by default, and comes pre-loaded with compiled assets and everything you'll need to run a Soundstorm instance in production.

First, pull down the latest production image:

docker pull weathermen/soundstorm

Create a .env file in the local dir for your configuration:

SOUNDSTORM_HOST=your.soundstorm.domain
DATABASE_URL=postgres://url@to.your.database.server:5432
REDIS_URL=rediss://url@to.your.redis.server:6379
CDN_URL=https://cdn.soundstorm.domain
SMTP_USERNAME=your-smtp-server-user
SMTP_PASSWORD=your-smtp-server-password
SMTP_HOST=smtp.server.if.not.using.sendgrid.net
RAILS_SERVE_STATIC_FILES=true

Create the database, set up its schema, and load in seed data:

docker run --rm -it \
           --env-file .env \
           --env SOUNDSTORM_ADMIN_USERNAME=your-username \
           --env SOUNDSTORM_ADMIN_PASSWORD=your-password \
           --env SOUNDSTORM_ADMIN_EMAIL=valid@email.address \
           weathermen/soundstorm \
           rails db:setup

You can now start the app server using the default container command. Make sure you have a Docker Network created so the container can talk to other neighboring containers:

docker network create soundstorm
docker create --env-file .env --network soundstorm weathermen/soundstorm

You'll still need to proxy requests from an HTTP server to the app server in order to process and terminate SSL. The soundstorm image does not come with SSL certificates built in, you'll need to either obtain one yourself or use the Caddy server to obtain them for you via LetsEncrypt.

Here's an example Caddyfile you can use:

your.soundstorm.host {
  log stdout
  errors stderr
  tls {
    dns route53
  }
  root /srv/public


  proxy / http://web:3000 {
    fail_timeout 300s
    transparent
    websocket
    header_upstream X-Forwarded-Ssl on
  }
}

Start the Caddy server like this:

docker pull abiosoft/caddy
docker create \
  --volume $(pwd)/Caddyfile:/etc/Caddyfile \
  --volume $HOME/.caddy:/root/.caddy \
  --publish 80:80 \
  --publish 443:443 \
  --network soundstorm
  abisoft/caddy

Development

The above goes into installing Soundstorm for real-world use, but you may also want to contribute to the project in some way. Developing on Soundstorm also requires the use of Docker.

First, make sure your $COMPOSE_FILE is set, so that development-level configuration is included whenever docker-compose is in use:

export COMPOSE_FILE="docker-compose.yml:docker-compose.development.yml"

Next, set up the database:

docker-compose run --rm web rails db:setup

You can now start all services:

docker-compose up

Once the web app loads, browse to http://localhost:3000 and log in with username admin and password Password1!. This is configurable by setting $SOUNDSTORM_ADMIN_USERNAME and $SOUNDSTORM_ADMIN_PASSWORD as environment variables when running db:setup.

For more information on making contributions to this project, read the [contributing guide][].

Deployment

Soundstorm can be easily deployed to your Docker Machine with the provided production configuration:

source .env # see "Installation" above
docker-machine create soundstorm
eval "$(docker-machine env soundstorm)"
docker-compose -f docker-compose.yml -f docker-compose.production.yml up

However, https://soundstorm.social, our reference implementation, is hosted on [Heroku][]. The make deploy task performs the commands needed to deploy the local production images you've already built to the Heroku platform. It uses the docker CLI to push images to Heroku's container registry, and the heroku CLI to start those new containers in the production environment.