From 2b291900b9d4e97d8ac985eb37f3f51e084f80aa Mon Sep 17 00:00:00 2001 From: Dustin Stiles Date: Sun, 9 Mar 2025 12:35:32 -0400 Subject: [PATCH] more improvements --- README.md | 8 ++++---- dsfx-client/main.go | 2 +- dsfx-server/main.go | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fd2d912..fb0c409 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,10 @@ go install ./... ### Starting the Server -The dsfx-server requires a listening host, port, and a master key (ECDSA private key in PEM format). For example: +The dsfx-server requires a listening host, port, and an identity key (ECDSA private key in PEM format). For example: ```sh -dsfx-server -host localhost -port 8000 -masterKey /path/to/masterkey.pem +dsfx-server -host localhost -port 8000 -key /path/to/serverkey.pem ``` > Note, if you need to generate a new ECDSA key, you can use the following command: `go run ./cmd/genkey > path/to/masterkey.pem` @@ -64,7 +64,7 @@ The host interface on which the server will listen. -port (default 8000) The TCP port on which the server will accept connections. --masterKey (required) +-key (required) File path to the PEM-encoded ECDSA private key that serves as the server’s master key. Once started, the server will bind to the specified host and port and wait for incoming secure file exchange (or other test) connections. When a client connects, the initial payload (up to 1024 bytes) from the client is read and logged. @@ -91,7 +91,7 @@ Tests the connection against the remote dsfx-server instance. : The address of the server in the format “dsfx://IP:PORT#PUBLIC_KEY_BASE_64”. -For example, “dsfx://127.0.0.1:8000#” or “dsfx://127.0.0.1:8000#eyJuIjoiLy8v..." +For example, `dsfx://127.0.0.1:8000#” or “dsfx://127.0.0.1:8000#eyJuIjoiLy8v...` Example: diff --git a/dsfx-client/main.go b/dsfx-client/main.go index a9953d6..5e8c0e8 100644 --- a/dsfx-client/main.go +++ b/dsfx-client/main.go @@ -44,7 +44,7 @@ func main() { flag.PrintDefaults() } - flagKey := flag.String("key", "", "the path to the private key file") + flagKey := flag.String("key", "", "the path to the key file") flag.Parse() diff --git a/dsfx-server/main.go b/dsfx-server/main.go index 667724c..ecbcb37 100644 --- a/dsfx-server/main.go +++ b/dsfx-server/main.go @@ -14,9 +14,9 @@ import ( ) var ( - flagHost = flag.String("host", "localhost", "the host to listen on") - flagPort = flag.Int("port", 8000, "the port to listen on") - flagMasterKey = flag.String("masterKey", "", "the path to the master key file") + flagHost = flag.String("host", "localhost", "the host to listen on") + flagPort = flag.Int("port", 8000, "the port to listen on") + flagKey = flag.String("key", "", "the path to the key file") ) func main() { @@ -43,12 +43,12 @@ func main() { flag.Parse() - if *flagMasterKey == "" { + if *flagKey == "" { slog.ErrorContext(ctx, "master key path is required") os.Exit(1) } - masterKey, err := dcrypto.LoadSigningKeyFromFile(*flagMasterKey) + masterKey, err := dcrypto.LoadSigningKeyFromFile(*flagKey) if err != nil { logger.ErrorContext(ctx, "failed to load master key", slog.Any("error", err)) os.Exit(1)