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/PUT/DELETE support, and enhanced plugin hooks.
- Akita Hexagon: A lightweight web server with discovery announcement, configurable request limits, optional directory listing and gzip responses, plugin-based path handling (GET/POST/PUT/DELETE), lifecycle hooks, and HTML error pages.
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. - Compressed Responses: Requests gzip-compressed responses when available and transparently decodes them.
- 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). - HTTP Methods: Send GET (default), POST (
post <path> <key=value&...>), PUT (put <path> <data>), DELETE (del <path>). - 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/. Supports priorities and selective enabling.
- Service Announcement: Announces
akita_web/hexagonfor discovery. - Configurable: Settings via
~/.config/akita-hexagon/config.json(timeouts, size limits, directory listing, custom headers, optional gzip compression, plugin management) and command-line overrides. - Interface Validation: Can require a named active Reticulum interface before startup. Interface enablement still comes from the underlying Reticulum configuration.
- Plugin System:
- Path Handling: Plugins register URL paths (
/myplugin/api) viaregister_path_handlerinload(). Requests are routed tohandle_registered_path(supports GET/POST/PUT/DELETE/etc.). - Lifecycle Hooks:
server_startup(config, destination)andserver_shutdown()for setup/cleanup (seestartup_logger.pyexample). - Response Hook:
modify_responseallows altering default responses/errors. - Priority System: Plugins have priorities for execution order. Selective loading via config.
- 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. Optional directory listing and gzip compression for clients that accept it. - Basic HTTP/1.0: Handles GET by default. Handles POST/PUT/DELETE/other methods via plugins. Requires
Content-Lengthfor body methods. - Error Handling: Serves HTML error pages (from
src/.../templates/) for common 4xx/5xx errors. Logs errors. Custom error templates. - Multi-threaded Request Handling: Uses a handler thread per accepted link.
- 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
- Configuration Reference: Key-by-key browser and server configuration details, defaults, caveats, and example JSON.
- Development Notes: Local virtual environment workflow, linting/compile commands, and project style settings.
- Use Cases: Practical deployment and workflow ideas for combining Akita Hexagon and Akita Phoenix.
- Server (
~/.config/akita-hexagon/config.json): Controls serve directory, required active interface name, identity path, log level, timeouts (request/link), size limits (header/POST body), gzip compression, custom headers, enabled plugins list, and directory listing. See docs/configuration.md for defaults and caveats. - Browser (
~/.config/akita-phoenix/config.json): Controls cache TTL, timeouts (request/link/RNS resolve), enabled plugins, user agent, and GET redirect behavior. See docs/configuration.md for defaults and examples.
(Create these JSON files if you want to override defaults)
- Start:
python3 scripts/run_hexagon_server.py - Config file override:
python3 scripts/run_hexagon_server.py -c /path/to/config.json - Serve directory override:
python3 scripts/run_hexagon_server.py --serve-dir ./examples - Log level override:
python3 scripts/run_hexagon_server.py --log-level DEBUG - Required interface:
python3 scripts/run_hexagon_server.py -i <iface>(<iface>must already be an active Reticulum interface name)
- Discover:
python3 scripts/run_phoenix_browser.py - Connect (Name/Hash):
python3 scripts/run_phoenix_browser.py <target> - Specify Path: Add
-p /path/page.html - Alternate config file: Add
--config /path/to/config.json - Verbose logging: Add
--debugor--log-level DEBUG
The browser fetches the initial path immediately after startup and follows GET redirects when follow_redirects is enabled in browser config.
- Browser Commands:
[Num]: Follow link.b: Back.r: Refresh.h: Home (/).p <path> <data>: Send POST (e.g.,p /echo name=test&val=123).put <path> <data>: Send PUT.del <path>: Send DELETE.a [name]: Add bookmark.l: List bookmarks.g <num>: Go to bookmark.q: Quit.
- Browser: Place in
src/.../plugins/phoenix/. InheritPhoenixPluginBase. Setself.priorityfor execution order. See base class docstrings for hooks. Enable/disable via config. - Server: Place in
src/.../plugins/hexagon/. InheritHexagonPluginBase. Setself.priorityfor execution order. Useload()to register paths viaself.register_path_handler(...). Implementhandle_registered_path(...)(returnTrueif handled). Use lifecycle hooksserver_startup/server_shutdown. Enable/disable via config.
- Reticulum Setup: Essential.
- POST: Browser sends URL-encoded. Server relies on plugins registering paths.
- Config caveat:
max_concurrent_connectionsstill exists in server defaults for compatibility, but the current request loop does not enforce a connection cap. - Security: Basic. Use cautiously.
GPLv3 - see LICENSE file.