{"id":14747650,"url":"https://github.com/zu1k/srun","last_synced_at":"2025-04-12T14:56:14.487Z","repository":{"id":36970571,"uuid":"423863161","full_name":"zu1k/srun","owner":"zu1k","description":"srun 深澜认证登录，超轻量、多平台，支持多拨、自动探测IP、指定网卡","archived":false,"fork":false,"pushed_at":"2025-02-03T18:42:41.000Z","size":178,"stargazers_count":262,"open_issues_count":1,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T15:09:26.427Z","etag":null,"topics":["cli","rust","srun","srun-client","srun3000","srun3k","srun4k"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zu1k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"custom":["https://zu1k.com/donate/"]}},"created_at":"2021-11-02T13:52:39.000Z","updated_at":"2025-03-26T06:40:29.000Z","dependencies_parsed_at":"2022-07-29T00:48:01.684Z","dependency_job_id":"368ab589-d653-42b6-a1a9-ca9487c25cfe","html_url":"https://github.com/zu1k/srun","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zu1k%2Fsrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zu1k%2Fsrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zu1k%2Fsrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zu1k%2Fsrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zu1k","download_url":"https://codeload.github.com/zu1k/srun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586244,"owners_count":21128996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","rust","srun","srun-client","srun3000","srun3k","srun4k"],"created_at":"2024-09-14T19:01:45.644Z","updated_at":"2025-04-12T14:56:14.464Z","avatar_url":"https://github.com/zu1k.png","language":"Rust","readme":"# srun\n\n[![GitHub stars](https://img.shields.io/github/stars/zu1k/srun)](https://github.com/zu1k/srun/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/zu1k/srun)](https://github.com/zu1k/srun/network)\n[![GitHub issues](https://img.shields.io/github/issues/zu1k/srun)](https://github.com/zu1k/srun/issues)\n[![Release](https://img.shields.io/github/release/zu1k/srun)](https://github.com/zu1k/srun/releases)\n[![Build](https://github.com/zu1k/srun/actions/workflows/build-test.yml/badge.svg)](https://github.com/zu1k/srun/actions/workflows/build-test.yml)\n[![GitHub license](https://img.shields.io/github/license/zu1k/srun)](https://github.com/zu1k/srun/blob/master/LICENSE)\n\nSrun authentication system login tools. [compatible versions](https://github.com/zu1k/srun/discussions/8)\n\n## Features\n\n- Support both command line and config file\n- Multiple IP acquisition methods\n  - User Specified\n  - Auto detect\n  - User select\n  - Query by NIC name\n- Support strict bind\n- Support multiple users login, suitable for multi-dial\n- Support multi CPU architecture\n- Support multi system\n\n## Usage\n\n[Pre-built binaries](https://github.com/zu1k/srun/releases)\n\n### CMD mode\n\n```\n./srun login -u USERNAME -p PASSWORD -i IP [-s AUTH_SERVER]\n```\n\n`AUTH_SERVER` should contain protocols, e.g. `http://10.0.0.1`.\n\n#### Which IP to be authorized?\n\nsrun support three methods of specifying IP:\n\n- use `-i IP` to specify ip\n- use `-d` to auto detect ip\n- use `--select-ip` to select ip\n\n##### specify IP\n\nYou need to check the IP address of each network interfaces in advance and choose the correct IP to be authorized.\n\n##### detect IP\n\nsrun support automatic IP detection, it determines the IP address from the information returned by the authentication server.\n\nThis is useful in cases where you only have one IP address to authorize.\n\nIf you are multidialing and have multiple legitimate IPs at the same time, you need to authorize multiple IPs at the same time, this method will not authorize all IPs properly.\n\n##### select IP\n\nThis method is similar to the first method, except that it saves you the trouble of manually querying all the IPs.\n\nsrun will query all the legitimate IPs in advance and then print a list of IPs for you to choose from.\n\n```sh\n$ ./srun login -u USERNAME -p PASSWORD --select-ip\nPlease select your IP:\n    1. 192.168.226.5\n    2. 10.27.196.218\n    3. 172.16.150.1\n    4. 192.168.128.1\n    5. 198.10.0.1\n2\nyou choose 10.27.196.218\n...\n```\n\nPlease note that when your computer has only one IP that can be authorized, we will simply omit the selection process and use this IP.\n\n### Using a Config\n\nUsually, it is sufficient to specify the information directly using command line parameters.\n\nIn order to meet the needs of multi-dial users, srun support reading multiple user information from a config file.\n\n```\n./srun login -c config.json\n```\n\nconfig file template\n\n```json\n{\n    \"server\": \"http://10.0.0.1\",\n    \"strict_bind\": false,\n    \"double_stack\": false,\n    \"retry_delay\": 1000,\n    \"retry_times\": 3,\n    \"n\": 200,\n    \"type\": 1,\n    \"acid\": 12,\n    \"os\": \"Windows\",\n    \"name\": \"Windows 98\",\n    \"users\": [\n        {\n            \"username\": \"username1\",\n            \"password\": \"password1\",\n            \"ip\": \"10.1.2.3\"\n        },\n        {\n            \"username\": \"username2@cmcc\",\n            \"password\": \"password2\",\n            \"if_name\": \"macvlan1\"\n        }\n    ]\n}\n```\n\nAs you can see, we support `ip` or `if_name`.\n\nIf your IP will not change, you can use `ip` to specify directly.\n\nBut for multi-dial, IP may be automatically assigned by DHCP and may change, at this time we suggest to use `if_name` to specify the corresponding NIC name, we will automatically query the IP under that NIC as the IP to be authorized.\n\nOn windows, the NIC name should be like `{93123211-9629-4E04-82F0-EA2E4F221468}`, use `--select-ip` to see.\n\n### Operator selection\n\nSome colleges support network operator selection, which implemented by append the operator code to the username.\n\nOperator code:\n\n- 中国电信: [`chinanet`, `ctcc`] \n- 中国移动: [`cmcc`] \n- 中国联通: [`unicom`, `cucc`]\n- 校园网: [`xn`] \n\nFor example, if you choose `cmcc`, just append `@cmcc` to your username, like `202112345@cmcc`.\n\nThis code needs to be confirmed by capturing packets.\n\n### TLS support\n\nTo keep the binary as small as possible, the pre-compiled binary remove the non-essential `tls` support\n\nIf your authentication system uses `https`, You need to compile it yourself with feature `tls` enabled.\n\n```sh\ncargo build --features \"tls\" --release\n```\n\n## License\n\n**srun** © [zu1k](https://github.com/zu1k), Released under the [GPL-3.0](./LICENSE) License.\u003cbr\u003e\n","funding_links":["https://zu1k.com/donate/"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzu1k%2Fsrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzu1k%2Fsrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzu1k%2Fsrun/lists"}