Compare commits
	
		
			3 Commits
		
	
	
		
			259f585968
			...
			be1bc22538
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | be1bc22538 | ||
|   | b0d6b75ac1 | ||
|   | 4a53d0b8e2 | 
| @@ -98,6 +98,7 @@ def _main(): | ||||
|     return 0 | ||||
|  | ||||
|  | ||||
|  | ||||
| def _confdir(args): | ||||
|     if args["-c"]: | ||||
|         # Custom config directory | ||||
|   | ||||
| @@ -82,6 +82,7 @@ async def control(req, ws): | ||||
|         await asend(ws, StatusMsg(status="ack", req=cmd)) | ||||
|  | ||||
|  | ||||
|  | ||||
| @bp.websocket("watch") | ||||
| @websocket_wrapper | ||||
| async def watch(req, ws): | ||||
|   | ||||
| @@ -39,12 +39,14 @@ async def main_start(app, loop): | ||||
|     app.ctx.threadexec = ThreadPoolExecutor(max_workers=8) | ||||
|  | ||||
|  | ||||
|  | ||||
| @app.after_server_stop | ||||
| async def main_stop(app, loop): | ||||
|     await watching.stop(app, loop) | ||||
|     app.ctx.threadexec.shutdown() | ||||
|  | ||||
|  | ||||
|  | ||||
| @app.on_request | ||||
| async def use_session(req): | ||||
|     req.ctx.session = session.get(req) | ||||
|   | ||||
| @@ -74,6 +74,7 @@ def verify(request, *, privileged=False): | ||||
|     raise Unauthorized("Login required", "cookie") | ||||
|  | ||||
|  | ||||
|  | ||||
| bp = Blueprint("auth") | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -24,6 +24,7 @@ class User(msgspec.Struct, omit_defaults=True): | ||||
|     lastSeen: int = 0  # noqa: N815 | ||||
|  | ||||
|  | ||||
|  | ||||
| class Link(msgspec.Struct, omit_defaults=True): | ||||
|     location: str | ||||
|     creator: str = "" | ||||
|   | ||||
| @@ -25,6 +25,7 @@ class MkDir(ControlBase): | ||||
|         path.mkdir(parents=True, exist_ok=False) | ||||
|  | ||||
|  | ||||
|  | ||||
| class Rename(ControlBase): | ||||
|     path: str | ||||
|     to: str | ||||
| @@ -50,6 +51,7 @@ class Rm(ControlBase): | ||||
|                 p.unlink() | ||||
|  | ||||
|  | ||||
|  | ||||
| class Mv(ControlBase): | ||||
|     sel: list[str] | ||||
|     dst: str | ||||
|   | ||||
| @@ -36,6 +36,7 @@ def run(*, dev=False): | ||||
|         Sanic.serve_single() | ||||
|  | ||||
|  | ||||
|  | ||||
| def check_cert(certdir, domain): | ||||
|     if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists(): | ||||
|         return | ||||
|   | ||||
| @@ -221,6 +221,7 @@ async def broadcast(msg): | ||||
|         logging.exception("Broadcast error") | ||||
|  | ||||
|  | ||||
|  | ||||
| async def start(app, loop): | ||||
|     config.load_config() | ||||
|     app.ctx.watcher = threading.Thread( | ||||
|   | ||||
| @@ -27,6 +27,7 @@ dependencies = [ | ||||
|     "stream-zip", | ||||
|     "tomli_w", | ||||
| ] | ||||
| requires-python = ">=3.10" | ||||
|  | ||||
| [project.urls] | ||||
| Homepage = "" | ||||
|   | ||||
| @@ -2,7 +2,6 @@ import tempfile | ||||
| from pathlib import Path | ||||
|  | ||||
| import pytest | ||||
|  | ||||
| from cista import config | ||||
| from cista.protocol import Cp, MkDir, Mv, Rename, Rm | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user