Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single server #5

Merged
merged 12 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# On GitHub Actions with Windows, git will use CRLF by default when checking out
# the repo. If this file has CRLF line endings
configure.ac text eol=lf
14 changes: 12 additions & 2 deletions .github/workflows/build-gradle-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ on:
jobs:
build-gradle-project:
runs-on: ubuntu-latest
env:
ALIAS: andrew
KEYSTORE: andrew_keystore
PASSWORD: ${{ secrets.PASSWORD }}

steps:
- name: Checkout project sources
uses: actions/checkout@v3

- name: Install packages
- name: Install Graphviz to visualize trees
run: sudo apt-get install -y graphviz

- name: Setup Gradle
Expand All @@ -19,7 +24,12 @@ jobs:
distribution: 'oracle'
java-version: '17'
cache: 'gradle'
- run: sh gradlew build

- name: Create Key Store
run: sh create_keystore.sh

- name: Run Gradle Testing
run: sh gradlew build

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Making certificates, dont mess around here
.env
andrew_*

# No Binaries
bin

Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.14.0'

implementation fileTree(dir: 'libs', include: ['*.jar'])
}

Expand Down
21 changes: 21 additions & 0 deletions create_keystore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# https://docs.oracle.com/cd/E54932_01/doc.705/e54936/cssg_create_ssl_cert.htm#CSVSG179

# Generate the self-signed certificate and place it in the KeyStore
keytool -genkey -noprompt \
-alias "${ALIAS}" \
-dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=US" \
-keystore "${KEYSTORE}" \
-storepass "${PASSWORD}" \
-keypass "${PASSWORD}" \
-keyalg RSA \
-sigalg SHA256withRSA

# Export the certificate needs to a certificate file, use this on both client and server to run
# Technically you just need the key store between level-sites, instead of hashing, just encrypt the leaf value
# with Paillier?

# -Djavax.net.ssl.keyStore=${KEYSTORE} -Djavax.net.ssl.keyStorePassword=${PASSWORD}
# -Djavax.net.ssl.trustStore=${KEYSTORE} -Djavax.net.ssl.trustStorePassword=${PASSWORD}

# keytool -export -alias "${ALIAS}" -keystore "${KEYSTORE}" -rfc -file "${CERTIFICATE}" -storepass "${PASSWORD}"
40 changes: 40 additions & 0 deletions k8/server-deploy/server_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ppdt-server-deploy
labels:
app: ppdt-server-deploy
role: client
spec:
replicas: 1
selector:
matchLabels:
pod: ppdt-server-deploy
template:
metadata:
labels:
pod: ppdt-server-deploy
spec:
containers:
- name: ppdt-server-deploy
image: andrewquijano92/ppdt
ports:
- containerPort: 9000
env:
- name: TREE_ROLE
value: "SERVER"

- name: PRECISION
value: "2"

- name: PORT_NUM
value: "9000"

- name: LEVEL_SITE_DOMAINS
value: "ppdt-level-site-01-service,ppdt-level-site-02-service,ppdt-level-site-03-service,ppdt-level-site-04-service,ppdt-level-site-05-service,ppdt-level-site-06-service,ppdt-level-site-07-service,ppdt-level-site-08-service,ppdt-level-site-09-service,ppdt-level-site-10-service"

- name: CLIENT
value: "ppdt-client-service"

- name: GRADLE_USER_HOME
value: "gradle_user_home"
12 changes: 12 additions & 0 deletions k8/server-deploy/server_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
kind: Service
apiVersion: v1
metadata:
name: ppdt-server-service
spec:
selector:
pod: ppdt-server-deploy
ports:
- protocol: TCP
port: 9000
targetPort: 9000
type: NodePort
File renamed without changes.
Loading