From 601313cf65ced1fadb66ca28b1ccc94271c5ee99 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 21 Aug 2022 15:40:25 +0200 Subject: [PATCH] Yunohost config utils --- app/main.py | 4 ---- tasks.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 3203cc9..c228d4c 100644 --- a/app/main.py +++ b/app/main.py @@ -74,7 +74,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # TODO(ts): -# # Next: # - fix issue with followers from a blocked server (skip it?) # - allow to share old notes @@ -82,10 +81,7 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # - prevent double accept/double follow # - UI support for updating posts # - indieauth tweaks -# - API for posting notes -# - FT5 text search # - support update post with history? -# - cleanup tasks class CustomMiddleware: diff --git a/tasks.py b/tasks.py index 4fa2d99..4bad7dd 100644 --- a/tasks.py +++ b/tasks.py @@ -191,3 +191,24 @@ def prune_old_data(ctx): from app.prune import run_prune_old_data asyncio.run(run_prune_old_data()) + + +@task +def yunohost_config( + ctx, + domain, + username, + name, + summary, + password, +): + # type: (Context, str, str, str, str, str) -> None + from app.utils import yunohost + + yunohost.setup_config_file( + domain=domain, + username=username, + name=name, + summary=summary, + password=password, + )