The File Server program is designed to serve files and respond to remote file transfer commands over a KISS‑framed connection.
Using AX.25 headers, it accepts commands such as GET, LIST, PUT, DEL, and REN from remote clients.
The server reads commands from an underlying connection (either TCP or serial), processes them, and sends back responses as RSP packets.
File content or directory listings are transferred by invoking external sender or receiver binaries.
The File Server performs the following functions:
CMD: and include a unique 2‑character command ID.
GET [FILE] command, the server reads the requested file from the
specified serve-directory (or from the sender’s own subdirectory in per‑callsign mode), responds with a “GET OK” status,
and then transfers the file using the sender binary.
LIST command causes the server to generate a CSV file listing of all files in the serve directory
(or the sender’s subdirectory in per‑callsign mode). The listing is then sent as LIST.txt via the sender binary.
PUT [FILE] command, the server verifies the sender’s callsign (if filtering is enabled)
and spawns the receiver binary to accept the incoming file. The file is then saved to the designated save directory or into the sender’s subdirectory in per‑callsign mode.
DEL [FILE] command deletes a specified file from the serve directory (or the sender’s subdirectory).
This is an administrative command and requires the sender to be authorized via the --admin-callsigns flag.
REN [CURRENT FILE]|[NEW FILE] command renames a file in the serve directory (or the sender’s subdirectory)
from the current filename to the new filename. Like the DEL command, this is restricted to senders whose callsigns match the patterns specified by --admin-callsigns.
--passthrough-port) allows for a transparent data relay between
the underlying KISS connection and remote clients.
--id-period flag.
--per-callsign option is specified, the server operates in per‑callsign mode.
In this mode, a base directory is provided and the server automatically creates a subdirectory for each sender (using the sender’s callsign).
All file operations (GET, LIST, PUT, DEL, and REN) then act only within the sender’s own subdirectory, and filtering based on allowed callsigns is bypassed.
Security checks are still enforced to prevent directory traversal (e.g. using "../").
To build the File Server, ensure that you have Go installed. Then compile the program with the following command:
go build -o fileserver fileserver.go
Make sure that any external binaries (the sender and receiver executables) are available in your system’s PATH or specify their paths via the command‑line options.
The table below lists all available command‑line options along with their descriptions and default values:
| Flag | Description | Default Value |
|---|---|---|
--my-callsign |
Your server’s callsign (required). This value is used as the destination for incoming command packets. | none |
--connection |
Connection type to use: tcp or serial.
|
tcp |
--host |
TCP host to connect to (if using TCP connection). | 127.0.0.1 |
--port |
TCP port to connect to (if using TCP connection). | 9001 |
--serial-port |
Serial port device (e.g. COM3 or /dev/ttyUSB0). Required for serial connections.
|
empty |
--baud |
Baud rate for the serial connection. | 115200 |
--get-callsigns |
Comma‑delimited list of allowed sender callsign patterns for GET commands (supports wildcards, e.g. MM5NDH-*,*-15).
(Ignored in per‑callsign mode.)
|
none |
--put-callsigns |
Comma‑delimited list of allowed sender callsign patterns for PUT commands (supports wildcards). (Ignored in per‑callsign mode.) | none |
--admin-callsigns |
Comma‑delimited list of allowed sender callsign patterns for administrative commands (DEL and REN).
If not specified, admin commands are denied. (Ignored in per‑callsign mode.)
|
none |
--serve-directory |
Directory from which files are served (mandatory unless --per-callsign is used).
|
none |
--save-directory |
Directory where received files should be saved. (Not used in per‑callsign mode.) | . |
--sender-binary |
Path to the binary used to send files (mandatory). This binary is invoked for GET and LIST commands. | none |
--receiver-binary |
Path to the binary used to receive files (for PUT commands). | receiver |
--passthrough-port |
TCP port for transparent passthrough (used for file transfers). Remote clients connect here to receive file data. | 5011 |
--id-period |
Interval (in minutes) between sending an ID packet containing the server identity. A value of 0 disables periodic ID transmission. | 30 |
--overwrite-existing |
When set, an uploaded file with the same name as an existing file will be overwritten rather than the filename automatically incremented. | false |
--per-callsign |
Base directory for per‑callsign subdirectories. When specified, the server creates a subdirectory for each sender (named after the sender’s callsign).
All file operations (GET, LIST, PUT, DEL, REN) then operate within that subdirectory, and callsign filtering is bypassed.
This option is mutually exclusive with --serve-directory, --save-directory, --get-callsigns, --put-callsigns, and --admin-callsigns.
|
none |
Run the File Server by providing the required options. For example, to start the server with a TCP connection, serving files from the files directory:
./fileserver --my-callsign=SERVER1 --serve-directory=files --sender-binary=/path/to/sender
For a serial connection, specify the serial port:
./fileserver --my-callsign=SERVER1 --connection=serial --serial-port=/dev/ttyUSB0 --baud=115200 --serve-directory=files --sender-binary=/path/to/sender
To run in per‑callsign mode, specify the --per-callsign flag with a base directory.
In this mode, the server ignores the global serve-directory, save-directory, and callsign filtering options.
Instead, it automatically creates a subdirectory (named after each sender’s callsign) under the provided base directory and generates a README.txt welcome file. You can specify --overwrite-existing if you want files with the same name to be overwritten.
For example:
./fileserver --my-callsign=SERVER1 --per-callsign=/path/to/base --sender-binary=/path/to/sender --overwrite-existing
The server supports the following commands:
LIST.txt) and transfers it using the sender binary.
--admin-callsigns (ignored in per‑callsign mode).
DEL, this is restricted to authorized senders.
--get-callsigns, --put-callsigns, and --admin-callsigns flags.
These options are ignored when operating in per‑callsign mode.
DEL and REN) are only executed if the sender’s callsign matches the allowed patterns provided with --admin-callsigns.
In per‑callsign mode, all senders have full access to their own subdirectory.
--passthrough-port) relays data between the underlying KISS connection and remote clients.
For further questions, suggestions, or to report issues, please contact the project maintainer or visit the project’s repository.