diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index e5f8750..863acc7 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -16,3 +16,7 @@ {"id":"int-b5112040","kind":"field_change","created_at":"2026-07-30T23:00:45.976151Z","actor":"E.Gavrilov","issue_id":"videoreg-kbh.9","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"MVideo discovery and product parsing are wired into the worker with smoke coverage; live source CAPTCHA is paused without bypass."}} {"id":"int-3528fa0c","kind":"field_change","created_at":"2026-07-30T23:00:46.850374Z","actor":"E.Gavrilov","issue_id":"videoreg-kbh.16","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Canonical model cleanup has fixtures for the SPAWNSON and iBOX cases, and canonical name/model edits are preserved in admin moderation."}} {"id":"int-3bda336d","kind":"field_change","created_at":"2026-07-30T23:00:47.750226Z","actor":"E.Gavrilov","issue_id":"videoreg-1v0","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Local Yandex crawl produced five real approved cards, export/import and desktop/mobile catalog rendering were verified, and quality/deploy checks pass."}} +{"id":"int-abc62651","kind":"field_change","created_at":"2026-10-26T11:17:20.344333Z","actor":"E.Gavrilov","issue_id":"videoreg-7wi.2","extra":{"field":"status","new_value":"in_progress","old_value":"open"}} +{"id":"int-a61b093d","kind":"field_change","created_at":"2026-10-26T11:17:25.540512Z","actor":"E.Gavrilov","issue_id":"videoreg-7wi.3","extra":{"field":"status","new_value":"in_progress","old_value":"open"}} +{"id":"int-046cf2af","kind":"field_change","created_at":"2026-10-26T11:18:15.172502Z","actor":"E.Gavrilov","issue_id":"videoreg-7wi.4","extra":{"field":"status","new_value":"in_progress","old_value":"open"}} +{"id":"int-ed73c368","kind":"field_change","created_at":"2026-10-26T11:18:33.579134Z","actor":"E.Gavrilov","issue_id":"videoreg-7wi.5","extra":{"field":"status","new_value":"in_progress","old_value":"open"}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 71b7ed8..0fb3063 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1,3 +1,8 @@ +{"_type":"issue","id":"videoreg-7wi.5","title":"Programmer veto: executable isolated deployment and correct standalone runtime","description":"Confirmed build output is web-front/.next/standalone/web-front/server.js, but existing deploy/docker/Dockerfile.web copies standalone to /app and executes /app/server.js; static/public are also copied to root rather than /app/web-front. Production runtime is therefore not accepted. Existing legacy deploy script also exposes optional global image/builder prune, forbidden during concurrent domain restoration. No live deployment proof exists yet.","design":"Options: fix standalone Docker paths and restrict deployment to isolated videoreg stack; alternatively static export with lightweight runtime after preserving required health and redirect semantics. Chosen compromise: owner may choose either implementation, but deploy path must contain no global cleanup and must retain route security and health.","acceptance_criteria":"Reproducible build and actual container starts; /, /catalog, guide, calculator, static asset and health return correct responses; /api/videos GET/POST and /_dev/showcase return 404; /auto.shtml redirects to guide; only videoreg stack mutated, no global prune; origin Host/SNI and health evidence recorded. Public DNS/TLS failure remains explicit blocker, never reported as success.","status":"in_progress","priority":1,"issue_type":"bug","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:18:25Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:18:34Z","started_at":"2026-10-26T11:18:34Z","labels":["blocking","role-programmer-expert"],"dependencies":[{"issue_id":"videoreg-7wi.5","depends_on_id":"videoreg-7wi","type":"parent-child","created_at":"2026-10-26T14:18:24Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"videoreg-7wi.4","title":"Illustrator veto: validate original road/camera illustration in browser","description":"CSS road-art/camera/lens is authored in repository with no imported visual asset, but no actual desktop/mobile render has been supplied. Illustration acceptance is blocked until rendered inspection: pseudo-elements, transform and overflow crop may miscompose camera and caption at small widths. This is a missing acceptance artifact, not an asserted rendering defect.","design":"Options: replace with licensed raster asset; remove art; retain original CSS illustration with documented provenance and responsive evidence. Chosen compromise: retain CSS artwork because it communicates dashcam theme with zero external image requests; document it as original decorative illustration, inspect at 360px and desktop, fix clipping if observed.","acceptance_criteria":"Provide browser screenshots of homepage at 360px and desktop; illustrator visually confirms camera/lens/caption composition remains intentional and no content is obscured; report CSS illustration provenance and verify no external image requests for hero. Decorative artwork remains aria-hidden.","status":"in_progress","priority":1,"issue_type":"task","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:18:07Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:18:15Z","started_at":"2026-10-26T11:18:15Z","labels":["blocking","role-illustrator"],"dependencies":[{"issue_id":"videoreg-7wi.4","depends_on_id":"videoreg-7wi","type":"parent-child","created_at":"2026-10-26T14:18:06Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"videoreg-7wi.3","title":"Content veto: record verifiable provenance and source installation guidance","description":"Role content_manager. Acceptance of content is blocked: about states archive outcomes but no committed request-level provenance exists, and installation guide contains electrical/airbag guidance with no primary source. Catalog is a local project snapshot, not demonstrated archive recovery. Options: remove installation guidance; delay publication pending old archive; retain honest new editorial guide and attach verified manufacturer installation instructions plus exact archive attempt log. Chosen compromise: preserve useful new guide, source safety points, record failed attempts honestly without guessed timestamps or copied content.","design":"Compromise retains existing project catalog as dated unverified seller snapshot, four new editorial guides clearly separated from recovered content; archive retry can be follow-up only after truthful provenance acceptance.","acceptance_criteria":"Committed provenance manifest records original/request URL, UTC attempt date, result/status, any archive timestamp as null when none retrieved, snapshot origin/hash and restored count zero. Installation page links verified primary manufacturer instructions covering cable/airbag safety or removes unsupported specifics. Public about/catalog wording matches manifest. Same content_manager agent re-reviews actual files and resolves veto only after checks.","notes":"First review complete. Blocking acceptance until parent implements provenance manifest and primary source support for installation guide; no product code changed by reviewer.","status":"in_progress","priority":1,"issue_type":"task","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:17:13Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:17:25Z","started_at":"2026-10-26T11:17:25Z","labels":["blocking","role:content_manager"],"dependencies":[{"issue_id":"videoreg-7wi.3","depends_on_id":"videoreg-7wi","type":"parent-child","created_at":"2026-10-26T14:17:13Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"videoreg-7wi.2","title":"[creative_director] Block acceptance until the four-step editorial journey has relevant next actions","description":"The homepage promises four steps from choosing a camera to preserving a file, but every guide ends with the same recording-time calculator CTA. In installation and save-video this interrupts the intended motorist journey and obscures the most useful next action. This blocks creative acceptance, not independent implementation.","design":"Options: keep generic calculator everywhere; add broad unrelated related-links; use one explicit next step for choose -\u003e memory-card -\u003e installation -\u003e save-video with a final review/checklist/home action. Selected compromise: keep calculator as a secondary resource where relevant and provide a short contextual next-step block matching the promised four-step sequence.","acceptance_criteria":"Inspect all four rendered guides: each has a contextually relevant continuation; first three point to next guide; final points to a useful review/home action. No invented ratings, product endorsements or archival restoration claims. Homepage and guide navigation tell the same four-step story.","notes":"Role: creative_director. Agent: /root/creative_director. Initial verdict: BLOCKED pending contextual continuation and rendered review.","status":"in_progress","priority":1,"issue_type":"task","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:17:10Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:17:20Z","started_at":"2026-10-26T11:17:20Z","labels":["blocking","creative-director"],"dependencies":[{"issue_id":"videoreg-7wi.2","depends_on_id":"videoreg-7wi","type":"parent-child","created_at":"2026-10-26T14:17:09Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"videoreg-7wi.1","title":"Designer veto: mobile navigation and keyboard acceptance remain unverified","description":"Designer review: layout imports restoration.css but that file does not yet exist. New site-nav, article-columns and calculator have no complete responsive rules or browser evidence. Navigation contains four links and the calculator uses long labels; adoption is blocked until a 360px viewport and keyboard flow are demonstrated. Options: collapse navigation into a JS menu or wrap visible links; choose visible wrapping links to avoid hidden navigation complexity. Provide visible focus states, skip-to-main navigation, comfortable targets and no horizontal overflow.","design":"Compromise: preserve direct navigation; wrap it on narrow screens. One-column articles/calculator on mobile. Use a visible-on-focus skip link. Do not require an elaborate menu or animation.","acceptance_criteria":"At 360px and desktop all primary links remain reachable, document scrollWidth \u003c= innerWidth, guide body readable, calculator labels and inputs fit. Keyboard focus is visible and skip link reaches main content. Browser evidence includes homepage, guide and calculator.","status":"open","priority":1,"issue_type":"task","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:17:00Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:17:00Z","labels":["blocking","role-designer"],"dependencies":[{"issue_id":"videoreg-7wi.1","depends_on_id":"videoreg-7wi","type":"parent-child","created_at":"2026-10-26T14:16:59Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-1v0","title":"Demo readiness: local crawl, catalog handoff, UI verification","description":"Prepare a reproducible demo flow: co-located ingestion and web share a validated catalog export, local PostgreSQL receives real source cards, approved catalog is visible in the frontend, and the runbook plus verification artifacts are present.","acceptance_criteria":"A local documented command sequence starts the stack, crawls at least five valid cards from enabled sources within configured budgets, approves and exports catalog data, renders it in the web UI, and passes test/typecheck/build/browser checks.","status":"closed","priority":1,"issue_type":"task","assignee":"E.Gavrilov","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-07-30T21:51:59Z","created_by":"E.Gavrilov","updated_at":"2026-07-30T23:00:48Z","started_at":"2026-07-30T21:52:14Z","closed_at":"2026-07-30T23:00:48Z","close_reason":"Local Yandex crawl produced five real approved cards, export/import and desktop/mobile catalog rendering were verified, and quality/deploy checks pass.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-nnv.4","title":"Single co-located deploy stack with shared exports volume","description":"Merge deploy so web + ingestion (postgres, worker, admin) run in one Swarm/Portainer env. Add a shared volume carrying ingestion-data/exports that the web build/runtime can read. Remove export-server from ingestion/docker-compose.yml. Deprecate deploy/portainer/ingestion-stack.standalone.yml (separate-host). Keep ingestion Postgres/admin bound internally; only Traefik fronts web (+ optionally /admin).","status":"closed","priority":1,"issue_type":"task","assignee":"E.Gavrilov","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:53:49Z","created_by":"E.Gavrilov","updated_at":"2026-07-30T23:00:43Z","started_at":"2026-07-30T23:00:28Z","closed_at":"2026-07-30T23:00:43Z","close_reason":"The combined web, PostgreSQL, worker, and admin Swarm stack shares catalog_exports and routes /admin through Traefik.","dependencies":[{"issue_id":"videoreg-nnv.4","depends_on_id":"videoreg-nnv","type":"parent-child","created_at":"2026-06-07T17:53:49Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-nnv.4","depends_on_id":"videoreg-nnv.3","type":"blocks","created_at":"2026-06-07T17:54:02Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-kbh.15","title":"Rewrite app catalog import to read shared-volume catalog.json (drop HTTP/token)","description":"web-front/src/entities/dashcam-catalog/api/importCatalogExport.ts currently fetches manifest+artifact over HTTP with a Bearer token. Switch to reading manifest.json + catalog.json from the shared exports volume (a mounted path). Keep SHA-256 verification + exportId/createdAt/itemCount checks + Zod validation. Remove DASHCAM_CATALOG_MANIFEST_URL/EXPORT_TOKEN; add a path env. Under static-export this runs at build time.","status":"closed","priority":1,"issue_type":"task","assignee":"E.Gavrilov","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:53:48Z","created_by":"E.Gavrilov","updated_at":"2026-07-30T23:00:45Z","started_at":"2026-07-30T23:00:28Z","closed_at":"2026-07-30T23:00:45Z","close_reason":"The app validates manifest/artifact files from the shared export directory with SHA-256 and Zod, then updates its read model atomically.","dependencies":[{"issue_id":"videoreg-kbh.15","depends_on_id":"videoreg-kbh","type":"parent-child","created_at":"2026-06-07T17:53:48Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-kbh.15","depends_on_id":"videoreg-kbh.14","type":"blocks","created_at":"2026-06-07T17:54:03Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-kbh.15","depends_on_id":"videoreg-nnv.3","type":"blocks","created_at":"2026-06-07T17:54:02Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0} @@ -7,6 +12,7 @@ {"_type":"issue","id":"videoreg-kbh.11","title":"Deep deduplication matching (fuzzy/alias/perceptual)","description":"Implement spec §14 matching: brand + normalized model + aliases + sourceProductId + image perceptual hash + specs similarity + URL history; classify same_product/possible_duplicate/variant/oem_clone so non-trivial groups require manual moderation before export. Currently only new_product is recorded.","status":"open","priority":1,"issue_type":"feature","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:23:36Z","created_by":"E.Gavrilov","updated_at":"2026-06-07T14:23:36Z","dependencies":[{"issue_id":"videoreg-kbh.11","depends_on_id":"videoreg-kbh","type":"parent-child","created_at":"2026-06-07T17:23:36Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-kbh.11","depends_on_id":"videoreg-kbh.16","type":"blocks","created_at":"2026-06-07T18:02:57Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-kbh.11","depends_on_id":"videoreg-kbh.7","type":"blocks","created_at":"2026-06-07T17:24:37Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-kbh.7","title":"Phase 7: Deduplication + moderation","description":"Canonical product grouping, moderation queue, bulk approve, conflict tracking. PARTIAL: moderation_queue + moderation_conflicts tables, products default moderation_status='needs_review', admin moderation UI/API exist. Deep dedup matching (fuzzy/alias/perceptual image hash, possible_duplicate/variant/oem_clone classification) is NOT implemented — only new_product entries are created.","notes":"Moderation queue/conflicts tables + admin UI done; deep dedup matching (kbh.11) outstanding.","status":"in_progress","priority":1,"issue_type":"feature","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:23:14Z","created_by":"E.Gavrilov","updated_at":"2026-06-07T14:24:37Z","started_at":"2026-06-07T14:24:37Z","dependencies":[{"issue_id":"videoreg-kbh.7","depends_on_id":"videoreg-kbh","type":"parent-child","created_at":"2026-06-07T17:23:14Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"videoreg-kbh","title":"Dashcam Catalog Ingestion Engine","description":"Maintainable catalog ingestion engine for car dashcams (источник: Yandex Market). HTTP-only crawler, PostgreSQL source of truth, normalization, dedup, moderation, and a token-protected versioned export consumed by the Next.js app. Full spec: tasks/002-crawler.md.","status":"open","priority":1,"issue_type":"epic","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:22:41Z","created_by":"E.Gavrilov","updated_at":"2026-06-07T14:22:41Z","dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"videoreg-7wi","title":"Restore videoreg.ru archive context and verify production deployment","description":"Investigate archived coverage, preserve existing catalog, add useful verified guides, deploy isolated site on zz and verify local and public health.","status":"in_progress","priority":2,"issue_type":"task","assignee":"E.Gavrilov","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-10-26T11:11:46Z","created_by":"E.Gavrilov","updated_at":"2026-10-26T11:13:36Z","started_at":"2026-10-26T11:13:36Z","dependencies":[{"issue_id":"videoreg-7wi","depends_on_id":"videoreg-7wi.2","type":"blocks","created_at":"2026-10-26T14:17:18Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-7wi","depends_on_id":"videoreg-7wi.3","type":"blocks","created_at":"2026-10-26T14:17:24Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-7wi","depends_on_id":"videoreg-7wi.4","type":"blocks","created_at":"2026-10-26T14:18:14Z","created_by":"E.Gavrilov","metadata":"{}"},{"issue_id":"videoreg-7wi","depends_on_id":"videoreg-7wi.5","type":"blocks","created_at":"2026-10-26T14:18:34Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":4,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-kbh.16","title":"Model/canonicalName cleaning leaks form-factor \u0026 descriptor words","description":"Verified on a live smoke run (2026 Yandex Market data). normalizer.cleanModelFromTitle/buildCanonicalModel leave non-model words in the canonical name, which will corrupt dedup/canonical grouping (kbh.7/kbh.11). Examples: title 'Видеорегистратор-зеркало iBOX Rover 2 автомобильный с базой камер' -\u003e canonicalName 'iBOX зеркало Rover 2 автомобильный' (should be ~'iBOX Rover 2'); 'iBOX F5 + WiFi с радар-детектором' -\u003e model retains 'с радар-детектором'. genericWords list lacks 'зеркало', standalone 'автомобильный', form-factor and feature tails. Fix: expand stopword/form-factor stripping and feature-tail removal; add fixtures from real titles.","status":"closed","priority":2,"issue_type":"bug","assignee":"E.Gavrilov","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T15:02:57Z","created_by":"E.Gavrilov","updated_at":"2026-07-30T23:00:47Z","started_at":"2026-07-30T21:52:03Z","closed_at":"2026-07-30T23:00:47Z","close_reason":"Canonical model cleanup has fixtures for the SPAWNSON and iBOX cases, and canonical name/model edits are preserved in admin moderation.","dependencies":[{"issue_id":"videoreg-kbh.16","depends_on_id":"videoreg-kbh","type":"parent-child","created_at":"2026-06-07T18:02:56Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"videoreg-nnv.1","title":"CI/CD pipelines + Swarm + Portainer + deploy scripts","description":"DONE: .gitea/workflows/{pr,master,ingestion}.yml, deploy/docker/Dockerfile.web, deploy/swarm/docker-stack.yml, deploy/portainer/{standalone,swarm} templates, deploy/scripts + deploy/remote ssh deploy/rollback + predeploy/smoke/release-manifest scripts.","status":"closed","priority":2,"issue_type":"feature","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:24:11Z","created_by":"E.Gavrilov","updated_at":"2026-06-07T14:24:35Z","closed_at":"2026-06-07T14:24:35Z","close_reason":"Implemented and verified in codebase (typecheck + 18 vitest tests pass)","dependencies":[{"issue_id":"videoreg-nnv.1","depends_on_id":"videoreg-nnv","type":"parent-child","created_at":"2026-06-07T17:24:11Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"videoreg-seu.1","title":"Video registry app: primitive JSON DB, caching, health probes","description":"Working Next.js app: dashboard + register-video flow, primitive file-backed JSON DB (shared/db/primitiveJsonDb.ts → data/videoreg.json), process+tag+HTTP read caching with revalidateTag on writes, /health/live + /health/ready, /api/videos. Tested (vitest).","status":"closed","priority":2,"issue_type":"feature","owner":"gavrilovdev@yandex-team.ru","created_at":"2026-06-07T14:24:10Z","created_by":"E.Gavrilov","updated_at":"2026-06-07T14:24:35Z","closed_at":"2026-06-07T14:24:35Z","close_reason":"Implemented and verified in codebase (typecheck + 18 vitest tests pass)","dependencies":[{"issue_id":"videoreg-seu.1","depends_on_id":"videoreg-seu","type":"parent-child","created_at":"2026-06-07T17:24:09Z","created_by":"E.Gavrilov","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0} diff --git a/.gitea/workflows/master.yml b/.gitea/workflows/master.yml index 37795c5..38d62b4 100644 --- a/.gitea/workflows/master.yml +++ b/.gitea/workflows/master.yml @@ -1,4 +1,4 @@ -name: Master Production Deploy +name: Production container deploy on: push: @@ -7,174 +7,121 @@ on: workflow_dispatch: concurrency: - group: deploy-production - cancel-in-progress: false + group: production-${{ github.repository }} + cancel-in-progress: true env: + NODE_VERSION: "22" + DOMAIN: videoreg.ru + STACK_NAME: videoreg + CONTAINER_REGISTRY: ${{ vars.CONTAINER_REGISTRY }} REGISTRY: ${{ vars.REGISTRY }} - WEB_IMAGE_REPO: ${{ vars.IMAGE_REPO }}-web - INGESTION_IMAGE_REPO: ${{ vars.IMAGE_REPO }}-ingestion - RELEASE_ID: ${{ github.sha }}-${{ github.run_number }} - NPM_CONFIG_AUDIT: "false" - NPM_CONFIG_FUND: "false" - NPM_CONFIG_UPDATE_NOTIFIER: "false" + PRODUCTION_TRAEFIK_NETWORK: ${{ vars.PRODUCTION_TRAEFIK_NETWORK }} + TRAEFIK_NETWORK: ${{ vars.TRAEFIK_NETWORK }} + TRAEFIK_ENTRYPOINTS: ${{ vars.TRAEFIK_ENTRYPOINTS }} + TRAEFIK_ENTRYPOINT: ${{ vars.TRAEFIK_ENTRYPOINT }} + TRAEFIK_TLS: ${{ vars.TRAEFIK_TLS }} + TRAEFIK_CERTRESOLVER: le + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + SWARM_MANAGER_HOST: ${{ secrets.SWARM_MANAGER_HOST }} + SWARM_SSH_USER: ${{ secrets.SWARM_SSH_USER }} + SWARM_SSH_PORT: ${{ secrets.SWARM_SSH_PORT }} jobs: production: runs-on: ubuntu-latest - permissions: - contents: read - packages: write steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Node + - name: Setup Node for build uses: actions/setup-node@v4 with: - node-version: 22 + node-version: ${{ env.NODE_VERSION }} - - name: Setup npm - run: npm install -g npm@11.6.4 + - name: Prepare deployment metadata + shell: bash + run: | + set -euo pipefail + + REGISTRY="${CONTAINER_REGISTRY:-${REGISTRY:-git.pryanik.synology.me}}" + : "${REGISTRY:?Set Gitea variable CONTAINER_REGISTRY or REGISTRY}" + : "${SWARM_MANAGER_HOST:?Set Gitea secret SWARM_MANAGER_HOST}" + : "${SWARM_SSH_USER:?Set Gitea secret SWARM_SSH_USER}" + + short_sha="${GITHUB_SHA:-${GITEA_SHA:-manual}}" + short_sha="${short_sha:0:12}" + image_repo="${REGISTRY}/${GITHUB_REPOSITORY}" + + { + echo "REGISTRY=${REGISTRY}" + echo "IMAGE_REPO=${image_repo}" + echo "IMAGE=${image_repo}:${short_sha}" + echo "SWARM_SSH_PORT=${SWARM_SSH_PORT:-22}" + network="${PRODUCTION_TRAEFIK_NETWORK:-${TRAEFIK_NETWORK:-traefik-public}}" + entrypoints="${TRAEFIK_ENTRYPOINTS:-${TRAEFIK_ENTRYPOINT:-websecure}}" + tls="${TRAEFIK_TLS:-true}" + echo "TRAEFIK_NETWORK=${network}" + echo "TRAEFIK_ENTRYPOINTS=${entrypoints}" + echo "TRAEFIK_TLS=${tls}" + echo "TRAEFIK_CERTRESOLVER=${TRAEFIK_CERTRESOLVER:-le}" + } >> "${GITHUB_ENV}" - name: Install dependencies - run: npm ci --prefer-offline --no-audit --no-fund + run: npm ci --no-audit --no-fund - - name: Quality gate + - name: Build static site + env: + NEXT_TELEMETRY_DISABLED: "1" run: npm run ci:quality - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Verify static output + shell: bash + run: | + set -euo pipefail + test -f web-front/out/index.html + test ! -e web-front/out/server.js + test ! -e web-front/out/.next + printf 'Static files: ' + find web-front/out -type f | wc -l - - name: Login to Gitea Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Login to container registry + shell: bash + run: | + set -euo pipefail + : "${REGISTRY_USERNAME:?Set Gitea secret REGISTRY_USERNAME}" + : "${REGISTRY_PASSWORD:?Set Gitea secret REGISTRY_PASSWORD}" + printf '%s' "${REGISTRY_PASSWORD}" | docker login "${REGISTRY}" \ + --username "${REGISTRY_USERNAME}" \ + --password-stdin - - name: Build and push web image - id: build-web - uses: docker/build-push-action@v6 - with: - context: . - file: deploy/docker/Dockerfile.web - push: true - tags: ${{ env.WEB_IMAGE_REPO }}:${{ github.sha }} - labels: | - org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.version=${{ env.RELEASE_ID }} + - name: Build static image + shell: bash + run: docker build --pull --tag "${IMAGE}" . - - name: Build and push ingestion image - id: build-ingestion - uses: docker/build-push-action@v6 - with: - context: . - file: ingestion/Dockerfile - push: true - tags: ${{ env.INGESTION_IMAGE_REPO }}:${{ github.sha }} - labels: | - org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.version=${{ env.RELEASE_ID }} + - name: Push static image + shell: bash + run: | + set -euo pipefail + docker push "${IMAGE}" + docker tag "${IMAGE}" "${IMAGE_REPO}:latest" + docker push "${IMAGE_REPO}:latest" - - name: Production pre-deploy checks - env: - ENVIRONMENT: production - STACK_NAME: ${{ vars.STACK_NAME }} - RELEASE_ID: ${{ env.RELEASE_ID }} - COMMIT_SHA: ${{ github.sha }} - WEB_IMAGE: ${{ env.WEB_IMAGE_REPO }}@${{ steps.build-web.outputs.digest }} - INGESTION_IMAGE: ${{ env.INGESTION_IMAGE_REPO }}@${{ steps.build-ingestion.outputs.digest }} - POSTGRES_PASSWORD: ${{ secrets.INGESTION_POSTGRES_PASSWORD }} - INGESTION_ADMIN_PASSWORD: ${{ secrets.INGESTION_ADMIN_PASSWORD }} - PUBLIC_HOST: ${{ vars.DOMAIN }} - TRAEFIK_NETWORK: ${{ vars.TRAEFIK_NETWORK }} - SWARM_MANAGER_HOST: ${{ secrets.SWARM_MANAGER_HOST }} - SWARM_SSH_USER: ${{ secrets.SWARM_SSH_USER }} - run: node deploy/scripts/predeploy-check.mjs + - name: Configure remote Docker + shell: bash + run: | + set -euo pipefail + docker_host="ssh://${SWARM_SSH_USER}@${SWARM_MANAGER_HOST}:${SWARM_SSH_PORT}" + docker --host "${docker_host}" info >/dev/null + echo "DOCKER_HOST=${docker_host}" >> "${GITHUB_ENV}" - - name: Deploy production - env: - ENVIRONMENT: production - STACK_NAME: ${{ vars.STACK_NAME }} - RELEASE_ID: ${{ env.RELEASE_ID }} - COMMIT_SHA: ${{ github.sha }} - WEB_IMAGE: ${{ env.WEB_IMAGE_REPO }}@${{ steps.build-web.outputs.digest }} - INGESTION_IMAGE: ${{ env.INGESTION_IMAGE_REPO }}@${{ steps.build-ingestion.outputs.digest }} - PUBLIC_HOST: ${{ vars.DOMAIN }} - TRAEFIK_NETWORK: ${{ vars.TRAEFIK_NETWORK }} - SWARM_MANAGER_HOST: ${{ secrets.SWARM_MANAGER_HOST }} - SWARM_SSH_USER: ${{ secrets.SWARM_SSH_USER }} - SWARM_SSH_PORT: ${{ secrets.SWARM_SSH_PORT }} - REGISTRY: ${{ env.REGISTRY }} - REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} - WEB_REPLICAS: ${{ vars.WEB_REPLICAS }} - WEB_PLACEMENT_CONSTRAINT: ${{ vars.WEB_PLACEMENT_CONSTRAINT }} - TRAEFIK_ENTRYPOINTS: ${{ vars.TRAEFIK_ENTRYPOINT }} - TRAEFIK_TLS: ${{ vars.TRAEFIK_TLS }} - TRAEFIK_CERTRESOLVER: ${{ vars.TRAEFIK_CERTRESOLVER }} - REGION: ${{ vars.REGION }} - TEAM_ID: ${{ vars.TEAM_ID }} - DEPLOY_MIN_FREE_MB: ${{ vars.DEPLOY_MIN_FREE_MB }} - DEPLOY_PRUNE_BEFORE_PULL: ${{ vars.DEPLOY_PRUNE_BEFORE_PULL }} - DEPLOY_PRUNE_UNTIL: ${{ vars.DEPLOY_PRUNE_UNTIL }} - DEPLOY_CLEANUP_FAILED_IMAGES: ${{ vars.DEPLOY_CLEANUP_FAILED_IMAGES }} - VIDEOREG_DB_MEMORY_TTL_MS: ${{ vars.VIDEOREG_DB_MEMORY_TTL_MS }} - VIDEOREG_NEXT_CACHE_REVALIDATE_SECONDS: ${{ vars.VIDEOREG_NEXT_CACHE_REVALIDATE_SECONDS }} - POSTGRES_DB: ${{ vars.INGESTION_POSTGRES_DB }} - POSTGRES_USER: ${{ vars.INGESTION_POSTGRES_USER }} - POSTGRES_PASSWORD: ${{ secrets.INGESTION_POSTGRES_PASSWORD }} - INGESTION_ADMIN_USERNAME: ${{ vars.INGESTION_ADMIN_USERNAME }} - INGESTION_ADMIN_PASSWORD: ${{ secrets.INGESTION_ADMIN_PASSWORD }} - YANDEX_MARKET_DASHCAM_CATEGORY_URL: ${{ vars.YANDEX_MARKET_DASHCAM_CATEGORY_URL }} - MVIDEO_DASHCAM_CATEGORY_URL: ${{ vars.MVIDEO_DASHCAM_CATEGORY_URL }} - INGESTION_CATEGORY_DAILY_BUDGET: ${{ vars.INGESTION_CATEGORY_DAILY_BUDGET }} - INGESTION_PRODUCT_DAILY_BUDGET: ${{ vars.INGESTION_PRODUCT_DAILY_BUDGET }} - INGESTION_SITEMAP_DAILY_BUDGET: ${{ vars.INGESTION_SITEMAP_DAILY_BUDGET }} - INGESTION_FETCH_DELAY_MIN_MS: ${{ vars.INGESTION_FETCH_DELAY_MIN_MS }} - INGESTION_FETCH_DELAY_MAX_MS: ${{ vars.INGESTION_FETCH_DELAY_MAX_MS }} - INGESTION_WORKER_BATCH_SIZE: ${{ vars.INGESTION_WORKER_BATCH_SIZE }} - INGESTION_WORKER_IDLE_MS: ${{ vars.INGESTION_WORKER_IDLE_MS }} - INGESTION_WORKER_REPLICAS: ${{ vars.INGESTION_WORKER_REPLICAS }} - TRAEFIK_ADMIN_PRIORITY: ${{ vars.TRAEFIK_ADMIN_PRIORITY }} - run: deploy/scripts/deploy-over-ssh.sh - - - name: Production smoke checks - id: smoke - continue-on-error: true - env: - BASE_URL: https://${{ vars.DOMAIN }} - EXPECTED_RELEASE_ID: ${{ env.RELEASE_ID }} - SMOKE_RESULT_PATH: smoke-result.json - run: node deploy/scripts/smoke-check.mjs - - - name: Roll back production after failed smoke checks - if: steps.smoke.outcome == 'failure' - env: - ENVIRONMENT: production - STACK_NAME: ${{ vars.STACK_NAME }} - SWARM_MANAGER_HOST: ${{ secrets.SWARM_MANAGER_HOST }} - SWARM_SSH_USER: ${{ secrets.SWARM_SSH_USER }} - SWARM_SSH_PORT: ${{ secrets.SWARM_SSH_PORT }} - run: deploy/scripts/rollback-over-ssh.sh - - - name: Fail after production smoke rollback - if: steps.smoke.outcome == 'failure' - run: exit 1 - - - name: Write release manifest - env: - COMMIT_SHA: ${{ github.sha }} - RELEASE_ID: ${{ env.RELEASE_ID }} - WEB_IMAGE_DIGEST: ${{ env.WEB_IMAGE_REPO }}@${{ steps.build-web.outputs.digest }} - INGESTION_IMAGE_DIGEST: ${{ env.INGESTION_IMAGE_REPO }}@${{ steps.build-ingestion.outputs.digest }} - SMOKE_RESULT_PATH: smoke-result.json - WORKFLOW_RUN_ID: ${{ github.run_id }} - run: node deploy/scripts/write-release-manifest.mjs > release-manifest.json - - - name: Upload release manifest - uses: actions/upload-artifact@v4 - with: - name: release-manifest-${{ env.RELEASE_ID }} - path: release-manifest.json + - name: Deploy production stack + shell: bash + run: | + set -euo pipefail + docker stack deploy \ + --with-registry-auth \ + --compose-file deploy/stack.yml \ + "${STACK_NAME}" + docker stack services "${STACK_NAME}" diff --git a/.gitignore b/.gitignore index 33c32bb..c51f5fb 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ npm-debug.log* .dolt/ *.db .beads-credential-key + +web-front/out/ +.playwright-cli/ +.local-run/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ea8d8d5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:1.28-alpine +COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf +COPY web-front/out/ /usr/share/nginx/html/ +EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD wget -qO- http://127.0.0.1:8080/health/ready >/dev/null || exit 1 diff --git a/README.md b/README.md index 8cc463d..e2fd3bf 100644 --- a/README.md +++ b/README.md @@ -1,103 +1,36 @@ -## videoreg.ru +# videoreg.ru -Small video registry using TypeScript, a Next.js web frontend, App Router, FSD-oriented folders, and a primitive file-backed JSON database. +Практический справочник об автомобильных видеорегистраторах. Существующий проект и Gitea сохранены. Доменный путь `~/tmp/videoreg.ru` — symlink на `~/tmp/videoreg`. -The Next.js app lives under `web-front/`. Ingestion code lives under `ingestion/`. +Публичные страницы: главная, четыре руководства, справочный снимок пяти карточек, калькулятор, источники. Архивных страниц восстановлено **0**: ограничения и точные запросы в `docs/provenance.json`. Новые тексты и собственная CSS-иллюстрация описаны в `docs/CONTENT_POLICY.md`. -### Local development +## Проверка и запуск -```bash -npm install -DASHCAM_CATALOG_EXPORT_DIR="$PWD/data/catalog-exports" npm run dev +```sh +npm ci +npm run ci:quality +python3 deploy/serve-local.py ``` -The app runs on [http://localhost:3000](http://localhost:3000). +Preview выбирает свободный порт через bind(0), сохраняет PID/URL в `.local-run/server.json`. Для фонового запуска: -### Data storage - -By default records are stored in `data/videoreg.json`. Override the path with: - -```bash -VIDEOREG_DB_FILE=/absolute/path/videoreg.json npm run dev +```sh +mkdir -p .local-run +nohup python3 deploy/serve-local.py > .local-run/server.log 2>&1 & ``` -Reads are intentionally cached aggressively: +`npm run dev` доступен для разработки. Production — статический Next export в `web-front/out`, nginx на 8080, без Node и базы данных на сервере. Старые demo entrypoints сохранены в `web-front/legacy`, ingestion-код — в `ingestion`; они не публикуются. Карточки каталога — сохранённые данные продавцов от 30 июля 2026, не актуальные цены и не результаты испытаний. -- process memory cache for the primitive JSON database; -- Next.js cache tag for dashboard/API reads; -- long HTTP cache headers on the read API. +## Деплой -Writes call `revalidateTag` and update the process cache. +`.gitea/workflows/master.yml` запускает typecheck, 21 тест и export, публикует image с тегом SHA в `git.pryanik.synology.me/huncode/videoreg.ru`, затем обновляет только стек `videoreg` через `deploy/stack.yml`. Использует существующие account/repository vars и secrets как next-incpu: `REGISTRY_USERNAME`, `REGISTRY_PASSWORD`, `SWARM_MANAGER_HOST`, `SWARM_SSH_USER`, `SWARM_SSH_PORT`. Регистри по умолчанию `git.pryanik.synology.me`, сеть `traefik-public`, router/service `videoreg`, resolver `le`. Значения секретов не хранятся в репозитории. -### Dashcam catalog ingestion +Ручной деплой уже опубликованного immutable image: -The catalog ingestion services run in the **same cloud** as the Next.js app -(one Swarm/Portainer environment), not on a separate server: - -```bash -docker compose -f ingestion/docker-compose.yml up --build +```sh +IMAGE=git.pryanik.synology.me/huncode/videoreg.ru: deploy/deploy-static.sh ``` -It starts PostgreSQL, an HTTP-only ingestion worker, and a minimal admin server on -`http://localhost:4101`. The worker writes the validated `manifest.json` + -`catalog.json` to a shared export volume; there is no HTTP export server and no -export token — the app reads the artifacts directly from that volume. +Ни bootstrap, ни глобальный prune не выполняются. Старые динамические deploy scripts и compose-файлы сохранены для истории и ingestion, но **не используются** публичным workflow. Их запуск не требуется. -The default Yandex Market seed category is: - -```text -https://market.yandex.ru/catalog--avtomobilnye-videoregistratory/82798275/list?hid=82798269 -``` - -Seed env vars are source-specific: `YANDEX_MARKET_DASHCAM_CATEGORY_URL` is active -today. `MVIDEO_DASHCAM_CATEGORY_URL` enables the MVideo discovery/parser path -when configured. - -Crawler policy is intentionally conservative: no browser fallback in the regular -path, no stealth/proxy behavior, PostgreSQL-backed queue and daily budgets, raw -snapshots stored on the ingestion volume, and source pause on captcha/403/429. - -To import an approved export into the app read-model cache, point the import at -the shared export volume: - -```bash -DASHCAM_CATALOG_EXPORT_DIR=/path/to/ingestion/data/exports \ -npm run catalog:import -``` - -The import command reads `manifest.json` + `catalog.json` from that directory, -validates them with Zod, verifies the artifact `sha256`, checks -`exportId`/`createdAt`/`itemCount`, and atomically updates `data/videoreg.json`. -No HTTP call and no token are involved. - -The ingestion admin server exposes its own operator UI at -`http://127.0.0.1:4101/admin`. It is served by `ingestion-admin`, requires Basic -Auth, and is not part of the Next.js app. In production Traefik should route -`/admin` to `ingestion-admin` and `/` to Next.js, without stripping the `/admin` -prefix. - -For the production setup where ingestion is co-located with the app and shares -the export volume, see [`ingestion/README.md`](ingestion/README.md). -For Portainer stacks, see [`deploy/portainer/README.md`](deploy/portainer/README.md). -For the local end-to-end demonstration, see [`DEMO.md`](DEMO.md). - -### Deployment - -Gitea Actions runs: - -- `.gitea/workflows/pr.yml`: quality gate for pull requests into `master`; -- `.gitea/workflows/master.yml`: quality gate, build/push of web and ingestion images, and direct co-located Swarm deploy from `master`. - -The production workflow uses the runner's existing Gitea configuration names: - -- variables: `REGISTRY`, `IMAGE_REPO`, `DOMAIN` (`videoreg.ru`), `STACK_NAME`, - `TRAEFIK_NETWORK`, `TRAEFIK_ENTRYPOINT`, and `TRAEFIK_CERTRESOLVER`; -- secrets: `REGISTRY_USERNAME`, `REGISTRY_PASSWORD`, `SWARM_MANAGER_HOST`, - `SWARM_SSH_USER`, `SWARM_SSH_PORT`, `INGESTION_POSTGRES_PASSWORD`, and - `INGESTION_ADMIN_PASSWORD`. - -Images are published as `${IMAGE_REPO}-web` and `${IMAGE_REPO}-ingestion`, then -the Swarm manager pulls their immutable digests. Both `/` and `/admin` receive -the configured TLS certificate through Traefik. - -The Swarm stack defaults to one replica on a manager node because the primitive database is a mounted JSON file. Use a real database before raising replicas above one or spreading the service across nodes. +`/health/ready` проверяет валидность включённого каталога во время сборки; Docker health проверяет HTTP-ответ runtime. `/auto.shtml` отвечает относительным 308 на `/guides/choose`. Demo API и showcase возвращают 404. Публичный TLS требует исправной DNS-делегации домена на zz; состояние — в `DEPLOYMENT_REPORT.md`. diff --git a/deploy/deploy-static.sh b/deploy/deploy-static.sh new file mode 100755 index 0000000..2c7d67e --- /dev/null +++ b/deploy/deploy-static.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail +: "${IMAGE:?Provide immutable registry image tag or digest}" +DEPLOY_HOST="${DEPLOY_HOST:-zz}" +REMOTE_RELEASE="/tmp/videoreg-static-deploy" +ssh -o BatchMode=yes "$DEPLOY_HOST" "mkdir -p '$REMOTE_RELEASE'" +scp -o BatchMode=yes deploy/stack.yml "$DEPLOY_HOST:$REMOTE_RELEASE/stack.yml" +# IMAGE is validated to avoid injecting shell commands in the remote environment. +[[ "$IMAGE" =~ ^[a-zA-Z0-9._/:@-]+$ ]] || exit 2 +ssh -o BatchMode=yes "$DEPLOY_HOST" "cd '$REMOTE_RELEASE' && IMAGE='$IMAGE' DOMAIN=videoreg.ru STACK_NAME=videoreg TRAEFIK_NETWORK=traefik-public docker stack deploy --with-registry-auth -c stack.yml videoreg && docker stack services videoreg" diff --git a/deploy/docker/Dockerfile.web b/deploy/docker/Dockerfile.web index 27287cd..b8f2b0e 100644 --- a/deploy/docker/Dockerfile.web +++ b/deploy/docker/Dockerfile.web @@ -1,37 +1,14 @@ -# syntax=docker/dockerfile:1 - -FROM node:22-alpine AS deps +# Legacy dynamic application image; public production uses root Dockerfile (static). +FROM node:22-alpine AS build WORKDIR /app - -COPY .npmrc package.json package-lock.json ./ -RUN npm install -g npm@11.6.4 \ - && npm ci --prefer-offline --no-audit --no-fund - -FROM deps AS build -WORKDIR /app -ENV NEXT_TELEMETRY_DISABLED=1 +COPY package.json package-lock.json .npmrc ./ +RUN npm ci --no-audit --no-fund COPY tsconfig.json vitest.config.ts ./ COPY web-front web-front COPY ingestion ingestion -RUN npm run ci:quality - -FROM node:22-alpine AS runtime -ENV NODE_ENV=production \ - APP_ENV=production \ - NEXT_TELEMETRY_DISABLED=1 \ - VIDEOREG_DB_FILE=/data/videoreg.json \ - PORT=3000 -WORKDIR /app - -RUN addgroup -S nodeapp && adduser -S nodeapp -G nodeapp && mkdir -p /data && chown nodeapp:nodeapp /data - -COPY --from=build /app/web-front/.next/standalone ./ -COPY --from=build /app/web-front/.next/static ./.next/static -COPY --from=build /app/web-front/public ./public - -USER nodeapp -EXPOSE 3000 -HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \ - CMD wget -qO- http://127.0.0.1:3000/health/ready >/dev/null || exit 1 - -CMD ["node", "server.js"] +RUN npm run build +FROM nginx:1.28-alpine +COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/web-front/out/ /usr/share/nginx/html/ +EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=3s CMD wget -qO- http://127.0.0.1:8080/health/ready >/dev/null || exit 1 diff --git a/deploy/nginx.conf b/deploy/nginx.conf new file mode 100644 index 0000000..9688428 --- /dev/null +++ b/deploy/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 8080; + server_name _; + root /usr/share/nginx/html; + charset utf-8; + server_tokens off; + absolute_redirect off; + add_header X-Content-Type-Options nosniff always; + add_header Referrer-Policy strict-origin-when-cross-origin always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always; + location = /auto.shtml { return 308 /guides/choose; } + location /api/ { return 404; } + location ~ /showcase/?$ { return 404; } + location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; } + location /health/ { default_type application/json; try_files $uri =503; } + location / { try_files $uri $uri.html $uri/ =404; } + error_page 404 /404.html; + location = /404.html { internal; } +} diff --git a/deploy/serve-local.py b/deploy/serve-local.py new file mode 100644 index 0000000..cae6014 --- /dev/null +++ b/deploy/serve-local.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Preview the public static release on an OS-assigned local port.""" +from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler +from pathlib import Path +import json, os +ROOT=Path(__file__).resolve().parents[1] +OUT=ROOT/'web-front/out' +class Handler(SimpleHTTPRequestHandler): + def __init__(self,*args,**kwargs):super().__init__(*args,directory=str(OUT),**kwargs) + def do_GET(self): + path=self.path.split('?',1)[0] + if path=='/auto.shtml': + self.send_response(308);self.send_header('Location','/guides/choose');self.end_headers();return + if path.startswith('/api/') or path.rstrip('/').endswith('/showcase'): + self.send_error(404);return + target=OUT/path.lstrip('/') + if path.startswith('/health/') and target.is_file(): + self.send_response(200);self.send_header('Content-Type','application/json');self.end_headers();self.wfile.write(target.read_bytes());return + if target.with_suffix('.html').is_file():self.path=path+'.html' + super().do_GET() +httpd=ThreadingHTTPServer(('127.0.0.1',0),Handler) +runtime=ROOT/'.local-run';runtime.mkdir(exist_ok=True) +state=dict(port=httpd.server_port,pid=os.getpid(),url=f'http://127.0.0.1:{httpd.server_port}') +(runtime/'server.json').write_text(json.dumps(state,indent=2)+'\n') +print(json.dumps(state),flush=True) +httpd.serve_forever() diff --git a/deploy/stack.yml b/deploy/stack.yml new file mode 100644 index 0000000..2aeefac --- /dev/null +++ b/deploy/stack.yml @@ -0,0 +1,38 @@ +services: + web: + image: ${IMAGE} + networks: + - proxy + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/ >/dev/null || exit 1"] + interval: 30s + timeout: 3s + retries: 3 + start_period: 5s + deploy: + replicas: 1 + update_config: + order: start-first + parallelism: 1 + failure_action: rollback + monitor: 30s + rollback_config: + order: start-first + parallelism: 1 + monitor: 30s + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.docker.network=${TRAEFIK_NETWORK:-traefik-public}" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`) && PathPrefix(`/`)" + - "traefik.http.routers.${STACK_NAME}.priority=100" + - "traefik.http.routers.${STACK_NAME}.entrypoints=${TRAEFIK_ENTRYPOINTS:-websecure}" + - "traefik.http.routers.${STACK_NAME}.tls=${TRAEFIK_TLS:-true}" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${TRAEFIK_CERTRESOLVER:-le}" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080" + +networks: + proxy: + external: true + name: ${TRAEFIK_NETWORK:-traefik-public} diff --git a/docs/CONTENT_POLICY.md b/docs/CONTENT_POLICY.md new file mode 100644 index 0000000..99f71a1 --- /dev/null +++ b/docs/CONTENT_POLICY.md @@ -0,0 +1,11 @@ +# Происхождение и редакционные решения + +Архивных страниц восстановлено: **0**. Полный журнал запросов и hash сохранённого каталога: `provenance.json`. Неполученный снимок всегда имеет `archiveTimestamp: null`. Архивные ресурсы и серверный код не выполнялись. Спам из архива не заявляется удалённым: снимков нет. + +Существующий проект сохранён в `~/tmp/videoreg`; `~/tmp/videoreg.ru` — ссылка на него. Сохранён Gitea `huncode/videoreg.ru`, прежний ingestion-код и тесты. Production публикует руководства и фиксированный каталог; ingestion не включается без отдельной настройки и модерации. + +Все новые тексты написаны 26 октября 2026, не являются архивными. Источники технических определений — SD Association, 70mai и Thinkware, ссылки в статьях. Общие проверки и расчёт объёма — редакционная работа, без заявлений о проведённых испытаниях. Сведения каталогов продавцов явно отделены от измерений. + +Иллюстрация главной (`road-art`, `camera`, `lens`) — оригинальная CSS-композиция этого проекта, созданная 26 октября 2026, без внешних изображений, шрифтов и сетевых запросов. Это условная камера, не фотография или изображение конкретного товара. `dashcam-product.svg` — прежняя условная иллюстрация проекта; её использование обозначено перед каталогом. + +Удалён счётчик Яндекс Метрики. Вымышленные модели и оценки прежней dev-витрины сохранены только в исходниках, публичный маршрут закрыт. Демонстрационный API создания видео закрыт. Не добавлены цены, отзывы, партнёрские ссылки, скачивания прошивок или пиратские файлы. Старый `/auto.shtml` перенаправлен на новое руководство по выбору, а не выдан за прежнюю страницу. diff --git a/docs/provenance.json b/docs/provenance.json new file mode 100644 index 0000000..96629b7 --- /dev/null +++ b/docs/provenance.json @@ -0,0 +1,51 @@ +{ + "archivePagesRecovered": 0, + "archiveResourcesRecovered": 0, + "records": [ + { + "originalUrl": "https://web.archive.org/cdx/search/cdx?url=videoreg.ru/*&output=json&filter=statuscode:200&collapse=urlkey&filter=mimetype:text/html&limit=100", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "Local curl connection failure, web tool inaccessible; zz CDX request timed out after 25s" + }, + { + "originalUrl": "https://web.archive.org/web/20100101000000id_/http://www.videoreg.ru/auto.shtml", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "Web tool inaccessible; no snapshot retrieved" + }, + { + "originalUrl": "https://archive.org/wayback/available?url=videoreg.ru/auto.shtml×tamp=20100101", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "HTTP 429; no snapshot retrieved" + }, + { + "originalUrl": "https://arquivo.pt/textsearch?versionHistory=videoreg.ru&maxItems=5", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "HTTP 200; estimated_nr_results=0; response_items=[]" + }, + { + "originalUrl": "https://index.commoncrawl.org/CC-MAIN-2026-43-index?url=videoreg.ru/*&output=json", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "Web tool inaccessible; no crawl retrieved" + }, + { + "originalUrl": "https://autoclub.kharkov.ua/forum/viewtopic.php?f=78&t=9649", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "result": "Search index retrieved discussion dated 2007-08-28 linking http://www.videoreg.ru/auto.shtml; topic evidence only, no reproduction" + }, + { + "originalUrl": "local:data/videoreg.json", + "checkedAt": "2026-10-26", + "archiveTimestamp": null, + "sourceCommit": "2ce58fc", + "result": "Existing ignored local catalog snapshot; copied dashcamCatalog only, excluding demo videos. Product source URLs and fetchedAt retained. Not a Web Archive restoration.", + "sha256": "e5ac701d06029f87e174be5f4ddcb56034608d5a393e9627a64a19d06a42e27c", + "products": 5 + } + ] +} diff --git a/docs/review-evidence/videoreg-desktop.png b/docs/review-evidence/videoreg-desktop.png new file mode 100644 index 0000000..6f46351 Binary files /dev/null and b/docs/review-evidence/videoreg-desktop.png differ diff --git a/docs/review-evidence/videoreg-mobile-full.png b/docs/review-evidence/videoreg-mobile-full.png new file mode 100644 index 0000000..641cc82 Binary files /dev/null and b/docs/review-evidence/videoreg-mobile-full.png differ diff --git a/package.json b/package.json index 683bf0d..81f36ce 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "next dev web-front", "build": "next build web-front", - "start": "next start web-front", + "start": "python3 deploy/serve-local.py", "typecheck": "tsc --noEmit", "test": "vitest run", "catalog:import": "node --experimental-strip-types web-front/scripts/importCatalogExport.ts", diff --git a/web-front/src/app/api/videos/route.ts b/web-front/legacy/api-videos.ts similarity index 100% rename from web-front/src/app/api/videos/route.ts rename to web-front/legacy/api-videos.ts diff --git a/web-front/legacy/proxy.ts b/web-front/legacy/proxy.ts new file mode 100644 index 0000000..79c455c --- /dev/null +++ b/web-front/legacy/proxy.ts @@ -0,0 +1,3 @@ +import { NextResponse, type NextRequest } from 'next/server'; +export function proxy(request: NextRequest) { if(request.nextUrl.pathname.startsWith('/api/videos') || request.nextUrl.pathname.endsWith('/showcase')) return new NextResponse('Not found',{status:404}); return NextResponse.next(); } +export const config={matcher:['/api/videos/:path*','/:devRoot/showcase']}; diff --git a/web-front/src/app/(dev)/[devRoot]/showcase/layout.tsx b/web-front/legacy/showcase-layout.tsx similarity index 100% rename from web-front/src/app/(dev)/[devRoot]/showcase/layout.tsx rename to web-front/legacy/showcase-layout.tsx diff --git a/web-front/src/app/(dev)/[devRoot]/showcase/page.tsx b/web-front/legacy/showcase-page.tsx similarity index 100% rename from web-front/src/app/(dev)/[devRoot]/showcase/page.tsx rename to web-front/legacy/showcase-page.tsx diff --git a/web-front/next.config.ts b/web-front/next.config.ts index c37b060..08bbd21 100644 --- a/web-front/next.config.ts +++ b/web-front/next.config.ts @@ -1,10 +1,3 @@ import type { NextConfig } from 'next'; - -const nextConfig: NextConfig = { - output: 'standalone', - turbopack: { - root: process.cwd(), - }, -}; - +const nextConfig: NextConfig = {output:'export',experimental:{cpus:2},turbopack:{root:process.cwd()}}; export default nextConfig; diff --git a/web-front/src/app/about/page.tsx b/web-front/src/app/about/page.tsx new file mode 100644 index 0000000..418b4d4 --- /dev/null +++ b/web-front/src/app/about/page.tsx @@ -0,0 +1,2 @@ +export const metadata={title:'Источники и история проекта'}; +export default function About(){return

ПРОИСХОЖДЕНИЕ МАТЕРИАЛОВ

Открыто об истории сайта

Автомобильные видеорегистраторы — тема videoreg.ru. Мы сохраняем полезное и честно отмечаем границы восстановления.

Что известно о старом сайте

В обсуждении Харьковского АвтоКлуба от августа 2007 года участники ссылались на www.videoreg.ru/auto.shtml. Это подтверждает старый адрес и автомобильную тему, но не даёт нам полного текста страницы.

Посмотреть историческое упоминание ↗

Что удалось восстановить из архива

На 26 октября 2026 года — ни одной страницы или картинки из Web Archive. CDX и получение снимков недоступны из проверенных сетей, API доступности вернул 429. Альтернативный поиск Arquivo.pt вернул ноль результатов. Мы не воспроизводим чужие форумные сообщения как тексты старого сайта.

Старый адрес /auto.shtml ведёт к новому руководству по выбору. Это совместимый маршрут, а не копия прежней страницы. Другие неизвестные адреса возвращают 404.

Что сохранено из проекта

Каталог из существующего репозитория: снимок карточек Яндекс Маркета от 30 июля 2026 с адресами источников. Сохранили исходные значения, не добавляли цены, оценки и отзывы. Снимок не доказывает текущую доступность товара.

Что создано заново

Четыре руководства, калькулятор, навигация и этот интерфейс написаны 26 октября 2026. Технические определения сверены с SD Association и документацией 70mai; ссылки находятся рядом с материалами. Практические списки проверок — редакционные рекомендации.

Чистая версия

Удалён внешний счётчик Яндекс Метрики. Демонстрационные рейтинги с вымышленными моделями не публикуются. Сайт не запускает архивные скрипты, не предлагает прошивки и пиратские загрузки. Обнаруженного архивного спама нет: сами снимки недоступны.

} diff --git a/web-front/src/app/catalog/page.tsx b/web-front/src/app/catalog/page.tsx new file mode 100644 index 0000000..cdea6b8 --- /dev/null +++ b/web-front/src/app/catalog/page.tsx @@ -0,0 +1,5 @@ +import { DashcamCatalog } from '@/widgets/dashcam-catalog/ui/DashcamCatalog'; +import snapshot from '@/content/catalog.json'; +import { parseDashcamCatalogExport } from '@/entities/dashcam-catalog/model/schema'; +export const metadata={title:'Справочный каталог видеорегистраторов'}; +export default function Catalog(){const catalog=parseDashcamCatalogExport(snapshot);return <>
Снимок прежнего каталога от 30 июля 2026. Характеристики взяты из карточек продавцов и не проверены независимыми испытаниями. Актуальную комплектацию уточняйте у производителя. Изображения — условная иллюстрация.
} diff --git a/web-front/src/app/guides/[slug]/page.tsx b/web-front/src/app/guides/[slug]/page.tsx new file mode 100644 index 0000000..5f24418 --- /dev/null +++ b/web-front/src/app/guides/[slug]/page.tsx @@ -0,0 +1,6 @@ +import { notFound } from 'next/navigation'; +import { guides } from '@/content/guides'; +export const dynamicParams = false; +export function generateStaticParams(){return guides.map(g=>({slug:g.slug}))} +export async function generateMetadata({params}:{params:Promise<{slug:string}>}){const {slug}=await params;const g=guides.find(g=>g.slug===slug);return {title:g?.title,description:g?.summary}} +export default async function Guide({params}:{params:Promise<{slug:string}>}){const {slug}=await params;const g=guides.find(g=>g.slug===slug);if(!g)notFound();const next=guides[guides.indexOf(g)+1];return
← Все руководства

{g.number} / ПРАКТИКА · НОВЫЙ МАТЕРИАЛ

{g.title}

{g.summary}

{g.sections.map((s,i)=>

{s.title}

{s.text}

)}{g.sources.length>0&&

Первичные источники

{g.sources.map(s=>

{s.title} ↗

)}

Проверены 26 октября 2026. Примеры конкретных моделей не распространяются на весь рынок.

}

Редакционный материал videoreg.ru, 26 октября 2026. Не является восстановленной архивной статьёй.

{next?"Далее: "+next.title:"Вернуться к руководствам"} →

Дополнительно: калькулятор времени записи

} diff --git a/web-front/src/app/health/live/route.ts b/web-front/src/app/health/live/route.ts index 47b5e77..7f7c831 100644 --- a/web-front/src/app/health/live/route.ts +++ b/web-front/src/app/health/live/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from 'next/server'; -export const dynamic = 'force-dynamic'; +export const dynamic = 'force-static'; export function GET() { return NextResponse.json({ diff --git a/web-front/src/app/health/ready/route.ts b/web-front/src/app/health/ready/route.ts index bbc00c7..b905eb8 100644 --- a/web-front/src/app/health/ready/route.ts +++ b/web-front/src/app/health/ready/route.ts @@ -1,17 +1,5 @@ import { NextResponse } from 'next/server'; -import { listVideos } from '@/entities/video/api/videoRepository'; - -export const dynamic = 'force-dynamic'; - -export async function GET() { - await listVideos(); - - return NextResponse.json({ - status: 'ok', - service: 'videoreg-web', - metadata: { - commitSha: process.env.COMMIT_SHA ?? 'local', - releaseId: process.env.RELEASE_ID ?? 'local', - }, - }); -} +import snapshot from '@/content/catalog.json'; +import { parseDashcamCatalogExport } from '@/entities/dashcam-catalog/model/schema'; +export const dynamic='force-static'; +export async function GET(){const catalog=parseDashcamCatalogExport(snapshot);return NextResponse.json({status:'ok',service:'videoreg-web',products:catalog.products.length,metadata:{commitSha:process.env.COMMIT_SHA??'local'}})} diff --git a/web-front/src/app/icon.svg b/web-front/src/app/icon.svg new file mode 100644 index 0000000..d67b7a1 --- /dev/null +++ b/web-front/src/app/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/src/app/layout.tsx b/web-front/src/app/layout.tsx index fa1b29b..7f9a306 100644 --- a/web-front/src/app/layout.tsx +++ b/web-front/src/app/layout.tsx @@ -1,45 +1,11 @@ import type { Metadata } from 'next'; -import Script from 'next/script'; import './globals.css'; - -const YANDEX_METRIKA_ID = 109268682; - +import './restoration.css'; export const metadata: Metadata = { - title: 'videoreg.ru - автомобильные видеорегистраторы', - description: 'Каталог автомобильных видеорегистраторов из одобренных source cards.', + metadataBase: new URL('https://videoreg.ru'), + title: { default: 'Видеорег — запись, которой можно доверять', template: '%s · videoreg.ru' }, + description: 'Практические руководства по автомобильным видеорегистраторам: выбор, установка, карты памяти и сохранение записи.', }; - -type RootLayoutProps = { - children: React.ReactNode; -}; - -export default function RootLayout({ children }: RootLayoutProps) { - return ( - - - {children} - - - - - ); +export default function RootLayout({children}: {children: React.ReactNode}) { + return Перейти к содержимому
видеорегRU / ДОРОЖНЫЕ ЗАПИСИ
{children}; } diff --git a/web-front/src/app/page.tsx b/web-front/src/app/page.tsx index 84ee434..68cba68 100644 --- a/web-front/src/app/page.tsx +++ b/web-front/src/app/page.tsx @@ -1,17 +1,2 @@ -import { readDashcamCatalog } from '@/entities/dashcam-catalog/api/catalogRepository'; -import { DashcamCatalog } from '@/widgets/dashcam-catalog/ui/DashcamCatalog'; - -export const dynamic = 'force-dynamic'; - -export default async function Home() { - const catalog = await readDashcamCatalog(); - - return ( - - ); -} +import { guides } from '@/content/guides'; +export default function Home(){return

ВНИМАНИЕ К ДЕТАЛЯМ / VIDEOREG.RU

Дорога меняется.
Запись остаётся.

Как выбрать регистратор, настроить запись и сохранить важный момент. Понятные руководства без выдуманных рейтингов.

Начать с выбора ↗
04 руководства01 полезный инструментБез трекеров

БАЗА ЗНАНИЙ

От выбора до сохранённого файла

Четыре шага к предсказуемой записи.

СЧИТАЕМ ДО ПОКУПКИ

На сколько часов хватит карты?

Оцените время записи по ёмкости и суммарному битрейту всех камер.

Открыть калькулятор ↗

Каталог с открытым происхождением

Сохранили прежний каталог проекта: карточки продавцов от 30 июля 2026 года. Это справочный снимок, а не актуальное предложение или независимое испытание.

Посмотреть каталог →Как мы работаем с источниками →
} diff --git a/web-front/src/app/restoration.css b/web-front/src/app/restoration.css new file mode 100644 index 0000000..a9e5ed3 --- /dev/null +++ b/web-front/src/app/restoration.css @@ -0,0 +1,3 @@ +:root{--ink:#152d3b;--paper:#f7f5ef;--amber:#efb34f}body{background:var(--paper);color:var(--ink);margin:0}a{text-underline-offset:4px}a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #b27300;outline-offset:5px}p{line-height:1.75}.site-nav,.site-footer{max-width:1280px;margin:auto;padding:26px 40px;display:flex;align-items:center;justify-content:space-between;gap:24px}.site-nav{min-height:106px}.brand{font-size:28px;font-weight:850;letter-spacing:-1.3px;text-decoration:none}.brand span{display:block;font:10px/1.5 monospace;letter-spacing:1.5px;margin-top:4px}.site-nav nav{display:flex;gap:26px;font-size:14px;font-weight:650}.site-nav nav a{text-decoration:none}.site-nav nav a:hover{color:#976000}.road-hero{display:grid;grid-template-columns:1.15fr 1fr;max-width:1440px;margin:auto;background:var(--ink);color:#fff;min-height:550px;overflow:hidden}.hero-copy{padding:70px 40px 36px max(40px,calc((100vw - 1200px)/2))}.eyebrow{font:11px/1.6 monospace;letter-spacing:1.8px;font-weight:650;margin:0 0 20px}.road-hero .eyebrow{color:var(--amber)}h1,h2,h3{letter-spacing:-1.2px;line-height:1.13}h1{font-size:clamp(36px,4.4vw,66px);margin:0 0 24px;font-weight:750}.road-hero h1 em{font-style:normal;color:var(--amber)}.intro{max-width:490px;font-size:17px;color:#cbd7da;margin:0 0 32px}.primary-link{display:inline-flex;align-items:center;justify-content:space-between;gap:26px;background:var(--amber);color:#142b37;padding:16px 22px;border-radius:4px;font-size:14px;font-weight:750;text-decoration:none}.primary-link:hover{background:#ffd08b}.hero-meta{display:flex;gap:16px;flex-wrap:wrap;border-top:1px solid #ffffff26;padding-top:20px;margin-top:46px;font:11px/1.5 monospace;color:#b2c4cb}.road-art{position:relative;isolation:isolate;background:radial-gradient(ellipse at center,#375467,#122737 75%);min-height:440px;overflow:hidden}.road-art:before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(0deg,transparent 0 38px,#ffffff07 39px 40px),repeating-linear-gradient(90deg,transparent 0 38px,#ffffff07 39px 40px);z-index:-1}.rec{position:absolute;top:32px;right:32px;font:12px monospace;letter-spacing:2px;color:#e7b55b}.road-line{position:absolute;height:600px;width:180px;border-left:2px solid #83959e55;border-right:2px solid #83959e55;top:20px;left:35%;transform:rotate(28deg)}.road-line:after{content:'';position:absolute;width:3px;height:100%;left:50%;background:repeating-linear-gradient(#efb34f99 0 40px,transparent 40px 80px)}.camera{position:absolute;width:230px;height:140px;left:50%;top:45%;transform:translate(-50%,-50%) rotate(-9deg);background:linear-gradient(140deg,#445c68,#142833);border:2px solid #80949e;border-radius:28px 28px 19px 19px;box-shadow:18px 28px 40px #0006}.camera:before{content:'';position:absolute;width:70px;height:38px;border:10px solid #5c7381;border-bottom:0;top:-38px;left:85px;border-radius:9px 9px 0 0}.lens{position:absolute;right:20px;top:18px;width:98px;height:98px;border:10px solid #1b303c;outline:2px solid #a3b0b6;border-radius:50%;background:radial-gradient(circle at 36% 34%,#96c6d5 0 3%,#2e6b89 5%,#182e3e 20%,#0b1721 45%,#426273 48%,#102a3e 53%,#061722 70%);box-shadow:3px 5px 9px #0008}.camera>span{position:absolute;bottom:20px;left:12px;font:8px monospace;color:#c2cdd1;width:65px;line-height:1.7}.art-caption{position:absolute;bottom:32px;left:32px;color:#bdc9d0;font:10px/1.8 monospace;letter-spacing:1.3px}.guide-section,.home-note,.tool-banner{max-width:1200px;margin:72px auto;padding:0 24px;scroll-margin-top:20px}.section-head{display:flex;gap:24px;align-items:end;justify-content:space-between;margin-bottom:28px}.section-head h2{font-size:34px;max-width:600px;margin:0}.section-head p{color:#586873;font-size:14px;max-width:240px}.guide-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.guide-card{display:flex;flex-direction:column;border:1px solid #d4dcd9;background:#fffefa;padding:26px 22px;min-height:300px;text-decoration:none;border-radius:4px;transition:transform .15s,border-color .15s}.guide-card:hover{transform:translateY(-4px);border-color:#7594a0}.card-number{font:10px monospace;letter-spacing:1px;color:#687a84}.guide-card h3{font-size:24px;margin-top:28px}.guide-card p{font-size:14px;color:#61717b}.card-arrow{margin-top:auto;padding-top:26px;font-size:13px;font-weight:750}.tool-banner{background:#e5ebe7;padding:38px 40px;display:flex;align-items:center;justify-content:space-between;gap:32px;border-radius:5px}.tool-banner h2{font-size:32px;margin:0}.tool-banner p{margin-bottom:0;color:#4e6570}.home-note{display:grid;grid-template-columns:1fr 1fr;gap:20px 40px}.home-note h2{font-size:30px;margin:0}.home-note p{margin:0;color:#526875}.home-note a{font-size:14px;font-weight:700}.site-footer{border-top:1px solid #d0d9d7;margin-top:80px;font-size:12px;color:#526571;align-items:start}.site-footer p{margin-bottom:0}.site-footer .brand{color:var(--ink)}.article-shell{max-width:1160px;margin:46px auto 80px;padding:0 32px}.article-shell>h1{max-width:900px}.back{display:inline-block;margin-bottom:36px;font-size:14px}.article-lead{font-size:21px;max-width:760px;color:#5c727d;margin-bottom:48px}.article-columns{display:grid;grid-template-columns:230px 1fr;gap:70px}.article-columns aside{border-top:3px solid var(--amber);padding-top:20px;font-size:13px;align-self:start;position:sticky;top:24px}.article-columns aside a{display:block;margin-top:20px;color:#506772}.article-columns article{max-width:750px}.article-shell h2{font-size:27px;margin:36px 0 16px}.article-shell article section:first-child h2{margin-top:0}.article-shell article p,.narrow p{font-size:17px;line-height:1.85}.article-shell section{scroll-margin-top:24px}.sources{border-top:1px solid #ccd5d2;margin-top:38px}.sources p,.editor-note{font-size:13px!important;color:#5b6f79}.editor-note{margin-top:35px}.narrow{max-width:780px}.catalog-disclosure{max-width:1180px;margin:32px auto 0;padding:18px 24px;background:#e8ece4;border-left:4px solid #b17b28;font-size:14px;line-height:1.8}.catalog-header__subtitle{color:#526571}.calculator{display:grid;grid-template-columns:1fr 1fr;border:1px solid #cbd5d2;margin:38px 0 52px;border-radius:5px;overflow:hidden}.calculator-fields{display:grid;gap:24px;padding:32px;background:#fffefa}.calculator-fields label{display:grid;gap:10px;font-size:14px;font-weight:700}.calculator-fields input{width:100%;padding:14px;background:var(--paper);border:1px solid #899d9f;border-radius:3px;font:20px monospace;color:var(--ink)}.calculator-result{display:flex;flex-direction:column;justify-content:center;background:var(--ink);color:white;padding:36px}.calculator-result>span{font:11px monospace;letter-spacing:2px;color:#cad4d7}.calculator-result strong{font-size:clamp(30px,4vw,54px);margin:22px 0;color:var(--amber);line-height:1.2}.calculator-result p{color:#b5cbd3;font-size:14px}.catalog-status{font-size:12px}.site-nav a,.site-footer a{color:inherit} @media(max-width:1000px){.guide-grid{grid-template-columns:repeat(2,1fr)}.hero-copy{padding:45px 30px}.road-hero{grid-template-columns:1.2fr 1fr}.site-nav{padding:20px 24px}.site-nav nav{gap:16px}.article-columns{gap:35px;grid-template-columns:190px 1fr}.tool-banner{margin-left:24px;margin-right:24px}}@media(max-width:700px){.site-nav{align-items:start;flex-direction:column;gap:20px}.site-nav nav{flex-wrap:wrap;gap:12px 24px;font-size:13px}.road-hero{grid-template-columns:1fr}.hero-copy{padding:40px 24px 30px}.road-art{min-height:300px}.camera{transform:translate(-50%,-50%) rotate(-9deg) scale(.85)}.hero-meta{margin-top:28px}.road-hero h1{font-size:42px}.section-head{display:block}.section-head h2{font-size:30px}.section-head p{max-width:100%}.guide-section{margin-top:44px}.guide-grid{gap:12px}.guide-card{padding:22px 16px;min-height:290px}.guide-card h3{font-size:21px}.tool-banner{flex-direction:column;align-items:start;padding:30px 24px;margin-top:42px;margin-bottom:42px}.tool-banner h2{font-size:28px}.home-note{display:block;margin-top:40px}.home-note p{margin:18px 0}.home-note a{display:block;margin-top:18px}.site-footer{padding:28px 24px;flex-direction:column;margin-top:48px}.article-shell{padding:0 24px;margin-top:30px}.article-shell h1{font-size:38px}.article-lead{font-size:18px;margin-bottom:30px}.article-columns{display:flex;flex-direction:column;gap:30px}.article-columns aside{position:static;width:100%;padding:18px;background:#e7ece6}.article-columns aside a{margin-top:14px}.calculator{grid-template-columns:1fr}.calculator-fields,.calculator-result{padding:24px}.catalog-disclosure{margin:22px 10px 0;padding:14px}.article-shell article p,.narrow p{font-size:16px}}@media(max-width:380px){.guide-grid{grid-template-columns:1fr}.road-hero h1{font-size:36px}.guide-card{min-height:230px}}@media(prefers-reduced-motion:reduce){.guide-card{transition:none}.guide-card:hover{transform:none}} + +.skip-link{position:absolute;top:-100px;left:12px;background:#fff;color:#152d3b;padding:14px;z-index:100}.skip-link:focus{top:12px} diff --git a/web-front/src/app/tools/recording-time/Calculator.tsx b/web-front/src/app/tools/recording-time/Calculator.tsx new file mode 100644 index 0000000..bdc0a1e --- /dev/null +++ b/web-front/src/app/tools/recording-time/Calculator.tsx @@ -0,0 +1,3 @@ +"use client"; +import { useState } from 'react'; +export default function Calculator(){const [capacity,setCapacity]=useState('128');const [rate,setRate]=useState('40');const [reserve,setReserve]=useState('10');const c=Number(capacity),r=Number(rate),s=Number(reserve);const valid=capacity!==''&&rate!==''&&reserve!==''&&Number.isFinite(c)&&Number.isFinite(r)&&Number.isFinite(s)&&c>0&&c<=100000&&r>0&&r<=10000&&s>=0&&s<100;const minutes=valid?c*1000*8*(1-s/100)/r/60:0;return
ПРИБЛИЗИТЕЛЬНО{valid?`${Math.floor(minutes/60)} ч ${Math.floor(minutes%60)} мин`:'Проверьте ввод'}

{valid?'Обычная запись до перезаписи старейших файлов.':'Нужны положительные ёмкость и битрейт, резерв от 0 до 99%.'}

} diff --git a/web-front/src/app/tools/recording-time/page.tsx b/web-front/src/app/tools/recording-time/page.tsx new file mode 100644 index 0000000..0e919d7 --- /dev/null +++ b/web-front/src/app/tools/recording-time/page.tsx @@ -0,0 +1,3 @@ +import Calculator from './Calculator'; +export const metadata={title:'Калькулятор времени записи видеорегистратора'}; +export default function Page(){return

ИНСТРУМЕНТ / ОБЪЁМ И ВРЕМЯ

Сколько дороги
поместится на карте?

Введите ёмкость и суммарный битрейт. Расчёт выполняется в браузере, данные никуда не отправляются.

Где взять битрейт

Посмотрите свойства исходного видеофайла. Если камер несколько, сложите их битрейты. Например, 25 Мбит/с спереди и 15 Мбит/с сзади дают суммарно 40 Мбит/с. Разрешение 4K само по себе не определяет битрейт.

Как считается

Время в секундах = ГБ × 1000 × 8 × (1 − резерв / 100) ÷ Мбит/с. Используем десятичные гигабайты, как при маркировке накопителей. Для 128 ГБ, 40 Мбит/с и резерва 10% получается 6 ч 24 мин.

Это оценка для постоянного битрейта. Переменный битрейт, звук, служебные данные, защищённые файлы и отдельные разделы могут изменить результат. Резерв 10% — пример настройки, а не измеренное свойство регистратора. Расчёт не проверяет совместимость карты.

Как подобрать совместимую карту →
} diff --git a/web-front/src/content/catalog.json b/web-front/src/content/catalog.json new file mode 100644 index 0000000..bbc36f6 --- /dev/null +++ b/web-front/src/content/catalog.json @@ -0,0 +1,138 @@ +{ + "schemaVersion": 1, + "exportId": "catalog_20260730_225710538", + "createdAt": "2026-07-30T22:57:10.538Z", + "products": [ + { + "id": "ym_5905404498", + "brand": "70mai", + "model": "Dash Cam 4K A800SE 4G", + "canonicalName": "70mai Dash Cam 4K A800SE 4G", + "title": "Видеорегистратор 70mai Dash Cam 4K A800SE 4G", + "specs": { + "channels": 1, + "resolution_max": "3840x2160", + "recording_mode": "циклическая", + "sensor_type": "CMOS", + "sensor_megapixels": 8 + }, + "images": [], + "sources": [ + { + "source": "yandex_market", + "sourceProductId": "5905404498", + "url": "https://market.yandex.ru/card/videoregistrator-70mai-dash-cam-4k-a800se-4g/5905404498", + "stableContentHash": "1f31f95eca1398d732d4936696dd41bd5fbaf1bac594e8cbf16fc1f61a0c9f64", + "fetchedAt": "2026-07-30T22:32:49.442Z" + } + ], + "discoveredAt": "2026-07-30T22:32:49.442Z", + "updatedAt": "2026-07-30T22:39:53.815Z" + }, + { + "id": "ym_5905353577", + "brand": "70mai", + "model": "Dash Cam 4K A800SE-1 4G", + "canonicalName": "70mai Dash Cam 4K A800SE-1 4G", + "title": "Видеорегистратор 70mai Dash Cam 4K A800SE-1 4G", + "specs": { + "channels": 2, + "resolution_max": "3840x2160", + "recording_mode": "циклическая", + "sensor_type": "CMOS", + "sensor_megapixels": 8 + }, + "images": [], + "sources": [ + { + "source": "yandex_market", + "sourceProductId": "5905353577", + "url": "https://market.yandex.ru/card/videoregistrator-70mai-dash-cam-4k-a800se-1-4g/5905353577", + "stableContentHash": "16c7d4967423121269e2eefd248f349fbaadc66b8128ac19941eb515296ce4e0", + "fetchedAt": "2026-07-30T22:33:07.641Z" + } + ], + "discoveredAt": "2026-07-30T22:33:07.641Z", + "updatedAt": "2026-07-30T22:39:53.819Z" + }, + { + "id": "ym_5905353576", + "brand": "70mai", + "model": "Dash Cam M310 Plus 3K", + "canonicalName": "70mai Dash Cam M310 Plus 3K", + "title": "Видеорегистратор 70mai Dash Cam M310 Plus 3K", + "specs": { + "channels": 1, + "resolution_max": "2880x1620", + "recording_mode": "циклическая", + "sensor_megapixels": 5, + "view_angle_degrees": 139 + }, + "images": [], + "sources": [ + { + "source": "yandex_market", + "sourceProductId": "5905353576", + "url": "https://market.yandex.ru/card/videoregistrator-70mai-dash-cam-m310-plus-3k/5905353576", + "stableContentHash": "774c30245b8fe6e85abdf120d4aa0421ba304135813a8e2de5063e1ad0cee510", + "fetchedAt": "2026-07-30T22:33:01.658Z" + } + ], + "discoveredAt": "2026-07-30T22:33:01.658Z", + "updatedAt": "2026-07-30T22:39:53.818Z" + }, + { + "id": "ym_5905353578", + "brand": "70mai", + "model": "Dash Cam M310 Plus 4K", + "canonicalName": "70mai Dash Cam M310 Plus 4K", + "title": "Видеорегистратор 70mai Dash Cam M310 Plus 4K", + "specs": { + "channels": 1, + "resolution_max": "3840x2160", + "recording_mode": "циклическая", + "sensor_megapixels": 8, + "view_angle_degrees": 140 + }, + "images": [], + "sources": [ + { + "source": "yandex_market", + "sourceProductId": "5905353578", + "url": "https://market.yandex.ru/card/videoregistrator-70mai-dash-cam-m310-plus-4k/5905353578", + "stableContentHash": "f71cc96baf064da814392306c99c3016618bb999cc6c86eee896bb6230b6d6e3", + "fetchedAt": "2026-07-30T22:32:55.705Z" + } + ], + "discoveredAt": "2026-07-30T22:32:55.705Z", + "updatedAt": "2026-07-30T22:39:53.836Z" + }, + { + "id": "ym_5905353579", + "brand": "70mai", + "model": "Dash Cam T400 + Rear Cam Set", + "canonicalName": "70mai Dash Cam T400 + Rear Cam Set", + "title": "Видеорегистратор 70mai Dash Cam T400 + Rear Cam Set (T400-1)", + "specs": { + "channels": 3, + "resolution_max": "2560x1440", + "recording_mode": "циклическая", + "view_angle_degrees": 125, + "night_mode": true, + "memory_card_support": "microSDXC" + }, + "images": [], + "sources": [ + { + "source": "yandex_market", + "sourceProductId": "5905353579", + "url": "https://market.yandex.ru/card/videoregistrator-70mai-dash-cam-t400--rear-cam-set-t400-1/5905353579", + "stableContentHash": "692e790e617d25ba973d789fe9f29c57176c6d7a072e79e132826ed5127ed61c", + "fetchedAt": "2026-07-30T22:32:43.465Z" + } + ], + "discoveredAt": "2026-07-30T22:32:43.465Z", + "updatedAt": "2026-07-30T22:39:44.015Z" + } + ] +} diff --git a/web-front/src/content/guides.ts b/web-front/src/content/guides.ts new file mode 100644 index 0000000..1818aeb --- /dev/null +++ b/web-front/src/content/guides.ts @@ -0,0 +1,117 @@ +export const guides = [ + { + "slug": "choose", + "title": "Как выбрать видеорегистратор", + "summary": "Начните со сценария, а не с цифры на коробке.", + "number": "01", + "sections": [ + { + "title": "Что должно попасть в кадр", + "text": "Для поездок по городу сначала определите, нужна ли только передняя камера или также задняя. Камера салона решает другую задачу: она не заменяет обзор дороги позади автомобиля. Составьте короткий список обязательных функций до сравнения моделей." + }, + { + "title": "Как сравнивать качество", + "text": "Попросите оригинальный видеофайл с нужной модели, а не ролик после сжатия социальной сетью. Посмотрите дневную и ночную запись, движение навстречу свету, отражения на стекле. Разрешение само по себе не гарантирует читаемость номера: результат зависит от света, выдержки, оптики и условий съёмки." + }, + { + "title": "Питание и парковка", + "text": "Уточните по инструкции, что требуется для парковочной записи: отдельный комплект подключения, внешний источник питания или постоянное питание автомобиля. Например, у 70mai Pro Plus+ режим time-lapse требует отдельного Hardwire Kit. Это пример конкретной модели, а не правило для всех устройств." + }, + { + "title": "Перед покупкой", + "text": "Проверьте доступность инструкции, совместимость карты памяти, длину кабеля задней камеры, способ снятия устройства и условия гарантии. Уточните, какие функции доступны без приложения и подписки. Каталог на сайте хранит старый снимок карточек продавцов; текущие комплектации проверяйте у производителя." + } + ], + "sources": [ + { + "title": "70mai: Pro Plus+ — функции и условия парковочного режима", + "url": "https://www.70mai.com/us/a500s/" + } + ] + }, + { + "slug": "memory-card", + "title": "Карта памяти без путаницы", + "summary": "Ёмкость, класс записи и совместимость — разные параметры.", + "number": "02", + "sections": [ + { + "title": "Сначала инструкция регистратора", + "text": "Проверьте допустимую ёмкость, тип карты и указанный производителем класс скорости. Большая ёмкость не означает автоматическую совместимость. Не переносите требования одной модели регистратора на другую." + }, + { + "title": "Что означают классы", + "text": "SD Association определяет классы скорости через минимальную последовательную скорость записи в установленных условиях. Обозначения Speed Class, UHS Speed Class и Video Speed Class относятся к разным системам. Сопоставляйте символ класса в инструкции устройства с символом на карте, а не только рекламную скорость чтения." + }, + { + "title": "Подготовка и проверка", + "text": "Скопируйте нужные файлы перед форматированием. Затем выполните форматирование способом, указанным в инструкции регистратора. После установки запишите короткую поездку и откройте несколько файлов: начало, середину и конец. Проверьте видео, звук, дату и отсутствие пропусков." + }, + { + "title": "Если появляются ошибки", + "text": "Остановите запись и сохраните важные файлы. Проверьте совместимость и состояние карты по инструкции. SD Association отмечает, что фрагментация при повторной записи и удалении может снижать скорость. Форматирование уничтожает данные: делайте его только после резервного копирования. При повторных ошибках обратитесь к производителю карты и устройства." + } + ], + "sources": [ + { + "title": "SD Association: Speed Class", + "url": "https://www.sdcard.org/developers/sd-standard-overview/speed-class/" + } + ] + }, + { + "slug": "installation", + "title": "Установка и первая поездка", + "summary": "Проверьте крепление, обзор и реальную запись до выезда.", + "number": "03", + "sections": [ + { + "title": "Выберите место на стекле", + "text": "На стоящем автомобиле подберите положение по инструкции устройства и правилам вашей страны. Камера должна видеть дорогу, а крепление и провода не должны мешать обзору водителя. Проверьте, попадает ли рабочая область стекла перед объективом в зону очистки дворниками." + }, + { + "title": "Проложите питание безопасно", + "text": "Используйте совместимый блок питания и кабель. Не прокладывайте провод через зоны раскрытия подушек безопасности, возле педалей или движущихся механизмов. Схему подключения к бортовой сети согласуйте с квалифицированным установщиком; универсальной схемы для всех автомобилей нет." + }, + { + "title": "Настройте кадр", + "text": "Очистите стекло и объектив, снимите транспортировочную плёнку. На экране или в приложении выровняйте горизонт. Проверьте, не занимает ли панель приборов слишком большую часть кадра и не перекрывает ли зеркало дорогу. Закрепите заднюю камеру по её инструкции." + }, + { + "title": "Проверьте результат", + "text": "Выставьте дату и часовой пояс. На безопасной короткой поездке запишите тест, затем остановитесь и просмотрите исходные файлы. Проверьте звук, обе камеры, читаемость времени и штатное завершение файла после выключения питания. Повторяйте проверку после изменения настроек и обновления прошивки." + } + ], + "sources": [{"title":"Thinkware: прокладка кабелей и профессиональная установка","url":"https://support.thinkware.com/hc/en-us/articles/360046325994-How-to-Hide-the-Dash-Cam-Cables"}] + }, + { + "slug": "save-video", + "title": "Как сохранить важную запись", + "summary": "Оригинал, соседние фрагменты и вторая копия.", + "number": "04", + "sections": [ + { + "title": "Не откладывайте копирование", + "text": "Циклическая запись перезаписывает старые файлы: это прямо описано, например, в документации 70mai Pro Plus+. Защита события и поведение отдельной папки зависят от модели. Не полагайтесь только на датчик удара или значок блокировки." + }, + { + "title": "Завершите запись штатно", + "text": "Сначала остановитесь в безопасном месте. Завершите запись способом из инструкции и дождитесь сохранения файла перед извлечением карты. Не вынимайте её во время записи. Скопируйте нужный фрагмент вместе с записями до и после события, а также файлы задней камеры, если она есть." + }, + { + "title": "Оставьте оригинал", + "text": "Сохраните исходные имена и структуру файлов. Сделайте вторую копию на другом носителе и откройте её для проверки. Не редактируйте единственный экземпляр. Для удобного просмотра можно создать отдельную копию, сохранив исходник без перекодирования." + }, + { + "title": "Перед публикацией", + "text": "Запись может содержать лица, номера автомобилей, разговоры и координаты. Для публичного ролика подготовьте отдельную версию с необходимым скрытием личной информации. Требования к передаче записи и её использованию зависят от ситуации и юрисдикции; техническая копия сама по себе не гарантирует юридический результат." + } + ], + "sources": [ + { + "title": "70mai: описание циклической записи", + "url": "https://www.70mai.com/us/a500s/" + } + ] + } +]; diff --git a/web-front/src/widgets/dashcam-catalog/ui/DashcamCatalog.tsx b/web-front/src/widgets/dashcam-catalog/ui/DashcamCatalog.tsx index 46dcf60..79758cd 100644 --- a/web-front/src/widgets/dashcam-catalog/ui/DashcamCatalog.tsx +++ b/web-front/src/widgets/dashcam-catalog/ui/DashcamCatalog.tsx @@ -115,21 +115,21 @@ export function DashcamCatalog({ catalog, source, exportInfo, hasSharedExportIss const products = catalog?.products ?? []; return ( -
+

videoreg.ru

Автомобильные видеорегистраторы

-

Проверенный каталог карточек из публичных источников.

+

Сохранённые карточки из публичных источников.

{products.length} - одобренных моделей + моделей в снимке
- Источник: {source === 'shared_export' ? 'shared export' : source === 'read_model' ? 'read model' : 'ожидается export'} + Источник: {source === 'shared_export' ? 'shared export' : source === 'read_model' ? 'сохранённый каталог, 30 июля 2026' : 'ожидается export'} {exportInfo ? Обновлён: {formatDate(exportInfo.createdAt)} : null} {hasSharedExportIssue ? Последний shared export недоступен, показана сохранённая версия. : null}