Skip to main content

hipp-https-agent

在需要证书的机器上申请和续期 Let’s Encrypt 证书,并把状态上报到服务端。不需要远程登录这台机器。

服务端地址是 https://hipp.site/cert/。程序会自己接上 /api/...,不要再加接口路径。末尾斜杠可以留着。

安装

在证书机器上用 root 安装。申请证书、写 /etc/nginx/certs 和重新加载 Nginx 都需要 root,常驻进程也用这个用户。

sudo pip install hipp-https-agent

安装后得到命令 hipp-agent。包在 PyPI 上的名字是 hipp-https-agent。

先装好 certbot,并准备校验目录:

sudo apt-get install -y certbot
sudo mkdir -p /var/www/acme

登记

先在 https://hipp.site/cert/ 用手机号登录,打开「证书端令牌」,按页面上的安装和登记范例操作。证书端名称要填这台机器的 hostname。

再用 root 登记,这样配置会写到 root 的家目录,和后面的常驻进程是同一个用户:

sudo hipp-agent register -s https://hipp.site/cert/ -t <令牌>

-s 是服务端地址。-t 是「证书端令牌」页里的令牌。

配置在 /root/.config/hipp-agent/config.json。控制台里与本机 hostname 同名的域名会一并写入。还没有域名时也可以先登记,补上之后常驻进程会自动取回。

后台常驻

hipp-agent run 是常驻循环:每轮向服务端取配置,按申请、生效、监听推进,并上报心跳。它不会自己退出。直接在终端里跑时,关掉终端进程就没了。

用 systemd 把它留在后台,断线、重启机器之后也会再拉起来:

sudo tee /etc/systemd/system/hipp-agent.service >/dev/null <<'EOF'
[Unit]
Description=hipp certificate agent
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/hipp-agent --config /root/.config/hipp-agent/config.json run
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now hipp-agent

若 command -v hipp-agent 不是 /usr/local/bin/hipp-agent,先改单元里的 ExecStart 再执行。仓库里的 deploy/hipp-agent.service 与上面这段相同,给仍从源码安装的人用。

查看是否在跑:

systemctl status hipp-agent
journalctl -u hipp-agent -n 50 --no-pager

停掉或重新拉起:

sudo systemctl stop hipp-agent
sudo systemctl restart hipp-agent

控制台「证书状态」里,最后上报在 3 分钟内为程序在运行。

Metadata

Release files for hipp-https-agent 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hipp-https-agent 0.2.0
File Size Uploaded Provenance Actions
hipp_https_agent-0.2.0.tar.gz 18.7 kB Without provenance Details for hipp_https_agent-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hipp-https-agent 0.2.0
File Interpreter ABI Platform Actions
hipp_https_agent-0.2.0-py3-none-any.whl Python 3 none any Details for hipp_https_agent-0.2.0-py3-none-any.whl

Total release size: 41.4 kB

Release files / hipp_https_agent-0.2.0.tar.gz

Download URL hipp_https_agent-0.2.0.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec40ed02de6b91d2f669abc89d8a531adbb69ba333e6e3e0915e831da5a190ff
BLAKE2b-256 checksum
How to use checksums
53c28347fc3871d021003655ab932e6016f01269976ca06e447ca7121d364149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / hipp_https_agent-0.2.0-py3-none-any.whl

Download URL hipp_https_agent-0.2.0-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6af17ee9a837476edeb1790fa1ed233b0f9e5a7b8822d3b00a1c10db27b580c2
BLAKE2b-256 checksum
How to use checksums
7550705dd80f4ffbb6714a0756a71556ddf6dfa5494358da1d99f5e49694f7b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for hipp-https-agent 0.2.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page