Skip to content

Commit 3cd5c92

Browse files
authored
feat: initial CI scaffolding and processors (#1)
Add initial processors and release please scaffolding
1 parent 0f6dbcc commit 3cd5c92

29 files changed

+1386
-2
lines changed

.github/workflows/checks.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Checks"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
merge_group:
11+
branches:
12+
- main
13+
types:
14+
- checks_requested
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
pr:
21+
name: Validate PR title
22+
if: contains(fromJSON('["pull_request", "pull_request_target"]'), github.event_name)
23+
runs-on: ubuntu-22.04
24+
permissions:
25+
pull-requests: read
26+
steps:
27+
- uses: amannn/action-semantic-pull-request@e9fabac35e210fea40ca5b14c0da95a099eff26f
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
mavenverify:
32+
runs-on: ubuntu-latest
33+
if: always()
34+
needs:
35+
- pr
36+
steps:
37+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
38+
- name: Set up JDK
39+
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
40+
with:
41+
java-version: "21"
42+
distribution: "temurin"
43+
server-id: github
44+
- name: Maven Verify
45+
run: |
46+
mvn --batch-mode clean install -DskipTests -s settings.xml
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
51+
ci:
52+
needs:
53+
- mavenverify
54+
- pr
55+
runs-on: ubuntu-latest
56+
if: always()
57+
steps:
58+
- if: contains(needs.*.result, 'failure')
59+
run: echo "Failed due to ${{ contains(needs.*.result, 'failure') }}" && exit 1

.github/workflows/release.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Generate a token
17+
id: generate_token
18+
uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0
19+
with:
20+
app-id: "${{ secrets.APP_ID }}"
21+
private-key: "${{ secrets.AUTOMATION_KEY }}"
22+
- uses: google-github-actions/release-please-action@v4
23+
with:
24+
token: "${{ steps.generate_token.outputs.token }}"
25+
config-file: release-please.json
26+
manifest-file: .release-please-manifest.json
27+
release:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
32+
- name: Set up JDK
33+
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
34+
with:
35+
java-version: "21"
36+
distribution: "temurin"
37+
server-id: github
38+
- name: Publish package
39+
run: mvn --batch-mode deploy -s settings.xml
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.idea/
2+
/**/target/

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.0"
3+
}

CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CODEOWNERS
2+
3+
* @opentdf/nifi @opentdf/architecture
4+
5+
## High Security Area
6+
7+
CODEOWNERS @opentdf/architecture @opentdf/security
8+
LICENSE @opentdf/architecture

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# The Clear BSD License
2+
3+
Copyright 2023 Virtru Corporation
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below)
7+
provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
* Neither the name of Virtru Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without
13+
specific prior written permission.
14+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
15+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
16+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
18+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
.PHONY: compose-package
3+
compose-package: nar-build
4+
@echo "package for docker compose"
5+
rm -rf deploy/extensions/*.nar
6+
cp nifi-tdf-nar/target/*.nar deploy/extensions
7+
cp nifi-tdf-controller-services-api-nar/target/*.nar deploy/extensions
8+
9+
.PHONY: truststore-create
10+
truststore-create:
11+
@echo "Build Truststore from *.crt in ./deploy/truststore"
12+
cd ./deploy && ./build_truststore.sh
13+
14+
.PHONY: nar-build
15+
nar-build:
16+
@echo "Build NARs"
17+
mvn clean package -s settings.xml

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# nifi
2-
OpenTDF NiFi Processors
1+
# OpenTDF NiFi
2+
Integration of the [OpenTDF Platform](https://github.com/opentdf/platform) into [NiFi](https://nifi.apache.org/)
3+
4+
Components:
5+
* ConvertToTDF: A NiFi processor that converts FlowFile content to TDF format
6+
* ConvertFromTDF: A NiFi processor that converts TDF formatted FlowFile content to it's plaintext representation
7+
* OpenTDFControllerService: A NiFi controller service providing OpenTDF Platform Configuration
8+
9+
10+
# Quick Start - Docker Compose
11+
12+
1. Build the NiFi Archives (NARs) and place in the docker compose mounted volumes
13+
```shell
14+
make compose-package
15+
```
16+
1. Start docker compose
17+
```shell
18+
docker compose up
19+
```
20+
1. [Log into NiFi](http://localhost:18080/nifi)

deploy/build_truststore.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
TRUSTSTORE_PASSWORD=password
4+
5+
certDir="$(pwd)/truststore"
6+
7+
echo "import certs from $certDir"
8+
9+
for filename in $certDir/*.crt; do
10+
echo "import $filename into truststore"
11+
filelocal=$(basename ${filename})
12+
docker run -v $(pwd)/truststore:/keys \
13+
openjdk:latest keytool \
14+
-import -trustcacerts \
15+
-alias $filelocal \
16+
-file keys/$filelocal \
17+
-destkeystore keys/ca.jks \
18+
-noprompt \
19+
-deststorepass "$TRUSTSTORE_PASSWORD"
20+
done
21+

docker-compose.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3'
2+
services:
3+
opentdf-nifi:
4+
image: ghcr.io/ttschampel/nifi/nifi-1.25.0-jre17:latest
5+
restart: always
6+
ulimits:
7+
nofile:
8+
soft: 2048
9+
hard: 4096
10+
environment:
11+
- NIFI_WEB_HTTP_PORT=8080
12+
volumes:
13+
- ./deploy/extensions:/opt/nifi/nifi-current/extensions #mount custom NARs
14+
- ./deploy/truststore:/opt/nifi/nifi-current/truststore # mounts truststore
15+
- ./deploy/custom-libs:/opt/nifi/nifi-current/custom-libs #mount additional libs
16+
ports:
17+
- 18080:8080/tcp

0 commit comments

Comments
 (0)