From 2843155501b2ef4ca99e1632502f607736d72b3e Mon Sep 17 00:00:00 2001 From: Kevin Wallace Date: Fri, 4 Nov 2022 00:34:04 -0700 Subject: [PATCH] Allow actor id to be specified in config This is useful if the actor won't be at the root of the domain. --- app/config.py | 3 +++ data/tests.toml | 1 + scripts/config_wizard.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/config.py b/app/config.py index dfd6ec9..cc20ed5 100644 --- a/app/config.py +++ b/app/config.py @@ -90,6 +90,7 @@ class Config(pydantic.BaseModel): name: str summary: str https: bool + id: str = None icon_url: str secret: str debug: bool = False @@ -146,6 +147,8 @@ CONFIG = load_config() DOMAIN = CONFIG.domain _SCHEME = "https" if CONFIG.https else "http" ID = f"{_SCHEME}://{DOMAIN}" +if CONFIG.id: + ID = CONFIG.id USERNAME = CONFIG.username MANUALLY_APPROVES_FOLLOWERS = CONFIG.manually_approves_followers HIDES_FOLLOWERS = CONFIG.hides_followers diff --git a/data/tests.toml b/data/tests.toml index cf7b5f9..909b4a3 100644 --- a/data/tests.toml +++ b/data/tests.toml @@ -5,6 +5,7 @@ admin_password = "$2b$12$OwCyZM33uXQUVrChgER.h.qgFJ4fBp6tdFwArR3Lm1LV8NgMvIxVa" name = "test" summary = "

Hello

" https = false +id = "http://localhost:8000" icon_url = "https://localhost:8000/static/nopic.png" secret = "1dd4079e0474d1a519052b8fe3cb5fa6" debug = true diff --git a/scripts/config_wizard.py b/scripts/config_wizard.py index 22119e6..f5a75a2 100644 --- a/scripts/config_wizard.py +++ b/scripts/config_wizard.py @@ -74,6 +74,8 @@ def main() -> None: dat["https"] = False proto = "http" + dat["id"] = f'{proto}://{dat["domain"]}' + print("Note that you can put your icon/avatar in the static/ directory") dat["icon_url"] = prompt( "icon URL: ", default=f'{proto}://{dat["domain"]}/static/nopic.png'