Commit Graph

39 Commits

Author SHA1 Message Date
王性驊 af2e5b4a28 fix frontend 2026-07-23 05:56:42 +00:00
王性驊 ae58b1e82a fix frontend 2026-07-20 06:33:14 +00:00
王性驊 055bfb8ed0 reset-data.sh: require typed confirmation + auto pre-backup by default
- local wrapper now prompts interactively for the operator to type the
  exact DEPLOY_TARGET before it will even upload/run the remote script;
  refuses to run without a TTY. --yes alone is no longer enough.
- remote script takes a fresh backup.sh snapshot right before wiping
  mongo/redis/minio (aborts the reset if the backup fails) unless
  --skip-backup is explicitly passed on both ends.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 17:54:46 +00:00
王性驊 ea5f51aa7d threads-profile: drop --no-sandbox, re-enable Chromium's own sandbox
Verified live on prod (systemd-run with the same User=harbor,
NoNewPrivileges=true, ProtectSystem=strict, ProtectHome=true,
ReadWritePaths=/var/lib/harbor as harbor-worker@.service) that Chromium's
unprivileged-userns sandbox launches and navigates fine without
--no-sandbox; kernel.unprivileged_userns_clone=1 on this host makes it
unnecessary. Keeping the browser's own renderer/GPU sandbox gives real
defense-in-depth against a malicious/compromised public Threads page,
instead of relying on systemd's process-level ProtectSystem alone.

Needs a normal release (build-release.sh + activate-release.sh) to reach
prod; not hot-patched on the live host.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 17:52:20 +00:00
王性驊 8c1be42f4a prod: throttle persona scrape jobs, cap worker CPU, add job-failure alerting + offsite backup
- job: cap concurrent persona_analyze_account (real headless-Chromium scrape)
  jobs per owner to 1 in flight via CountActiveByOwnerAndTemplate; rejects
  with the new ErrTooManyActive (429) instead of letting a member queue up
  many scrapes and pin the shared 1-vCPU host, or double-schedule the same
  persona while a previous run is still executing.
- harbor-worker@.service: CPUQuota=70% so nginx/gateway keep headroom while
  a scrape job briefly saturates Chromium.
- backup.sh: default BACKUP_DIR now matches the systemd unit (/var/backups/harbor)
  instead of the stale /var/backups/haixun default.
- add harbor-job-health.timer (every 5m): queries Mongo for jobs that failed
  in the last 15 minutes and writes a node-exporter textfile-collector
  metric (haixun_job_failures_recent), with new Prometheus alerts
  (PersonaScrapeJobsFailing / BackgroundJobsFailing / JobHealthMetricStale)
  so a stuck worker surfaces on its own instead of only via member reports —
  this would have caught the recent Playwright headless-shell bug directly.
- add harbor-offsite-backup.timer + backup/offsite-sync.sh: pushes
  backup.sh's local backups to an off-host restic repository (client-side
  encrypted). Installed and enabled by default but a safe no-op until
  RESTIC_REPOSITORY/RESTIC_PASSWORD are set in harbor.env.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 17:38:36 +00:00
王性驊 d1e876629a prod: bundle threads-profile scrape release, fix headless-shell install, add reset-data tooling
- release layout now ships scripts/threads-profile/scrape.mjs + node_modules;
  activate-release.sh verifies it exists before activating a release
- profile_scrape.go resolves the script path relative to the release dir
  (bin/{gateway,worker} -> ../scripts/threads-profile/scrape.mjs) in prod,
  falling back to the dev-tree relative paths for local runs
- bootstrap.sh: Playwright 1.49+ needs a separate chromium-headless-shell
  build for headless launches; the idempotency check only looked for
  chromium-*, so a stalled/partial headless-shell download from an earlier
  run was never retried. Now checks and installs both builds.
- add reset-data.sh (local wrapper + remote script) to wipe Mongo/Redis/MinIO
  and reseed the admin account for a clean-slate redeploy

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 16:26:30 +00:00
王性驊 fb8100825f fix frontend 2026-07-15 15:23:59 +00:00
王性驊 377b7f06ea fix frontend 2026-07-14 08:54:31 +00:00
王性驊 8ef6fe470b fix frontend 2026-07-13 08:59:13 +00:00
王性驊 ef6322b635 fix frontend 2026-07-13 03:18:08 +00:00
王性驊 e41c1f96a2 fix frontend 2026-07-13 01:15:30 +00:00
王性驊 fcc76911bb fix frontend 2026-07-10 12:54:45 +00:00
王性驊 c57987f6a8 fix frontend 2026-07-10 05:10:31 +00:00
王性驊 2e0b625735 fix all 2026-07-09 03:45:28 +00:00
王性驊 7ed9f50a2c add minio 2026-07-07 14:02:41 +00:00
王性驊 5acd1b6567 fix 2026-07-07 12:12:04 +00:00
王性驊 152d42e77b feat/rebone (#3)
Co-authored-by: 王性驊 <danielwang@supermicro.com>
Reviewed-on: #3
Co-authored-by: wang <igs170911@gmail.com>
Co-committed-by: wang <igs170911@gmail.com>
2026-07-06 06:13:14 +00:00
王性驊 71d2384bf5 Merge remote-tracking branch 'refs/remotes/origin/main'
# Conflicts:
#	.gitignore
#	Makefile
#	backend/etc/gateway.dev.example.yaml
#	backend/internal/library/matrix/generate.go
#	backend/internal/library/prompt/files/matrix_copy.system.md
#	backend/internal/library/prompt/files/matrix_copy.user.md
#	backend/internal/library/viral/discover_accounts_test.go
#	backend/internal/model/copy_mission/domain/entity/mission.go
#	backend/internal/model/copy_mission/domain/usecase/usecase.go
#	backend/internal/model/job/usecase/usecase.go
#	backend/internal/model/threads_account/domain/entity/account.go
#	backend/internal/model/threads_account/domain/usecase/usecase.go
#	backend/internal/worker/job/analyze_copy_mission.go
#	backend/worker/package-lock.json
#	deploy/.env.example
#	deploy/Dockerfile.node-worker
#	deploy/Dockerfile.web
#	deploy/README.md
#	deploy/docker-compose.yml
#	deploy/nginx.conf
#	frontend/src/components/AccountAiSettings.tsx
#	frontend/src/components/CopyMissionResearchOverview.tsx
#	frontend/src/components/JobMonitor.tsx
#	frontend/src/lib/aiCredentials.ts
#	frontend/src/lib/jobMonitorUi.ts
#	frontend/src/pages/CopyMissionDetailPage.tsx
#	frontend/src/types/copyMission.ts
2026-06-30 00:37:57 +08:00
王性驊 2dc81e409c Merge branch 'feat/picture'
# Conflicts:
#	backend/internal/model/job/usecase/usecase.go
#	backend/internal/model/threads_account/domain/usecase/usecase.go
2026-06-30 00:28:24 +08:00
王性驊 2faac625ac feat/add_search (#1)
Reviewed-on: #1
Co-authored-by: wang <igs170911@gmail.com>
Co-committed-by: wang <igs170911@gmail.com>
2026-06-29 16:11:08 +00:00
王性驊 a6c429a66d fix2 2026-06-28 20:25:39 +08:00
王性驊 cdda235597 fix2 2026-06-28 20:13:58 +08:00
王性驊 eef4a0f985 fix2 2026-06-28 19:58:15 +08:00
王性驊 3d5989e342 fix2 2026-06-28 19:40:52 +08:00
王性驊 9d7853c75a fix2 2026-06-28 19:07:22 +08:00
王性驊 a18909f579 fix2 2026-06-28 18:24:23 +08:00
王性驊 f2ca28c1d5 fix2 2026-06-28 18:19:16 +08:00
王性驊 eaf029a16f fix2 2026-06-28 18:08:43 +08:00
王性驊 184e7763ac fix2 2026-06-28 16:52:29 +08:00
王性驊 acd6eb93e9 fix2 2026-06-28 16:28:42 +08:00
王性驊 9ab5b6671d add search and post 2026-06-27 16:03:28 +00:00
王性驊 ae89e0451e add script 2026-06-27 15:00:10 +00:00
王性驊 c44d6c2bfc fix2 2026-06-27 22:49:17 +08:00
王性驊 ef6281ef83 fix 2026-06-26 16:35:47 +00:00
王性驊 29d0aca295 fix2 2026-06-27 00:15:29 +08:00
王性驊 ffd6a31d6f fix2 2026-06-27 00:02:06 +08:00
王性驊 3342f7a344 fix floder 2026-06-26 20:09:36 +08:00
王性驊 8b0985f604 first commit 2026-06-26 16:56:07 +08:00
王性驊 232111712d first commit 2026-06-26 16:37:04 +08:00