This repository has been archived on 2025-08-12. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • C++ 42.3%
  • Smarty 16.5%
  • CSS 13.5%
  • JavaScript 12.3%
  • Python 5%
  • Other 10.4%
Find a file
2016-01-14 09:05:02 +01:00
conf takeout: change port to something less common 2015-12-28 20:33:06 +01:00
include introduce include/ 2014-06-01 14:41:20 +02:00
lib fix: undefined behaviour if EQBEATS_POSTGRES or EQBEATS_REDIS aren't set 2014-11-29 17:39:45 +01:00
sql take out all youtube stuff 2015-04-20 19:36:03 +02:00
src Merge branch 'readonly' into takeout 2015-12-28 18:18:31 +01:00
static player.js: stop sending "played" beacons 2016-01-03 17:11:15 +01:00
takeout takeout: raise timeout on jobs 2016-01-14 09:05:02 +01:00
templates hide email from user pages 2016-01-03 11:03:01 +01:00
.dockerignore add docker & fig stuff 2014-11-22 22:53:44 +01:00
.gitignore eqbeats.pc for pkg-config 2014-06-01 14:41:21 +02:00
autogen.sh autogen.sh, to follow the standards 2014-06-01 14:54:07 +02:00
configure.ac make everything readonly 2015-08-07 19:25:16 +02:00
docker-compose.yml takeout: add statistics to archive 2015-12-29 14:55:58 +01:00
Dockerfile add docker & fig stuff 2014-11-22 22:53:44 +01:00
failsafe failsafe: update to ignore pidfile as well 2013-03-17 00:08:46 +01:00
LICENSE BSD3 2012-11-06 22:20:15 +01:00
Makefile.am generate a convenient nginx.conf 2014-06-01 14:41:21 +02:00
README.md take out all youtube stuff 2015-04-20 19:36:03 +02:00
TODO make playlist usage clearer 2013-01-31 08:19:47 +01:00

EqBeats

Running a dev environment in docker

A very easy way to get a dev environment set up is by using Docker and Docker Compose. Once Docker and Docker Compose are installed on your system, run

docker-compose up

Once the image is built and the services are up, a brand new instance of EqBeats will be listening on localhost:8642. To rebuild, run

docker-compose build

Setting up a dev environment by hand

Dependencies

  • A webserver that supports FastCGI
  • PostgreSQL with libpq
  • libfcgi (or just fcgi in some package managers)
  • GNU cgicc
  • spawn-fcgi
  • libpcre++ (sometimes included with pcre)
  • TagLib >= 1.9
  • ImageMagick
  • Nettle
  • ctemplate
  • FFmpeg compiled with libfdk_aac and libopus support
  • Redis and hiredis
  • Optional: OpenBSD netcat for hitsd

Preliminary setup

Environment

You can set the EQBEATS_HTTPS variable to anything if you wish to always use HTTPS.

You also need to make sure that you are in the http group, as well as the user running the webserver.

You need the following file structure, writable by the user that will run EqBeats:

  • EQBEATS_DIR (by default: /var/lib/eqbeats/)
  • EQBEATS_DIR/tracks
  • EQBEATS_DIR/art
  • EQBEATS_DIR/art/medium
  • EQBEATS_DIR/art/thumb

Web server

We’ll assume you put the FastCGI socket in /run/eqbeats/eqbeats.sock, and that EqBeats’s data files are installed in /usr/share/eqbeats.

Here is a sample config for nginx:

server {
    listen       [::]:80;
    server_name localhost;
    client_max_body_size 100m;

    error_page 502 /static/502.html;

    location / {
        include fastcgi.conf;
        fastcgi_pass unix:/run/eqbeats/eqbeats.sock;
    }
    location /static {
        alias /usr/share/eqbeats/static/;
    }
    location /downloads/art {
        internal;
        alias /var/lib/eqbeats/art/;
    }
    location /downloads/tracks {
        internal;
        alias /var/lib/eqbeats/tracks/;
    }
    location /robots.txt {
        alias /usr/share/eqbeats/static/robots.txt;
    }
}

PostgreSQL database

By default, EqBeats will use the default PostgreSQL DB for your user, so make sure you have one and that the pgcrypto extension is enabled on it.

su postgres -c 'createuser -d YOURNAME'
su YOU -c 'createdb'
su postgres
echo "CREATE EXTENSION pgcrypto;" | psql -d YOURNAME

Then, import the database schema:

psql -d YOURNAME < sql/db.sql

Redis database

If you want statistics support, you need to set up a Redis server to listen on a Unix socket (like /run/eqbeats/redis.sock). It is recommended that only the user that runs EqBeats is allowed to access it.

A sample Redis configuration is available in conf/redis-eqbeats.conf. A systemd unit is also provided in conf/redis-eqbeats.service.

Installing from source

If you want to generate the configure script, run:

./autogen.sh

You can then see the available options with:

./configure --help

After that, the usual procedure will do:

./configure
make
make install

Running

If you’re running systemd, you can use the service unit at conf/eqbeats.service. You’ll need to have spawn-fcgi and multiwatch installed in order to use it. You might as well want conf/tmpfiles-eqbeats.conf (see tmpfiles.d(5) for more information).

Since EqBeats is a regular FastCGI application, you can spawn it the way you want though.