DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

xushilianzhuren /

xushilianzhuren/dsh-golden-ward

Verified

定制金身守护器:给任何频繁被升级覆盖的文件(默认=插件市场网页端client)捕获金身正本,被覆盖后经 /goldenward/api(状态/捕获/恢复)整文件原子恢复;配套看门狗60秒自愈,升级覆盖零手工。

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@113c2e0b

dsh-golden-ward

Customization golden guardian for DSH hosts. When a frequently-customized file (e.g. the plugin-market web client) gets overwritten by a package upgrade, restore it whole-file from a captured golden copy — no manual re-patching, no reinstalling suites.

Install

dsh plugin add github:<owner>/dsh-golden-ward

Then insert into your profile patch (see cordis.patch.yml) and restart dsh.

Usage

  1. Customize your target file as usual.
  2. Capture the golden copy once: curl -X POST "http://127.0.0.1:<port>/goldenward/api?act=init"
  3. Check any time: curl "http://127.0.0.1:<port>/goldenward/api?act=status"
  4. Restore after an upgrade clobbers it: curl -X POST "http://127.0.0.1:<port>/goldenward/api?act=restore"

Restore is guarded: it refuses when golden or target is missing, or when the golden copy lacks the configured marker string (defaults to golden-ward; set your own marker in config so it matches your customization).

Auto-heal (optional)

Pair with a simple watchdog loop (crontab * * * * * or a while true; sleep 60 shell) that calls act=status and act=restore when hasMarker is false, then restarts dsh. With that in place, an upgrade-overwritten customization heals within ~60 seconds with zero manual work.

Config

- id: golden-ward
  name: "@local/dsh-golden-ward"
  config:
    target: ~/.dsh/profiles/web/node_modules/@dsh-market/plugin/lib/client.js
    goldenDir: ~/.dsh/golden
    marker: golden-ward

Design notes

  • Whole-file restore over anchor re-patching: upgrades change code shape, so patch anchors rot; an intact golden copy does not.
  • init refuses to capture a target that lacks the marker (never save a clobbered file as golden).
  • Restore writes via tmp + rename (atomic on the same filesystem).
—/ 5

No ratings yet

Verified DSH bundle

Commit 113c2e0be1cb

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout