Skip to content

Commit

Permalink
Code freeze for first minor release (#39)
Browse files Browse the repository at this point in the history
* nit: minor code format

* refactor: remove duplicate function contents

* Updated configuration flow of control (#38)

* feat: draft variable packet size experiment

* docs: new section for project replicability

* docs: markdown diagram (system control flow) + blockquote highlight

* refactor: utility to insights + diode collection script

* feat: module install & output binary

* feat: begin subscribe and publish commands

* feat: basic payload retrieval from standard input

* refactor: prepare for complete message detection

* feat: filter output from incoming payload

* refactor: stream demo into encapsulator & republisher

* refactor: option to delimit message & remove write new line

* feat: draft message flow w/ client-server location

* feat: mock MQTT connection prior to testing

* feat: recieve message from given source location

* refactor: next steps for outbound message flow

* docs: text on links for architecture diagram

* remove: start/end delimiter + message case

* refactor: entry point for main application, build information, & testing

* feat: split input & output metadata via project settings

* fix: repackaged JSON object contents + diode metadata

* docs: update main program directory name
  • Loading branch information
TechSolomon authored Apr 2, 2024
1 parent 084f41b commit 8ab3ec3
Show file tree
Hide file tree
Showing 13 changed files with 359 additions and 581 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ go.work

# Input source → experimental results
*.txt

# Output binary
diode
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
BIN_NAME=diode
BIN_VERSION=0.1.0
BIN_DATE=$(shell date +%FT%T%z)

all: build

build:
go build -o diode -ldflags="-X main.SemVer=0.0.9" diode.go
go build -o ${BIN_NAME} -ldflags="-X 'main.SemVer=${BIN_VERSION}' -X 'main.BuildInfo=${BIN_DATE}'"

test:
go test -v ./...

run:
go run diode.go
run: build
./${BIN_NAME} --help

clean:
go clean
rm ${BIN_NAME}

13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,27 @@ Scripts for verifying TCP passthrough functionality.
```zsh
.
├── config
├── diode.go
├── diode_test.go
├── docker-compose.yaml
├── Dockerfile
├── docs
├── go.mod
├── go.sum
├── insights
├── main.go
├── Makefile
├── README.md
├── sample
└── utility

5 directories, 8 files
5 directories, 7 files
```

#### Architecture Diagram (WIP)
#### Architecture Diagram

```mermaid
graph LR
A("Publish (MQTT)") --> B(TCP Client)
B --> C(Data Diode)
C --> D(TCP Server)
D --> E("Subscribe (MQTT)")
A("Subscribe (MQTT)") -->|TCP Client|B(Data Diode) -->|TCP Server|C("Publish (MQTT)")
```

> [!NOTE]
Expand Down
33 changes: 20 additions & 13 deletions config/settings.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Data Diode Settings
input:
ip: "localhost"
port: 49152
timeout: 60 # seconds
output:
ip: "localhost"
port: 13337
tls: false
broker:
server: "localhost"
port: 1883
topic: "diode/telemetry"
# Project Settings
diode:
input:
ip: "localhost"
port: 49152
timeout: 60 # seconds
output:
ip: "localhost"
port: 13337
tls: false
mqtt:
inside:
server: "localhost"
port: 1883
topic: "#"
outside:
server: "localhost"
port: 1883
prefix: "diode"
# Avoid namespace collisions
185 changes: 0 additions & 185 deletions diode_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/acep-uaf/data-diode

go 1.22.1
go 1.22

require (
github.com/eclipse/paho.mqtt.golang v1.4.3
github.com/google/uuid v1.6.0
github.com/olekukonko/tablewriter v0.0.5
github.com/urfave/cli/v2 v2.27.1
gopkg.in/yaml.v2 v2.4.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lV
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik=
github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
Expand Down
Loading

0 comments on commit 8ab3ec3

Please sign in to comment.