Skip to content

Commit

Permalink
Merge branch 'develop-upstream' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/libs/database/impl/Migration.cpp
#	src/libs/database/include/database/Track.hpp
#	src/libs/metadata/impl/TagLibTagReader.cpp
#	src/libs/services/scanner/impl/ScanStepScanFiles.cpp
#	src/libs/subsonic/impl/SubsonicResponse.hpp
  • Loading branch information
tsshadow committed Dec 20, 2024
2 parents c6eaac3 + 2899db7 commit 6415be9
Show file tree
Hide file tree
Showing 344 changed files with 10,564 additions and 4,108 deletions.
7 changes: 5 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Checks: '-*,bugprone-*,concurrency-*,cppcoreguidelines-*,misc-*,-misc-include-cleaner,-misc-no-recursion,performance*,portability-*,readability-*,-readability-braces-around-statements,-readability-identifier-length,-readability-implicit-bool-conversion'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: none
User: ''
CheckOptions:
Expand All @@ -13,5 +12,9 @@ CheckOptions:
- key: cppcoreguidelines-avoid-do-while.IgnoreMacros
value: '1'
- key: performance-unnecessary-value-param.AllowedTypes
value: "shared_ptr"
value: "shared_ptr;ObjectPtr;.*::pointer"
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted
value: '1'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '1'
...
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
CMakeCache.txt
CMakeFiles/
build/
.vscode/
.cache/
.vscode/
4 changes: 2 additions & 2 deletions Dockerfile-release
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM alpine:3.19 AS build

WORKDIR /tmp/workdir

ARG PREFIX="/tmp/install"
ENV PREFIX="/tmp/install"

ARG BUILD_PACKAGES=" \
ca-certificates \
Expand Down Expand Up @@ -118,7 +118,7 @@ COPY . /tmp/lms/
RUN \
DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR} && \
PKG_CONFIG_PATH=/tmp/install/lib/pkgconfig CXXFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib -Wl,--rpath-link=${PREFIX}/lib" cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_PREFIX_PATH=${PREFIX} && \
LD_LIBRARY_PATH=${PREFIX}/lib VERBOSE=1 make -j$(nproc) && \
LD_LIBRARY_PATH=${PREFIX}/lib make -j$(nproc) && \
LD_LIBRARY_PATH=${PREFIX}/lib make test && \
make install && \
mkdir -p ${PREFIX}/etc/ && \
Expand Down
22 changes: 16 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
+ [Upgrade](#upgrade)
- [Deployment](#deployment)
* [Configuration](#configuration)
* [Authentication backend](#authentication-backend)
* [Authentication backends](#authentication-backends)
* [Deploy on non root path](#deploy-on-non-root-path)
* [Reverse proxy settings](#reverse-proxy-settings)
- [Run](#run)
- [First launch](#first-launch)
# Installation
## Docker
_Docker_ images are available, please see detailed instructions on https://hub.docker.com/r/epoupon/lms.
Expand Down Expand Up @@ -100,7 +101,7 @@ __Note__: don't forget to give the _lms_ user read access to the music directory
_LMS_ uses a configuration file, installed by default in `/etc/lms.conf`. It is recommended to edit this file and change relevant settings (listen address, listen port, working directory, Subsonic API activation, deployment path, ...).
All other settings are set using the web interface (user management, scan settings, transcode settings, ...).
If a setting is not present in the configuration file, a hardcoded default value is used (the same as in the [default configuration file](conf/lms.conf))
## Authentication backend
## Authentication backends
You can define which authentication backend to be used thanks to the `authentication-backend` option:
* `internal` (default): _LMS_ uses an internal database to store users and their associated passwords (salted and hashed using [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt)). Only the admin user can create, edit or remove other users.
* `PAM`: the user/password authentication request is forwarded to PAM (see the default [PAM configuration file](conf/pam/lms) provided).
Expand Down Expand Up @@ -129,7 +130,10 @@ deploy-path = "/newroot/"; # ending slash is important
```
If you use nginx as a reverse proxy, you can simply replace `location /` with `location /newroot/` to achieve the same result.
## Reverse proxy settings
_LMS_ is shipped with an embedded web server, but it is recommended to deploy behind a reverse proxy. You have to set the _behind-reverse-proxy_ option to _true_ in the `lms.conf` configuration file.
_LMS_ is shipped with an embedded web server, but it is recommended to deploy behind a reverse proxy. You have to set the `behind-reverse-proxy` option to _true_ in the `lms.conf` configuration file and to adjust the trusted proxy list in `trusted-proxies` option.

__Note__: when running in a docker environment, you have to trust the docker gateway IP (which is `172.17.0.1` by default)

Here is an example to make _LMS_ properly work on _myserver.org_ using _nginx_:
```
server {
Expand All @@ -147,10 +151,9 @@ server {
keepalive_timeout 10m;
location / {
proxy_set_header Client-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:5082/;
Expand All @@ -168,3 +171,10 @@ Log traces can be accessed using journactl:
journalctl -u lms.service
```
To connect to _LMS_, just open your favorite browser and go to `http://localhost:5082`
# First launch
At the first launch, a setup assistant will guide you through creating the administrator account (username and password). Once this information is saved, you can refresh the page to access the _LMS_ login screen.
__Note__: If you are using `PAM` or `http-header` authentication, this setup assistant will not appear (see [Authentication backends](#authentication-backends)).

Once logged in as an administrator, you will need to define your libraries—that is, select the music folders you want to scan. Then, check that the scan settings meet your needs (scan frequency, tag delimiters, etc.).

You can now initiate the initial scan to import your music into _LMS_.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ _LMS_ is a self-hosted music streaming software: access your music collection fr
A [demo instance](http://lms-demo.poupon.dev) is available. Note the administration settings are not available.

## Main features
* Recommendation engine
* [Subsonic/OpenSubsonic API](SUBSONIC.md) support
* Multi-valued tags: `genre`, `mood`, `artists`, ...
* Artist relationships: `composer`, `conductor`, `lyricist`, `mixer`, `performer`, `producer`, `remixer`
* [Release types](https://musicbrainz.org/doc/Release_Group/Type): `album`, `single`, `EP`, `compilation`, `live`, ...
* [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) support to handle duplicated artist and release names
* [ListenBrainz](https://listenbrainz.org) support for:
* Scrobbling and synchronizing listens
* Synchronizing 'love' feedbacks
* Audio transcoding for maximum interoperability and reduced bandwith requirements
* Recommendation engine
* Multi-library support
* ReplayGain support
* Audio transcoding for compatibility and reduced bandwidth
* User management, with several [authentication backends](INSTALL.md#authentication-backend)
* [Subsonic/OpenSubsonic API](SUBSONIC.md) support
* Playlists support
* Lyrics support

## Music discovery
_LMS_ provides several ways to help you find the music you like:
Expand All @@ -43,20 +45,26 @@ _LMS_ primarily relies on tags to organize your music collection but also suppor
### Filtering
It is possible to apply global filters on your collection using `genre`, `mood`, `grouping`, `language`, and by music library. More tags, including custom ones, can be added in the database administration settings.

__Note__: You can use the `lms-metadata` tool to get an idea of the tags parsed by _LMS_ using [TagLib](https://github.com/taglib/taglib).
__Note__: You can use the `lms-metadata` tool to get an idea of the tags parsed by _LMS_.

### Multiple artists
_LMS_ works best when using the default Picard settings, where the `artist` tag contains a single display-friendly value, and the `artists` tag holds the actual artist names. This ensures a cleaner, more organized representation of artist names, when multiple artists are involved.
_LMS_ works best when using the default [Picard](https://picard.musicbrainz.org/) settings, where the `artist` tag contains a single display-friendly value, and the `artists` tag holds the actual artist names. This ensures a cleaner, more organized representation of artist names, when multiple artists are involved.

### Multiple album artists
While LMS can manage multiple album artists using the `albumartist` tag, it works better when using the custom `albumartists` and `albumartistssort` tags, similar to how it handles regular artist tags.

__Note__: if you use [Picard](https://picard.musicbrainz.org/), add the following script to include these tags:
__Note__: if you use Picard, add the following script to include these tags:
```
$setmulti(albumartists,%_albumartists%)
$setmulti(albumartistssort,%_albumartists_sort%)
```

## Playlist support
_LMS_ supports playlist files in `m3u` and `m3u8` formats. These playlists are synced during the scan process and are available as public shared playlists.

## Lyrics support
_LMS_ supports lyrics in `lrc` files and embedded track metadata. Both synchronized and unsynchronized lyrics are supported.

## Keyboard shortcuts
* Play/pause: <kbd>Space</kbd>
* Previous track: <kbd>Ctrl</kbd> + <kbd>Left</kbd>
Expand Down
17 changes: 14 additions & 3 deletions SUBSONIC.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Subsonic API
The API version implemented is 1.16.0 and has been tested on _Android_ using _Subsonic Player_, _Ultrasonic_, _Symfonium_, and _DSub_.
The API version implemented is 1.16.0 and has been tested on _Android_ using _DSub_, _Subsonic Player_, _Symfonium_, _Tempo_ and _Ultrasonic_.

Folder navigation commands are supported. However, since _LMS_ does not store information for each folder, it is not possible to star/unstar folders considered as artists.
Given the API limitations of folder navigation commands, it is recommended to place all tracks of an album in the same folder and not to mix multiple albums in the same folder.

The Subsonic API is enabled by default.

__Note__: since _LMS_ may store hashed and salted passwords or may forward authentication requests to external services, it cannot handle the __token authentication__ method. You may need to check your client to make sure to use the __password__ authentication method. Since logins/passwords are passed in plain text through URLs, it is highly recommended to use a unique password when using the Subsonic API. Note that this may affect the use of authentication via PAM. In any case, ensure the web server logs (and proxy logs, if applicable) are properly secured.

# OpenSubsonic API
OpenSubsonic is an initiative to patch and extend the legacy Subsonic API. You'll find more details in the [official documentation](https://opensubsonic.netlify.app/)

## Authentication
_LMS_ supports the [API Key Authentication](https://opensubsonic.netlify.app/docs/extensions/apikeyauth/) method. Each user has to generate their own API key on the settings page to use the Subsonic API.

By default, API keys can also be used as passwords, provided the `user` parameter matches the API key owner. To disable this fallback authentication method, set the following in `lms.conf`:
```
api-subsonic-support-user-password-auth = false;
```

__Note__: the token+salt authentication method is not supported.

## Extra fields
The following extra fields are implemented:
* `Album` response:
Expand Down Expand Up @@ -50,4 +58,7 @@ The following extra fields are implemented:
* `roles`

## Supported extensions
* [API Key Authentication](https://opensubsonic.netlify.app/docs/extensions/apikeyauth/)
* [HTTP form POST](https://opensubsonic.netlify.app/docs/extensions/formpost/)
* [Transcode offset](https://opensubsonic.netlify.app/docs/extensions/transcodeoffset/)
* [Song Lyrics](https://opensubsonic.netlify.app/docs/extensions/songlyrics/)
2 changes: 1 addition & 1 deletion approot/artist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
${</if-has-non-release-tracks>}
${<if-has-similar-artists>}
<h3>${tr:Lms.Explore.Artist.similar-artists}</h3>
${similar-artists class="d-grid gap-3"}
${similar-artists class="row row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 gx-2 gy-4"}
${</if-has-similar-artists>}
</message>

Expand Down
11 changes: 9 additions & 2 deletions approot/artists.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@
</message>

<message id="Lms.Explore.Artists.template.entry">
${name class="text-decoration-none link-secondary"}
<div class="col h-100 Lms-bg-dark-hover rounded">
<div class="p-2">
<div class="Lms-responsive-square Lms-cover-container mb-1">
${image class="shadow-sm"}
</div>
${name class="d-block text-center text-truncate text-decoration-none link-secondary"}
</div>
</div>
</message>

<message id="Lms.Explore.Artists.template.container">
${elements class="d-grid gap-3"}
${elements class="row row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 gx-2 gy-4"}
${loading-indicator}
</message>

Expand Down
Binary file removed approot/images/unknown-artist.jpg
Binary file not shown.
9 changes: 9 additions & 0 deletions approot/images/unknown-artist.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6415be9

Please sign in to comment.