diff --git a/config_dist/config.yml b/config_dist/config.yml index 917fcfb2..f2b57ca9 100644 --- a/config_dist/config.yml +++ b/config_dist/config.yml @@ -11,7 +11,6 @@ bot: botapi-file-url: "http://nginx:80" webhook: web-url: https://example.org/context/path - local-url: 127.0.0.1:8080/ path: /bot secret: my-$ecr3t db: diff --git a/shvatka/__main__.py b/shvatka/__main__.py index a241646d..0710aa57 100644 --- a/shvatka/__main__.py +++ b/shvatka/__main__.py @@ -42,20 +42,18 @@ def main() -> FastAPI: secret_token=webhook_config.secret, ) webhook_handler.register(app, webhook_config.path) - logger.info(webhook_config.web_url) - logger.info(webhook_config.path) - - setup = partial(on_startup, builder, webhook_config) - app.router.add_event_handler("startup", setup) - logger.info("app prepared") root_app = FastAPI() root_app.mount(api_config.context_path, app) + setup = partial(on_startup, builder, webhook_config) + root_app.router.add_event_handler("startup", setup) + logger.info("app prepared") return root_app async def on_startup(dp_builder: DpBuilder, webhook_config: WebhookConfig): await dp_builder.start() + logger.info(webhook_config.web_url + webhook_config.path) await dp_builder.bot.set_webhook( url=webhook_config.web_url + webhook_config.path, secret_token=webhook_config.secret, diff --git a/shvatka/tgbot/config/models/bot.py b/shvatka/tgbot/config/models/bot.py index 14ed2f40..d513d1aa 100644 --- a/shvatka/tgbot/config/models/bot.py +++ b/shvatka/tgbot/config/models/bot.py @@ -59,6 +59,5 @@ class BotApiType(Enum): @dataclass class WebhookConfig: web_url: str - local_url: str path: str secret: str diff --git a/tests/config/config.yml b/tests/config/config.yml index 0015d1b2..95a9fd0b 100644 --- a/tests/config/config.yml +++ b/tests/config/config.yml @@ -9,7 +9,6 @@ bot: type: official webhook: web-url: https://example.org/context/path - local-url: 127.0.0.1:8080/ path: secret/path secret: my-$ecr3t redis: