{"id":49394815,"url":"https://github.com/wangwindow/campus-network-autologin","last_synced_at":"2026-04-28T15:03:39.298Z","repository":{"id":353017189,"uuid":"1217617706","full_name":"WangWindow/campus-network-autologin","owner":"WangWindow","description":"Lightweight Dr.COM campus network auto-login tool written in Rust.","archived":false,"fork":false,"pushed_at":"2026-04-22T04:26:57.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T06:32:25.185Z","etag":null,"topics":["campus-network","login","rust-tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WangWindow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T04:04:37.000Z","updated_at":"2026-04-22T04:27:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/WangWindow/campus-network-autologin","commit_stats":null,"previous_names":["wangwindow/campus-network-autologin"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/WangWindow/campus-network-autologin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWindow%2Fcampus-network-autologin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWindow%2Fcampus-network-autologin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWindow%2Fcampus-network-autologin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWindow%2Fcampus-network-autologin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WangWindow","download_url":"https://codeload.github.com/WangWindow/campus-network-autologin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WangWindow%2Fcampus-network-autologin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32385943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["campus-network","login","rust-tui"],"created_at":"2026-04-28T15:03:17.671Z","updated_at":"2026-04-28T15:03:39.287Z","avatar_url":"https://github.com/WangWindow.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# campus-network-autologin\r\n\r\nLightweight Dr.COM campus network auto-login tool written in Rust.\r\n\r\n## What it does\r\n\r\n- Saves credentials to `campus-network/config.toml` under the platform config directory\r\n  - Linux: `~/.config/campus-network/config.toml`\r\n  - Windows: `%APPDATA%\\campus-network\\config.toml`\r\n- Opens a ratatui-based terminal setup screen when run without arguments\r\n- Supports CLI-based config updates when run with arguments\r\n- Reproduces the observed HFUT Xuancheng Dr.COM password transform\r\n- Only attempts campus authentication when the configured campus gateway looks reachable\r\n- Detects captive-portal redirects and re-authenticates automatically\r\n- Sleeps between checks to keep CPU usage negligible once the network is online\r\n- Writes daemon logs to `campus-network/daemon.log` under the platform config directory\r\n\r\n## Commands\r\n\r\n```bash\r\n# Interactive setup (no arguments)\r\ncampus-network-autologin\r\n\r\n# Save config from the CLI\r\ncampus-network-autologin config set \\\r\n  --username 2022xxxxxx \\\r\n  --password your-password \\\r\n  --portal-url http://172.18.3.3/0.htm \\\r\n  --probe-url http://www.baidu.com/ \\\r\n  --campus-gateways 172.18.3.3,172.18.2.2\r\n\r\n# Show the redacted config\r\ncampus-network-autologin config show\r\n\r\n# Submit one login attempt and verify internet access\r\ncampus-network-autologin login\r\n\r\n# Check whether the network is online or captive\r\ncampus-network-autologin status\r\n\r\n# Run the low-overhead monitor\r\ncampus-network-autologin run\r\n\r\n# Print the config path\r\ncampus-network-autologin paths\r\n\r\n# Install/remove user autostart entry for this executable\r\ncampus-network-autologin autostart install\r\ncampus-network-autologin autostart remove\r\n```\r\n\r\n## Config file\r\n\r\n```toml\r\n[auth]\r\nusername = \"2022xxxxxx\"\r\npassword = \"plain-text-for-now\"\r\nportal_url = \"http://172.18.3.3/0.htm\"\r\n\r\n[detect]\r\nprobe_url = \"http://www.baidu.com/\"\r\nrequest_timeout_secs = 8\r\n\r\n[daemon]\r\nonline_check_interval_secs = 300\r\noffline_check_interval_secs = 15\r\n\r\n[campus]\r\nipv4_cidrs = []\r\ngateway_hosts = [\"172.18.3.3\", \"172.18.2.2\"]\r\n```\r\n\r\nThe login form is submitted as:\r\n\r\n```text\r\nDDDDD=\u003cusername\u003e\r\nupass=\u003cmd5(\"2\" + password + \"12345678\") + \"123456782\"\u003e\r\nR1=0\r\nR2=1\r\npara=00\r\n0MKKey=123456\r\nv6ip=\r\n```\r\n\r\n## TUI controls\r\n\r\n- `Tab` / `Shift+Tab` / mouse wheel: move between fields and buttons\r\n- `Enter`: jump to the next field or activate the selected button\r\n- `Ctrl+S`: save config\r\n- `Ctrl+T`: save config and test login immediately\r\n- `Ctrl+A`: toggle current-user autostart\r\n- `F2`: show or hide the password\r\n- `?`: show or hide shortcut hints (hidden by default)\r\n- `Esc`: quit without saving further changes\r\n\r\nUse the `Autostart: ON/OFF` button in TUI to toggle current-user autostart.\r\nYou can toggle it by:\r\n- selecting that button and pressing `Enter` or `Space`\r\n- clicking it with the mouse\r\n- pressing `Ctrl+A`\r\n\r\nMouse support:\r\n- click any input field to focus and place the cursor\r\n- click any button to trigger its action\r\n- drag with left mouse button inside an input field to select text\r\n\r\n## Campus network detection\r\n\r\nBefore it attempts login, the program checks whether at least one configured campus gateway is reachable.\r\n\r\n- `gateway_hosts` is the main signal and should include your wired/wireless campus gateways\r\n- `ipv4_cidrs` is optional; when filled, it only adds context and does not block login by itself\r\n\r\nWith the current defaults, the daemon stays idle off-campus and only tries to authenticate when a campus gateway responds.\r\n\r\n## Autostart\r\n\r\nInstall autostart for the current user:\r\n\r\n```bash\r\ncampus-network-autologin autostart install\r\n```\r\n\r\nThis writes a platform-specific startup file that points to the current executable absolute path:\r\n\r\n- Windows: Task Scheduler entry `campus-network-autologin` (runs hidden at user logon)\r\n- Linux: `~/.config/systemd/user/campus-network-autologin.service`\r\n- macOS: `~/Library/LaunchAgents/com.campus-network-autologin.plist`\r\n\r\nRemove it:\r\n\r\n```bash\r\ncampus-network-autologin autostart remove\r\n```\r\n\r\n## Scope\r\n\r\nThis version only covers:\r\n\r\n- automatic login\r\n- captive-portal detection\r\n- connectivity verification\r\n\r\nIt does not implement self-service account queries, logout, or password management.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwindow%2Fcampus-network-autologin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangwindow%2Fcampus-network-autologin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwindow%2Fcampus-network-autologin/lists"}