Compare commits

..
2 Commits
Author SHA1 Message Date
3970260761 5c77b39239 fixed69: 版本号对齐fixed69
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
Release / release (push) Canceled after 0s
Release / docker (push) Canceled after 0s
2026-11-07 15:11:24 +08:00
3970260761 7b27de7551 fixed69: 访问日志源码化(middleware内[ACCESS]日志,替代注入next内部start-server)
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
2026-11-07 15:11:15 +08:00
3 changed files with 12 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
ENV DOCKER_ENV=true
ENV NEXT_PUBLIC_SITE_VERSION=fixed68
ENV NEXT_PUBLIC_SITE_VERSION=fixed69
# 从构建器中复制 standalone 输出
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
+1 -1
View File
@@ -37,7 +37,7 @@ export default function TopRightButtons({ variant = 'bar' }: TopRightButtonsProp
className='hidden lg:inline-flex shrink-0 items-center select-none rounded-lg px-2 py-1.5 text-xs font-bold tracking-wide text-purple-600 dark:text-purple-400 bg-purple-500/10 border border-purple-500/20'
title='米视TV 当前版本'
>
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed68'}
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed69'}
</span>
<HubBell />
<TvboxButton />
+10
View File
@@ -34,6 +34,16 @@ export async function middleware(request: NextRequest) {
});
}
// 访问日志(源码化,替代旧 patches/patch_access_log.js 运行时注入 next 内部 start-server):
// middleware 覆盖全部路由请求,跳过静态资源
if (pathname.indexOf('/_next/static') !== 0 && pathname !== '/favicon.ico') {
const ua = (request.headers.get('user-agent') || '-').slice(0, 90);
const ref = request.headers.get('referer');
console.log(
`[ACCESS] ${new Date().toISOString()} ip=${ip} ${request.method} ${fullUrl} ua=${JSON.stringify(ua)}${ref ? ` ref=${ref.slice(0, 80)}` : ''}`
);
}
// 跳过不需要认证的路径
if (shouldSkipAuth(pathname)) {
return NextResponse.next();