====== Мониторинг изменений веб-страниц ====== ===== changedetection.io ===== git clone https://github.com/dgtlmoon/changedetection.io.git cd changedetection.io Примерный файл docker-compose.yml (Chrome [[https://github.com/dgtlmoon/changedetection.io/wiki/Fetching-pages-with-WebDriver|нужен для динамических страниц]]).\\ Playwright-chrome отличается от browser-chrome тем, что умеет выделять части страниц для отслеживания, поэтому лучше (наверное) использовать его. version: '3.7' services: changedetection: image: ghcr.io/dgtlmoon/changedetection.io container_name: changedetection hostname: changedetection restart: unless-stopped environment: PORT: 5000 PUID: 1000 PGID: 1000 PLAYWRIGHT_DRIVER_URL: "ws://changedetection-chrome:3000/?stealth=1&--disable-web-security=true" BASE_URL: "https://bva.dyndns.info/cdt" USE_X_SETTINGS: 1 volumes: - changedetection:/datastore labels: - "traefik.enable=true" - "traefik.http.routers.changedetection.rule=Host(`bva.dyndns.info`) && PathPrefix(`/cdt`)" - "traefik.http.routers.changedetection.middlewares=cdt-strip,cdt-path" - "traefik.http.middlewares.cdt-strip.stripprefix.prefixes=/cdt" - "traefik.http.middlewares.cdt-path.headers.customrequestheaders.X-Forwarded-Prefix=/cdt" - "traefik.http.routers.changedetection.tls.certresolver=le" changedetection-chrome: image: browserless/chrome container_name: changedetection-chrome hostname: changedetection-chrome restart: unless-stopped environment: SCREEN_WIDTH: 1920 SCREEN_HEIGHT: 1080 SCREEN_DEPTH: 16 ENABLE_DEBUGGER: "false" PREBOOT_CHROME: "true" CONNECTION_TIMEOUT: 300000 MAX_CONCURRENT_SESSIONS: 10 CHROME_REFRESH_TIME: 600000 DEFAULT_BLOCK_ADS: "true" DEFAULT_STEALTH: "true" volumes: changedetection: Стандартный docker-compose.yml: https://github.com/dgtlmoon/changedetection.io/blob/master/docker-compose.yml Запуск: docker-compose up -d ==== Уведомления ==== # Yandex mailtos://user:password@yandex.ru/?smtp=smtp.yandex.ru&port=465&mode=ssl&to=user@example.com # Внутренний открытый релей mailto://mail.example.com/?from=changedetection@example.com&to=user1@example.com,user2@example.com https://github.com/caronc/apprise/wiki/Notify_email Notification body нужно оформлять в зависимости от выбранного формата, например, для HTML использовать тэги ''

'' и т. д. ==== Расписание, API ==== [[https://github.com/dgtlmoon/changedetection.io/issues/1695|[feature] cron or exact time scheduler / or trigger check via webhook #1695]] # Выкключить/включить оповещение (на почту и т. п.) curl "http://monitoring:5000/api/v1/watch/7a0f144f-76b9-448b-94f1-9011027e661e?muted=muted" -H "x-api-key:813031b16330fe25e3780cf0325daa45" curl "http://monitoring:5000/api/v1/watch/7a0f144f-76b9-448b-94f1-9011027e661e?muted=unmuted" -H "x-api-key:813031b16330fe25e3780cf0325daa45" https://changedetection.io/docs/api_v1/index.html#api-Watch-Watch Выключить оповещения для всех (нужен установленный jq) url='http://monitoring:5000/api/v1/watch' apikey='813031b16330fe25e3780cf0325daa45' for i in `curl "${url}" -H "x-api-key:${apikey}" |jq keys |sed -E 's#(\"|\[|\]|,|\s)##g'` do curl "${url}/${i}?muted=muted" -H "x-api-key:${apikey}" done ==== Реверс-прокси ==== https://github.com/dgtlmoon/changedetection.io/wiki/Running-changedetection.io-behind-a-reverse-proxy ===== Другие варианты ===== Скрипт: https://bhfsteve.blogspot.com/2013/03/monitoring-web-page-for-changes-using.html\\ Мощный комбайн: https://github.com/huginn/huginn\\ https://github.com/SR-G/watchthatpage\\ https://github.com/thp/urlwatch\\ https://followthatpage.com/