Skip to content

Commit

Permalink
Release 1.2.0
Browse files Browse the repository at this point in the history
- Download service saves visited countries in database.
- Added efficient Docker images with Spring Boot 2.3.
  • Loading branch information
iCesofT committed Dec 21, 2020
2 parents 8cc885c + 54b4976 commit 17a9e5b
Show file tree
Hide file tree
Showing 60 changed files with 829 additions and 760 deletions.
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
# Changelog

## [Unreleased]
All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.2.0.RELEASE] - 2020-12-17

### Added

- Download keys service saves visited countries in database.

## [1.1.0.RELEASE] - 2020-11-12

### Added

- Added documentation for simulated functionality in [README.md](./README.md).
- Added batch signature test.
- Added OWASP plugin suppresions.
- Added [efficient Docker images with Spring Boot 2.3](https://spring.io/blog/2020/08/14/creating-efficient-docker-images-with-spring-boot-2-3).

### Changed

- Fixed typo in [README.md](./README.md).
- [THIRD-PARTY-NOTICES](./THIRD-PARTY-NOTICES) - Deleted Hazelcast IMDG and Auth0 Java since these libraries are not used.
- Copied new BatchSignatureVerifier.java from EFGS.
- Upgraded to Spring Boot 2.3.5.RELEASE..
- Upgraded to Spring Boot 2.3.5.RELEASE.
- Changed project from web application to batch application - Using [ApplicationRunner](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/ApplicationRunner.html).

### Fixed

## [1.0.0.RELEASE] - 2020-10-31

- New service to integrate Radar COVID with [EU Federation Gateway Service (EFGS)](https://github.com/eu-federation-gateway-service/efgs-federation-gateway).

[Unreleased]: https://github.com/RadarCOVID/radar-covid-backend-efgs-server/compare/1.2.0.RELEASE...develop
[1.2.0.RELEASE]: https://github.com/RadarCOVID/radar-covid-backend-efgs-server/compare/1.1.0.RELEASE...1.2.0.RELEASE
[1.1.0.RELEASE]: https://github.com/RadarCOVID/radar-covid-backend-efgs-server/compare/1.0.0.RELEASE...1.1.0.RELEASE
[1.0.0.RELEASE]: https://github.com/RadarCOVID/radar-covid-backend-efgs-server/releases/tag/1.0.0.RELEASE
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EFGS Service in terms of the Radar COVID project enables the connectivity with [
These are the frameworks and tools used to develop the solution:

- [Java 11](https://openjdk.java.net/).
- [Maven](https://maven.apache.org/).
- [Maven 3.6](https://maven.apache.org/).
- [Spring Boot](https://spring.io/projects/spring-boot) version 2.3.
- [Lombok](https://projectlombok.org/), to help programmer. Developers have to include the IDE plugin to support Lombok features (ie, for Eclipse based IDE, go [here](https://projectlombok.org/setup/eclipse)).
- [ArchUnit](https://www.archunit.org/) is used to check Java architecture.
Expand Down Expand Up @@ -64,9 +64,14 @@ If you want to run the application inside a docker in local, once you built it,

```shell
docker-compose up -d postgres
docker-compose up -d backend
docker-compose run backend <job>
```

Where `<job>` has these possible values:
- `uploadDiagnosisKeys`. To upload diagnosis keys to EFGS Gateway.
- `downloadDiagnosisKeys`. To download diagnosis keys from EFGS Gateway.
- `cleanBatchJobExecution`. To clean old information in database.

#### EFGS Federation Gateway service

There are two ways to connect with [EFGS Federation Gateway](https://github.com/eu-federation-gateway-service/efgs-federation-gateway) service:
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ services:
SECURITY_USER_PASSWORD: radarcovid
depends_on:
- postgres
ports:
- 8080:8080
networks:
service:
persistence:
Expand Down
36 changes: 0 additions & 36 deletions efgs-server-api/pom.xml

This file was deleted.

31 changes: 14 additions & 17 deletions efgs-server-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>es.gob.radarcovid</groupId>
<artifactId>efgs-server-parent</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.2.0.RELEASE</version>
<relativePath>../</relativePath> <!-- lookup parent from repository -->
</parent>

Expand Down Expand Up @@ -166,6 +166,12 @@
<artifactId>httpclient</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -176,6 +182,10 @@
<configuration>
<outputDirectory>${project.build.directory}/docker</outputDirectory>
<classifier>exec</classifier>
<layers>
<enabled>true</enabled>
<configuration>${project.basedir}/src/main/docker/layers.xml</configuration>
</layers>
<excludes>
<exclude>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -211,6 +221,9 @@
<resource>
<directory>${project.basedir}/src/main/docker</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/layers.xml</exclude>
</excludes>
</resource>
</resources>
<delimiters>
Expand Down Expand Up @@ -238,22 +251,6 @@
</delimiters>
</configuration>
</execution>
<execution>
<id>copy-certificates</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/docker/certs</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/certificates/${build.profile.id}</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
25 changes: 14 additions & 11 deletions efgs-server-boot/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@
# SPDX-License-Identifier: MPL-2.0
#

FROM adoptopenjdk:11-jre-hotspot
FROM adoptopenjdk:11-jre-openj9 as builder
WORKDIR /efgs
COPY [ "${project.artifactId}-${project.version}-exec.jar", "app.jar" ]
RUN java -Djarmode=layertools -jar app.jar extract

FROM adoptopenjdk:11-jre-openj9
WORKDIR /efgs

# Metadata
LABEL module.vendor="Radar-COVID" \
module.maintainer="SEDIAgob" \
module.name="${project.artifactId}" \
module.version="${project.version}"

COPY [ "${project.artifactId}-${project.version}-exec.jar", "/app.jar" ]
COPY [ "./certs", "/certs" ]

RUN sh -c 'touch /app.jar'

VOLUME [ "/tmp" ]

ARG AWS_ACCESS_KEY
Expand All @@ -31,7 +32,7 @@ ENV AWS_ACCESS_KEY_ID ${AWS_ACCESS_KEY}
ENV AWS_SECRET_KEY ${AWS_SECRET_KEY}
ENV AWS_PARAMSTORE_ENABLED ${AWS_PARAMSTORE_ENABLED}

ENV JAVA_OPTS ${JAVA_OPTS} -Xms256M -Xmx1G \
ENV JAVA_TOOL_OPTIONS $JAVA_TOOL_OPTIONS -Xms256M -Xmx1G \
--add-modules java.se \
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
Expand All @@ -40,8 +41,10 @@ ENV JAVA_OPTS ${JAVA_OPTS} -Xms256M -Xmx1G \
--add-opens java.management/sun.management=ALL-UNNAMED \
--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED

ENV SERVER_PORT 8080

EXPOSE ${SERVER_PORT}
COPY --from=builder efgs/dependencies/ ./
COPY --from=builder efgs/spring-boot-loader/ ./
COPY --from=builder efgs/snapshot-dependencies/ ./
COPY --from=builder efgs/company-dependencies/ ./
COPY --from=builder efgs/application/ ./

ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=${build.profile.id} -jar /app.jar" ]
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=${build.profile.id}", "org.springframework.boot.loader.JarLauncher"]
27 changes: 27 additions & 0 deletions efgs-server-boot/src/main/docker/layers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<layers xmlns="http://www.springframework.org/schema/boot/layers"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/boot/layers
https://www.springframework.org/schema/boot/layers/layers-{spring-boot-xsd-version}.xsd">
<application>
<into layer="spring-boot-loader">
<include>org/springframework/boot/loader/**</include>
</into>
<into layer="application" />
</application>
<dependencies>
<into layer="snapshot-dependencies">
<include>*:*:*SNAPSHOT</include>
</into>
<into layer="company-dependencies">
<include>es.gob.radarcovid:*</include>
</into>
<into layer="dependencies" />
</dependencies>
<layerOrder>
<layer>dependencies</layer>
<layer>spring-boot-loader</layer>
<layer>snapshot-dependencies</layer>
<layer>company-dependencies</layer>
<layer>application</layer>
</layerOrder>
</layers>
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
*/
package es.gob.radarcovid.efgs;

import es.gob.radarcovid.efgs.etc.EfgsProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import es.gob.radarcovid.efgs.etc.EfgsProperties;

@SpringBootApplication
@EnableAspectJAutoProxy
@EnableJpaRepositories(basePackages = {"es.gob.radarcovid.efgs.persistence.repository"})
Expand All @@ -25,7 +26,8 @@
public class EfgsApplication {

public static void main(String[] args) {
SpringApplication.run(EfgsApplication.class, args);
System.exit(SpringApplication
.exit(SpringApplication.run(EfgsApplication.class, args)));
}

}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 17a9e5b

Please sign in to comment.