feat: enhance user-agent identification and implement backoff strategy for university source requests

- Added PSU_CONTACT environment variable to docker-compose for owner contact in User-Agent.
- Updated source.js to include user-agent construction with service version and contact information.
- Implemented exponential backoff strategy for failed requests to the university, with retry logic based on HTTP response status.
- Modified status.js to display backoff information in the status response.
- Adjusted watch.js to reduce request frequency during university downtime.
- Enhanced test coverage with new backoff.test.js to validate backoff behavior and user-agent format.
This commit is contained in:
2026-10-22 01:17:54 +03:00
parent 10c85e3bb9
commit c0487e4c2a
9 changed files with 82503 additions and 81477 deletions

View File

@@ -30,6 +30,9 @@ services:
DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD:-}
# Публичный адрес для ссылок в сообщениях, например https://psu.rumblur.by
PSU_PUBLIC_URL: ${PSU_PUBLIC_URL:-}
# Контакт владельца в User-Agent запросов к университету (почта или ссылка),
# чтобы администраторы Nextcloud знали, кому написать: mailto:you@example.com
PSU_CONTACT: ${PSU_CONTACT:-}
# Путь к LibreOffice для импорта старых .doc уже есть в образе.
volumes:
# Кэш каталога, таблицы недель и распознанных документов.