Merge branch 'develop' into sortname

This commit is contained in:
emeric
2020-04-04 14:08:30 +02:00
4 changed files with 25 additions and 10 deletions
+14
View File
@@ -98,6 +98,7 @@ Get the latest stable release and build it:
git clone https://github.com/epoupon/lms.git lms
cd lms
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
```
__Note__: in order to customize the installation directory, you can use the _-DCMAKE_INSTALL_PREFIX_ option (defaults to `/usr/local`).
@@ -163,6 +164,19 @@ All other settings are set using the web interface (user management, scan settin
If a setting is not present in the configuration file, a hardcoded default value is used (the same as in the [default.conf](https://github.com/epoupon/lms/blob/master/conf/lms.conf) file)
### Deploy on non root path
If you want to deploy on non root path (e.g. https://mydomain.com/newroot/), you have to set the `deploy-path` option accordingly in `lms.conf`.
As static resources are __not__ related to the `deploy-path` option, you have to perform the following steps if you want them to be on a non root path too:
* Create a new intermediary `newroot` directory in `/usr/share/lms/docroot` and move everything in it.
* Symlink `/usr/share/lms/docroot/newroot/resources` to `/usr/share/Wt/resources`.
* Edit `lms.conf` and set:
```
wt-resources = "" # do not comment the whole line
docroot = "/usr/share/lms/docroot/;/newroot/resources,/newroot/css,/newroot/images,/newroot/js,/newroot/favicon.ico";`
deploy-path = "/newroot/"; # ending slash is important
```
### 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.
+3 -4
View File
@@ -18,19 +18,18 @@ listen-port = 5082;
listen-addr = "0.0.0.0";
behind-reverse-proxy = false;
# Location for deployment
deploy-path = "/";
# If enabled, these files have to exist and have correct permissions
tls-enable = false;
tls-cert = "/var/lms/cert.pem";
tls-key = "/var/lms/privkey.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";
docroot = "/usr/share/lms/docroot/;/resources,/css,/images,/js,/favicon.ico";
approot = "/usr/share/lms/approot";
# Location for deployment (See README if you want to deploy on a non root path)
deploy-path = "/";
# Acoustic brainz's root API
acousticbrainz-api-url = "https://acousticbrainz.org/api/v1/";
+3 -1
View File
@@ -43,13 +43,15 @@ std::vector<std::string> generateWtConfig(std::string execPath)
const std::filesystem::path wtConfigPath {ServiceProvider<IConfig>::get()->getPath("working-dir") / "wt_config.xml"};
const std::filesystem::path wtLogFilePath {ServiceProvider<IConfig>::get()->getPath("log-file", "/var/log/lms.log")};
const std::filesystem::path wtAccessLogFilePath {ServiceProvider<IConfig>::get()->getPath("access-log-file", "/var/log/lms.access.log")};
const std::filesystem::path wtResourcesPath {ServiceProvider<IConfig>::get()->getPath("wt-resources", "/usr/share/Wt/resources")};
args.push_back(execPath);
args.push_back("--config=" + wtConfigPath.string());
args.push_back("--docroot=" + ServiceProvider<IConfig>::get()->getString("docroot"));
args.push_back("--approot=" + ServiceProvider<IConfig>::get()->getString("approot"));
args.push_back("--deploy-path=" + ServiceProvider<IConfig>::get()->getString("deploy-path", "/"));
args.push_back("--resources-dir=" + ServiceProvider<IConfig>::get()->getString("wt-resources"));
if (!wtResourcesPath.empty())
args.push_back("--resources-dir=" + wtResourcesPath.string());
if (ServiceProvider<IConfig>::get()->getBool("tls-enable", false))
{
+5 -5
View File
@@ -153,9 +153,9 @@ LmsApplication::LmsApplication(const Wt::WEnvironment& env,
messageResourceBundle().use(appRoot() + "tracksinfo");
// Require js here to avoid async problems
requireJQuery("/js/jquery-1.10.2.min.js");
require("/js/mediaplayer.js");
require("/js/bootstrap-notify.js");
requireJQuery("js/jquery-1.10.2.min.js");
require("js/mediaplayer.js");
require("js/bootstrap-notify.js");
setTitle("LMS");
@@ -293,7 +293,7 @@ LmsApplication::handleException(LmsApplicationException& e)
btn->clicked().connect([this]()
{
setConfirmCloseMessage("");
redirect("/");
redirect(".");
});
}
@@ -302,7 +302,7 @@ LmsApplication::goHomeAndQuit()
{
setConfirmCloseMessage("");
WApplication::quit("");
redirect("/");
redirect(".");
}
enum IdxRoot