added PyInstaller builds, AGPLv3, transport config
- Add pyinstaller.spec and GitHub/Forgejo CI workflows for cross-platform builds - Add AGPLv3 license - Move data storage to ~/.tinyweb/ - Add --version and --port CLI flags - Add transport node selection in /style (smart regeneration preserves Reticulum config) - Add discover more nodes link to rmap.world
This commit is contained in:
parent
e6f77f0a55
commit
5b32d69863
9 changed files with 924 additions and 20 deletions
16
handlers.py
16
handlers.py
|
|
@ -684,6 +684,8 @@ def handle_style_form(msg=""):
|
|||
reranker_checked = " checked" if reranker == "1" else ""
|
||||
disabled = "" if semantic == "1" else " disabled"
|
||||
dimmed = ' style="opacity:0.4"' if semantic != "1" else ""
|
||||
transport_host = get_setting("transport_host", "reticulum.derickphan.com")
|
||||
transport_port = get_setting("transport_port", "4242")
|
||||
return _respond(
|
||||
f"<h1>customize</h1>"
|
||||
f"<h2>name your search engine</h2>"
|
||||
|
|
@ -693,6 +695,12 @@ def handle_style_form(msg=""):
|
|||
f"<h2>sharing</h2>"
|
||||
f'<label><input type="checkbox" name="sharing_enabled" value="1"{checked}>'
|
||||
f" share your site list publicly at /api/sites</label><br><br>"
|
||||
f"<h2>mesh network</h2>"
|
||||
f"<p>Connect to a Reticulum transport node to reach other peers.</p>"
|
||||
f"<small>Default: reticulum.derickphan.com:4242</small><br>"
|
||||
f'<input name="transport_host" value="{esc(transport_host)}" placeholder="hostname" size="30">'
|
||||
f' <input name="transport_port" value="{esc(transport_port)}" placeholder="port" size="6"><br>'
|
||||
f'<p><a href="https://rmap.world/" target="_blank">discover more nodes</a></p><br>'
|
||||
f"<h2>search</h2>"
|
||||
f"<h3>ai</h3>"
|
||||
f'<label><input type="checkbox" name="semantic_search" value="1"{semantic_checked} '
|
||||
|
|
@ -732,12 +740,18 @@ def handle_style_submit(body):
|
|||
sharing = "1" if body.get("sharing_enabled") else "0"
|
||||
semantic = "1" if body.get("semantic_search") else "0"
|
||||
reranker = "1" if body.get("use_reranker") else "0"
|
||||
transport_host = body.get("transport_host", [""])[0].strip()
|
||||
transport_port = body.get("transport_port", [""])[0].strip()
|
||||
set_setting("custom_template", template if template.strip() != DEFAULT_TEMPLATE.strip() else "")
|
||||
set_setting("site_name", name or "tinyweb")
|
||||
set_setting("sharing_enabled", sharing)
|
||||
set_setting("semantic_search", semantic)
|
||||
set_setting("use_reranker", reranker)
|
||||
return handle_style_form("Saved.")
|
||||
if transport_host:
|
||||
set_setting("transport_host", transport_host)
|
||||
if transport_port:
|
||||
set_setting("transport_port", transport_port)
|
||||
return handle_style_form("Saved. Restart TinyWeb for mesh network changes to take effect.")
|
||||
|
||||
|
||||
def handle_about():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue