Airsonic: Unable to add managerPass to airsonic.properties crashes after install

Created on 19 Apr 2020  路  4Comments  路  Source: airsonic/airsonic

Problem description

I am trying to set up a stack of services in Docker that will authenticate to LDAP and, wherever possible, setting up the authentication in configuration so the user won't have to go into each app to switch it on manually. In Airsonic, it seems that I can do this by writing the necessary LDAP fields in airsonic.properties and volume mounting the file. The problem is that when starting the container for first time (as in, the admin user's password has not been reset), the app crashes. Log shows an error

 Caused by: java.lang.IllegalStateException: managerPassword is required if managerDn is supplied

Steps to reproduce

  1. Write and save a airsonic.properties with the following content:
JWTKey=test
SettingsChanged=
MediaLibraryStatistics=1512 4850 62662 486912890569 15485585
LastScanned=
IndexString=A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ)
IgnoredArticles=The El La Los Las Le Les
Shortcuts=New Incoming Podcast
PlaylistFolder=/var/playlists
MusicFileTypes=mp3 ogg oga aac m4a flac wav wma aif aiff ape mpc shn
VideoFileTypes=flv avi mpg mpeg mp4 m4v mkv mov wmv ogv divx m2ts
CoverArtFileTypes2=cover.jpg cover.png cover.gif folder.jpg jpg jpeg gif png
SortAlbumsByYear=true
GettingStartedEnabled=false
WelcomeTitle=Airsonic
WelcomeSubtitle=
WelcomeMessage2=
LoginMessage=
Theme=default
LocaleLanguage=en
LocaleCountry=
LocaleVariant=
IndexCreationInterval=3
IndexCreationHour=3
FastCacheEnabled=false
OrganizeByFolderStructure=true
DownloadBitrateLimit=0
UploadBitrateLimit=0
LdapEnabled=true
LdapUrl=ldap://openldap:389/ou=people,dc=example,dc=com
LdapSearchFilter=(uid={0})
LdapManagerDn=cn=admin,dc=example,dc=com
LdapManagerPass=test
LdapAutoShadowing=false
SmtpServer=smtp.mail.net
SmtpEncryption=SSL/TLS
SmtpPort=465
[email protected]
[email protected]
SmtpPassword=XXXXXXXXXXXXXXXXXXXXXXX
  1. Write and save a docker-compose.yml file:'
version: '3.5'

services:
    openldap:
        image: osixia/openldap:1.3.0
        container_name: openldap-test
        restart: unless-stopped
        environment:
            - LDAP_RFC2307BIS_SCHEMA=true
            - LDAP_ORGANISATION=Airsonic Test
            - LDAP_DOMAIN=example.com
            - LDAP_ADMIN_PASSWORD=test
            - LDAP_CONFIG_PASSWORD=test
            - LDAP_BASE_DN=ou=people,dc=example,dc=com
            - LDAP_READONLY_USER=true
            - LDAP_READONLY_USER_USERNAME=readonly
            - LDAP_READONLY_USER_PASSWORD=readonly
            - LDAP_TLS_ENFORCE=false
        ports:
            - "389:389"
            - "636:636"
        command: --copy-service

    airsonic:
        image: airsonic/airsonic
        container_name: airsonic-test
        environment:
            - PUID=1000
            - PGID=1000
        volumes:
            - ./airsonic.properties:/airsonic/data/airsonic.properties
        restart: unless-stopped

Alternatively, just clone this repo: https://github.com/ProfessorSalty/airsonic-test

System information

  • Airsonic version: 10.6.0-release
  • Operating system: Ubuntu 19.10
  • Java version: Whatever is in the container
  • Proxy server: Traefik v2.2
  • Client: n/a
  • Language: en-us
external cooperation stale feedback-provided question

All 4 comments

So, unfortunately I don't use LDAP and have little experience with it, and even our documentation is "work in progress"...

If you (or someone) figure if out and feel like improving things, I'll happily welcome improvements to Airsonic and/or documentation, this is definitely one of the areas where we could make things easier...

If someone can point me in the right direction, I'd be happy to take a whack at it.

airsonic just slaps on Spring's ldap auth manager to provide ldap auth. The relevant portion of the code is here: https://github.com/airsonic/airsonic/blob/master/airsonic-main/src/main/java/org/airsonic/player/security/GlobalSecurityConfig.java#L55-L64

Spring is throwing this exception and therefore you'll likely need to search for Spring-related answers. Here's a quick google that might or might not yield an answer: https://stackoverflow.com/questions/26472734/ldap-authentication-without-managerdn-and-manager-password

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

protist picture protist  路  8Comments

fxthomas picture fxthomas  路  9Comments

anarcat picture anarcat  路  5Comments

Uatschitchun picture Uatschitchun  路  3Comments

danieldietsch picture danieldietsch  路  6Comments