Remove database
This commit is contained in:
@@ -9,7 +9,6 @@ dependencies = [
|
|||||||
"pynacl (>=1.6.0,<2.0.0)",
|
"pynacl (>=1.6.0,<2.0.0)",
|
||||||
"flask[async] (>=3.1.2,<4.0.0)",
|
"flask[async] (>=3.1.2,<4.0.0)",
|
||||||
"resolvematrix @ git+https://codeberg.org/timedout/resolvematrix.git",
|
"resolvematrix @ git+https://codeberg.org/timedout/resolvematrix.git",
|
||||||
"pycouchdb (>=1.16.0,<2.0.0)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
from types import SimpleNamespace
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import tomllib
|
import tomllib
|
||||||
import os
|
import os
|
||||||
@@ -14,11 +13,6 @@ server_name: str = ""
|
|||||||
signing_key: str = ""
|
signing_key: str = ""
|
||||||
support: dict = {"contacts": []}
|
support: dict = {"contacts": []}
|
||||||
|
|
||||||
db = SimpleNamespace(
|
|
||||||
name="vona",
|
|
||||||
url="",
|
|
||||||
)
|
|
||||||
|
|
||||||
_CONFIG_PATH = Path(os.getenv("VONA_CONFIG", "/etc/vona/config.toml"))
|
_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):
|
if "enable_registration" in cfg and isinstance(cfg["enable_registration"], bool):
|
||||||
users_can_register = cfg["enable_registration"]
|
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")
|
print("[INFO] Configuration file was valid")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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']}")
|
|
||||||
Reference in New Issue
Block a user