{"id":16505698,"url":"https://github.com/johnnychen94/ecnu-net-login","last_synced_at":"2025-03-23T13:32:09.251Z","repository":{"id":47599764,"uuid":"260205121","full_name":"johnnychen94/ecnu-net-login","owner":"johnnychen94","description":"华东师范大学 校园网网关一键登录","archived":false,"fork":false,"pushed_at":"2022-11-20T14:58:10.000Z","size":20,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T20:49:20.837Z","etag":null,"topics":["ecnu","gateway"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnnychen94.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}},"created_at":"2020-04-30T12:26:20.000Z","updated_at":"2024-12-24T06:22:32.000Z","dependencies_parsed_at":"2023-01-22T16:15:17.995Z","dependency_job_id":null,"html_url":"https://github.com/johnnychen94/ecnu-net-login","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnychen94%2Fecnu-net-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnychen94%2Fecnu-net-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnychen94%2Fecnu-net-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnnychen94%2Fecnu-net-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnnychen94","download_url":"https://codeload.github.com/johnnychen94/ecnu-net-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245108271,"owners_count":20562018,"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":["ecnu","gateway"],"created_at":"2024-10-11T15:12:54.719Z","updated_at":"2025-03-23T13:32:08.906Z","avatar_url":"https://github.com/johnnychen94.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ECNU Internet Login/Logout\n命令行登陆及注销华东师范大学网络验证系统 \u003chttps://login.ecnu.edu.cn\u003e\n\nECNU 内网及外网各提供一个版本，根据需要使用：\n\n* `Gitlab@LFLab.ECNU`: https://gitlab.lflab.cn/lflab/ecnu-net-login\n* `Github`: https://github.com/johnnychen94/ecnu-net-login\n\n注: 当前版本因为网络测试的原因可能会出现 实际上连接上但报错的情况\n\n# 背景\n\n* 一个ID(学号/工号)同时只能让五台设备连接外网，如果有第六台设备联网时，最先连接的那一台设备会被强制断网\n* 并非所有设备都需要一直连外网\n* 当某台设备一段时间没有网络流量的时候，校园网网关会断开该设备与外网的连接\n\n\n# 安装\n\n```bash\n# bash\ngit clone https://gitlab.lflab.cn/lflab/ecnu-net-login.git\ncp ecnu-net-login/ecnu_net.py ~/.local/bin/ecnu_net\nchmod +x ~/.local/bin/ecnu_net\n```\n\n# 使用\n\n第一次使用会记录学号与密码（也可以不存储），后面则可以自动连接\n\n* 帮助: `ecnu_net`, `ecnu_net -h`\n* 联网: `ecnu_net --login`\n* 断网重连: `ecnu_net --login --daemon` （需要保存账号密码）\n* 断网: `ecnu_net --logout`\n* 更新参数: `ecnu_net --update`\n\n## 后台运行 daemon mode\n\n`nohup ecnu_net --login --verbose --daemon \u003e\u003e ecnu_net.log 2\u003e\u00261 \u0026`\n\n当然也可以用 tmux\n\n或者利用systemctl部署:\n\n```bash\n# \"安装\" ecnu_net\ngit clone https://gitlab.lflab.cn/lflab/ecnu-net-login.git\ncp ecnu-net-login/ecnu_net.py /usr/local/bin/ecnu_net\nchmod a+x /usr/local/bin/ecnu_net\n\n# 部署服务\ncp ecnu-net-login/ecnu_net.service /lib/systemd/system/ecnu_net.service\n\n# 开机自启动\nsystemctl enable ecnu_net\n\n# 把账号密码写入配置\necnu_net --update\n# 开启服务\nsystemctl start ecnu_net\n```\n\n# TODO\n\n- [ ] 更快的检查网络开断的工具 (多线程)\n- [ ] register to pypi?\n\n# F.A.Q\n\n* 密码**明文**存储在`~/.config/ecnu_net/config`下，请确保其他人没有对此的权限\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnychen94%2Fecnu-net-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnychen94%2Fecnu-net-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnychen94%2Fecnu-net-login/lists"}