Skip to content

Commit c8c0439

Browse files
authored
Merge pull request #447 from RADAR-base/release-2.4.1
Release 2.4.1
2 parents ae21553 + 0919a8e commit c8c0439

File tree

24 files changed

+273
-217
lines changed

24 files changed

+273
-217
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ jobs:
5252
- name: Check
5353
run: GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/src/integrationTest/resources/google-credentials.json ./gradlew check
5454

55+
- name: Upload build artifacts
56+
if: always()
57+
uses: actions/upload-artifact@v3
58+
with:
59+
path: build/reports
60+
if-no-files-found: ignore
61+
retention-days: 5
62+
5563
# Check that the docker image builds correctly
5664
docker:
5765
# The type of runner that the job will run on

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ The app server provides REST endpoints to interact with the entities and data. F
3030

3131
3.2. To use as an embedded in-memory database instance (Not recommended for production deployments), set the `spring.datasource.url=jdbc:hsqldb:mem:/appserver` in `application-<profile>.properties`. Also, change the properties in `src/main/resources/application.properties` to dev or prod according to your requirements.
3232

33-
4. Build the project using gradle wrapper and run using spring boot. Note: This project uses JAVA 11, please download and install it before building.
33+
4. Build the project using gradle wrapper and run using spring boot. Note: This project uses JAVA 17, please download and install it before building.
3434

3535
5. The build will need to create a logs directory. The default path is `/usr/local/var/lib/radar/appserver/logs`. Either create the directory there using `sudo mkdir -p /usr/local/var/lib/radar/appserver/logs` followed by `sudo chown $USER /usr/local/var/lib/radar/appserver/logs` or change logs file directory in `src/main/resources/logback-spring.xml` to local log directory like `<property name="LOGS" value="logs" />`
3636

3737
6. The appserver uses the Admin SDK to communicate with the Firebase Cloud Messaging. To
3838
configure this, please look at the [FCM section](#fcm).
3939

40-
7. To run the build on mac or linux, run the below -
40+
7. To run the build, run the command below -
4141
```bash
4242
./gradlew bootRun
4343
```
@@ -141,13 +141,12 @@ The same result as stated in [Getting Started](#getting-started) can be achieved
141141
## FCM
142142

143143
### AdminSDK
144-
To configure AdminSDK, follow the official Firebase [documentation](https://firebase.google.
145-
com/docs/admin/setup#initialize-sdk) till you setup the environment variable (`GOOGLE_APPLICATION_CREDENTIALS`). In the properties
144+
To configure AdminSDK, follow the official Firebase [documentation](https://firebase.google.com/docs/admin/setup#initialize-sdk) till you setup the environment variable (`GOOGLE_APPLICATION_CREDENTIALS`). In the properties
146145
file, you would need to set `fcmserver.fcmsender` to `org.radarbase.fcm.downstream.AdminSdkFcmSender`.
147146

148147

149148
## Docker/ Docker Compose
150-
The AppServer is also available as a docker container. It's [Dockerfile](/Dockerfile) is provided with the project. It can be run as follows -
149+
The AppServer is also available as a docker container. Its [Dockerfile](/Dockerfile) is provided with the project. It can be run as follows -
151150

152151
```shell
153152
docker run -v /logs/:/var/log/radar/appserver/ \
@@ -167,7 +166,7 @@ The same can be achieved by running as a docker-compose service. Just specify th
167166
ports:
168167
- 8080:8080
169168
volumes:
170-
- ./radar_is.yml:/resources/radar_is.yml
169+
- ./radar-is.yml:/resources/radar-is.yml
171170
- ./logs/:/var/log/radar/appserver/
172171
- ./etc/google-credentials.json:/etc/google-credentials.json
173172
environment:
@@ -176,7 +175,7 @@ The same can be achieved by running as a docker-compose service. Just specify th
176175
RADAR_ADMIN_USER: "radar"
177176
RADAR_ADMIN_PASSWORD: "radar"
178177
SPRING_APPLICATION_JSON: '{"spring":{"boot":{"admin":{"client":{"url":"http://spring-boot-admin:1111","username":"radar","password":"appserver"}}}}}'
179-
RADAR_IS_CONFIG_LOCATION: "/resources/radar_is.yml"
178+
RADAR_IS_CONFIG_LOCATION: "/resources/radar-is.yml"
180179
SPRING_BOOT_ADMIN_CLIENT_INSTANCE_NAME: radar-appserver
181180
```
182181
@@ -378,7 +377,7 @@ security.radar.managementportal.url=<your management portal base url>
378377
This will instantiate all the classes needed for security using the management portal. Per endpoint level auth is controlled using Pre and Post annotations for each permission.
379378
All the classes are located in [/src/main/java/org/radarbase/appserver/auth/managementportal](/src/main/java/org/radarbase/appserver/auth/managementportal).
380379

381-
You can provide the Management Portal specific config in [radar_is.yml](radar_is.yml) file providing the public key endpoint and the resource name. The path to this file should be specified in the env variable `RADAR_IS_CONFIG_LOCATION`.
380+
You can provide the Management Portal specific config in [radar-is.yml](radar-is.yml) file providing the public key endpoint and the resource name. The path to this file should be specified in the env variable `RADAR_IS_CONFIG_LOCATION`.
382381

383382
### Management Portal Clients
384383
If security is enabled, please also make sure that the correct resources and scope are set in the OAuth Client configurations in Management Portal.

build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ apply plugin: 'io.spring.dependency-management'
1414
apply plugin: 'scala'
1515

1616
group = 'org.radarbase'
17-
version = '2.4.0'
17+
version = '2.4.1'
1818

1919
java {
2020
toolchain {
@@ -69,7 +69,6 @@ dependencies {
6969
// Open API spec
7070
implementation(group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: springDocVersion)
7171

72-
7372
//runtimeOnly('org.springframework.boot:spring-boot-devtools')
7473
runtimeOnly('org.hsqldb:hsqldb')
7574
runtimeOnly('org.liquibase:liquibase-core:4.20.0')
@@ -112,7 +111,7 @@ javafx {
112111
}
113112

114113
checkstyle {
115-
configDirectory = file("config/checkstyle")
114+
configDirectory.set(file("config/checkstyle"))
116115
toolVersion = "10.8.0"
117116
showViolations = false
118117
ignoreFailures = true
@@ -134,14 +133,14 @@ test {
134133
}
135134
}
136135

137-
task unpack(type: Copy) {
138-
duplicatesStrategy = 'include'
136+
tasks.register('unpack', Copy) {
137+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
139138
dependsOn bootJar
140139
from(zipTree(tasks.bootJar.outputs.files.singleFile))
141140
into("build/dependency")
142141
}
143142

144-
task loadTest(type: JavaExec) {
143+
tasks.register('loadTest', JavaExec) {
145144
dependsOn testClasses
146145
description = "Load Test With Gatling"
147146
group = "Load Test"
@@ -158,13 +157,13 @@ task loadTest(type: JavaExec) {
158157
]
159158
}
160159

161-
task integrationTest(type: Test) {
160+
tasks.register('integrationTest', Test) {
162161
testClassesDirs = sourceSets.integrationTest.output.classesDirs
163162
classpath = sourceSets.integrationTest.runtimeClasspath
164163
useJUnitPlatform() {
165164
excludeEngines 'junit-vintage'
166165
}
167-
environment "RADAR_IS_CONFIG_LOCATION", "src/integrationTest/resources/radar_is.yml"
166+
environment "RADAR_IS_CONFIG_LOCATION", "src/integrationTest/resources/radar-is.yml"
168167

169168
shouldRunAfter test
170169
}

radar-is.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resourceName: res_AppServer
2+
publicKeyEndpoints:
3+
- http://localhost:8081/managementportal/oauth/token_key

radar_is.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/integrationTest/java/org/radarbase/appserver/auth/common/MPOAuthHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
public class MPOAuthHelper implements OAuthHelper {
4040
private static final ObjectMapper mapper = new ObjectMapper();
4141
private static final String ACCESS_TOKEN;
42-
private static final String MP_URL = "http://localhost:8081";
42+
private static final String MP_URL = "http://localhost:8081/managementportal/";
4343
private static final String MP_CLIENT = "ManagementPortalapp";
4444
private static final String REST_CLIENT = "pRMT";
4545
private static final String USER = "sub-1";

src/integrationTest/resources/docker/docker-compose.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
POSTGRES_DB: radar
2020
POSTGRES_PASSWORD: radar
2121
ports:
22-
- 5432:5432
22+
- "5432:5432"
2323

2424
appserver:
2525
build: ../../../..
@@ -29,12 +29,12 @@ services:
2929
- default
3030
- admin
3131
ports:
32-
- 8080:8080
32+
- "8080:8080"
3333
depends_on:
3434
- postgres
3535
- spring-boot-admin
3636
volumes:
37-
- ../radar_is.yml:/resources/radar_is.yml
37+
- ../radar-is.yml:/resources/radar-is.yml
3838
- ../../../../logs/:/var/log/radar/appserver/
3939
environment:
4040
JDK_JAVA_OPTIONS: -Xmx4G -Djava.security.egd=file:/dev/./urandom
@@ -43,7 +43,7 @@ services:
4343
RADAR_ADMIN_USER: "radar"
4444
RADAR_ADMIN_PASSWORD: "radar"
4545
SPRING_APPLICATION_JSON: '{"spring":{"boot":{"admin":{"client":{"url":"http://spring-boot-admin:1111","username":"radar","password":"appserver"}}}}}'
46-
RADAR_IS_CONFIG_LOCATION: "/resources/radar_is.yml"
46+
RADAR_IS_CONFIG_LOCATION: "/resources/radar-is.yml"
4747
SPRING_BOOT_ADMIN_CLIENT_INSTANCE_NAME: radar-appserver
4848

4949
spring-boot-admin:
@@ -53,7 +53,7 @@ services:
5353
- admin
5454
- default
5555
ports:
56-
- 8888:1111
56+
- "8888:1111"
5757
environment:
5858
SPRING_BOOT_ADMIN_USER_NAME: radar
5959
SPRING_BOOT_ADMIN_USER_PASSWORD: appserver
@@ -71,10 +71,11 @@ services:
7171
SPRING_PROFILES_ACTIVE: dev
7272
SERVER_PORT: 8081
7373
MANAGEMENTPORTAL_FRONTEND_CLIENT_SECRET: ""
74-
MANAGEMENTPORTAL_COMMON_BASE_URL: http://localhost:8081/
75-
MANAGEMENTPORTAL_COMMON_MANAGEMENT_PORTAL_BASE_URL: http://localhost:8081/
74+
MANAGEMENTPORTAL_COMMON_BASE_URL: http://localhost:8081/managementportal
75+
MANAGEMENTPORTAL_COMMON_MANAGEMENT_PORTAL_BASE_URL: http://localhost:8081/managementportal
7676
MANAGEMENTPORTAL_OAUTH_CLIENTS_FILE: /mp-includes/config/oauth_client_details.csv
7777
MANAGEMENTPORTAL_CATALOGUE_SERVER_ENABLE_AUTO_IMPORT: 'false'
78+
SERVER_SERVLET_CONTEXT_PATH: /managementportal
7879
JAVA_OPTS: -Xmx256m # maximum heap size for the JVM running ManagementPortal, increase this as necessary
7980
volumes:
8081
- ./etc/:/mp-includes/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resourceName: res_AppServer
2+
publicKeyEndpoints:
3+
- http://localhost:8081/managementportal/oauth/token_key

src/integrationTest/resources/radar_is.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/main/java/org/radarbase/appserver/config/AuthConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public ManagementPortalAuthProperties getAuthProperties() {
3636
}
3737

3838
/**
39-
* First tries to load config from radar_is.yml config file. If any issues, then uses the default
39+
* First tries to load config from radar-is.yml config file. If any issues, then uses the default
4040
* MP oauth token key endpoint.
4141
*
4242
* @param managementPortalAuthProperties

0 commit comments

Comments
 (0)