API for Accentor, a modern music server focusing on metadata.
Accentor gives you complete control over your music. You can build your own collection (with good old CD's, bandcamp downloads, ...) in the sound quality that you want and stream it either through the web frontend or android app.
Accentor is focused on metadata. We allow you to add detailed metadata to your music collection, beyond what the tags inside an audio file are capable of. Album and tracks can have multiple artists with a different name on different albums/tracks, albums can have multiple labels and tracks can have multiple genres.
The metadata is completely in your control: you can edit it however you want.
-
Make sure you have the correct dependencies installed. This is mostly ffmpeg and ruby.
-
Create a checkout of the code.
-
Install all ruby dependencies with
bundle install
. -
Setup the database. Only postgresql is supported. Don't forget to run
rails db:setup
. -
Make sure to perform migrations before starting the server. Also run the
ffmpeg:check_version
rake task. -
Run
puma -C config/puma.rb
to start the server. You can use any other application server as well, but there is no configuration provided. -
Run
good_job start
to start a background worker. In Accentor, all jobs are handled by the following 4 queues:- within_30_seconds
- within_5_minutes
- within_30_minutes
- whenever
These queue names refer to the period in which a job should be picked up by a worker. If you want/need to manage the available workers in more details, you can specify the availability of workers per process or per thread with
GOOD_JOB_QUEUES
. Check the good job docs for the possibilities. -
You probably want to set the following environment variables when running:
- DATABASE_URL
- RACK_ENV
- RAILS_ENV
- SECRET_KEY_BASE
You can generate a new
SECRET_KEY_BASE
usingbin/rails secret
. For optimal caching, this key should be stable.Optionally set the following variables to control where Accentor stores its files:
- FFMPEG_LOG_LOCATION
- RAILS_STORAGE_PATH
- RAILS_TRANSCODES_PATH
- BOOTSNAP_CACHE_DIR
- PIDFILE
- RAILS_LOG_TO_STDOUT
-
This leaves you with a server running on port 3000. Use a reverse proxy like Apache or nginx to route your traffic. If you are deploying the web frontend an the same subdomain, you can match the requested path on
/api
and/rails
and only proxy those requests.
To run and develop locally:
- Make sure you are running the correct version of ruby.
- Install all dependencies with
bundle install
- Make sure you have postgresql is running and add a role
accentor
with passwordaccentor
(This role should have the permission to login and createdb) - Make sure you have ffmpeg installed, this is needed to calculate file length and convert audio.
- Setup the local database with
rails db:setup
. This will also seed the database with an admin account and some starting points for the application.
Once you've done this, you can always run a local server with rails server
If you use nix on your local machine, you can also use the devShell provided by flake.nix
.
Have a question? You can ask it through GitHub discussions or in the Matrix channel.
Think you have noticed a bug or thought of a great feature we can add? Create an issue.