feat(bot): Коммит — навигация по дереву репозитория загрузок
- UploadsRepo: локальный клон, fetch не чаще fetch_interval, ls-tree -z (пробелы/кириллица), cat-file, последний коммит по пути; git без shell, ssh с -F /dev/null (без конфига хоста) - «📝 Коммит»: папки/файлы с размерами, ⬆️ Вверх, страницы по 20, карточка файла с последним коммитом, «👁 Показать» (<pre> или документом); в кнопках только индексы - ключ для контейнера: GIT_SSH_KEY_B64 → временный файл 0600 (смонтированный файл хоста контейнерному uid не прочитать); volume /data для клона - тесты на настоящем bare-репозитории во временной папке Refs #8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,6 @@ def build_router(texts: Texts, access: AccessService) -> Router:
|
||||
router = Router(name="common")
|
||||
sections = section_by_button(texts)
|
||||
section_text = {
|
||||
Section.COMMIT: texts.section.commit,
|
||||
Section.STATUS: texts.section.status,
|
||||
Section.LOGS: texts.section.logs,
|
||||
Section.ALERTS: texts.section.alerts,
|
||||
@@ -49,7 +48,8 @@ def build_router(texts: Texts, access: AccessService) -> Router:
|
||||
async def help_(message: Message) -> None:
|
||||
await message.answer(texts.help.text)
|
||||
|
||||
@router.message(F.text.in_({k for k, v in sections.items() if v is not Section.MEMBERS}))
|
||||
# Sections with their own routers (members, commit) are matched there first
|
||||
@router.message(F.text.in_({k for k, v in sections.items() if v in section_text}))
|
||||
async def open_section(message: Message, state: FSMContext) -> None:
|
||||
await state.clear()
|
||||
await message.answer(section_text[sections[message.text or ""]], reply_markup=section_nav(texts))
|
||||
|
||||
Reference in New Issue
Block a user