module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: May 18, 2022
License: MIT
Opens a new window with license information.
README
¶
SrunLogin
一个简单的南昌大学校园网自动登录器的实现。
使用说明
Windows
配置文件说明
account:
isp: <isp> # 运营商名称,可设置为 ncu、cmcc、unicom 或者 ndcard。具体参考“运营商名称说明”。
username: <username> # 帐号,如:6109110000。
password: <password> # 密码,如:abc123456。
app:
solution: cdp # 使用 Chrome DP。
test-url: http://www.baidu.com # 用于被校园网重定向到登录页面,请不要设置为能够在不登录的情况下还能解析的域名。
timeout: 60s # 每次尝试登录的超时时间。
retry: 3 # 最小有效值为 1。
cdp:
flags: # 设置参考 https://pkg.go.dev/github.com/chromedp/chromedp。
headless: true # 设置为 true 则不打开浏览器窗口。
hide-scrollbars: true
mute-audio: true
no-default-browser-check: true # 可能需要设置 headless 为 true 才有效,如果打开窗口运行,可能会在桌面添加图标。
运营商名称说明
运营商 |
account.isp |
校园网 |
ncu |
中国移动 |
cmcc |
中国联通 |
unicom |
中国电信 |
ndcard |
使用环境变量覆盖配置
-
环境变量开头统一为 SRUN
。
-
环境变量中节点间的分隔符为 _
。
-
例子:
配置名 |
环境变量 |
account.isp |
SRUN_ACCOUNT_ISP |
account.username |
SRUN_ACCOUNT_USERNAME |
account.password |
SRUN_ACCOUNT_PASSWORD |
其他配置文件路径
优先级从高到底:
Directories
¶
Click to show internal directories.
Click to hide internal directories.