diff --git a/pyproject.toml b/pyproject.toml
index 43e578e..a6f301f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,18 +1,22 @@
[project]
name = "vona"
-version = "1.4.1"
description = "Flazing bast Matrix homeserver"
-authors = [
- {name = "Kierre",email = "vel@riseup.net"}
-]
license = {text = "Velicense"}
-requires-python = ">=3.13"
+requires-python = ">=3.12"
+
dependencies = [
- "httpx (>=0.28.1,<0.29.0)",
- "pynacl (>=1.6.0,<2.0.0)",
- "flask[async] (>=3.1.2,<4.0.0)",
+ "httpx (>=0.28.1,<0.29.0)",
+ "pynacl (>=1.6.0,<2.0.0)",
+ "flask[async] (>=3.1.2,<4.0.0)",
]
+authors = [
+ { name = "Kierre", email = "vel@riseup.net" }
+]
+
+# We put this in the code itself rather than here.
+version = "0.0.0"
+
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
diff --git a/vona/__main__.py b/vona/__main__.py
index 0f5adf8..1fdf8a4 100644
--- a/vona/__main__.py
+++ b/vona/__main__.py
@@ -62,7 +62,7 @@ async def root():
@app.route("/_matrix/static/")
async def matrix_static():
- return f'
Vona {globals.vona_version} is running
It works! Vona {globals.vona_version} is running
Your Vona server is listening on this port and is ready for messages.
To use this server you\"ll need a Matrix client.
Welcome to the Matrix universe :)
matrix.org
'
+ return f'Vona {globals.version} is running
It works! Vona {globals.version} is running
Your Vona server is listening on this port and is ready for messages.
To use this server you\"ll need a Matrix client.
Welcome to the Matrix universe :)
matrix.org
'
# Error handlers
diff --git a/vona/client/__init__.py b/vona/client/__init__.py
index 96348ea..e4d5697 100644
--- a/vona/client/__init__.py
+++ b/vona/client/__init__.py
@@ -64,7 +64,7 @@ async def whois(user):
"connections": [{
"ip": "127.0.0.1",
"last_seen": config.the_funny_number,
- "user_agent": f"Vona/{globals.vona_version}"
+ "user_agent": f"Vona/{globals.version}"
}]
}]
}
diff --git a/vona/config/__init__.py b/vona/config/__init__.py
index ad57980..b48888e 100644
--- a/vona/config/__init__.py
+++ b/vona/config/__init__.py
@@ -30,31 +30,31 @@ def _load_toml(path: Path) -> dict:
with path.open("rb") as f:
return tomllib.load(f)
except FileNotFoundError:
- _fatal(f"[FATL] Configuration file not found at {path}")
+ _fatal(f"Configuration file not found at {path}")
except PermissionError:
- _fatal(f"[FATL] Permission denied when accessing configuration {path}")
+ _fatal(f"Permission denied when accessing configuration {path}")
except tomllib.TOMLDecodeError as e:
- _fatal(f"[FATL] Invalid TOML configuration: {e}")
+ _fatal(f"Invalid TOML configuration: {e}")
def _read_signing_key_from_path(path_value) -> str | None:
p = Path(path_value)
if not p.exists():
- _fatal(f"[FATL] signing_key_path {p} does not exist")
+ _fatal(f"signing_key_path {p} does not exist")
try:
return p.read_text(encoding="utf-8").strip()
except Exception as e:
- _fatal(f"[FATL] Failed to read signing_key_path {p}: {e}")
+ _fatal(f"Failed to read signing_key_path {p}: {e}")
def _validate_cat_path(cat_path: str) -> Path:
p = Path(cat_path)
if not p.exists():
- _fatal(f"[FATL] Cat photo at {p} does not exist")
+ _fatal(f"Cat photo at {p} does not exist")
mtype, _ = mimetypes.guess_type(str(p))
if mtype is None or not mtype.startswith("image/"):
- _warn(f"[WARN] Cat file {p} does not look like an image (mimetype={mtype})")
+ _warn(f"Cat file {p} does not look like an image (mimetype={mtype})")
return p
@@ -69,9 +69,7 @@ def _apply_config(cfg: dict) -> None:
try:
port = int(cfg["port"])
except (TypeError, ValueError):
- _warn(
- f"[WARN] Invalid port in config: {cfg.get('port')}; using default {port}"
- )
+ _warn(f"Invalid port in config: {cfg.get('port')}; using default {port}")
if "allow_registration" in cfg:
allow_registration = bool(cfg["allow_registration"])
@@ -79,12 +77,10 @@ def _apply_config(cfg: dict) -> None:
if "server_name" in cfg:
server_name = str(cfg["server_name"])
else:
- _fatal("[FATL] `server_name` is not in configuration")
+ _fatal("`server_name` is not in configuration")
if "signing_key" in cfg and "signing_key_path" in cfg:
- _warn(
- "[WARN] Both `signing_key` and `signing_key_path` present. Using `signing_key`."
- )
+ _warn("Both `signing_key` and `signing_key_path` present. Using `signing_key`.")
if "signing_key" in cfg:
signing_key = str(cfg["signing_key"]).strip()
@@ -94,7 +90,7 @@ def _apply_config(cfg: dict) -> None:
signing_key = sk
else:
_fatal(
- "[FATL] `signing_key` is not in configuration. "
+ "`signing_key` is not in configuration. "
"A signing key can be generated using `cmd/generate_key.py`."
)
@@ -115,7 +111,7 @@ def _apply_config(cfg: dict) -> None:
if len(contact) > 1:
support_obj["contacts"].append(contact)
else:
- _warn("[WARN] No support contacts are defined")
+ _warn("No support contacts are defined")
support = support_obj
print("[INFO] Configuration file was valid")
diff --git a/vona/config/__main__.py b/vona/config/__main__.py
index c56b35b..a4156a2 100644
--- a/vona/config/__main__.py
+++ b/vona/config/__main__.py
@@ -1 +1 @@
-import vona.config
\ No newline at end of file
+import vona.config
diff --git a/vona/custom/__init__.py b/vona/custom/__init__.py
index 39eb2bc..799f57c 100644
--- a/vona/custom/__init__.py
+++ b/vona/custom/__init__.py
@@ -42,7 +42,7 @@ async def empty_response(**kwargs):
# Synapse
@custom.route("/_synapse/admin/v1/server_version")
async def synapse_version():
- return jsonify({"server_version": globals.vona_version})
+ return jsonify({"server_version": globals.version})
@custom.route("/_synapse/admin/v2/users")
async def synapse_user_list():
@@ -102,7 +102,7 @@ async def synapse_whois(user_id):
"connections": [{
"ip":f"127.0.0.1",
"last_seen":config.the_funny_number,
- "user_agent":f"Vona/{globals.vona_version}"
+ "user_agent":f"Vona/{globals.version}"
}]
}]
}
@@ -148,7 +148,7 @@ async def synapse_device_list(user_id):
"display_name": "Vona",
"last_seen_ip": "127.0.0.1",
"last_seen_ts": config.the_funny_number,
- "last_seen_user_agent": f"Vona/{globals.vona_version}"
+ "last_seen_user_agent": f"Vona/{globals.version}"
}],
"total": 1
})
@@ -163,7 +163,7 @@ async def synapse_device_info(user_id, device_id):
"display_name": "Vona",
"last_seen_ip": "127.0.0.1",
"last_seen_ts": config.the_funny_number,
- "last_seen_user_agent": f"Vona/{globals.vona_version}"
+ "last_seen_user_agent": f"Vona/{globals.version}"
})
return jsonify({})
@@ -460,5 +460,5 @@ async def conduwuit_user_count():
async def conduwuit_server_version():
return jsonify({
"name": "Vona",
- "version":globals.vona_version
+ "version":globals.version
})
diff --git a/vona/federation/__init__.py b/vona/federation/__init__.py
index d2d928e..c7b0887 100644
--- a/vona/federation/__init__.py
+++ b/vona/federation/__init__.py
@@ -228,7 +228,7 @@ def send_join(request, roomId) -> dict:
async def version():
return jsonify({
"server": {
- "version": globals.vona_version,
+ "version": globals.version,
"name": "Vona"
}
})
diff --git a/vona/globals/__init__.py b/vona/globals/__init__.py
index 9c2c5f5..0522d0a 100644
--- a/vona/globals/__init__.py
+++ b/vona/globals/__init__.py
@@ -1,4 +1,3 @@
-from importlib.metadata import version
import vona.config as config
import nacl.signing
import hashlib
@@ -8,7 +7,7 @@ import copy
import json
import re
-vona_version = version("vona")
+version = "1.4.1"
def canonical_json(value):