Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
3965b32
Updated Pom versions for release changes
Prafulrakhade Aug 6, 2024
fa2c6ca
Merge pull request #204 from mosip/releas-branch
ckm007 Aug 6, 2024
7b4df96
Merge pull request #206 from ashok-ksharma/MOSIP-34253
vishwa-vyom Aug 9, 2024
1bc86d2
[MOSIP-35160] Updated URL from https://github.com/mosip/mosip-infra/b…
Prafulrakhade Sep 9, 2024
bcea3f6
Merge pull request #213 from Prafulrakhade/release-1.3.x
ckm007 Sep 10, 2024
450fad0
[DSD-6430] Release changes (#216)
ckm007 Oct 15, 2024
aa821fd
[DSD-6430] inji-web release changes (#219)
ckm007 Oct 16, 2024
816a7db
[DSD-6430] Post release changes (#220)
ckm007 Oct 17, 2024
04ba4d5
[MOSIP-35455] Unlimited download support and changing the transaction…
ashok-ksharma Dec 12, 2024
5abb517
[MOSIP-35455] Changing the pom version to 1.3.0-SNAPSHOT for next rel…
ashok-ksharma Dec 12, 2024
7ccd23c
[DSD-7131] injiweb 0.11.0 release (#226)
ckm007 Jan 28, 2025
769a090
Updated Pom version and Chart version for post-release changes (#227)
ckm007 Jan 29, 2025
ef01daf
MOSIP-37901: durian-release (#229)
nagendra0721 Feb 21, 2025
a7cc37d
MOSIP-39990 Added ZCG (#238)
kameshsr Feb 25, 2025
a7dd977
MOSIP-40699 change version to snapshot (#240)
kameshsr Mar 17, 2025
61d6f45
MOSIP-37901: exclude mosip services-release (#241)
nagendra0721 Apr 29, 2025
903478c
[MOSIP-41872] [MOSIP-41322] Datashare pod slow because no of request …
kameshsr Jun 26, 2025
3637618
version changes (#256)
GOKULRAJ136 Jul 22, 2025
4d5acbc
MOSIP-42406 : Khazana version changes (#257)
GOKULRAJ136 Jul 28, 2025
d1d8794
[MOSIP-42464] [MOSIP-41674] central sonatype migration changes (#260)
Prafulrakhade Aug 5, 2025
692d945
Updated pom.xml (#269)
dhanendra06 Sep 22, 2025
6eeb853
MOSIP-42406 (#270)
dhanendra06 Nov 13, 2025
a45c2c9
[MOSIP-43613] DateUtils Changes (#272)
GOKULRAJ136 Nov 13, 2025
99f3038
cherry-pick the changes from develop
ckm007 Nov 16, 2025
575bcbc
updated tag
dhanendra06 Nov 16, 2025
4704646
Merge pull request #274 from dhanendra06/MOSIP-04
ckm007 Nov 16, 2025
32f7078
[MOSIP-43631]Updated helm charts for develop and release-1.3.x
bhumi46 Nov 17, 2025
2406250
Merge pull request #277 from bhumi46/release-1.3.x
ckm007 Nov 17, 2025
9e0e0a6
Add THIRD-PARTY-NOTICES file with package licenses
Rakshithasai123 Nov 25, 2025
4d48776
remove unused properties (#279)
tarique-azeez Nov 25, 2025
22eafb6
Create Apache-2.0.txt
Rakshithasai123 Nov 27, 2025
26a00ac
fix cpu & memory
kaledOu Nov 28, 2025
68f5910
Merge pull request #282 from kaledOu/release-1.3.x-helm-fix
ckm007 Nov 29, 2025
3777333
Create NOTICES.txt
rajapandi1234 Dec 2, 2025
ecc13f6
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 3, 2025
854a681
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 4, 2025
483a47e
Create NOTICES.txt
Rakshithasai123 Dec 5, 2025
7b4604e
Create EPL-0.1.txt
Rakshithasai123 Dec 8, 2025
6c17327
Create EPL-2.0.txt
Rakshithasai123 Dec 8, 2025
766a73e
Create MIT.txt
Rakshithasai123 Dec 8, 2025
587a09c
Create CDDL-1.0.txt
Rakshithasai123 Dec 8, 2025
e8f018f
Create LGPL-3.0-only.txt
Rakshithasai123 Dec 8, 2025
a517d04
Rename NOTICES.txt to NOTICE
Rakshithasai123 Dec 9, 2025
9015105
Rename NOTICES.txt to NOTICE
rajapandi1234 Dec 9, 2025
1de0fae
Update Apache-2.0.txt
Rakshithasai123 Dec 11, 2025
0ba79c9
Update Apache-2.0.txt
Rakshithasai123 Dec 11, 2025
9a33a63
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 12, 2025
debdf2f
Rename EPL-0.1.txt to EPL-1.0.txt
Rakshithasai123 Dec 12, 2025
bc5190f
Merge pull request #278 from Rakshithasai123/patch-1
Mahesh-Binayak Dec 20, 2025
cdb7002
Merge pull request #288 from Rakshithasai123/patch-8
Mahesh-Binayak Dec 21, 2025
a658212
Merge pull request #285 from rajapandi1234/patch-2
Mahesh-Binayak Dec 21, 2025
e25dfee
Merge pull request #280 from Rakshithasai123/patch-2
Mahesh-Binayak Dec 21, 2025
270b6e6
Updated chart versions, image and tag for release changes (#289)
ckm007 Dec 22, 2025
861366e
Updated Pom versions for release changes (#290)
ckm007 Dec 22, 2025
20d2f61
[DSD-9524] 1.2.1.0 Platform GA release (#291)
Prafulrakhade Dec 22, 2025
7cc2108
Update pom.xml
rajapandi1234 Dec 22, 2025
304717a
Update pom.xml
rajapandi1234 Dec 22, 2025
2bf8636
Perform optimization for JVM arguments Durian Repo [MOSIP-44752]
GOKULRAJ136 Mar 27, 2026
2f38b99
Corrected Values helm and docker
GOKULRAJ136 Apr 1, 2026
3e87740
Update Dockerfile
GOKULRAJ136 Apr 1, 2026
560fadf
Updated commons versions in pom
GOKULRAJ136 Apr 3, 2026
b64feb7
MOSIP-44198 (#303)
dhanendra06 Apr 3, 2026
524f03f
Docker configure_start.sh correction
GOKULRAJ136 Apr 6, 2026
625aca1
Merge branch 'release-1.3.x' into JOPT-13X
GOKULRAJ136 Apr 6, 2026
c14a394
Docker correction
GOKULRAJ136 Apr 6, 2026
27f3cb8
Update values.yaml
GOKULRAJ136 Apr 7, 2026
8ba47bc
Update values.yaml
GOKULRAJ136 Apr 7, 2026
0dc25b6
Corrected Xms value
GOKULRAJ136 Apr 7, 2026
a176c43
Merge pull request #301 from GOKULRAJ136/JOPT-13X
ckm007 Apr 7, 2026
1792f67
MOSIP-37901 - Exclude MOSIP services from being published or released…
NidhiKumari0201 Apr 20, 2026
188abbe
MOSIP-37901 - Exclude MOSIP services from being published or released…
NidhiKumari0201 Apr 20, 2026
30891bf
MOSIP-37901 - re-verify Exclude MOSIP services from being published o…
NidhiKumari0201 Apr 20, 2026
01e724a
MOSIP-37901 - revert snapshot for Exclude MOSIP services from being p…
NidhiKumari0201 Apr 20, 2026
e49fd6f
Merge pull request #292 from rajapandi1234/patch-3
ckm007 May 12, 2026
79894bb
MOSIP-44206 corrected helm
kameshsr May 12, 2026
df73be6
Merge pull request #311 from kameshsr/release-1.3.x-latest
ckm007 May 13, 2026
f388fe1
MOSIP-44206 Increase memory limits and requests in values.yaml
kameshsr May 13, 2026
70f445a
Merge pull request #312 from kameshsr/patch-5
ckm007 May 14, 2026
641453d
#313 Update khazana dependency version (#314)
kameshsr May 19, 2026
72f7b6c
[DSD-10347] 1.3.1 Packet Processing Performance Tuning release (#321)
ckm007 Jun 1, 2026
1c3629e
Merge branch 'branch-1.3.1-tag' into develop
ashok-ksharma Jun 3, 2026
2cc9a12
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 3, 2026
62219c5
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 3, 2026
0a7b0ac
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 3, 2026
8fae2e6
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 4, 2026
2b96a2e
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 4, 2026
6fb608c
Resolves #1830 Merged the 1.3.1-rc.1 release in develop branch.
ashok-ksharma Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ jobs:
- SERVICE_LOCATION: 'data-share/data-share-service'
SERVICE_NAME: 'data-share-service'
BUILD_ARTIFACT: 'data-share'
SQUASH_LAYERS: '11'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master-java21
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }}
SQUASH_LAYERS: ${{ matrix.SQUASH_LAYERS }}
secrets:
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
Expand Down
166 changes: 166 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# AGENTS.md

This file provides guidance to AI agents when working with code in this repository.

## Project Overview

**Durian** is the **MOSIP Datashare Service** — a Spring Boot microservice within the MOSIP (Modular Open Source Identity Platform) ID lifecycle. It securely stores binary data (biometric packets, UIN PDFs) in object storage and returns time-limited, policy-governed URLs that trusted partners use to retrieve that data.

Callers from Registration Processor (ABIS Handler, Manual Adjudication, Verification Stage, Print Service) POST data to Durian; ABIS systems, adjudicators, and print services then GET the data back via the returned URL.

## Build Commands

All commands run from the repo root (the Maven parent at `pom.xml`):

```bash
# Full build — skip Javadoc and GPG for local dev
mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true

# Run all tests
mvn test

# Run a single test class
mvn test -pl data-share/data-share-service -Dtest=ClassName

# Run a single test method
mvn test -pl data-share/data-share-service -Dtest=ClassName#methodName

# Build only the service module
mvn clean install -pl data-share/data-share-service -am -Dmaven.javadoc.skip=true -Dgpg.skip=true

# Coverage report (output: data-share/data-share-service/target/site/jacoco/index.html)
mvn clean verify

# SonarQube static analysis
mvn clean verify -Psonar

# Generate OpenAPI JSON (starts/stops the service during integration-test phase)
mvn verify -Popenapi-doc-generate-profile -pl data-share/data-share-service
```

## Running the Service

The service requires a running **Spring Cloud Config Server** on `http://localhost:51000/config` before it will start. Configuration files (`application-default.properties`, `data-share-default.properties`) must exist in the [mosip-config](https://github.com/mosip/mosip-config) repository.

```bash
java \
-Dspring.cloud.config.uri=http://localhost:51000/config \
-Dspring.cloud.config.label=master \
-Dspring.profiles.active=default \
-jar data-share/data-share-service/target/data-share-service-<version>.jar
```

The service listens on port `8097` at servlet path `/v1/datashare` (both configurable). Swagger UI is at `/v1/datashare/swagger-ui.html`.

**Standalone mode** (no external service dependencies) is enabled by adding `standalone` to `spring.profiles.active` and setting the properties below.

## Architecture

### Request Flow

1. **POST `/v1/datashare/create/{policyId}/{subscriberId}`** — caller uploads a file (`multipart/form-data`).
2. `DataShareController` delegates to `DataShareServiceImpl`.
3. In normal mode, `PolicyUtil` fetches the sharing policy from **Partner Management Service** (cached in Spring's `partnerpolicyCache`, evicted on a configurable schedule).
4. Based on `encryptionType` in the policy:
- `"Partner Based"` → `EncryptionUtil` calls **Cryptomanager** to encrypt the bytes.
- `"none"` → data is stored as-is.
5. Simultaneously (via `CompletableFuture` on a dedicated `dataShareTaskExecutor` thread pool), `DigitalSignatureUtil` calls **Keymanager** for a JWT signature over the file's SHA-256 digest.
6. `DataShareServiceImpl` stores the encrypted bytes in **Object Store** (S3-compatible via `khazana` `S3Adapter`) with metadata: policyId, subscriberId, expiry time, transaction count, JWT signature.
7. A URL is returned: either a full URL (`/get/{policyId}/{subscriberId}/{randomShareKey}`) or a short URL (`/datashare/{shortKey}`) depending on `mosip.data.share.urlshortner`.

### Retrieval Flow

**GET `/v1/datashare/get/{policyId}/{subscriberId}/{randomShareKey}`** (or `/datashare/{shortKey}`)
1. Reads object metadata from the object store.
2. Checks `transactionsallowed` — decrements by 1 if > 0; allows unlimited access if set to `-1`.
3. Returns the raw bytes in the response body with a `Signature` response header containing the JWT.
4. Throws `DataShareExpiredException` (quota exhausted) or `DataShareNotFoundException` (key missing).

### Key Components

| Class | Location | Purpose |
|---|---|---|
| `DataShareController` | `controller/` | REST endpoints — create and get |
| `DataShareServiceImpl` | `service/impl/` | Orchestrates policy lookup, encryption, signing, storage |
| `PolicyUtil` | `util/` | Partner Management Service client; caches policy responses |
| `EncryptionUtil` | `util/` | Cryptomanager client for partner-based encryption |
| `DigitalSignatureUtil` | `util/` | Keymanager JWT signing client |
| `CacheUtil` | `util/` | Spring `@Cacheable` wrapper for short-URL → full-key mapping |
| `DataShareBeanConfig` | `config/` | Wires `S3Adapter`, `TaskExecutor`, `ObjectMapper`, `RestUtil` |
| `DataShareExceptionHandler` | `controller/handler/` | `@ControllerAdvice` — maps domain exceptions to HTTP responses |

### External Service Dependencies

| Service | Integration Point | `ApiName` enum value |
|---|---|---|
| Partner Management | Policy lookup by `policyId` + `subscriberId` | `PARTNER_POLICY` |
| Cryptomanager | Encrypt data for partner-based encryption | `CRYPTOMANAGER_ENCRYPT` |
| Keymanager | JWT sign the payload digest | `KEYMANAGER_JWTSIGN` |
| Keymanager | Certificate fetch / upload | `KEYMANAGER_GET_CERTIFICATE`, `KEYMANAGER_UPLOAD_OTHER_DOMAIN_CERTIFICATE` |
| Object Store | Binary blob + metadata (S3-compatible) | `khazana` `S3Adapter` |

`RestUtil` wraps Spring `RestTemplate` for all outbound REST calls. URL values for each `ApiName` are resolved from environment properties (e.g., `PARTNER_POLICY`, `CRYPTOMANAGER_ENCRYPT`) provided by the config server.

### Async Thread Pool

Encryption and JWT signing are parallelised per request using a `ThreadPoolTaskExecutor` bean (`dataShareTaskExecutor`). The pool degrades gracefully under saturation via `CallerRunsPolicy`. Sizes are tunable:

```
mosip.data.share.async.core-pool-size=25 # default
mosip.data.share.async.max-pool-size=50
mosip.data.share.async.queue-capacity=80
```

## Standalone Mode

Standalone mode bypasses Partner Management and Keymanager. Set these properties:

```properties
mosip.data.share.standalone.mode.enabled=true
mosip.data.share.static-policy.policy-json={"typeOfShare":"","transactionsAllowed":"2","shareDomain":"datashare.datashare","encryptionType":"NONE","source":"","validForInMinutes":"30"}
mosip.data.share.static-policy.policy-id=<must match policyId in /create request>
mosip.data.share.static-policy.subscriber-id=<must match subscriberId in /create request>
mosip.data.share.signature.disabled=true
```

`transactionsAllowed` of `-1` grants unlimited downloads. The `/create` API accepts an optional `usageCountForStandaloneMode` query parameter that overrides the configured count at request time (must be ≥ 1 or exactly -1).

**Standalone mode is not safe for production** — it disables policy verification and signature computation.

## Key Configuration Properties

All runtime properties come from the Spring Cloud Config Server:

| Property | Description |
|---|---|
| `mosip.data.share.urlshortner` | `true` → return short `/datashare/{key}` URL; `false` → full `/get/{policyId}/{subscriberId}/{key}` |
| `mosip.data.share.protocol` | `http` or `https` prefix for constructed URLs |
| `mosip.data.share.key.length` | Byte length of the random key appended to the share key (default `8`) |
| `mosip.data.share.policy-cache.expiry-time-millisec` | How often the policy cache is evicted (Spring `@Scheduled` fixed rate) |
| `mosip.data.share.prependThumbprint` | Whether to prepend the key thumbprint to encrypted output |
| `mosip.data.share.includeCertificate` | Include cert in JWT signing request |
| `mosip.data.share.includeCertificateHash` | Include cert hash in JWT signing request |
| `mosip.data.share.includePayload` | Include payload in JWT signing request |
| `mosip.data.share.digest.algorithm` | Digest algorithm for JWT payload (default `SHA256`) |
| `data.share.application.id` | Application ID sent to Cryptomanager (default `PARTNER`) |
| `PARTNER_POLICY` | URL template for Partner Management policy API |
| `CRYPTOMANAGER_ENCRYPT` | URL for Cryptomanager encrypt API |
| `KEYMANAGER_JWTSIGN` | URL for Keymanager JWT sign API |

## CI/CD

GitHub Actions (`.github/workflows/push-trigger.yml`) triggers on pushes to `master`, `develop*`, `release*`, and `MOSIP*` branches:
1. Maven build via reusable `mosip/kattu` workflow (Java 21).
2. Publish JARs to Maven Central (OSSRH) — skipped for PRs, master, and releases.
3. Build and push `data-share-service` Docker image to Docker Hub.
4. SonarCloud analysis (project key: `mosip_durian`) — skipped for PRs.

Kubernetes deployment uses the Helm chart in `helm/datashare/` (requires Kubernetes 1.12+, Helm 3.1.0+).

## Testing Notes

- Unit tests use JUnit 4, Mockito, and PowerMock.
- Tests run against an H2 in-memory database; no external services are required.
- Surefire is configured with `--add-opens` JVM args for Java 21 module compatibility.
- SonarQube excludes `constant/`, `config/`, `dto/`, `entity/`, `repository/`, `httpfilter/`, and `*BootApplication` from coverage.
- The `TestBootApplication` in `src/test/java` bootstraps the test Spring context with a `TestSecurityConfig` that bypasses auth.
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ separately in the LICENSE directory.

Full license texts for all dependencies are available in the `license/`
directory or from the respective project repositories.

137 changes: 137 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
THIRD-PARTY-NOTICES

This project includes third-party packages that are distributed under various open-source licenses. Below is a list of packages and their associated licenses.

================================================================================
Package: Spring Boot (Starter Web, Starter Security, Starter Cache, Starter Data JPA)
Version: Not specified in SBOM
License: Apache License 2.0
Homepage: https://spring.io/projects/spring-boot
================================================================================

================================================================================
Package: Spring Cloud Starter Config
Version: Not specified in SBOM
License: Apache License 2.0
Homepage: https://spring.io/projects/spring-cloud-config
================================================================================

================================================================================
Package: SpringDoc OpenAPI (Starter WebMVC UI, Maven Plugin)
Version: 2.5.0 (UI), 0.2 (Plugin)
License: Apache License 2.0
Homepage: https://springdoc.org
================================================================================

================================================================================
Package: Micrometer (micrometer-core, micrometer-registry-prometheus)
Version: Not specified in SBOM
License: Apache License 2.0
Homepage: https://micrometer.io
================================================================================

================================================================================
Package: Gson (com.google.code.gson:gson)
Version: Not specified in SBOM
License: Apache License 2.0 (Inferred from project’s official repository)
Homepage: https://github.com/google/gson
================================================================================

================================================================================
Package: JSON Simple (com.googlecode.json-simple:json-simple)
Version: Not specified in SBOM
License: Apache License 2.0 (Inferred from project’s official repository)
Homepage: https://github.com/fangyidong/json-simple
================================================================================

================================================================================
Package: Mockito Core (org.mockito:mockito-core)
Version: Not specified in SBOM
License: MIT License
Homepage: https://github.com/mockito/mockito
================================================================================

================================================================================
Package: PowerMock (powermock-api-mockito2, powermock-module-junit4)
Version: Not specified in SBOM
License: Apache License 2.0 (Inferred from project’s official repository)
Homepage: https://github.com/powermock/powermock
================================================================================

================================================================================
Package: JUnit 4 (junit:junit)
Version: Not specified in SBOM
License: Eclipse Public License 1.0
Homepage: https://junit.org/junit4/
================================================================================

================================================================================
Package: JUnit Vintage Engine (org.junit.vintage:junit-vintage-engine)
Version: Not specified in SBOM
License: Eclipse Public License 2.0
Homepage: https://junit.org
================================================================================

================================================================================
Package: JAXB API (javax.xml.bind:jaxb-api)
Version: Not specified in SBOM
License: CDDL 1.1 AND GPL v2 with Classpath Exception (Dual License)
Homepage: https://eclipse-ee4j.github.io/jaxb-ri/
================================================================================

================================================================================
Package: H2 Database (com.h2database:h2)
Version: Not specified in SBOM
License: EPL 1.0 or MPL 2.0 (Dual License)
Homepage: https://www.h2database.com
================================================================================

================================================================================
Package: Apache Maven Compiler Plugin
Version: 3.11.0
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-compiler-plugin/
================================================================================

================================================================================
Package: Apache Maven Source Plugin
Version: 2.2.1
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-source-plugin/
================================================================================

================================================================================
Package: Apache Maven Jar Plugin
Version: 3.0.2
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-jar-plugin/
================================================================================

================================================================================
Package: Apache Maven Javadoc Plugin
Version: 3.2.0
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-javadoc-plugin/
================================================================================

================================================================================
Package: Apache Maven War Plugin
Version: 3.1.0
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-war-plugin/
================================================================================

================================================================================
Package: Apache Maven GPG Plugin
Version: 1.5
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/
================================================================================

================================================================================
Package: Apache Maven Surefire Plugin
Version: 2.22.0
License: Apache License 2.0
Homepage: https://maven.apache.org/surefire/maven-surefire-plugin/
================================================================================
Full license texts and additional details for each of the above packages are available in the license/ directory of this repository. Please refer to those files or the original source of each package for complete legal terms and conditions.
12 changes: 8 additions & 4 deletions data-share/data-share-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ VOLUME ${work_dir}/logs

ADD ./target/data-share-service-*.jar data-share-service.jar

COPY configure_start.sh ${work_dir}/configure_start.sh

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}
RUN sed -i 's/\r$//' ${work_dir}/configure_start.sh \
&& chmod +x ${work_dir}/configure_start.sh \
&& chown -R ${container_user}:${container_user} ${work_dir}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}

EXPOSE 8097

CMD wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
java -XX:-UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:-UseParallelGC -XX:+UseZGC -XX:+ZGenerational -XX:-UseShenandoahGC -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseCompressedOops \
-Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar data-share-service.jar ; \
ENTRYPOINT ["sh", "configure_start.sh"]

CMD java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar data-share-service.jar ; \
12 changes: 12 additions & 0 deletions data-share/data-share-service/configure_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

#installs the pre-requisites.
set -e

echo "Downloading pre-requisites install scripts"

wget "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \

echo "Installating pre-requisites completed."

exec "$@"
Loading
Loading