2025-03-08 15:07:27 -05:00
# dsfx: Distributed Secure File Exchange
dsfx is a robust, secure, and distributed file exchange system written in Go. Designed from the ground up for safety, performance, and ease of maintenance, dsfx enables encrypted file transfers between nodes in a distributed network. Its streamlined architecture ensures that file exchanges are both secure and efficient.
---
## Features
2025-03-10 10:29:54 -04:00
- **End-to-End Security:** Uses modern cryptographic primitives (ED25519 keys, for example) to ensure that all file exchanges are encrypted and authenticated.
2025-03-08 15:07:27 -05:00
- **Distributed Architecture:** Designed for secure file exchange across multiple nodes with built-in support for key-based authentication.
- **High Performance:** Optimized for low latency and high throughput, with a focus on reliable and predictable behavior.
2025-03-09 10:30:58 -04:00
- **Administrative and Test Tools:** The dsfx client can be used to test connectivity and perform preliminary administrative actions against the dsfx server.
2025-03-08 15:07:27 -05:00
- **Easy Integration:** Built in Go with minimal external dependencies, dsfx is simple to deploy and integrate into existing systems.
---
## Installation
### Prerequisites
- Go 1.24 or later is required.
- Git
### Build from Source
Clone the repository:
2025-03-09 12:33:27 -04:00
```sh
2025-03-08 15:07:27 -05:00
git clone https://koti.casa/numenor-labs/dsfx.git
cd dsfx
2025-03-09 12:33:27 -04:00
```
2025-03-08 15:07:27 -05:00
Build the project:
2025-03-09 12:33:27 -04:00
```sh
2025-03-09 15:52:33 -04:00
go build -o dist/ ./cmd/...
2025-03-09 12:33:27 -04:00
```
2025-03-08 15:07:27 -05:00
2025-03-09 10:30:58 -04:00
You can also install the executables to your $GOPATH/bin:
2025-03-08 15:07:27 -05:00
2025-03-09 12:33:27 -04:00
```sh
2025-03-09 15:52:33 -04:00
go install ./cmd/...
2025-03-09 12:33:27 -04:00
```
2025-03-08 15:07:27 -05:00
---
## Usage
### Starting the Server
2025-03-10 10:29:54 -04:00
The dsfxnode requires a listening host, port, and an identity key (ED25519 private key in Base64 format). For example:
2025-03-08 15:07:27 -05:00
2025-03-09 12:33:27 -04:00
```sh
2025-03-10 10:29:54 -04:00
dsfxnode -host localhost -port 8000 -key /path/to/serverkey
2025-03-09 12:33:27 -04:00
```
2025-03-08 15:07:27 -05:00
2025-03-10 10:29:54 -04:00
> Note, if you need to generate a new ED25519 key, you can use the following command: `go run ./tool/genkey > path/to/masterkey`
2025-03-09 10:32:16 -04:00
2025-03-09 10:30:58 -04:00
Command-line flags for dsfx-server:
-host (default "localhost")
The host interface on which the server will listen.
-port (default 8000)
The TCP port on which the server will accept connections.
2025-03-09 12:35:32 -04:00
-key (required)
2025-03-10 10:29:54 -04:00
File path to the Base64-encoded ED25519 private key that serves as the server’ s master key.
2025-03-09 10:30:58 -04:00
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.
2025-03-08 15:07:27 -05:00
2025-03-09 15:52:33 -04:00
### Running the Admin Client
2025-03-08 15:07:27 -05:00
2025-03-10 10:29:54 -04:00
The dsfxctl uses a private key for the client (also an ED25519 key in Base64 format) and currently supports only the “test” command for checking connectivity to the server.
2025-03-09 10:30:58 -04:00
Client command usage:
2025-03-09 12:33:27 -04:00
```sh
2025-03-10 10:29:54 -04:00
dsfxctl -key /path/to/clientkey test < remote_addr >
2025-03-09 12:33:27 -04:00
```
2025-03-09 10:30:58 -04:00
Where:
2025-03-08 15:07:27 -05:00
2025-03-09 10:30:58 -04:00
-key (required)
Specifies the file path to your client’ s PEM-encoded private key.
2025-03-08 15:07:27 -05:00
2025-03-09 10:30:58 -04:00
The command-line arguments for the dsfx-client are as follows:
2025-03-08 15:07:27 -05:00
2025-03-09 10:30:58 -04:00
Command: test
Tests the connection against the remote dsfx-server instance.
2025-03-08 15:07:27 -05:00
2025-03-09 10:30:58 -04:00
< remote_addr > :
The address of the server in the format “dsfx://IP:PORT#PUBLIC_KEY_BASE_64 ”.
2025-03-09 12:35:32 -04:00
For example, `dsfx://127.0.0.1:8000#<base64 pubkey>” or “dsfx://127.0.0.1:8000#eyJuIjoiLy8v...`
2025-03-09 10:30:58 -04:00
Example:
2025-03-09 12:33:27 -04:00
```sh
2025-03-09 15:52:33 -04:00
dsfxctl -key ./dsfx-client/masterkey test dsfx://127.0.0.1:8000#eyJuIjoiLy8v ..
2025-03-09 12:33:27 -04:00
```
2025-03-09 10:30:58 -04:00
If no command or an unrecognized command is provided, the client will print a brief usage message and exit.
### Help and Usage Information
For quick help, simply pass the -h flag:
2025-03-08 15:07:27 -05:00
2025-03-09 12:33:27 -04:00
```sh
2025-03-09 15:52:33 -04:00
dsfxctl -h
dsfxnode -h
2025-03-09 12:33:27 -04:00
```
2025-03-09 10:30:58 -04:00
This will display the usage information along with available flags.
2025-03-08 15:07:27 -05:00
---
## Contributing
Contributions to dsfx are welcome and encouraged!
### How to Contribute
1. **Fork the Repository:** Create your own branch from the latest code in `main` .
2025-03-09 10:32:16 -04:00
2. **Make Your Changes:** Follow the [TigerStyle for Go ](./tigerstyle.md ) guidelines to ensure code consistency and quality.
2025-03-09 10:30:58 -04:00
3. **Write Tests:** Ensure that new features and bug fixes include proper tests.
2025-03-08 15:07:27 -05:00
4. **Submit a Pull Request:** Document your changes clearly in your pull request.
### Reporting Issues
2025-03-09 10:30:58 -04:00
Please use the Git repository's issue tracker to report bugs or to suggest new features. Provide as much detail as possible to help reproduce and address any issues.
2025-03-08 15:07:27 -05:00
---
## License
2025-03-09 10:32:16 -04:00
dsfx is distributed under the MIT License. See [LICENSE ](./LICENSE ) for details.