. . .

Innkeeper


Introduction

Innkeeper p rovides FTP and HTTP access to host files like websites, javascript and maven repositories. It provides a maven repository (maven2 and maven2-snapshots) to contain artifacts, like generated services. One repository per service and system is available. It also provides a storage by application and system when using the Webhosting module (depending on where the module is added to). In both cases, user authentication is handled by Innkeeper using either YAMBAS module/system authorization or application/system.

HTTP port

2400

FTP port

3021

Context path

/hosting

Host

http://localhost:2400/hosting

Component interactions

images/download/attachments/65296088/Grafiken-Service-Doc_Innkeeper.png

The above diagram represents interactions between actors and components where Innkeeper is involved within the ApiOmat cloud. In this diagram you can see the developer as an actor, the two services Innkeeper and YAMBAS as components, the discovery service Consul and the database MongoDB. Each service interacts with the Consul discovery to register itself, additionally Innkeeper uses Consul to retrieve information to communicate with YAMBAS.

At the upper level you have the developer interaction with Innkeeper. A developer can ask Innkeeper to store any kind of file under a specific path and delete one or multiple files under a specific path. Every operation is authenticated using ApiOmat credentials.

Innkeeper is interacting with YAMBAS to check for the developer rights over application/system or modules/system. Innkeeper also uses YAMBAS to get information about applications and modules available to the authenticated user. Lastly Innkeeper can also notify YAMBAS when a generated service archive is pushed so the meta data information of the services will be kept up to date.

Innkeeper uses MongoDB to store and retrieve the files provided by the developer.

Installation

Refer to [Innkeeper] Installation.

Service feature configuration

In order to have access to service artifacts that were uploaded to the Innkeeper service you need to configure the Read Role:

Config name

Config value

Read role

Possible values: Guest,User, or AppAdmin (Default: Guest)

The Read role is configurable via Dashboard.

Usage

Deploy a project artifact to Innkeeper

Add the repository to the pom.xml of your project to connect it to the Innkeeper (in this example the LIVE repository):

pom.xml
...
<distributionManagement>
<repository>
<id>aomrepo-LIVE</id>
<name>Releases</name>
<url>http://localhost:2400/maven2/LIVE</url>
</repository>
<snapshotRepository>
<id>aomrepo-LIVE-snapshots</id>
<name>Snapshot</name>
<url>http://localhost:2400/maven2-snapshots/LIVE</url>
</snapshotRepository>
</distributionManagement>
...

Set up account credentials in ~/.m2/settings.xml :

settings.xml
<settings>
<servers>
<server>
<id>aomrepo-LIVE</id>
<username>{APIOMAT_USER_NAME}</username>
<password>{APIOMAT_USER_PASSWORD}</password>
</server>
</servers>
</settings>

(to avoid storing your password as plain text into the settings.xml you can use the following guide https://blog.sonatype.com/2009/10/maven-tips-and-tricks-encrypting-passwords/ )

Deploy the project to the Innkeeper repo :

The Service needs com.apiomat.microservice set as Maven groupId to be deployed to either maven2 or maven2-snapshots, the project name should also correspond to the ApiOmat available/wanted service name.

mvn deploy

Use an artifact from Innkeeper in a project

Use in other pom.xml :

pom.xml
...
<repositories>
<repository>
<id>aomrepo-LIVE</id>
<url>http://localhost:2400/hosting/maven2/LIVE</url>
</repository>
</repositories>
...

Setup SSL using keystore

Enabling SSL for a FTP over TLS encryption will require a keystore, which can be created using the following command (more information can be found here: https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/). The keytool binary can be found in the JDK installation bin directory.

keytool -keystore HostingKeystore.key -genkey -keyalg RSA

Just fill in the certificate details and use the provided password as key password at the end (do not provide a second one). Afterwards, a HostingKeystore.key keystore file will be written to the current directory.

Now you can configure the path to the created keystore file and the password as described in Configuration section within the Innkeeper Installation page.

You will have to restart Innkeeper for this setup to be effective.