Better Buster compatibility

This commit is contained in:
emeric
2019-09-16 19:20:35 +02:00
parent 2c5917235a
commit c65338ef4d
6 changed files with 84 additions and 68 deletions
+61 -42
View File
@@ -48,18 +48,45 @@ __Note__: since _LMS_ stores hashed and salted passwords, it cannot handle the _
## Installation ## Installation
__Note__: this installation process and the default values of the configuration file and the _systemd_ service file have been written for _Debian Buster_. Therefore, you may have to adapt commands and/or paths in order to fit to your distribution. ### From packages
### Build dependencies #### Debian Buster packages
_Buster_ packages are provided for _amd64_ and _armhf_ architectures.
As root, trust the following debian package provider and add it in your list of repositories:
```sh
wget -O - https://debian.poupon.io/apt/debian/epoupon.gpg.key | apt-key add -
echo "deb https://debian.poupon.io/apt/debian buster main" > /etc/apt/sources.list.d/epoupon.list
```
To install _LMS_:
```sh
apt-get update
apt-get install lms
```
To upgrade _LMS_:
```sh
apt-get update
apt-get install lms
```
By default, the _lms_ service is started just after the package installation. You may want to refer to [Deployment](#deployment) for further configuration options.
### From Sources
__Note__: this installation process and the default values of the configuration files have been written for _Debian Buster_. Therefore, you may have to adapt commands and/or paths in order to fit to your distribution.
#### Build dependencies
__Note__: a C++17 compiler is needed to compile _LMS_ __Note__: a C++17 compiler is needed to compile _LMS_
```sh ```sh
apt-get install g++ autoconf automake libboost-filesystem-dev libboost-system-dev libavcodec-dev libavutil-dev libavformat-dev libav-tools libmagick++-dev libpstreams-dev libconfig++-dev libpstreams-dev ffmpeg libtag1-dev apt-get install g++ autoconf automake libboost-filesystem-dev libboost-system-dev libavutil-dev libavformat-dev libmagick++-dev libpstreams-dev libconfig++-dev libpstreams-dev ffmpeg libtag1-dev
``` ```
You also need _W4_, that is not packaged yet on _Debian_. See [installation instructions](https://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html). You also need _W4_, that is not packaged yet on _Debian_. See [installation instructions](https://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html).
### Build #### Build
Get the latest stable release and build it: Get the latest stable release and build it:
```sh ```sh
@@ -81,13 +108,7 @@ make
``` ```
__Note__: you can use `make -jN` to speed up compilation time (N is the number of compilation workers to spawn). __Note__: you can use `make -jN` to speed up compilation time (N is the number of compilation workers to spawn).
#### Raspberry 3 build notes #### Installation
Due to memory limitations, you may need to build _Wt4_ in _Release_ mode if you want to compile it natively on a Raspberry Pi3B+.
The build process is really long, roughly 1 hour to build _Wt4_ + _LMS_.
### Deployment
__Note__: the commands of this section require root privileges. __Note__: the commands of this section require root privileges.
@@ -106,14 +127,34 @@ cp /usr/share/lms/default.conf /etc/lms.conf
cp /usr/share/lms/default.service /lib/systemd/system/lms.service cp /usr/share/lms/default.service /lib/systemd/system/lms.service
``` ```
Create working directories and give access to the _lms_ user: Create the working directory and give it access to the _lms_ user:
```sh ```sh
mkdir /var/lms mkdir /var/lms
touch /var/log/lms.log chown lms:lms /var/lms
touch /var/log/lms.access.log
chown lms:lms /var/lms /var/log/lms.log /var/log/lms.access.log
``` ```
To make _LMS_ run automatically during startup:
```sh
systemctl enable lms
```
#### Upgrade
To upgrade `LMS` from sources, you need to update the master branch and rebuild/install it:
```sh
cd build
git pull
make
```
Then using root privileges:
```sh
make install
systemctl restart lms
```
## Deployment
__Note__: don't forget to give the _lms_ user read access to the music directory you want to scan. __Note__: don't forget to give the _lms_ user read access to the music directory you want to scan.
### Configuration ### Configuration
@@ -156,36 +197,14 @@ server {
```sh ```sh
systemctl start lms systemctl start lms
``` ```
Two log files are used:
* `/var/log/lms.log`: logs of the `lms` daemon Log traces can be accessed using journactl:
* `/var/log/lms.access.log`: access logs of the embedded web server ```sh
journalctl -u lms.service
```
To connect to _LMS_, just open your favorite browser and go to http://localhost:5082 To connect to _LMS_, just open your favorite browser and go to http://localhost:5082
To make _LMS_ run automatically during startup:
```sh
systemctl enable lms
```
## Upgrade
To upgrade `LMS`, you need to update the master branch and rebuild/install it:
```sh
cd build
git pull
make
```
Then using root privileges:
```sh
make install
systemctl restart lms
```
Read the [release notes](https://github.com/epoupon/lms/releases) to check if any relevant setting has been added into the configuration file.
Any change in the database schema is made automatically by the application during startup.
## Credits ## Credits
* Wt (http://www.webtoolkit.eu/) * Wt (http://www.webtoolkit.eu/)
* bootstrap3 (http://getbootstrap.com/) * bootstrap3 (http://getbootstrap.com/)
+7 -6
View File
@@ -3,8 +3,12 @@
# Path to the working directory # Path to the working directory
# Must have write privileges in order to create and modify this directory # Must have write privileges in order to create and modify this directory
working-dir = "/var/lms/"; working-dir = "/var/lms/";
log-file = "/var/log/lms.log";
access-log-file = "/var/log/lms.access.log"; # Log files, empty means stdout
log-file = "";
access-log-file = "";
# Logger configuration, see log-config in https://webtoolkit.eu/wt/doc/reference/html/overview.html#config_general
log-config = "* -debug -info:WebRequest";
# Listen port/addr of the web server # Listen port/addr of the web server
listen-port = 5082; listen-port = 5082;
@@ -18,7 +22,7 @@ tls-key = "/var/lms/privkey.pem";
tls-dh = "/var/lms/dh2048.pem"; tls-dh = "/var/lms/dh2048.pem";
# Path to the resources used by the web interface # Path to the resources used by the web interface
wt-resources="/usr/share/Wt/resources"; wt-resources = "/usr/share/Wt/resources";
docroot = "/usr/share/lms/docroot/;/resources,/css,/images,/js,/favicon.ico"; docroot = "/usr/share/lms/docroot/;/resources,/css,/images,/js,/favicon.ico";
approot = "/usr/share/lms/approot"; approot = "/usr/share/lms/approot";
@@ -28,9 +32,6 @@ acousticbrainz-api-url = "https://acousticbrainz.org/api/v1/";
# API # API
api-subsonic = true; api-subsonic = true;
# Logger configuration, see log-config in https://webtoolkit.eu/wt/doc/reference/html/overview.html#config_general
log-config = "* -debug -info:WebRequest";
# Turn on this option to allow the demo account creation/use # Turn on this option to allow the demo account creation/use
demo = false; demo = false;
+6 -11
View File
@@ -1,5 +1,5 @@
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT(lms, 2.2.0, test@test) AC_INIT(lms, 3.0.0, test@test)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AC_CONFIG_HEADER(src/config/config.h) AC_CONFIG_HEADER(src/config/config.h)
@@ -29,6 +29,11 @@ AC_CHECK_LIB([pthread],
, ,
[AC_MSG_ERROR([libpthread not found!])]) [AC_MSG_ERROR([libpthread not found!])])
AC_CHECK_LIB([boost_system],
[main],
,
[AC_MSG_ERROR([libboost_system not found!])])
AC_CHECK_LIB([wt], AC_CHECK_LIB([wt],
[main], [main],
, ,
@@ -55,21 +60,11 @@ AC_CHECK_LIB([avutil],
, ,
[AC_MSG_ERROR([libavutil not found!])]) [AC_MSG_ERROR([libavutil not found!])])
AC_CHECK_LIB([avcodec],
[avcodec_find_decoder],
,
[AC_MSG_ERROR([libavcodec not found!])])
AC_CHECK_LIB([avformat], AC_CHECK_LIB([avformat],
[av_read_frame], [av_read_frame],
, ,
[AC_MSG_ERROR([libavformat not found!])]) [AC_MSG_ERROR([libavformat not found!])])
AC_CHECK_LIB([boost_system],
[main],
,
[AC_MSG_ERROR([libboost_system not found!])])
AC_CHECK_LIB( [tag], AC_CHECK_LIB( [tag],
[main], [main],
, ,
+1
View File
@@ -66,6 +66,7 @@ std::vector<std::string> generateWtConfig(std::string execPath)
args.push_back("--http-address=" + getService<Config>()->getString("listen-addr", "0.0.0.0")); args.push_back("--http-address=" + getService<Config>()->getString("listen-addr", "0.0.0.0"));
} }
if (!wtAccessLogFilePath.empty())
args.push_back("--accesslog=" + wtAccessLogFilePath.string()); args.push_back("--accesslog=" + wtAccessLogFilePath.string());
// Generate the wt_config.xml file // Generate the wt_config.xml file
+1 -1
View File
@@ -179,7 +179,7 @@ Explore::Explore()
static static
std::vector<Database::IdType> std::vector<Database::IdType>
getArtistsTracks(Database::Session& session, const std::vector<Database::IdType>& artistsId, const std::set<Database::IdType>& clusters) getArtistsTracks(Database::Session& session, const std::vector<Database::IdType>& artistsId, const std::set<Database::IdType>&)
{ {
std::vector<Database::IdType> res; std::vector<Database::IdType> res;
+6 -6
View File
@@ -1,17 +1,17 @@
TESTS = som database TESTS = test-som test-database
check_PROGRAMS = som database check_PROGRAMS = test-som test-database
som_SOURCES = \ test_som_SOURCES = \
$(srcdir)/som/SomTest.cpp \ $(srcdir)/som/SomTest.cpp \
$(top_srcdir)/src/similarity/features/som/DataNormalizer.cpp \ $(top_srcdir)/src/similarity/features/som/DataNormalizer.cpp \
$(top_srcdir)/src/similarity/features/som/Network.cpp $(top_srcdir)/src/similarity/features/som/Network.cpp
som_CXXFLAGS=-std=c++17 -I${top_srcdir}/src/ -I${top_srcdir}/src/similarity/features/som/ test_som_CXXFLAGS=-std=c++17 -I${top_srcdir}/src/ -I${top_srcdir}/src/similarity/features/som/
database_SOURCES = \ test_database_SOURCES = \
$(srcdir)/database/DatabaseTest.cpp \ $(srcdir)/database/DatabaseTest.cpp \
$(top_srcdir)/src/database/Artist.cpp \ $(top_srcdir)/src/database/Artist.cpp \
$(top_srcdir)/src/database/Cluster.cpp \ $(top_srcdir)/src/database/Cluster.cpp \
@@ -29,5 +29,5 @@ database_SOURCES = \
$(top_srcdir)/src/utils/Logger.cpp \ $(top_srcdir)/src/utils/Logger.cpp \
$(top_srcdir)/src/utils/Utils.cpp $(top_srcdir)/src/utils/Utils.cpp
database_CXXFLAGS=-std=c++17 -I${top_srcdir}/src/ test_database_CXXFLAGS=-std=c++17 -I${top_srcdir}/src/