Seguridad y docs: fix SQLi en updatePost, middleware por segmentos exactos, cover-cache directo al upstream, JWT sin fallback hardcodeado, password sudo fuera de deploy/setup.sh; reescritura AGENTS.md y CLAUDE.md

This commit is contained in:
Renato
2026-08-04 11:13:57 +08:00
parent 5d36c635cb
commit 451518004d
12 changed files with 419 additions and 928 deletions
+1 -8
View File
@@ -1,5 +1,5 @@
import Link from "next/link"
import { Image, Search, Shield } from "lucide-react"
import { Image, Search } from "lucide-react"
export default function PublicLayout({ children }: { children: React.ReactNode }) {
return (
@@ -20,13 +20,6 @@ export default function PublicLayout({ children }: { children: React.ReactNode }
<Search className="h-4 w-4" />
<span className="hidden sm:inline">Buscar</span>
</Link>
<Link
href="/feed"
className="flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[var(--muted)] hover:bg-[var(--surface)] hover:text-[var(--foreground)] transition-colors"
>
<Shield className="h-4 w-4" />
<span className="hidden sm:inline">Admin</span>
</Link>
</nav>
</div>
</header>
+1 -2
View File
@@ -12,8 +12,7 @@ export async function GET(
if (!coverPath) {
try {
const proxyUrl = `http://127.0.0.1:${process.env.PORT || 3000}/api/proxy/galleries/${gid}/cover`
coverPath = await cacheCover(gid, proxyUrl)
coverPath = await cacheCover(gid)
} catch {
}
}
+1 -3
View File
@@ -75,9 +75,7 @@ export async function POST(req: NextRequest) {
})!
}
const port = process.env.PORT || "3000"
const proxyUrl = `http://127.0.0.1:${port}/api/proxy/galleries/${gid}/cover`
await cacheCover(gid, proxyUrl)
await cacheCover(gid)
return Response.json({
success: true,