Various build fixes, cleanup and details #6

Merged
leo merged 34 commits from trace into main 2023-11-21 15:32:49 +00:00
4 changed files with 4 additions and 3 deletions
Showing only changes of commit d2ad269df8 - Show all commits

View File

@ -1,3 +1,4 @@
import os
import sys
from pathlib import Path
@ -117,6 +118,7 @@ def _confdir(args):
raise ValueError("Config path is not a directory")
# Accidentally pointed to the db.toml, use parent
confdir = confdir.parent
os.environ["CISTA_HOME"] = confdir.as_posix()
config.conffile = confdir / config.conffile.name

View File

@ -36,7 +36,6 @@ app.exception(Exception)(handle_sanic_exception)
async def main_start(app, loop):
tracemalloc.start()
config.load_config()
print(config.config, config.config.public)
app.ctx.threadexec = ThreadPoolExecutor(
max_workers=3, thread_name_prefix="cista-ioworker"
)

View File

@ -1,5 +1,6 @@
from __future__ import annotations
import os
import secrets
import sys
from functools import wraps
@ -33,7 +34,7 @@ class Link(msgspec.Struct, omit_defaults=True):
config = None
conffile = Path.home() / ".local/share/cista/db.toml"
conffile = os.environ.get("CISTA_HOME") or Path.home() / ".local/share/cista/db.toml"
def derived_secret(*params, len=8) -> bytes:

View File

@ -5,7 +5,6 @@ import msgspec
def readconf() -> dict:
p = Path.home() / ".droppy/config" # Hardcoded in Droppy
print("Reading Droppy config", p)
cf = msgspec.json.decode((p / "config.json").read_bytes())
db = msgspec.json.decode((p / "db.json").read_bytes())
cf["path"] = p.parent / "files"