init: init proj

This commit is contained in:
Kid
2026-07-18 16:48:41 +08:00
commit d975859286
12 changed files with 1204 additions and 0 deletions

12
gen-cert.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# 生成/更新自签名 HTTPS 证书IP 变了就重新跑一次)
cd "$(dirname "$0")"
mkdir -p certs
IP=$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null || echo 127.0.0.1)
echo "为本机 IP = $IP 生成自签名证书..."
openssl req -x509 -newkey rsa:2048 -nodes \
-keyout certs/key.pem -out certs/cert.pem -days 825 \
-subj "/CN=calx-local" \
-addext "subjectAltName=IP:${IP},IP:127.0.0.1,DNS:localhost"
openssl x509 -in certs/cert.pem -outform der -out certs/calx-cert.cer
echo "完成。iOS 请访问 https://${IP}:8443/cert 下载并信任证书。"