Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ PARSER_APPEND_URL=true

# nonebot-plugin-htmlrender
# https://github.com/kexue-z/nonebot-plugin-htmlrender
# HTMLRENDER_CI_MODE=false
HTMLRENDER_CONNECT="ws://playwright:53333/playwright"
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
name: Docker
runs-on: ubuntu-latest
needs: test
services:
playwright:
image: jacoblincool/playwright:chromium-server-1.56.1
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -135,7 +138,7 @@ jobs:

# 启动容器
echo "正在启动容器..."
docker run --env HTMLRENDER_CI_MODE=true --name test-docker-container -d he0119/coolqbot:test > /dev/null
docker run --env HTMLRENDER_CONNECT=ws://playwright:53333/playwright --network=${{ job.services.playwright.network }} --name test-docker-container -d he0119/coolqbot:test > /dev/null

TIMEOUT=60
ELAPSED=0
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

- 使用依赖注入的 User 来判断权限

### Changed

- htmlrender 使用外部浏览器

## [0.26.2] - 2025-08-27

### Fixed
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync

# 安装浏览器
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
uv run playwright install --with-deps chromium firefox

# Gunicorn 配置
COPY ./docker/gunicorn_conf.py /gunicorn_conf.py
COPY ./docker/start.sh /start.sh
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,22 @@ services:
- "8080:8080"
env_file:
- ".env"
depends_on:
playwright:
condition: service_healthy

rsshub:
image: diygod/rsshub
container_name: rsshub
restart: always

playwright:
image: jacoblincool/playwright:chromium-server-1.56.1
container_name: playwright
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:53333/playwright"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ dependencies = [
"nonebot-plugin-zssm==0.3.7",
"nonebot-plugin-abs==1.1.0",
"nonebot-plugin-parser[htmlkit]==2.4.1",
"nonebot-plugin-htmlrender>=0.7.0a3",
"playwright==1.56.0",
]

[project.urls]
Expand Down
4 changes: 4 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading