harbor-check-cli:SSH 隧道快速上手
这个 CLI 用于在本地电脑上访问远程服务器上的 Harbor Check 服务。适用于
Harbor Check 只监听服务器 127.0.0.1:8000、不直接暴露到公网的情况。
1. 安装
python -m pip install --upgrade harbor-check-cli
你需要拥有远程服务器的 SSH 账号,并确认 Harbor Check 已在服务器的
127.0.0.1:8000 运行。
2. 建立 SSH 隧道
在本地电脑执行以下命令,并保持这个终端运行:
ssh -N -L 8000:127.0.0.1:8000 YOUR_SERVER_USERNAME@YOUR_SERVER_HOST
这会把本地的 http://127.0.0.1:8000 转发到远程服务器的 8000 端口。
如果本地 8000 端口已被占用,可以换一个本地端口,并在后续命令中统一使用
这个端口。
3. 通过隧道登录
打开第二个终端,执行:
harbor-check login \
--server http://127.0.0.1:8000 \
--username YOUR_SERVER_USERNAME
根据提示输入密码。登录令牌会保存到
~/.config/harbor-check/credentials.json,文件权限为仅当前用户可读写。
4. 使用 CLI
harbor-check tasks
harbor-check folders
harbor-check folder-tasks FOLDER_NAME
harbor-check task USER/FOLDER/TASK_NAME --detail
harbor-check stop USER/FOLDER/TASK_NAME
harbor-check restart USER/FOLDER/TASK_NAME
通过同一条 SSH 隧道上传任务目录:
harbor-check upload ./my-task \
--username YOUR_SERVER_USERNAME \
--server http://127.0.0.1:8000
脚本需要机器可读输出时,把 --json 放在子命令前,例如:
harbor-check --json tasks
常见问题
Connection refused:SSH 隧道已关闭、本地端口不匹配,或服务器上的 Harbor Check 没有监听127.0.0.1:8000。- 返回 HTML 错误页:确认 CLI 使用的是隧道地址
http://127.0.0.1:8000,而不是服务器公网地址。 - 登录失败:确认使用的是 Harbor Check 部署所接受的 SSH/服务器用户名和密码。
Metadata
Release files for harbor-check-cli 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| harbor_check_cli-0.1.15.tar.gz | 6.6 kB | Without provenance | Details for harbor_check_cli-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| harbor_check_cli-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for harbor_check_cli-0.1.15-py3-none-any.whl |
Total release size: 14.1 kB
Release files / harbor_check_cli-0.1.15.tar.gz
| Download URL | harbor_check_cli-0.1.15.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b90e182879df87489464106d5d23014e58386432801de53c2bb1fd635a0e8d5
|
|
BLAKE2b-256 checksum How to use checksums |
4eede2464c4410153e3e6ae31d5ddddc01aafe19ac08f767e00ec86446012461
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / harbor_check_cli-0.1.15-py3-none-any.whl
| Download URL | harbor_check_cli-0.1.15-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bf5e5258a87dc719c4adaa24ba4a1fa2e99c3e27dc668e63b9cd4df7c76bd30
|
|
BLAKE2b-256 checksum How to use checksums |
70154cd46c301629c0dea9822d7fbaf80a4cdc6dc1e4be302274d77f4d492176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for harbor-check-cli 0.1.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.