Implement user deletion
Properly handle missing session cookie
Merge branch 'user_api'
Hypnos allows you to listen to your music from anywhere in the world, where you have access to an internet connection.
It uses the embedded tags in your files to determine the audio metadata. Cover art is supported via external files in the same directory as the songs.
Hypnos consists of two parts.
A backend called Soil. It reads your audio
library on startup and saves the found Songs into a Postgresql database.
It provides an API which you can use to get information about your audio
library.
The backend will transparently transcode your songs for playback using ffmpeg
.
There is also a frontend called Solanum. It runs in the browser and allows you to browse your library and play songs.
Currently the following files are supported:
Songs:
Cover Art:
Field | Tags | Required |
---|---|---|
Album Artist | album artist, albumartist, album_artist | Yes |
Album Title | album | Yes |
Song Title | title | Yes |
Track Number | track, tracknumber | Yes |
Disc | disc | No |
On Archlinux you can use the hypnos-soil AUR package.
Checkout Soil and compile it with
cargo build --release
. This should result in a binary at
target/release/soil
. Soil is configured entirely with environment variables:
Parameter | Info |
---|---|
DB_HOST | The host of the Postgresql DB (e.g. localhost) |
DB_USER | Which user to connect to the DB |
DB_PW | Which password to use to connect to the DB |
DB_NAME | Which Database to connect to |
LISTEN | On which IP address and port to listen. Use 0.0.0.0 to listen on all interfaces |
MUSIC_LIB | Path to the folder containing your Songs (e.g. /srv/hypnos/music) |
You might want to use systemd
to launch soil. The author uses the following unit file:
# /etc/systemd/system/soil.service
[Unit]
Description=Soil - Hypnos backend
After=network.target
[Service]
User=soil
EnvironmentFile=/etc/conf.d/soil
ExecStart=/usr/bin/soil
[Install]
WantedBy=multi-user.target
Please refer to the Solanum documentation
Soil by itself does not support https or access management. You might want to use a reverse proxy to limit access. The author uses an httpd
configuration like the following
<VirtualHost _default_:443>
ServerName your.domain.com
SSLEngine On
SSLCertificateFile /path/to/SSLCert
SSLCertificateKeyFile /path/to/SSLKey
# Serves the Solanum frontend
DocumentRoot "/srv/http/solanum"
<Directory /srv/http/solanum>
AuthName "Hypnos - Come and chill"
AuthUserFile "/etc/httpd/conf/users"
AuthType Basic
Header always unset Strict-Transport-Security
Require valid-user granted
AllowOverride None
</Directory>
# Serves the Soil backend
<LocationMatch "/(albums|song/.*|cover/.*)$">
AuthName "Hypnos - Come and chill"
AuthUserFile "/etc/httpd/conf/users"
AuthType Basic
Require valid-user granted
ProxyPassMatch http://localhost:3030/$1
ProxyPassReverse http://localhost:3030/$1
</LocationMatch>
</VirtualHost>
If you encounter any bugs in either Soil or Solanum please create a ticket at https://todo.sr.ht/~serra/hypnos. You can also add feature requests there.
If you have any improvements, questions or suggestions that don't seem fit for the bugtracker please write a mail to hypnos@peterlamby.de.
If you want to contribute code please send your patches to hypnos@peterlamby.de. You can either use git-send-email to send the patches directly or just host your patches somewhere and send me a pull request via email.