Skip to content

Commit

Permalink
Merge pull request #48 from PHACDataHub/consolidate-scanners
Browse files Browse the repository at this point in the history
Consolidate scanners
  • Loading branch information
Collinbrown95 authored Oct 19, 2023
2 parents 4eee5f7 + 8508f8f commit 66e7168
Show file tree
Hide file tree
Showing 127 changed files with 4,569 additions and 26,243 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# [Choice] Node.js version (use -bookworm, and -bullseye variants on local arm64/Apple Silicon): 20, 18, 20-bookworm, 18-bookworm, 20-bullseye, 18-bullseye, 20-buster, 18-buster
ARG VARIANT=16-bullseye
ARG VARIANT=18-bullseye
# modified in devcontainer.json
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT}

# _ _ _
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ build: build-api-image build-webhook-server-image

# Main RUOK API
build-api-image:
$(CONTAINER_RUNTIME) build ./api/ -t $(APP_NAME)-api:$(APP_VERSION)
$(CONTAINER_RUNTIME) build ./api/ -t localhost/$(APP_NAME)-api:$(APP_VERSION)

# Scanners
# TODO

# Webhook Server API
build-webhook-server-image:
$(CONTAINER_RUNTIME) build ./webhook-server/ -t $(APP_NAME)-webhook-server:$(APP_VERSION)
$(CONTAINER_RUNTIME) build ./webhook-server/ -t localhost/$(APP_NAME)-webhook-server:$(APP_VERSION)

# _ _
# __| | ___ _ __ | | ___ _ _
Expand All @@ -41,4 +41,10 @@ k8s:
kubectl apply -k ./k8s/arangodb-crds/
echo DEPLOY MAIN APPLICATION AFTER CRDS ARE INSTALLED
sleep 2
kubectl apply -k ./k8s/
kubectl apply -k ./k8s/

port-forward:
kubectl port-forward svc/example-simple-single-ea 8529:8529 &
kubectl port-forward svc/nats 4222:4222 &
kubectl port-forward svc/webhook-server 3000:3000 &
kubectl port-forward svc/api 4000:4000
4 changes: 3 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ COPY ./.env ./.env.example ./
COPY ./src ./src
COPY ./index.js .

CMD ["npm", "--no-update-notifier", "start"]
CMD ["npm", "--no-update-notifier", "start"]

EXPOSE 4000
6 changes: 6 additions & 0 deletions database/temp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# curl -u root:yourpassword -X POST --header 'accept: application/json' \
# --data '{"name": "dataServices", "createCollection": true }' \
# --dump - http://0.0.0.0:8529/_api/database


curl -X POST -d "{ \"field\": \"value\" }" --dump - https://localhost:8529/_db/myDatabase/_api/document?collection=cars
2 changes: 2 additions & 0 deletions k8s/arangodeployment-single-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ metadata:
name: "example-simple-single"
namespace: "default"
spec:
tls:
caSecretName: None
mode: Single
image: 'arangodb/arangodb:3.10.8'
6 changes: 4 additions & 2 deletions k8s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ resources:
- ./deployment-nats.yaml
- ./deployment-ruok-api.yaml
- ./deployment-webhook-server.yaml
- ./nats-svc.yaml
- ./svc-nats.yaml
- ./svc-ruok-api.yaml
- ./svc-webhook-server.yaml
patches:
- target:
version: v1
Expand All @@ -18,4 +20,4 @@ patches:
- name: NATS_SERVER
value: nats:4222
- name: NATS_PUB_STREAM
value: GitHubEvent
value: GitHubEvent
File renamed without changes.
9 changes: 9 additions & 0 deletions k8s/svc-ruok-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: api
spec:
selector:
app: api
ports:
- port: 4000
9 changes: 9 additions & 0 deletions k8s/svc-webhook-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: webhook-server
spec:
selector:
app: webhook-server
ports:
- port: 3000
1 change: 0 additions & 1 deletion scanners/endpoint-dispatcher/.env.example

This file was deleted.

84 changes: 0 additions & 84 deletions scanners/endpoint-dispatcher/index.js

This file was deleted.

72 changes: 0 additions & 72 deletions scanners/endpoint-dispatcher/package-lock.json

This file was deleted.

19 changes: 0 additions & 19 deletions scanners/endpoint-dispatcher/package.json

This file was deleted.

57 changes: 0 additions & 57 deletions scanners/endpoint-dispatcher/src/parse-endpoints.js

This file was deleted.

2 changes: 1 addition & 1 deletion scanners/github-clone-repo/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NATS_URL=
NATS_URL=localhost:4222
Loading

0 comments on commit 66e7168

Please sign in to comment.