This guide describes how to setup the appNG platform with appNGizer.

1. appNGizer setup

1.1. Shared secret

REST clients that use appNGizer must establish a session. This is done by sending a sharedSecret via POST request to the login URL. A successful login response will contain a session cookie, that the client must accept and provide in all subsequent requests.

The sharedSecret will be preset to a default value during the first start of the appNG platform. If the manager application is installed, administrators can look up the value in the Platform properties tab.

In headless installations an individual value can be set with the appNG CLI.

% ./appng update-property -n platform.sharedSecret -v <sharedSecret>

1.2. Login

Method: POST

The tailing slash is mandatory otherwise the request gets redirected as GET request to that location and the authentication procedure is not performed!
The login request is the only one, that must be sent with the header Content-Type=text/plain. All other PUT and POST requests have to use the header Content-Type=text/xml.

Request Body: (plain text format!)

<sharedSecret>

Response Body:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<appngizer version="0.12.0" self="http://localhost:8080/appNGizer/" xmlns="http://www.appng.org/schema/appngizer">
        <links>
                <link name="site" self="http://localhost:8080/appNGizer/site" />
                <link name="application" self="http://localhost:8080/appNGizer/application" />
                <link name="subject" self="http://localhost:8080/appNGizer/subject" />
                <link name="group" self="http://localhost:8080/appNGizer/group" />
                <link name="repository" self="http://localhost:8080/appNGizer/repository" />
                <link name="platform" self="http://localhost:8080/appNGizer/platform" />
        </links>
</appngizer>

2. Enable messaging

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property xmlns="http://www.appng.org/schema/appngizer" name="messagingEnabled">
    <value>true</value>
    <defaultValue>false</defaultValue>
    <description>Set to true to enable cluster messaging</description>
</property>

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property xmlns="http://www.appng.org/schema/appngizer" name="messagingReceiver">
    <value>org.appng.core.controller.messaging.RabbitMQReceiver</value>
    <defaultValue>org.appng.core.controller.messaging.MulticastReceiver</defaultValue>
    <description>Define messaging implementation by referring class name. Default method is multicast </description>
</property>

3. Set required platform properties for messaging

In the example we use RabbitMQ as message broker.

METHOD: POST

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property xmlns="http://www.appng.org/schema/appngizer" name="rabbitMQHost">
    <value></value>
    <defaultValue>192.168.0.188</defaultValue>
    <description>the host for RabbitMQ</description>
</property>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property xmlns="http://www.appng.org/schema/appngizer" name="rabbitMQUser">
    <value></value>
    <defaultValue>appng</defaultValue>
    <description>the user for RabbitMQ</description>
</property>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<property xmlns="http://www.appng.org/schema/appngizer" name="rabbitMQPassword">
    <value></value>
    <defaultValue>s3cr3t</defaultValue>
    <description>the password for RabbitMQ</description>
</property>

4. Create a Repository

METHOD: POST

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<repository xmlns="http://www.appng.org/schema/appngizer" name="Remote">
    <remoteName>pdev0-all</remoteName>
    <uri>http://appng.s-ait-p-dev0.aitintra.de/service/appng/appng-manager/soap/repositoryService</uri>
    <enabled>true</enabled>
    <strict>false</strict>
    <published>false</published>
    <mode>ALL</mode>
    <type>REMOTE</type>
</repository>

5. Install appng-authentication

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<package xmlns="http://www.appng.org/schema/appngizer" name="appng-authentication">
    <displayName>Authentication</displayName>
    <version>0.9.3</version>
    <timestamp>20150710-1037</timestamp>
    <installed>false</installed>
    <type>APPLICATION</type>
</package>

5.1. Make it a hidden privileged application

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application xmlns="http://www.appng.org/schema/appngizer" name="appng-authentication">
    <displayName>Authentication</displayName>
    <core>true</core>
    <fileBased>true</fileBased>
    <hidden>true</hidden>
    <version>0.9.3</version>
</application>

6. Install appng-manager

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<package xmlns="http://www.appng.org/schema/appngizer" name="appng-manager">
    <displayName>Manager</displayName>
    <version>0.12.1</version>
    <timestamp>20170426-0634</timestamp>
    <installed>false</installed>
    <type>APPLICATION</type>
</package>

6.1. Make it a privileged application

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<application xmlns="http://www.appng.org/schema/appngizer" name="appng-manager">
        <displayName>Manager</displayName>
        <core>true</core>
        <fileBased>true</fileBased>
        <hidden>false</hidden>
        <version>0.12.1</version>
</application>

7. Install appng template

METHOD: PUT

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<package xmlns="http://www.appng.org/schema/appngizer" name="appng-template">
    <displayName>appng</displayName>
    <version>0.14.2</version>
    <timestamp>20170620-0832</timestamp>
    <installed>false</installed>
    <type>TEMPLATE</type>
</package>

8. Create a Site

METHOD: POST

BODY:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<site xmlns="http://www.appng.org/schema/appngizer" name="manager">
    <host>localhost</host>
    <domain>http://localhost:8080</domain>
    <active>true</active>
</site>

9. Assign applications to the site

10. Create a user

METHOD: POST

BODY:

<subject xmlns="http://www.appng.org/schema/appngizer" name="admin">
    <realName>appNG Administrator</realName>
    <email>admin@appng.org</email>
    <description></description>
    <digest>@ppNG$42</digest>
    <timeZone>Europe/Berlin</timeZone>
    <language>en</language>
    <type>LOCAL_USER</type>
    <groups>
            <!-- assign user to the built-in Administrators group -->
        <group name="Administrators" />
    </groups>
</subject>

11. Restart appNG

12. Login into Site

Visit

and login with the user created in the step before

13. Trigger a site reload

METHOD: PUT

Visit http://localhost:8080/manager/manager/appng-manager/sites to see how the startup time of the manager site changed!