Openfire install/configuration automation via <autosetup> tag

Hi all,
I am working on PowerShell script that will reset configuration of existing Openfire installation.
I am using this to automate process:
Autosetup
While everything so far is working as expected I cannot find a way to configure AD (ldap).
By looking at example provided it looks like that <authprovider> is tag for ldap configuration? If this is true I would appreciate if somebody can provide additional info or point me to some documentation what are the the other tags required.
Further to discussion our current installation was originally configured with AD and after running above autosetup, profile section in web interface is now locked to default. Directory Server (LDAP) option while I can click it does not do any change (both buttons are selected at the same time)
I tried to change <mode>default</mode> to <mode> LDAP </mode> but nothing happens. Probably I need correct syntax but cannot find more info.
Thanks

If it can help to somebody else, here is code that worked for me with little bit of trial and error :

<jive>
<autosetup>
        <run>true</run>
        <locale>en</locale>
        <xmpp>
            <domain>localhost</domain>
            <fqdn>localhost</fqdn>
            <auth>
                <anonymous>true</anonymous>
            </auth>
            <socket>
                <ssl>
                    <active>true</active>
                </ssl>
            </socket>
        </xmpp>
        <encryption>
            <algorithm>AES</algorithm>
            <key>some-key</key>
        </encryption>
        <database>
            <mode>standard</mode>
            <defaultProvider>
                <driver>org.postgresql.Driver</driver>
                <serverURL>jdbc:postgresql://localhost:5432/a-database</serverURL>
                <username>a-database</username>
                <password>a-password</password>
                <minConnections>5</minConnections>
                <maxConnections>25</maxConnections>
                <connectionTimeout>1.0</connectionTimeout>
            </defaultProvider>
        </database>
        <admin>
            <email>admin@example.com</email>
        <password>admin</password>
        </admin>
        <authprovider>
            <mode>default</mode>
        </authprovider>
        <users>
            <user1> <!-- Use incremental numbers for more users, eg: user2, user3 -->
                <username>jane</username> <!-- Required -->
                <password>secret</password> <!-- Required -->
                <name>Jane Doe</name>
                <email>user1@example.org</email>
                <roster>
                    <item1> <!-- Use incremental numbers for more items, eg: item2, item3 -->
                        <jid>john@example.com</jid>
                        <nickname>John</nickname>
                    </item1>
                </roster>
            </user1>
        </users>
    </autosetup>
      <ldap>
        <host></host>
        <port>389</port>
        <usernameField>uid</usernameField>
        <nameField>cn</nameField>
        <emailField>mail</emailField>
        <baseDN>ou=People;dc=example;dc=com</baseDN>
        <adminDN>cn=Directory Administrator</adminDN>
        <adminPassword></adminPassword>
      </ldap>
      <provider>
        <user>
          <className>org.jivesoftware.openfire.ldap.LdapUserProvider</className>
        </user>
        <auth>
          <className>org.jivesoftware.openfire.ldap.LdapAuthProvider</className>
        </auth>
        <group>
          <className>org.jivesoftware.openfire.ldap.LdapGroupProvider</className>
        </group>
      </provider>
      <admin>
        <authorizedUsernames>joe, jane</authorizedUsernames>
      </admin>
    </jive>

NOTE:

  • Ensure that <setup>true</setup> does not exist.
  • After running openfire service <autosetup> and <ldap> tags should disappear from openfire.xml.
  • There will be left only sections that automated installer cannot (or wont) change in DB for various reasons (e.g. if entry already exists). According to log messages You would need to change them in DB directly.
  • openfire.log helped me to narrow issues.
1 Like