From 6df2de5bb22122e61823089fbab4c2f3eefc35d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 5 Nov 2025 06:14:18 +0100 Subject: [PATCH] feat: add Scrapy UI service with path-based routing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added scrapy-ui service to scrapy stack: - Image: ghcr.io/valknarness/scrapy-ui:latest - Path-based routing: https://scrapy.pivoine.art/ui - HTTP Basic Auth protection (same credentials as scrapyd) - StripPrefix middleware to remove /ui from requests - Auto-connects to scrapyd using SCRAPYD_URL, USERNAME, PASSWORD - Watchtower auto-updates enabled Traefik configuration: - Middleware chain: auth -> stripprefix -> compress - Routes /ui prefix to port 3000 - Shares authentication with main scrapyd interface 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- scrapy/compose.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/scrapy/compose.yaml b/scrapy/compose.yaml index 84e1409..be64944 100644 --- a/scrapy/compose.yaml +++ b/scrapy/compose.yaml @@ -54,6 +54,35 @@ services: networks: - compose_network + scrapy_ui: + image: ${SCRAPY_UI_IMAGE:-ghcr.io/valknarness/scrapy-ui:latest} + container_name: ${SCRAPY_COMPOSE_PROJECT_NAME}_ui + restart: unless-stopped + environment: + TZ: ${TIMEZONE:-Europe/Berlin} + NODE_ENV: production + SCRAPYD_URL: ${SCRAPY_UI_SCRAPYD_URL:-https://scrapy.pivoine.art} + SCRAPYD_USERNAME: ${SCRAPY_UI_SCRAPYD_USERNAME} + SCRAPYD_PASSWORD: ${SCRAPY_UI_SCRAPYD_PASSWORD} + networks: + - compose_network + labels: + - 'traefik.enable=${SCRAPY_TRAEFIK_ENABLED}' + - 'traefik.http.middlewares.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-redirect-web-secure.redirectscheme.scheme=https' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web.middlewares=${SCRAPY_COMPOSE_PROJECT_NAME}-ui-redirect-web-secure' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web.rule=Host(`${SCRAPY_TRAEFIK_HOST}`) && PathPrefix(`/ui`)' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web.entrypoints=web' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure.rule=Host(`${SCRAPY_TRAEFIK_HOST}`) && PathPrefix(`/ui`)' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure.tls.certresolver=resolver' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure.entrypoints=web-secure' + - 'traefik.http.middlewares.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-stripprefix.stripprefix.prefixes=/ui' + - 'traefik.http.middlewares.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-auth.basicauth.users=${SCRAPY_AUTH_USERS}' + - 'traefik.http.middlewares.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure-compress.compress=true' + - 'traefik.http.routers.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure.middlewares=${SCRAPY_COMPOSE_PROJECT_NAME}-ui-auth,${SCRAPY_COMPOSE_PROJECT_NAME}-ui-stripprefix,${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure-compress' + - 'traefik.http.services.${SCRAPY_COMPOSE_PROJECT_NAME}-ui-web-secure.loadbalancer.server.port=3000' + - 'traefik.docker.network=${NETWORK_NAME}' + - 'com.centurylinklabs.watchtower.enable=${WATCHTOWER_LABEL_ENABLE}' + volumes: scrapyd_data: name: ${SCRAPY_COMPOSE_PROJECT_NAME}_scrapyd_data