update svg

This commit is contained in:
Gloridust
2026-05-31 12:50:07 +08:00
Unverified
parent 17ba168764
commit d581a49a90
6 changed files with 43 additions and 12 deletions
+36 -2
View File
@@ -118,7 +118,7 @@ docker volume ls | grep woc # 看所有微信实例的数据卷
**方式 A · 本地自构建(官方尚未发布镜像时用这个)**
```bash
git clone <this-repo> WechatOnCloud
git clone https://github.com/Gloridust/WechatOnCloud.git WechatOnCloud
cd WechatOnCloud
cp .env.example .env # 至少改掉默认密码 WOC_PASSWORD
./scripts/build-local.sh # 构建面板 + 微信实例镜像,打成 compose 用的同名标签
@@ -128,7 +128,7 @@ docker compose up -d # compose 默认优先用本地镜像,不会
**方式 B · 拉取官方镜像(已发布到 GHCR 后)**
```bash
git clone <this-repo> WechatOnCloud
git clone https://github.com/Gloridust/WechatOnCloud.git WechatOnCloud
cd WechatOnCloud
cp .env.example .env # 至少改掉默认密码 WOC_PASSWORD
docker compose up -d # 直接从 GHCR 拉取
@@ -182,13 +182,47 @@ docker compose up -d # 直接从 GHCR 拉取
## 发布到 GHCR
两种方式任选其一。
### 方式 A · GitHub Actions(推荐)
仓库自带 GitHub Actions[.github/workflows/release.yml](.github/workflows/release.yml)),在你**推送 `vX.Y.Z` 标签或发布 Release** 时,自动构建多架构(amd64+arm64)镜像并推到 GHCR
```bash
git tag v1.0.0
git push origin v1.0.0 # 触发 Actions,产出 ghcr.io/<owner>/woc-panel:1.0.0 等标签
# 或在 GitHub 上 Publish 一个 Release(会额外打 latest):
gh release create v1.0.0 --title v1.0.0 --notes "..."
```
> 注意:单纯 push tag 只产出 `X.Y.Z / X.Y / X`**不会更新 `latest`**;要更新 `latest` 请改用 **发布 Release** 或在 Actions 里手动 `workflow_dispatch`。
### 方式 B · 本机 buildx 手动构建并推送(不走 Actions)
适合想立刻出包、或不依赖 CI 的场景。需要 Docker BuildxDocker Desktop 自带;纯 Linux 跨架构需先装 QEMU:`docker run --privileged --rm tonistiigi/binfmt --install all`)。
```bash
# 1) 登录 GHCRPAT 需 write:packages 权限)
echo <YOUR_GITHUB_PAT> | docker login ghcr.io -u <github 用户名> --password-stdin
# 2) 首次创建并启用多架构构建器(已建过改用 docker buildx use woc
docker buildx create --name woc --use
# 3) 构建并推送两个镜像(amd64 + arm64)。VER 与 git tag 保持一致(不带 v)
VER=1.0.1
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/gloridust/woc-panel:$VER -t ghcr.io/gloridust/woc-panel:latest \
--push ./panel
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/gloridust/wechat-on-cloud:$VER -t ghcr.io/gloridust/wechat-on-cloud:latest \
--push ./docker
```
> 把 `gloridust` 换成你的 GHCR 命名空间(与 `docker-compose.yml` / `WOC_IMAGE_PREFIX` 一致)。
> 只想本机自用、不推 GHCR,用 [`./scripts/build-local.sh`](scripts/build-local.sh) 构建本机架构单架构镜像即可。
### 发布后:把包设为公开
首次发布后还需把 GHCR 包设为公开,否则别人 `docker compose up -d` 会报 `denied`
1. 打开 GitHub → 你的头像 → **Packages** → 分别进入 `woc-panel``wechat-on-cloud`
+2 -3
View File
@@ -7,9 +7,8 @@
</defs>
<rect width="100" height="100" rx="23" fill="url(#bg)"/>
<rect x="3.5" y="3.5" width="93" height="93" rx="20" fill="none" stroke="#ffffff" stroke-opacity="0.18" stroke-width="2"/>
<circle cx="22" cy="36" r="3.4" fill="#ffffff" fill-opacity="0.92"/>
<g fill="none" stroke="#ffffff" stroke-width="7.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M34 30 L48 44 L34 58"/>
<path d="M56 60 L72 60"/>
<path d="M28 24 L42 38 L28 52"/>
<path d="M50 54 L66 54"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

+5 -7
View File
@@ -56,15 +56,14 @@ function makePng(size) {
const stroke = (7.5 / 2) * s; // 笔画半宽
// 提示符坐标(基于 100 视图)
const chevron = [
[34, 30],
[48, 44],
[34, 58],
[28, 24],
[42, 38],
[28, 52],
].map(([x, y]) => [x * s, y * s]);
const underline = [
[56, 60],
[72, 60],
[50, 54],
[66, 54],
].map(([x, y]) => [x * s, y * s]);
const dot = [22 * s, 36 * s, 3.4 * s]; // cx, cy, r
const inRounded = (x, y) => {
const r = radius;
@@ -93,7 +92,6 @@ function makePng(size) {
cov = Math.max(cov, clamp01(stroke - distToSeg(gx, gy, chevron[0][0], chevron[0][1], chevron[1][0], chevron[1][1]) + 0.5));
cov = Math.max(cov, clamp01(stroke - distToSeg(gx, gy, chevron[1][0], chevron[1][1], chevron[2][0], chevron[2][1]) + 0.5));
cov = Math.max(cov, clamp01(stroke - distToSeg(gx, gy, underline[0][0], underline[0][1], underline[1][0], underline[1][1]) + 0.5));
cov = Math.max(cov, clamp01(dot[2] - Math.hypot(gx - dot[0], gy - dot[1]) + 0.5));
const o = y * rowLen + 1 + x * 4;
raw[o] = Math.round(bg[0] + (WHITE[0] - bg[0]) * cov);