Added UI for Database settings
Also cleanup some documentation *Database Settings have been renamed and will require manually fixing from 6.2beta1* database.varchar.maxlength -> DatabaseMysqlMaxlength database.config.type -> DatabaseConfigType database.config.embed.driver -> DatabasigEmbedDriver database.config.embed.url -> DatabaseConfigEmbedUrl database.config.embed.username -> DatabasigEmbedUsername database.config.embed.password -> DatabasigEmbedPassword database.config.jndi.name -> DatabaseConfigJNDIName database.usertable.quote -> DatabaseUsertableQuote Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
# Startup Configuration Guide
|
||||
|
||||
Libresonic has some system-wide configuration. These configurations are stored in the
|
||||
`libresonic.properties` file. There is one exception, which is the `libresonic.home` parameter which
|
||||
is supplied as a Java System Property.
|
||||
|
||||
## `libresonic.properties`
|
||||
These parameters are simple key-value pairs stored in a list. It is recommended that these parameters
|
||||
are changed through the web interface settings page. However, they can also be modified directly. Shutdown
|
||||
your server first, modify, then start it for changes to take effect.
|
||||
|
||||
## Java Parameters
|
||||
The `libresonic.home` parameter is a Java System Property that is not modifiable through the web interface.
|
||||
It must be configured via Java startup parameters. See below for steps to do this.
|
||||
|
||||
#### `libresonic.home`
|
||||
This parameter dictates the folder where Libresonic will store its logs,
|
||||
settings, transcode binaries, index and database if using the default H2
|
||||
database. As such it is recommended to backup this folder.
|
||||
|
||||
*default: `/var/libresonic` or `C:\\music`*
|
||||
|
||||
#### Setting Java Parameters on Tomcat
|
||||
As described in the [RUNNING.txt](http://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt) doc provided by tomcat,
|
||||
you can create a file named `setenv.sh` or for windows `setenv.bat` in the Tomcat home `bin` folder to modify the
|
||||
java args.
|
||||
|
||||
Here is an example of a `setenv.sh` file (`setenv.bat` has slightly different syntax):
|
||||
```
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dlibresonic.home=/home/andrew/.cache/libresonic-test"
|
||||
```
|
||||
|
||||
#### Setting Java Parameters for Standalone Package (SpringBoot)
|
||||
When running the standalone package, add `-Dlibresonic.home=YOUR_PATH_HERE` to the `java` command line right before the
|
||||
`-jar` argument. Here is an example for linux (windows users will want to use their OS specific path syntax i.e.
|
||||
`C:\\your\path`)
|
||||
|
||||
```
|
||||
java -Dlibresonic.home=/home/andrew/libresonichome -jar libresonic.war
|
||||
```
|
||||
@@ -21,16 +21,19 @@ We will refer to container managed configuration as jndi and libresonic managed
|
||||
In your libresonic.properties file, you will need to add the following settings (this is just an example):
|
||||
|
||||
```
|
||||
database.config.type=embed
|
||||
database.config.embed.driver=org.hsqldb.jdbcDriver
|
||||
database.config.embed.url=jdbc:hsqldb:file:/tmp/libre/db/libresonic
|
||||
database.config.embed.username=sa
|
||||
database.config.embed.password=
|
||||
DatabaseConfigType=embed
|
||||
DatabaseConfigEmbedDriver=org.hsqldb.jdbcDriver
|
||||
DatabaseConfigEmbedUrl=jdbc:hsqldb:file:/tmp/libre/db/libresonic
|
||||
DatabaseConfigEmbedUsername=sa
|
||||
DatabaseConfigEmbedPassword=
|
||||
```
|
||||
|
||||
In addition, you will need to ensure that a jdbc driver suitable for your
|
||||
database is on the
|
||||
[classpath](https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html)
|
||||
[classpath](https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html).
|
||||
|
||||
*Note adding to the classpath is currently pretty difficult for spring-boot. Tomcat is easy, just copy into tomcat home
|
||||
/lib. TODO: provide prebuilt artifacts with tested databases built in?*
|
||||
|
||||
## JNDI
|
||||
*Before doing anything, make sure your database is properly backed up. Ensure your server is shutdown*
|
||||
@@ -38,8 +41,8 @@ database is on the
|
||||
In your libresonic.properties file, you will need to add the following settings (this is just an example):
|
||||
|
||||
```
|
||||
database.config.type=jndi
|
||||
database.config.jndi.name=jdbc/libresonicDB
|
||||
DatabaseConfigType=jndi
|
||||
DatabaseConfigJNDIName=jdbc/libresonicDB
|
||||
```
|
||||
|
||||
Then in your context.xml in your tomcat directory, add the jndi config:
|
||||
@@ -65,5 +68,10 @@ Finally, copy the jdbc driver from the database vendor website to the `lib` dire
|
||||
|
||||
`stringtype=unspecified` on your jdbc url string is necessary.
|
||||
|
||||
You will also need to add `database.usertable.quote=\"` to your properties
|
||||
You will also need to add `DatabaseUsertableQuote=\"` to your properties
|
||||
file. This is due to the fact that our `user` table is a keyword for postgres.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
In the event that you change these settings, restart your server and it fails to start, you can remedy this by reverting
|
||||
to the LEGACY config by removing all `Database*` settings from your `libresonic.properties` file.
|
||||
|
||||
Reference in New Issue
Block a user