Skip to content

Commit 8ab3ec3

Browse files
authored
Code freeze for first minor release (#39)
* 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
1 parent 084f41b commit 8ab3ec3

File tree

13 files changed

+359
-581
lines changed

13 files changed

+359
-581
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ go.work
2222

2323
# Input source → experimental results
2424
*.txt
25+
26+
# Output binary
27+
diode

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
BIN_NAME=diode
2+
BIN_VERSION=0.1.0
3+
BIN_DATE=$(shell date +%FT%T%z)
4+
15
all: build
26

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

610
test:
711
go test -v ./...
812

9-
run:
10-
go run diode.go
13+
run: build
14+
./${BIN_NAME} --help
15+
16+
clean:
17+
go clean
18+
rm ${BIN_NAME}
1119

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,27 @@ Scripts for verifying TCP passthrough functionality.
2323
```zsh
2424
.
2525
├── config
26-
├── diode.go
27-
├── diode_test.go
2826
├── docker-compose.yaml
2927
├── Dockerfile
3028
├── docs
3129
├── go.mod
3230
├── go.sum
3331
├── insights
32+
├── main.go
3433
├── Makefile
3534
├── README.md
3635
├── sample
3736
└── utility
3837

39-
5 directories, 8 files
38+
5 directories, 7 files
4039
```
4140

42-
#### Architecture Diagram (WIP)
41+
#### Architecture Diagram
4342

4443
```mermaid
4544
graph LR
46-
A("Publish (MQTT)") --> B(TCP Client)
47-
B --> C(Data Diode)
48-
C --> D(TCP Server)
49-
D --> E("Subscribe (MQTT)")
45+
A("Subscribe (MQTT)") -->|TCP Client|B(Data Diode) -->|TCP Server|C("Publish (MQTT)")
46+
5047
```
5148

5249
> [!NOTE]

config/settings.yaml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
# Data Diode Settings
2-
input:
3-
ip: "localhost"
4-
port: 49152
5-
timeout: 60 # seconds
6-
output:
7-
ip: "localhost"
8-
port: 13337
9-
tls: false
10-
broker:
11-
server: "localhost"
12-
port: 1883
13-
topic: "diode/telemetry"
1+
# Project Settings
2+
diode:
3+
input:
4+
ip: "localhost"
5+
port: 49152
6+
timeout: 60 # seconds
7+
output:
8+
ip: "localhost"
9+
port: 13337
10+
tls: false
11+
mqtt:
12+
inside:
13+
server: "localhost"
14+
port: 1883
15+
topic: "#"
16+
outside:
17+
server: "localhost"
18+
port: 1883
19+
prefix: "diode"
20+
# Avoid namespace collisions

diode_test.go

Lines changed: 0 additions & 185 deletions
This file was deleted.

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
module github.com/acep-uaf/data-diode
22

3-
go 1.22.1
3+
go 1.22
44

55
require (
66
github.com/eclipse/paho.mqtt.golang v1.4.3
7-
github.com/google/uuid v1.6.0
87
github.com/olekukonko/tablewriter v0.0.5
98
github.com/urfave/cli/v2 v2.27.1
109
gopkg.in/yaml.v2 v2.4.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lV
22
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
33
github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik=
44
github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE=
5-
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
6-
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
75
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
86
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
97
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=

0 commit comments

Comments
 (0)