File Server Documentation

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.

Table of Contents

Overview

The File Server performs the following functions:

Installation & Build

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.

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

Usage & Examples

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
  

Commands

The server supports the following commands:

Additional Notes

Contact & Support

For further questions, suggestions, or to report issues, please contact the project maintainer or visit the project’s repository.