Michael Woods f58f669cef True up.
2025-12-20 21:59:25 -05:00
2025-07-27 13:41:54 -04:00
2025-12-20 21:59:25 -05:00
2025-12-20 21:59:25 -05:00
2025-05-26 21:42:01 -04:00
2025-12-20 20:22:36 -05:00
2025-12-20 21:59:25 -05:00

PacketServer BBS

DISCLAIMER This whole project is still a major WIP.

HUGE HUGE THANKS TO https://github.com/mfncooper for providing the pyham_pe package that this uses to talk to the TNC

Intro

Basically, this is supposed to be a modernized BBS for radio, but with clients and servers exchanging binary messages (which can be compressed automatically) rather than human-typed text.

This compression is inherent to the protocol, and actually results in some pretty large transmission time savings when sending longer messages back and forth!

The downside is that right now, this BBS system will be useless to someone without the client library. You won't be able to just type in messages to the server. I may add some kind of workaround for this.

Right now, it uses ax25 connected sessions through any TNC that can provide an AGWPE TNC, though I may add a restricted unconnected protocol using UI packets later on..

Requirements

  • A radio of some kind that can transmit on a band suitable for any kind of AX25 packet work.
  • A way to connect the radio to a Linux machine (for hosting using the container orchestrator) or just anything that runs Python for the client. I recommend DigiRig.
  • A TNC that provides an AGWPE interface. Direwolf works; there are others for different platforms.
  • Recent Python (Python 3.11+.)

Features completed:

  • protocol using connected mode sessions to provide request/response architecture
  • Object CRUD operations
  • Server-side Podman containerized job orchestrator
  • automatic compression for all RF communication
  • Creating and retrieving bulletins
  • Sending and receiving and searching messages to/from other users

Features in-progress and working to some extent:

  • corresponding Python client wrapper library for most elements of the server-side (RF) API (enough for basic usage anyway)
  • Python CLI client supporting:
    • listing registered users on the server
    • setting and retrieving personal user profile details
    • uploading files as objects, searching objects on server, downloading object data
    • sending and retrieving messages to other users including attached arbitrary string and binary data
    • running basic scripts/commands as jobs on the server inside containers

Planned features not yet implemented:

  • client API and CLI capability to fully interact with the job system including getting artifacts back from jobs
  • client API and CLI capability to set and retrieve bulletins
  • editing public bulletins, once created
  • client/server API capability to modify objects

I'm considering several other features like:

  • Useful documentation of any variety..
  • RF beacon
  • service administration over RF
  • cli server administration tools
    • Right now, just edit the server's zope database with a python interpreter (included example scripts to help)
  • possibly a cron system (again in containers for safety)
  • maybe an e-mail or an sms gateway (though clever user uploaded scripts could do this instead)
  • maybe APRS integration through APRS-IS
  • Kubernetes or possibly simple shell job execution.

Examples

Main help dialog:

(venv) [user@host]$ export PSCLIENT_SERVER=KQ4PEC
(venv) [user@host]$ export PSCLIENT_AGWPE=localhost
(venv) [user@host]$ export PSCLIENT_PORT=8000
(venv) [user@host]$ export PSCLIENT_CALLSIGN=KQ4PEC-7
(venv) [user@host]$ packcli
Usage: packcli [OPTIONS] COMMAND [ARGS]...

  Command line interface for the PacketServer client and server API.

Options:
  --conf TEXT          path to configfile
  -s, --server TEXT    server radio callsign to connect to (required)
  -a, --agwpe TEXT     AGWPE TNC server address to connect to (config file)
  -p, --port INTEGER   AGWPE TNC server port to connect to (config file)
  -c, --callsign TEXT  radio callsign[+ssid] of this client station (config
                       file)
  -k, --keep-log       Save local copy of request log after session ends?
  -v, --version        Show the version and exit.
  --help               Show this message and exit.

Commands:
  job           Runs commands on the BBS server if jobs are enabled on it.
  message       Send, search, and filter messages to and from other users...
  object        Manages objects stored on the BBS.
  query-server  Query the server for basic info.
  set           Set your user profile settings on the BBS.
  user          Query users on the BBS.

Running jobs on the remote server:

(venv) [user@host]$ packcli job start -- ls -l /                                                                                       
67                                                                                                                                                             
(venv) [user@host]$ packcli job get                                                                                                    
You must either supply a job id, or --all-jobs                                                                                                                 
(venv) [user@host]$ packcli job get 67                                                                                                 
-----------  ------------------------------------------------------------------                                                                                
id           67                                                                                                                                                
return_code  0                                                                                                                                                 
status       SUCCESSFUL                                                                                                                                        
created      2025-03-21T00:15:41.142544+00:00                                                                                                                  
finished     2025-03-20T20:15:46.257489                                                                                                                        
cmd          ['ls', '-l', '/']                                                                                                                                 
owner        KQ4PEC                                                                                                                                            
artifacts                                                                                                                                                      
output       total 4                                                                                                                                           
             drwxr-xr-x   2 root   root      40 Mar 21 00:14 artifact_output                                                                                   
             lrwxrwxrwx   1 root   root       7 Mar 11  2024 bin -> usr/bin                                                                                                                                                                                                                                                    
             drwxr-xr-x   2 root   root       6 Jan 28  2024 boot                                                                                              
             drwxr-xr-x   5 root   root     340 Mar 21 00:14 dev                                                                                               
             drwxr-xr-x   1 root   root    4096 Mar 21 00:14 etc                                                                                                                                                                                                                                                               
             drwxr-xr-x   1 root   root      20 Mar 21 00:14 home                                                                                                                                                                                                                                                              
             lrwxrwxrwx   1 root   root       7 Mar 11  2024 lib -> usr/lib                                                                                    
             lrwxrwxrwx   1 root   root       9 Mar 11  2024 lib64 -> usr/lib64                                                                                
             drwxr-xr-x   2 root   root       6 Mar 11  2024 media                                                                                             
             drwxr-xr-x   2 root   root       6 Mar 11  2024 mnt                                                                                               
             drwxr-xr-x   2 root   root       6 Mar 11  2024 opt                                                                                               
             dr-xr-xr-x 534 nobody nogroup    0 Mar 21 00:14 proc                                                                                              
             drwx------   1 root   root      21 Mar 21 00:14 root                                                                                              
             drwxr-xr-x   1 root   root      27 Mar 21 00:14 run                                                                                               
             lrwxrwxrwx   1 root   root       8 Mar 11  2024 sbin -> usr/sbin                                                                                  
             drwxr-xr-x   2 root   root       6 Mar 11  2024 srv                                                                                               
             dr-xr-xr-x  13 nobody nogroup    0 Mar 21 00:14 sys                                                                                               
             drwxrwxrwt   1 root   root       6 Feb 16 02:08 tmp                                                                                               
             drwxr-xr-x   1 root   root      66 Mar 11  2024 usr                                                                                                                                                                                                                                                               
             drwxr-xr-x   1 root   root      41 Mar 11  2024 var                                                                                               
errors                                                                                                                                                         
-----------  ------------------------------------------------------------------

Working with objects:

(venv) [user@host]$ packcli object list
name               size_bytes  binary    private    created_at                        modified_at                       uuid
---------------  ------------  --------  ---------  --------------------------------  --------------------------------  ------------------------------------
testdb.txt            13        False     True       2025-03-16T22:26:05.049173+00:00  2025-03-16T22:26:05.051375+00:00  fbbd4527-a5f0-447f-9fc9-55b7b263c458

(venv) [user@host]$ packcli object upload-file 
Usage: packcli object upload-file [OPTIONS] FILE_PATH
Try 'packcli object upload-file --help' for help.

Error: Missing argument 'FILE_PATH'.

(venv) [user@host]$ packcli object upload-file /tmp/hello-world.txt 
35753577-21e3-4f64-8776-e3f86f1bb0e0

(venv) [user@host]$ packcli object list
name               size_bytes  binary    private    created_at                        modified_at                       uuid
---------------  ------------  --------  ---------  --------------------------------  --------------------------------  ------------------------------------
testdb.txt                 13  False     True       2025-03-16T22:26:05.049173+00:00  2025-03-16T22:26:05.051375+00:00  fbbd4527-a5f0-447f-9fc9-55b7b263c458
hello-world.txt            13  False     True       2025-03-19T02:25:41.501833+00:00  2025-03-19T02:25:41.503502+00:00  35753577-21e3-4f64-8776-e3f86f1bb0e0

(venv) packcli object get 35753577-21e3-4f64-8776-e3f86f1bb0e0
Hello world.

Retrieving messages:

(venv) [user@host]$ packcli message get 
from    to      id                                    text                             sent_at                           attachments
------  ------  ------------------------------------  -------------------------------  --------------------------------  -------------
KQ4PEC  KQ4PEC  df7493d7-5880-4c24-9e3c-1d3987a5203e  testing.. again with attachment  2025-03-18T03:41:36.597371+00:00  random.txt
KQ4PEC  KQ4PEC  e3056cdf-1f56-4790-8aef-dfea959bfa13  from stdin                       2025-03-18T03:40:36.051667+00:00
KQ4PEC  KQ4PEC  992c3e81-005a-49e2-81d7-8bf3026a2c46  testing.. again                  2025-03-18T03:40:05.025017+00:00
KQ4PEC  KQ4PEC  05684b13-40f8-40aa-ab7a-f50a3c22261e  testing.. 1.. 2.. 3              2025-03-18T03:39:50.510164+00:00
KQ4PEC  KQ4PEC  ad513075-e50f-4f84-8a87-a1217b43bef3  testing.. 1.. 2.. 3              2025-03-18T03:38:01.634498+00:00

Listing users:

(venv) [user@host]$ packcli user -l
username    status                 bio    socials    created                           last_seen                         email            location
----------  ---------------------  -----  ---------  --------------------------------  --------------------------------  ---------------  ----------
KQ4PEC      just happy to be here                    2025-03-16 04:29:52.044216+00:00  2025-03-19 02:22:21.413896+00:00  user@domain.com

Final Thoughts

I may also add a TCP/IP interface to this later, since that shouldn't be too difficult. We'll see.

I'm envisioning using a couple of python CLI clients with this for now, or possibly an android or PC GUI, assuming an AGWPE TNC is available on the network.

Description
a ham radio BBS over packet
Readme 14 MiB
Languages
Python 97%
HTML 2.8%
Dockerfile 0.1%