Skip to content

Commit

Permalink
Modular hawkBit (eclipse-hawkbit#378)
Browse files Browse the repository at this point in the history
* Cleaned up component scan
* More flexibility for hawkBit micro services
* Introduce spring boot starters
* Eclipse Jetty as hawkBit default
* Fixed links as prep for wiki removal

Signed-off-by: kaizimmerm <[email protected]>
  • Loading branch information
kaizimmerm authored Dec 13, 2016
1 parent 63adbd0 commit 92dd6a1
Show file tree
Hide file tree
Showing 178 changed files with 981 additions and 585 deletions.
29 changes: 6 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Build: [![Circle CI](https://circleci.com/gh/eclipse/hawkbit.svg?style=shield)](

# Documentation

see [hawkBit Wiki](https://github.com/eclipse/hawkbit/wiki)
see [hawkBit Documentation](https://www.eclipse.org/hawkbit/documentation/overview/introduction.html)

# Contact us

Expand All @@ -27,6 +27,10 @@ https://hawkbit.eu-gb.mybluemix.net/UI/

We are not providing an off the shelf installation ready hawkBit update server. However, we recommend to check out the [Example Application](examples/hawkbit-example-app) for a runtime ready Spring Boot based update server that is empowered by hawkBit. In addition we have [guide](https://github.com/eclipse/hawkbit/wiki/Run-hawkBit) for setting up a complete landscape.

# hawkBit (Spring boot) starters

Next to the [Example Application](examples/hawkbit-example-app) we are also providing a set of [Spring Boot Starters](hawkbit-starters) to quick start your own [Spring Boot](https://projects.spring.io/spring-boot/) based application.

#### Clone and build hawkBit
```
$ git clone https://github.com/eclipse/hawkbit.git
Expand Down Expand Up @@ -56,25 +60,4 @@ $ java -jar ./examples/hawkbit-example-mgmt-simulator/target/hawkbit-example-mgm
* Rollout Management for large scale rollouts.
* Clustering capabilities for the update server.
* Upgrade of Spring Boot and Vaadin dependencies.
* And of course tons of usability improvements and bug fixes.


# Modules
* `examples` : hawkBit examples
* `hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB.
* `hawkbit-autoconfigure` : Spring-boot auto-configuration.
* `hawkbit-core` : Core elements for internal interfaces and utility classes.
* `hawkbit-ddi-api` : The hawkBit DDI API.
* `hawkbit-ddi-dl-api` : The hawkBit DDI Download API.
* `hawkbit-ddi-resource` : Implementation of the hawkBit DDI API
* `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API.
* `hawkbit-dmf-api` : API for the Device Management Integration.
* `hawkbit-http-security` : Implementation for security filters for HTTP.
* `hawkbit-mgmt-api` : The hawkBit Management API
* `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API
* `hawkbit-repository` : Repository implementation based on SQL for all meta-data.
* `hawkbit-rest-core` : Core elements for the rest modules.
* `hawkbit-security-core` : Core security elements.
* `hawkbit-security-integration` : Security integration elements to integrate security into hawkBit.
* `hawkbit-test-report` : Test reports
* `hawkbit-ui` : Vaadin UI.
* And of course tons of usability improvements and bug fixes.
2 changes: 1 addition & 1 deletion docs/src/main/resources/documentation/guide/feignclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Clustering
In this guide we describe how to create a [Feign](https://github.com/Netflix/feign) Rest Client based on a [Spring Boot](http://projects.spring.io/spring-boot/) Application. [hawkBit](https://projects.eclipse.org/projects/iot.hawkbit) provides REST interfaces for [Management API](https://github.com/eclipse/hawkbit/tree/master/hawkbit-ddi-api) and [DDI API] (https://github.com/eclipse/hawkbit/tree/master/hawkbit-ddi-api). Using this interfaces you can create a feign client with the help of the [feign inheritance support] (http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).
Our [example](https://github.com/eclipse/hawkbit/tree/master/examples) modules demonstrate how to create [Feign](https://github.com/Netflix/feign) client resources. Here you can find the [Management API client resources](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-mgmt-feign-client) and the [DDI client resources](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-ddi-feign-client).
A small [simulator application](https://github.com/eclipse/hawkbit/blob/master/examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java) demonstrates how you can interact with the [hawkBit](https://projects.eclipse.org/projects/iot.hawkbit) via the [Management API
](https://github.com/eclipse/hawkbit/wiki/Management-API).
](http://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html).

Note: A hawkbit application have to be run. Therefore, you can use our [example application](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app)

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/resources/documentation/guide/runhawkbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: Run hawkBit

In this guide we describe how to run a full featured hawkBit setup based on a production ready infrastructure. It is based on the _hawkBit_ example modules. We call these _examples_ as we expect that developers who intend to create a _hawkBit_ based IoT application on their own will create a custom [Spring Boot](http://projects.spring.io/spring-boot/) app based on _hawkBit_ as demonstrated with the [hawkBit example app](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app).

Note: the example app can in fact be run [stand alone](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app). However, only with an embedded H2, no [Device Management Federation API](https://github.com/eclipse/hawkbit/wiki/Device-Management-Federation-API) and no artifact storage.
Note: the example app can in fact be run [stand alone](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-example-app). However, only with an embedded H2, no [Device Management Federation API](../interfaces/dmf-api.html) and no artifact storage.

This guide will focus on a complete setup that includes all _hawkBit_ features.

Expand Down Expand Up @@ -99,6 +99,6 @@ However, this is not done by _DMF_ which is in fact used by the device simulator

see [device simulator](https://github.com/eclipse/hawkbit/tree/master/examples/hawkbit-device-simulator)

## Enjoy hawkBit with a real database, artifact storage and all [interfaces](https://github.com/eclipse/hawkbit/wiki/Interfaces) available.
## Enjoy hawkBit with a real database, artifact storage and all [interfaces](../interfaces/interfaces.html) available.

![](../images/gettingStartedResult.png){:width="100%"}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The _hawkbit_ [update server](https://github.com/eclipse/hawkbit) provides REST
Note: in DDI the target is identified using a **controllerId**. Controller is used as a term for the actual service/client on the device. That allows users to have in some cases even multiple clients on the same target for different tasks, e.g. Firmware update and App management.

# State Machine Mapping
For historical reasons the DDI has a different state machine and status messages than the [Target State Machine](https://github.com/eclipse/hawkbit/wiki/Target-State-Machine) of the _hawkBit_ update server.
For historical reasons the DDI has a different state machine and status messages than the [Target State Machine](../architecture/targetstate.html) of the _hawkBit_ update server.

This is kept in order to ensure that _DDI_ stays compatible for devices out there in the field. A future version "2" of _DDI_ might change that. _DDI_ also defines more states than the update server, e.g. multiple DDI states are currently mapped by the _DDI_ implementation to _RUNNING_ state. It is possible that in the future _hawkBit_ will fully leverage these additional states.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ title: Interfaces

# Graphical User Interface

To get started _hawkBit_ offers a [Management UI](https://github.com/eclipse/hawkbit/wiki/Management-UI) that allows operators to manage the repository and trigger provisioning operations.
To get started _hawkBit_ offers a [Management UI](management-ui.html) that allows operators to manage the repository and trigger provisioning operations.

In addition Eclipse _hawkBit_ offers developers multiple options to integrate.

# Application Integration
The _hawkBit_ [Management API](https://github.com/eclipse/hawkbit/wiki/Management-API) allows applications to manage the repository and trigger provisioning operations. It is in general feature compliant with the _Management UI_. However, small differences may occur here and there. The authentication and authorization structure is identical, i.e. a user can login both at Management API and UI with the same credentials and has the same permissions available.
The _hawkBit_ [Management API](management-api.html) allows applications to manage the repository and trigger provisioning operations. It is in general feature compliant with the _Management UI_. However, small differences may occur here and there. The authentication and authorization structure is identical, i.e. a user can login both at Management API and UI with the same credentials and has the same permissions available.

# Device Integration
For device integration two options exist.

The [Direct Device Integration API](https://github.com/eclipse/hawkbit/wiki/Direct-Device-Integration-API) allows direct integration from the device to the _hawkBit_ server. It has been designed with simplicity in mind as its is fully focused on software update. It allows device integrators to separate concerns by means of having distinguished channels for business data and general device management tasks on one side and software update on the other. As a result it is possible to keep the _lifesaving_ provisioning process controller on the device separate from the more complex business functionality. A benefit of such an architecture should not be underestimated.
The [Direct Device Integration API](ddi-api.html) allows direct integration from the device to the _hawkBit_ server. It has been designed with simplicity in mind as its is fully focused on software update. It allows device integrators to separate concerns by means of having distinguished channels for business data and general device management tasks on one side and software update on the other. As a result it is possible to keep the _lifesaving_ provisioning process controller on the device separate from the more complex business functionality. A benefit of such an architecture should not be underestimated.

As result of such a simple HTTP/REST/JSON based API even a major back-end migration or disaster can be covered with simple web server hosting a text file that contains only the command to update one more time to execute a migration on the device. The API was designed on purpose in way to have that last resort even if the plan is that this will never be necessary.

The [Device Management Federation API](https://github.com/eclipse/hawkbit/wiki/Device-Management-Federation-API) however allows to combine the business data and _hawkBit_ connectivity. This is especially usefull if a constrained device cannot handle a TLS/HTTP connection, is supporting a standard device management protocol that covers also the software update part (e.g. TR-069, OMA-DM, LWM2M) or the device is already connected and _hawkBit_ is introduced later on.
The [Device Management Federation API](dmf-api.html) however allows to combine the business data and _hawkBit_ connectivity. This is especially usefull if a constrained device cannot handle a TLS/HTTP connection, is supporting a standard device management protocol that covers also the software update part (e.g. TR-069, OMA-DM, LWM2M) or the device is already connected and _hawkBit_ is introduced later on.

The decision for the right device integration path is up to the integration party.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For all requests an `Authorization` header has to be set.
* Username: `Tenant\username`
* Password: `password`

Also have a look to the [Security](https://github.com/eclipse/hawkbit/wiki/Security) chapter.
Also have a look to the [Security](../security/security.html) chapter.

In addition, for POST and PUT requests the `Content-Type` header has to be set. Accepted content-types are.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We offer a sandbox installation that is free for everyone to try out hawkBit. Ho

# Compile, Run and Getting Started

We are not providing an off the shelf installation ready hawkBit update server. However, we recommend to check out the [Example Application](examples/hawkbit-example-app) for a runtime ready Spring Boot based update server that is empowered by hawkBit. In addition we have [guide](https://github.com/eclipse/hawkbit/wiki/Run-hawkBit) for setting up a complete landscape.
We are not providing an off the shelf installation ready hawkBit update server. However, we recommend to check out the [Example Application](examples/hawkbit-example-app) for a runtime ready Spring Boot based update server that is empowered by hawkBit. In addition we have [guide](../guide/runhawkbit.html) for setting up a complete landscape.

#### Clone and build hawkBit
{% highlight bash %}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/resources/documentation/security/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Host: your.hawkBit.server
Authorization: TargetToken bH7XXAprK1ChnLfKSdtlsp7NOlPnZAYY
```

The target security token is provided in [DMF API](https://github.com/eclipse/hawkbit/wiki/Device-Management-Federation-API) as part of the update message in order to allow DMF clients to leverage the feature or can it be manually retrieved per target by [Management API](https://github.com/eclipse/hawkbit/wiki/Management-API) or in the [Management UI](https://github.com/eclipse/hawkbit/wiki/Management-UI) in the target details.
The target security token is provided in [DMF API](../interfaces/dmf-api.html) as part of the update message in order to allow DMF clients to leverage the feature or can it be manually retrieved per target by [Management API](../interfaces/management-api.html) or in the [Management UI](../interfaces/management-ui.html) in the target details.

Note: needs to be enabled in your _hawkBit_ installation **and** in the tenant configuration. That allows both the operator as well as the individual customer (if run in a multi-tenant setup) to enable this access method. See [DdiSecurityProperties](https://github.com/eclipse/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java) for system wide enablement.

Expand Down
1 change: 1 addition & 0 deletions examples/hawkbit-custom-theme-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.springBeans
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* http://www.eclipse.org/legal/epl-v10.html
*/

import org.eclipse.hawkbit.EnableJpaRepository;
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand All @@ -22,7 +21,6 @@
@EnableHawkbitManagedSecurityConfiguration
// Exception squid:S1118 - Spring boot standard behavior
@SuppressWarnings({ "squid:S1118" })
@EnableJpaRepository
public class Start {
/**
* Main method to start the spring-boot application.
Expand Down
4 changes: 2 additions & 2 deletions examples/hawkbit-device-simulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Example: for 10 simulated devices that start with the name prefix "activeSim":
http://localhost:8083/start?amount=10&name=activeSim
```

Example: for 5 simulated devices that start with the name prefix "ddi" using the Direct Device Integration API (http):
Example: for 5 simulated devices that start with the name prefix "ddi" using the Direct Device Integration API (http) authenticated by given gateway token, a pool interval of 10 seconds and a custom port for the DDI service.:
```
http://localhost:8083/start?amount=5&name=ddi?api=ddi
http://localhost:8083/start?amount=5&name=ddi&api=ddi&gatewaytoken=d5F2mmlARiMuMOquRmLlxW4xZFHy4mEV&polldelay=10&endpoint=http://localhost:8085
```
1 change: 1 addition & 0 deletions examples/hawkbit-example-app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target/
/artifactrepo/*
/.springBeans
67 changes: 4 additions & 63 deletions examples/hawkbit-example-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<version>0.2.0-SNAPSHOT</version>
</parent>
<artifactId>hawkbit-example-app</artifactId>
<name>hawkBit-example :: UI Application</name>
<name>hawkBit-example :: Update Server</name>

<build>
<plugins>
Expand Down Expand Up @@ -56,76 +56,17 @@
</build>

<dependencies>
<!-- Hawkbit -->
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-autoconfigure</artifactId>
<artifactId>hawkbit-boot-starter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-mgmt-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-dmf-amqp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-security-integration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-http-security</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository-jpa</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-aspects</artifactId>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependency>

<!-- exclude gwt-elemental as there are class conflicts -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.gwt</groupId>
<artifactId>gwt-elemental</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
*/
package org.eclipse.hawkbit.app;

import org.eclipse.hawkbit.EnableJpaRepository;
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
import org.eclipse.hawkbit.ddi.EnableDdiApi;
import org.eclipse.hawkbit.mgmt.EnableMgmtApi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Expand All @@ -22,9 +19,6 @@
*/
@SpringBootApplication
@EnableHawkbitManagedSecurityConfiguration
@EnableMgmtApi
@EnableDdiApi
@EnableJpaRepository
// Exception squid:S1118 - Spring boot standard behavior
@SuppressWarnings({ "squid:S1118" })
public class Start {
Expand Down
Loading

0 comments on commit 92dd6a1

Please sign in to comment.