This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Docker Registry 代理 Worker | |
* | |
* 功能说明: | |
* 1. 根路径请求重定向到 Docker 官网 | |
* 2. 针对 /v2/ 请求返回带有 WWW-Authenticate 挑战的响应, | |
* 引导 Docker 客户端获取认证 Token。 | |
* 3. 针对 /auth/token 请求,从 Docker 授权服务获取认证 Token。 | |
* 4. 对于其他请求(如拉取镜像配置或镜像数据),转发到上游 Docker Registry, | |
* 并在必要时对请求路径进行调整(例如缺失默认命名空间时自动补全 "library")。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
# 定义用户代理,用于模拟浏览器的请求头 | |
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36" | |
# 定义登录和注销的URL | |
LOGIN_URL = "http://192.168.1.1/boaform/admin/formLogin" | |
LOGOUT_URL = "http://192.168.1.1/boaform/admin/formLogout" | |
# 遍历尝试的密码,从0到9999 |