Remove database

This commit is contained in:
2025-10-27 10:16:28 -04:00
parent 35896ed1ee
commit b8f8a1a7b1
3 changed files with 0 additions and 34 deletions

View File

@@ -9,7 +9,6 @@ dependencies = [
"pynacl (>=1.6.0,<2.0.0)",
"flask[async] (>=3.1.2,<4.0.0)",
"resolvematrix @ git+https://codeberg.org/timedout/resolvematrix.git",
"pycouchdb (>=1.16.0,<2.0.0)",
]
authors = [

View File

@@ -1,4 +1,3 @@
from types import SimpleNamespace
from pathlib import Path
import tomllib
import os
@@ -14,11 +13,6 @@ server_name: str = ""
signing_key: str = ""
support: dict = {"contacts": []}
db = SimpleNamespace(
name="vona",
url="",
)
_CONFIG_PATH = Path(os.getenv("VONA_CONFIG", "/etc/vona/config.toml"))
@@ -122,20 +116,6 @@ def _apply_config(cfg: dict) -> None:
if "enable_registration" in cfg and isinstance(cfg["enable_registration"], bool):
users_can_register = cfg["enable_registration"]
if "db" in cfg and isinstance(cfg["db"], dict):
_db = cfg["db"]
if "url" in _db:
db.url = str(_db["url"])
else:
_fatal("No DB URL provided")
if "name" in _db:
db.name = str(_db["name"])
else:
_warn("No DB name provided, defaulting to `vona`")
else:
_fatal("NO DB provided")
print("[INFO] Configuration file was valid")

View File

@@ -1,13 +0,0 @@
import vona.config as config
import pycouchdb
import os
# NOTE: We don't do anything with the DB currently.
try:
server = pycouchdb.Server(config.db.url)
except Exception as e:
print(f"[FATL] Could not connect to DB: {e}")
os._exit(1)
print(f"[INFO] CouchDB version {server.info()['version']}")