Skip to content

Commit

Permalink
Need to add keystore info and password to all
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Oct 29, 2023
1 parent 8e4ddf2 commit 68993e1
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 68 deletions.
2 changes: 1 addition & 1 deletion k8/client/client_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ spec:
value: "keystore"

- name: PASSWORD
value: 'helloworld'
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_01_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_02_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_03_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_04_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_05_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_06_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_07_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_08_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_09_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
10 changes: 5 additions & 5 deletions k8/level_sites/level_site_10_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
- name: PORT_NUM
value: "9000"

- name: AES_PASS
valueFrom:
secretKeyRef:
name: ppdt-secrets
key: aes-key
- name: KEYSTORE
value: "keystore"

- name: PASSWORD
value: "WeshoulduseSealedSecretsSometime"
2 changes: 1 addition & 1 deletion k8/server-deploy/server_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ spec:
value: "keystore"

- name: PASSWORD
value: 'helloworld'
value: "WeshoulduseSealedSecretsSometime"
17 changes: 3 additions & 14 deletions src/main/java/weka/finito/level_site_server.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package weka.finito;

import weka.finito.structs.level_order_site;

import javax.crypto.NoSuchPaddingException;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import java.io.IOException;

import java.lang.System;
import java.security.NoSuchAlgorithmException;

import static weka.finito.utils.shared.cipher_suites;
import static weka.finito.utils.shared.protocols;
Expand All @@ -21,26 +18,19 @@ public class level_site_server implements Runnable {
protected boolean isStopped = false;
protected Thread runningThread= null;
protected level_order_site level_site_parameters = null;
protected int precision;

protected SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();

public static void main(String[] args) throws NoSuchPaddingException, NoSuchAlgorithmException {
public static void main(String[] args) {
int our_port = 0;
int our_precision = 0;
String AES_Pass = System.getenv("AES_PASS");

try {
our_port = Integer.parseInt(System.getenv("PORT_NUM"));
} catch (NumberFormatException e) {
System.out.println("Port is not defined.");
System.exit(1);
}
if(AES_Pass == null || AES_Pass.isEmpty()) {
System.out.println("AES_PASS is empty.");
System.exit(1);
}
level_site_server server = new level_site_server(our_port, our_precision);
level_site_server server = new level_site_server(our_port);
new Thread(server).start();
System.out.println("LEVEL SITE SERVER STARTED!");
while (true) {
Expand All @@ -53,9 +43,8 @@ public static void main(String[] args) throws NoSuchPaddingException, NoSuchAlgo
server.stop();
}

public level_site_server (int port, int precision) {
public level_site_server (int port) {
this.serverPort = port;
this.precision = precision;
}

public void run() {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/weka/finito/level_site_thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ private void closeClientConnection() throws IOException {
// This will run the communication with client and next level site
public final void run() {

int get_previous_index;
long start_time = System.nanoTime();

try {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/PrivacyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static String test_level_site(String training_data, String features_file,
for (int i = 0; i < level_sites.length; i++) {
String port_string = level_site_ports_string[i].replaceAll("[^0-9]", "");
level_site_ports[i] = Integer.parseInt(port_string);
level_sites[i] = new level_site_server(level_site_ports[i], precision);
level_sites[i] = new level_site_server(level_site_ports[i]);
new Thread(level_sites[i]).start();
}

Expand Down

0 comments on commit 68993e1

Please sign in to comment.