Organization: Akita Engineering (www.akitaengineering.com) License: GPLv3
This repository contains two Python applications providing web-like services over the Reticulum Network Stack:
- Akita Phoenix: A text-based web browser with discovery, RNS names, bookmarks, configurable caching, POST support, and enhanced plugin hooks.
- Akita Hexagon: A lightweight web server with discovery announcement, enhanced configuration (timeouts, sizes), plugin-based path handling (GET/POST), lifecycle hooks, HTML error pages, and plugin support.
Ideal for low-bandwidth, terminal-based, or specialized network environments.
- Server Discovery & RNS: Connect via discovery, RNS name (e.g.,
myweb.serv), or destination hash. - Bookmarks: Save (
addbm), list (listbm), navigate (gobm) favorite sites. Stored in~/.config/akita-phoenix/bookmarks.json. - Configurable Caching: Time-based response caching in
~/.config/akita-phoenix/cache/. TTL configurable via~/.config/akita-phoenix/config.json. Userto refresh. - Text Rendering: Displays
text/html,text/plain, and other common text types (application/json,text/css, etc.). Informs about binary types. - Navigation: Follow relative links (
[Num]), Back (b), Refresh (r), Home (h). - POST Requests: Send simple URL-encoded form data using the
post <path> <key=value&...>command. - Plugin System:
modify_request: Alter outgoing request (method, path, headers, body).process_content: Modify raw response bytes before parsing.post_parse_content: Modify extracted text/links after parsing.modify_links: Filter or change the list of links before display.- Plugins loaded from
src/akita_reticulum_web_services/plugins/phoenix/.
- Service Announcement: Announces
akita_web/hexagonfor discovery. - Configurable: Settings via
~/.config/akita-hexagon/config.json(timeouts, sizes, paths, log level) and command-line overrides. - Plugin System:
- Path Handling: Plugins register URL paths (
/myplugin/api) viaregister_path_handlerinload(). Requests are routed tohandle_registered_path(supports GET/POST/etc.). - Lifecycle Hooks:
server_startup(config, destination)andserver_shutdown()for setup/cleanup (seestartup_logger.pyexample). - Response Hook:
modify_responseallows altering default responses/errors. - Plugins loaded from
src/akita_reticulum_web_services/plugins/hexagon/. Includesecho_post.pyandstartup_logger.pyexamples.
- Path Handling: Plugins register URL paths (
- File Serving: Serves local files for GET requests if no plugin handles the path. Uses
mimetypes. - Basic HTTP/1.0: Handles GET by default. Handles POST/other methods only if a plugin registers a path handler. Requires
Content-Lengthfor POST/PUT. - Error Handling: Serves basic HTML error pages (from
src/.../templates/) for common 4xx/5xx errors. Logs errors. - Multi-threaded Request Handling: Uses threading for concurrency.
Akita-Reticulum-Web-Services/
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
├── examples/ # Sample HTML files
├── scripts/ # Executable scripts
│ ├── run_hexagon_server.py
│ └── run_phoenix_browser.py
└── src/ # Source code library
└── akita_reticulum_web_services/
├── init.py
├── hexagon_server.py # Server logic
├── html_parser.py # Browser HTML parser
├── phoenix_browser.py # Browser logic
├── templates/ # HTML error page templates
│ └── error_*.html
└── plugins/ # Plugin directory
├── init.py
├── phoenix/ # Browser plugins
│ ├── init.py
│ └── title_logger.py (Example)
└── hexagon/ # Server plugins
├── init.py
├── echo_post.py (Example)
└── startup_logger.py (Example)
- Prerequisites: Python 3.7+, running/configured Reticulum instance.
- Clone:
git clone <repo_url> && cd Akita-Reticulum-Web-Services - Install deps:
pip install -r requirements.txt
- Server (
~/.config/akita-hexagon/config.json): Controls serve directory, interface, identity path, log level, timeouts (request/link), size limits (header/POST body). Seeload_configinhexagon_server.pyfor keys and defaults. - Browser (
~/.config/akita-phoenix/config.json): Controls cache TTL (cache_ttl_seconds), timeouts (request/link/RNS resolve). Seeload_browser_configinphoenix_browser.pyfor keys and defaults.
(Create these JSON files if you want to override defaults)
- Start:
python3 scripts/run_hexagon_server.py - Overrides:
python3 scripts/run_hexagon_server.py -c /path/to/config.json -i <iface>
-
Discover:
python3 scripts/run_phoenix_browser.py -
Connect (Name/Hash):
python3 scripts/run_phoenix_browser.py <target> -
Specify Path: Add
-p /path/page.html -
Browser Commands:
[Num]: Follow link.b: Back.r: Refresh.h: Home (/).p <path> <data>: Send POST (e.g.,p /echo name=test&val=123).a [name]: Add bookmark.l: List bookmarks.g <num>: Go to bookmark.q: Quit.
- Browser: Place in
src/.../plugins/phoenix/. InheritPhoenixPluginBase. See base class docstrings for hooks. - Server: Place in
src/.../plugins/hexagon/. InheritHexagonPluginBase. Useload()to register paths viaself.register_path_handler(...). Implementhandle_registered_path(...)(returnTrueif handled). Use lifecycle hooksserver_startup/server_shutdown.
- Reticulum Setup: Essential.
- POST: Browser sends URL-encoded. Server relies on plugins registering paths.
- Security: Basic. Use cautiously.
- Asynchronous operations (
asyncio). - More robust error pages/handling.
- More configuration options.
- More sophisticated plugin management.
- Support for other HTTP methods via plugins (PUT, DELETE).
Contributions welcome!
GPLv3 - see LICENSE file.