返回目录
模型与 MCP 插件

dsh-campus-net

GUANUI/dsh-campus-net

Campus network auto-login for DeepSeek Harness (Windows): status, on-demand login, a local settings page, automatic switch-back from a hotspot, and a three-layer autostart watchdog. Works with any POST-JSON + reply_code portal; no school-specific data.

Stars
0
Forks
0
Issues
0
更新
9 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:GUANUI/dsh-campus-net

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-campus-net

Campus network auto-login for DeepSeek Harness (DSH). Check whether you are online, log in on demand, and optionally run a small background daemon that reconnects after sleep, reboot, or a portal timeout — even when DSH is closed.

Not tied to any school: the portal address, endpoint paths and campus SSIDs are all entered in the settings page. It works with “POST JSON + reply_code” style portals.

Install

dsh plugin --profile web add dsh-campus-net      # from npm
dsh plugin --profile web add github:GUANUI/dsh-campus-net   # from source

Check compatibility first. Only “POST JSON + reply_code” portals are supported. Srun (深澜), Dr.COM and Ruijie use different protocols and are not supported. After installing, enter your portal URL on the settings page and try one login before enabling the daemon.

Works Does not work
Portal answers JSON with reply_code Srun (深澜), Dr.COM, Ruijie
Endpoints getinfo / login / logout / challenge (editable) Portal pages that need a scripted browser jump
Windows 10/11 (Wi-Fi switching, autostart) Automatic Wi-Fi switching on macOS / Linux

Features

  • Status at a glance — online/offline, Wi-Fi SSID, daemon state, last action and last error.
  • On-demand login — one tool call, using credentials encrypted on disk.
  • Local settings page — scan and pick campus Wi-Fi, account/password, portal address, check interval, autostart. Bound to 127.0.0.1 with a per-run token.
  • Multiple campus profiles — save several setups (your university, an internship campus, a second school), each with its own portal, Wi-Fi and credentials; the daemon uses the selected one.
  • Prefers campus Wi-Fi — if the laptop is online through a paid carrier network (chinanet / cmcc / unicom), the daemon switches back only after a scan confirms a configured campus SSID is actually in range; otherwise it leaves the current connection alone. On startup it also sets saved cmcc / unicom profiles to manual connection so Windows does not fall back to them when the campus network is not reachable. Turn it off with the “Prefer campus Wi-Fi” checkbox.
  • First-run guide — on first load the plugin opens the user guide (five steps, how to find the page again, troubleshooting). It only opens once (autoOpenGuide: false disables it). DSH has no install-time popup hook, so this is the closest thing.
  • Optional background daemon — a separate Node process, not a child of DSH, so it keeps running after DSH exits. install also registers a hidden Startup entry so it comes back after reboot.
  • No account lockout — a wrong password is never retried; it stops and reports the portal message.

Requirements

  • DSH >= 0.2.0-rc.1 < 0.3.0
  • Node.js 20+ (DSH bundles one)
  • Windows 10/11 for the full feature set (DPAPI credentials, netsh Wi-Fi switching, Startup autostart). On macOS/Linux the portal login and daemon work, but automatic Wi-Fi switching is skipped and autostart must be configured manually.

Install

From the DSH plugin market: search for dsh-campus-net and install.

Manual (from a checkout):

dsh plugin add link:/absolute/path/to/dsh-campus-net

Restart DSH if the four tools do not appear immediately.

Guide

The plugin opens this guide on first load. You can also run campus_net_setup and click User guide at the top of the settings page.

Setup

  1. Ask DSH to run campus_net_setup. It returns a http://127.0.0.1:<port>/?token=… URL.
  2. In Campus Wi-Fi, press Scan nearby Wi-Fi and tick your campus network (chinanet / cmcc / unicom are paid carrier networks and are never auto-connected).
  3. Fill in your campus account and password, then Save.
  4. Press Login now to verify.
  5. Press Enable autostart (or run campus_net_daemon { "action": "install" }) if you want it to survive reboot.

Scanning needs Windows location permission: Settings → Privacy & security → Location, enable location services and desktop app access. You can also type the SSID manually; login still works without the permission.

With a global proxy or game accelerator running, the portal sees a non-campus source address and login fails with 请重新获取地址! (please obtain the address again). Quit those tools, or add a direct route to the portal IP, before logging in.

The settings link is valid only while the plugin process is alive. Re-run campus_net_setup after restarting DSH.

Multiple campus profiles

The Campus profile card stores several setups side by side — for example your own university and a campus you visit occasionally. Each profile keeps its own portal, Wi-Fi list, usernames and saved credentials; switch with the dropdown, use New to clone the current one, and Rename/Delete to manage them. The daemon always uses the selected profile, and switching applies from the next retry.

Your own portal

Fill in three things on the settings page:

Field Notes
Portal e.g. http://portal.yourschool.edu.cn — the host that serves the login page
Campus Wi-Fi Scan and tick, or type the SSID manually
Endpoint paths Defaults are getinfo / login / logout / challenge; change them only if your portal differs

Success is reply_code === 0. If your portal names the account field differently (e.g. user instead of username), change the field name too.

This plugin does not implement Srun (深澜) or Dr.COM protocols. Please do not list it as supporting them.

Tools

Tool What it does
campus_net_status Online state, SSID, daemon state, last error. quick: true reads cached state only.
campus_net_login Logs in now; tries the configured Wi-Fi first.
campus_net_setup Starts the local settings page and returns its tokenized URL.
campus_net_daemon status / start / stop / install / uninstall / logs.

How it works

  • Online check: only HTTP 204 from the probe URL counts as online. Many campus gateways answer any request with 200 plus a login page, so 200 is deliberately treated as offline.
  • Wi-Fi: netsh wlan connect to the configured SSIDs in order, then re-check the interface.
  • Portal: POST JSON to the login path. If the JSON login fails and auth is auto, it retries once with CHAP (md5(ident_byte + password + challenge_hex)).
  • Accounts: the saved username, then any aliases in usernames. It only tries the next account when the portal says the account does not exist (E012/E027 or io_reply_code 12/27). A wrong password stops immediately.
  • Already online elsewhere (E013/E002/E028): logs out the current session and retries once.
  • Daemon: a single Node process listens on 127.0.0.1:47215 as its single-instance lock. On Windows it is launched through WMI Win32_Process.Create so it is not tied to DSH's job object. A stop.flag file makes it exit within ~2 seconds.

Data and privacy

Everything stays on your machine. There is no telemetry and no third-party service.

Path Contents
%LOCALAPPDATA%\dsh-campus-net\config.json Portal, SSIDs, interval, usernames
%LOCALAPPDATA%\dsh-campus-net\cred.dat Encrypted username + password
%LOCALAPPDATA%\dsh-campus-net\campus-net.log Append-only log (rotated at 512 KB)
%LOCALAPPDATA%\dsh-campus-net\state.json Last check/login result, current account, PID

On Windows the credentials are encrypted with DPAPI (CurrentUser). On other platforms they use AES-256-GCM with a 0600 key file. The password is never written to logs, tool output, or the settings page. It is passed to PowerShell through an environment variable for the DPAPI call, so it does not appear on a command line.

Set DSH_CAMPUS_NET_HOME to use a different data directory.

Uninstall

  1. campus_net_daemon { "action": "uninstall" } — removes autostart and stops the daemon.
  2. Remove the plugin in DSH.
  3. Optionally delete %LOCALAPPDATA%\dsh-campus-net.

Troubleshooting

  • “没有保存账号密码” — open campus_net_setup and save the account first.
  • Password error — the plugin will not retry. Fix the password in the settings page; repeated failures can lock some portals.
  • Portal changed — update the portal URL/paths via the custom JSON mode, or open an issue.
  • Daemon not running after reboot — Windows only; check that autostart is enabled and that the Startup entry dsh-campus-net.vbs exists.
  • Port 47215 already in use — another copy is running, or change lockPort in config.json.
  • DSH closed and network dropped — install the daemon; the plugin itself only runs while DSH is open.

Development

node test/smoke.mjs

The smoke test uses a temporary data directory and covers config normalization, tool shapes, DPAPI round-trip, and the settings server (including token rejection).

License

MIT

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。