Skip to content

Commit 64b1402

Browse files
committed
update
1 parent 510ea47 commit 64b1402

File tree

6 files changed

+104
-7
lines changed

6 files changed

+104
-7
lines changed

.github/workflows/jekyll-gh-pages.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
key: ${{ runner.os }}-node-modules
3939

4040

41-
- uses: actions/setup-node@v3
41+
- uses: actions/setup-node@v4
4242
with:
4343
node-version: 18
4444

@@ -54,7 +54,7 @@ jobs:
5454
destination: ./_site
5555

5656
- name: Upload artifact
57-
uses: actions/upload-pages-artifact@v1
57+
uses: actions/upload-pages-artifact@v3
5858

5959
# Deployment job
6060
deploy:
@@ -66,4 +66,4 @@ jobs:
6666
steps:
6767
- name: Deploy to GitHub Pages
6868
id: deployment
69-
uses: actions/deploy-pages@v1
69+
uses: actions/deploy-pages@v4

.github/workflows/weekly-report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
run: |
2626
echo "OK=false" >> "$GITHUB_OUTPUT"
2727
28-
c=$(git rev-list --all --since '1 week ago' --reverse | head -n1 || true)
28+
c=$(git rev-list --all --since '168 hours ago' --reverse | head -n1 || true)
2929
if [ -z "${c:-}" ]; then
3030
echo "[Warn] No any changed"
3131
exit 0
3232
fi
3333
34-
git --no-pager diff --no-color -U0 "$c" HEAD -- '*.md' ':!./_docs' |
34+
git --no-pager diff --no-color -U0 "$c"^ HEAD -- '*.md' ':!./_docs' |
3535
grep -v -E '^(index|new file mode|deleted file mode|\-\-\-) ' |
3636
sed -E -e 's|^diff --git a/(.+) b/.+|```\n\n### \1\n|g' -e 's/^\+\+\+.+/```diff/' |
3737
tail +2 > _report

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include ./makefile-utils/*.mk
22
.DEFAULT_GOAL := help
33

4-
GH_PAGE_IMAGE=adoyle/gh-pages:v231.1
4+
GH_PAGE_IMAGE=ghcr.io/adoyle-h/jekyll-build-pages:v1.0.7-ad-7
55

66
# 本地编辑与浏览(不用先执行 make build,会自动构建,支持热更新)
77
.PHONY: serve
@@ -41,7 +41,7 @@ http:
4141
.PHONY: debug-gh-pages
4242
debug-gh-pages:
4343
docker run -it --rm -p 4000:4000 -v "${PWD}:/src/site" \
44-
--entrypoint ash \
44+
--entrypoint bash -w /src/site \
4545
${GH_PAGE_IMAGE}
4646

4747
.PHONY: clean-index-md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Connection closed by UNKNOWN port 65535
2+
3+
git fetch 或者 git push 时看到这个错误。
4+
5+
## 排查思路
6+
7+
`ssh -vvv -T [email protected]` 查看与 github.com 的 ssh 链接过程具体有什么问题。
8+
9+
比如我的案例是:
10+
11+
```sh
12+
debug3: channel_clear_timeouts: clearing
13+
debug1: Executing proxy command: exec nc -x 127.0.0.1:7890 github.com 22
14+
debug1: identity file /Users/adoyle/.ssh/id_rsa type 0
15+
debug1: identity file /Users/adoyle/.ssh/id_rsa-cert type -1
16+
debug1: identity file /Users/adoyle/.ssh/id_ecdsa type -1
17+
debug1: identity file /Users/adoyle/.ssh/id_ecdsa-cert type -1
18+
debug1: identity file /Users/adoyle/.ssh/id_ecdsa_sk type -1
19+
debug1: identity file /Users/adoyle/.ssh/id_ecdsa_sk-cert type -1
20+
debug1: identity file /Users/adoyle/.ssh/id_ed25519 type 3
21+
debug1: identity file /Users/adoyle/.ssh/id_ed25519-cert type -1
22+
debug1: identity file /Users/adoyle/.ssh/id_ed25519_sk type -1
23+
debug1: identity file /Users/adoyle/.ssh/id_ed25519_sk-cert type -1
24+
debug1: identity file /Users/adoyle/.ssh/id_xmss type -1
25+
debug1: identity file /Users/adoyle/.ssh/id_xmss-cert type -1
26+
debug1: identity file /Users/adoyle/.ssh/id_dsa type -1
27+
debug1: identity file /Users/adoyle/.ssh/id_dsa-cert type -1
28+
debug1: Local version string SSH-2.0-OpenSSH_9.7
29+
30+
kex_exchange_identification: Connection closed by remote host
31+
Connection closed by UNKNOWN port 65535
32+
```
33+
34+
`debug1: Executing proxy command: exec nc -x 127.0.0.1:7890 github.com 22` 表示我的 ssh 走了代理。
35+
36+
`kex_exchange_identification: Connection closed by remote host` 说明问题发生在 [kex_exchange_identification](https://github.com/openssh/openssh-portable/blob/aee54878255d71bf93aa6e91bbd4eb1825c0d1b9/kex.c#L1237)
37+
38+
目测是 GFW 或者网络代理商的缘故,ssh 传输被中断了。
39+
40+
## 解决方法
41+
42+
默认 ssh 用的端口是 22。可以采用 [SSH over the HTTPS port](https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port) 的方式,用 HTTPS 端口传输 SSH 协议。
43+
44+
修改 ~/.ssh/config,增加这一段:
45+
46+
```
47+
Host github.com
48+
Hostname ssh.github.com
49+
Port 443
50+
User git
51+
```

others/aliyun-cli.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# aliyun cli
2+
3+
https://github.com/aliyun/aliyun-cli/blob/master/README-CN.md
4+
5+
使用准备:先执行 `aliyun configure` 会生成 ./.aliyun/config.json
6+
7+
查询 API 文档:https://api.aliyun.com/
8+
9+
## -FILE 隐藏参数
10+
11+
当使用 `aliyun cdn BatchSetCdnDomainServerCertificate` 这个命令上传证书,根据官方文档,证书内容居然是整个作为字符串传参的。震惊。
12+
13+
根据[这个 issue](https://github.com/aliyun/aliyun-cli/issues/298) 发现,竟然还有一个隐藏参数。官方文档里居然一点都没提到。再次震惊。
14+
15+
我使用 [lego](https://github.com/go-acme/lego) 来生成证书,再配合 `--run-hook` 以及 `--renew-hook` 参数即可在生成证书后部署到阿里云。具体例子如下:
16+
17+
```sh
18+
#!/usr/bin/env bash
19+
# vim: ft=bash
20+
21+
set -o errexit -o nounset -o pipefail -o errtrace
22+
(shopt -p inherit_errexit &>/dev/null) && shopt -s inherit_errexit
23+
24+
PUB=~/.lego/certificates/$1.crt
25+
PRI=~/.lego/certificates/$1.key
26+
27+
args=(
28+
--region cn-hangzhou
29+
--DomainName "$2"
30+
--SSLProtocol on
31+
--CertType upload
32+
--SSLPub-FILE "$PUB"
33+
--SSLPri-FILE "$PRI"
34+
)
35+
36+
aliyun cdn BatchSetCdnDomainServerCertificate "${args[@]}"
37+
```
38+
39+
```sh
40+
lego --dns alidns -d '*.xxxx.com' -d 'xxxx.com' --email '@gmail.com' \
41+
renew \
42+
--renew-hook "./cert_hook.sh _.xxxx.com cdn.xxxx.com,public.xxxx.com"
43+
```

others/umami-is-blocked.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# umami.is 网站被反广告规则屏蔽
2+
3+
[AdGuard Tracking Protection filter — third-party trackers](https://raw.githubusercontent.com/AdguardTeam/AdguardFilters/master/SpywareFilter/sections/tracking_servers.txt) 以及 https://github.com/Loyalsoldier/clash-rules 的 reject.txt,以及 https://github.com/Silentely/AdBlock-Acceleration 的 AdGuard DNS Filter 文件里。都把 umami.is 屏蔽了。

0 commit comments

Comments
 (0)