From 5a43bce45d62ff8308aaa8343518b23cdd7561c6 Mon Sep 17 00:00:00 2001 From: RRRosmontis Date: Sun, 13 Sep 2026 02:26:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E9=BD=90=2099543c9=20=E9=81=97?= =?UTF-8?q?=E6=BC=8F=E7=9A=84=E5=86=85=E5=AE=B9=E6=94=B9=E5=8A=A8=EF=BC=88?= =?UTF-8?q?=E8=AF=A5=E6=8F=90=E4=BA=A4=E7=9A=84=20git=20add=20=E5=9B=A0=20?= =?UTF-8?q?pathspec=20=E6=8A=A5=E9=94=99=E6=9C=AA=E7=94=9F=E6=95=88?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上一个 refactor 提交只落到 main.py 的重命名,端口与路径的实际改动漏掉了,此提交补齐: - source/main.py: PIXIV_BACKEND 9088->9007, BILIBILI_BACKEND 19990->9006, port 9888->9008 - nginx/openapi.rrrosmontis.icu.conf: 3 处 proxy_pass -> 127.0.0.1:9008 - systemd/openapi.service: WorkingDirectory/ExecStart 同步为 source/ --- nginx/openapi.rrrosmontis.icu.conf | 10 +++++----- source/main.py | 6 +++--- systemd/openapi.service | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nginx/openapi.rrrosmontis.icu.conf b/nginx/openapi.rrrosmontis.icu.conf index ffa1b84..1b88781 100644 --- a/nginx/openapi.rrrosmontis.icu.conf +++ b/nginx/openapi.rrrosmontis.icu.conf @@ -1,5 +1,5 @@ # openapi.rrrosmontis.icu 统一入口(原 api/pixiv/apixiv.bu4.ren 合并) -# /pixiv/ /bilibili/ -> openapi 聚合层 127.0.0.1:9888 (main.py) +# /pixiv/ /bilibili/ -> openapi 聚合层 127.0.0.1:9008 (main.py) # /img-master/ /img-original/ -> i.pximg.net 图片反代(原 apixiv.bu4.ren 逻辑,方案二) # 2026-09-02 补 /img-original/:App API 原图 URL 为 /img-original/ 前缀,此前未配置导致 404 @@ -85,7 +85,7 @@ server { # ---- pixiv(openapi 聚合层 /pixiv/get_image)---- location ^~ /pixiv/ { - proxy_pass http://127.0.0.1:9888; + proxy_pass http://127.0.0.1:9008; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-Port $remote_port; @@ -104,7 +104,7 @@ server { # ---- bilibili(openapi 聚合层 /bilibili/get_video)---- location ^~ /bilibili/ { - proxy_pass http://127.0.0.1:9888; + proxy_pass http://127.0.0.1:9008; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-Port $remote_port; @@ -121,9 +121,9 @@ server { proxy_set_header Connection $connection_upgrade; } - # ---- 其余(根路径 / )→ 9888(main.py:跳转文章页)---- + # ---- 其余(根路径 / )→ 9008(main.py:跳转文章页)---- location / { - proxy_pass http://127.0.0.1:9888; + proxy_pass http://127.0.0.1:9008; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-Port $remote_port; diff --git a/source/main.py b/source/main.py index 298343e..2b5f8ab 100644 --- a/source/main.py +++ b/source/main.py @@ -1,8 +1,8 @@ from aiohttp import web, ClientSession, ClientTimeout -PIXIV_BACKEND = "http://127.0.0.1:9088" -BILIBILI_BACKEND = "http://127.0.0.1:19990" +PIXIV_BACKEND = "http://127.0.0.1:9007" +BILIBILI_BACKEND = "http://127.0.0.1:9006" async def handle_pixiv(request): @@ -52,4 +52,4 @@ app.router.add_get("/pixiv/get_image", handle_pixiv) app.router.add_get("/bilibili/get_video", handle_bilibili) if __name__ == "__main__": - web.run_app(app, host="127.0.0.1", port=9888) + web.run_app(app, host="127.0.0.1", port=9008) diff --git a/systemd/openapi.service b/systemd/openapi.service index 8b9ccec..82fc224 100644 --- a/systemd/openapi.service +++ b/systemd/openapi.service @@ -6,8 +6,8 @@ Wants=network-online.target [Service] Environment=PATH=/home/openapi/env/general/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Type=simple -WorkingDirectory=/home/openapi/source/openapi -ExecStart=/home/openapi/env/general/bin/python /home/openapi/source/openapi/main.py +WorkingDirectory=/home/openapi/source +ExecStart=/home/openapi/env/general/bin/python /home/openapi/source/main.py Restart=always RestartSec=5 StandardOutput=append:/var/log/openapi.log