Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ffb113ca5 | ||
|
|
e34ec79d5a |
No files matched your search
+2
-2
@@ -33,7 +33,7 @@ COPY . .
|
||||
RUN find ./src -type f -name "route.ts" -print0 \
|
||||
| xargs -0 sed -i "s/export const runtime = 'edge';/export const runtime = 'nodejs';/g"
|
||||
ENV DOCKER_ENV=true
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed96
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed97
|
||||
|
||||
# For Docker builds, force dynamic rendering to read runtime environment variables.
|
||||
RUN sed -i "/const inter = Inter({ subsets: \['latin'] });/a export const dynamic = 'force-dynamic';" src/app/layout.tsx
|
||||
@@ -52,7 +52,7 @@ ENV NODE_ENV=production
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
ENV PORT=3000
|
||||
ENV DOCKER_ENV=true
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed96
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed97
|
||||
|
||||
# 从构建器中复制 standalone 输出
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
|
||||
@@ -242,9 +242,16 @@ docker compose -f docker-compose.redis.yml down
|
||||
## 🐳 Docker 镜像
|
||||
|
||||
```bash
|
||||
docker pull gitea.88531.cn/jinghui/katelyatv:latest
|
||||
# 公网可拉(匿名)
|
||||
docker pull gitea.88531.cn/jinghui/katelyatv:latest # 固定版本
|
||||
docker pull gitea.88531.cn/jinghui/katelyatv:fixed96
|
||||
|
||||
# 腾讯云 TCR(东京,公网匿名)
|
||||
docker pull jpccr.ccs.tencentyun.com/jinghui/katelyatv:latest
|
||||
```
|
||||
|
||||
当前版本:**v-fixed96**
|
||||
|
||||
## 🔗 源码
|
||||
|
||||
- Gitea:https://gitea.88531.cn/jinghui/katelyatv
|
||||
|
||||
+39
-2
@@ -83,10 +83,31 @@ export default function IPv6Page() {
|
||||
|
||||
const choose = (which: 'v4' | 'v6') => {
|
||||
const dest = which === 'v4' ? H.v4 : H.v6;
|
||||
let targetBack = back;
|
||||
try {
|
||||
const s = sessionStorage.getItem('__v6back');
|
||||
if (s) { targetBack = s; sessionStorage.removeItem('__v6back'); }
|
||||
} catch (e) { /* ignore */ }
|
||||
try { localStorage.setItem('__v6dest', which); } catch (e) { // ignore
|
||||
// ignore
|
||||
}
|
||||
window.location.href = dest + back + window.location.search + window.location.hash;
|
||||
// 去掉 search 里的 back 参数,避免透传到目标地址
|
||||
const qs = new URLSearchParams(window.location.search);
|
||||
qs.delete('back');
|
||||
const searchStr = qs.toString() ? '?' + qs.toString() : '';
|
||||
const u = new URL(dest);
|
||||
const m = /^([^?#]*)(\?[^#]*)?(#.*)?$/.exec(targetBack) || [];
|
||||
u.pathname = m[1] || '/';
|
||||
if (m[2]) {
|
||||
const q2 = new URLSearchParams(m[2].slice(1));
|
||||
q2.forEach((v, k) => { if (!u.searchParams.has(k)) u.searchParams.set(k, v); });
|
||||
}
|
||||
if (searchStr) {
|
||||
const q3 = new URLSearchParams(searchStr.slice(1));
|
||||
q3.forEach((v, k) => { if (!u.searchParams.has(k)) u.searchParams.set(k, v); });
|
||||
}
|
||||
if (m[3]) u.hash = m[3];
|
||||
window.location.href = u.toString();
|
||||
};
|
||||
|
||||
const reprobe = () => {
|
||||
@@ -104,7 +125,23 @@ export default function IPv6Page() {
|
||||
try { localStorage.setItem('__v6dest', 'v6'); } catch (e) { // ignore
|
||||
// ignore
|
||||
}
|
||||
window.location.href = H.v6 + back + window.location.search + window.location.hash;
|
||||
let targetBack = back;
|
||||
try {
|
||||
const s = sessionStorage.getItem('__v6back');
|
||||
if (s) { targetBack = s; sessionStorage.removeItem('__v6back'); }
|
||||
} catch (e) { /* ignore */ }
|
||||
const u = new URL(H.v6);
|
||||
const m = /^([^?#]*)(\?[^#]*)?(#.*)?$/.exec(targetBack) || [];
|
||||
u.pathname = m[1] || '/';
|
||||
if (m[2]) {
|
||||
const q2 = new URLSearchParams(m[2].slice(1));
|
||||
q2.forEach((v, k) => { if (!u.searchParams.has(k)) u.searchParams.set(k, v); });
|
||||
}
|
||||
const qs = new URLSearchParams(window.location.search);
|
||||
qs.delete('back');
|
||||
qs.forEach((v, k) => { if (!u.searchParams.has(k)) u.searchParams.set(k, v); });
|
||||
if (m[3]) u.hash = m[3];
|
||||
window.location.href = u.toString();
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -8,6 +8,7 @@ import { getConfig } from '@/lib/config';
|
||||
|
||||
import { SiteProvider } from '../components/SiteProvider';
|
||||
import { ThemeProvider } from '../components/ThemeProvider';
|
||||
import Ipv6FirstVisitGate from '../components/Ipv6FirstVisitGate';
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] });
|
||||
|
||||
@@ -114,6 +115,7 @@ export default async function RootLayout({
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<SiteProvider siteName={siteName} announcement={announcement}>
|
||||
<Ipv6FirstVisitGate />
|
||||
{children}
|
||||
</SiteProvider>
|
||||
</ThemeProvider>
|
||||
|
||||
@@ -9,6 +9,7 @@ export default function Ipv6Button({ forceShow = false, compact = false, light =
|
||||
return (
|
||||
<button
|
||||
onClick={() => {
|
||||
try { sessionStorage.setItem('__v6back', location.pathname + location.search + location.hash); } catch {}
|
||||
location.href = '/ipv6';
|
||||
}}
|
||||
title='切换 IPv4 / IPv6 线路'
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
// 首次访问公网入口时跳转到 /ipv6 线路选择页(源码化恢复:旧版 patch_license.js V6-PROBE 在迁移时未搬入源码)
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function Ipv6FirstVisitGate() {
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (location.hostname !== 'tv.88531.cn') return; // 仅公网 IPv4 入口;LAN/IPv6 线路不跳转(避免循环)
|
||||
if (location.pathname === '/ipv6') return;
|
||||
if (localStorage.getItem('__v6dest')) return; // 已记住线路,不打扰
|
||||
sessionStorage.setItem('__v6back', location.pathname + location.search + location.hash);
|
||||
location.replace('/ipv6');
|
||||
} catch {}
|
||||
}, []);
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user