Compare commits
4
Commits
+2
-1
@@ -57,4 +57,5 @@ node_modules/
|
|||||||
.sentryclirc
|
.sentryclirc
|
||||||
|
|
||||||
.direnv
|
.direnv
|
||||||
!.envrc
|
!.envrc
|
||||||
|
.env*
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import { auditLog, user } from "@/lib/db/schema";
|
|||||||
import AuditLogViewer from "./client";
|
import AuditLogViewer from "./client";
|
||||||
|
|
||||||
export default async function AuditLogViewerPage() {
|
export default async function AuditLogViewerPage() {
|
||||||
const logs = (
|
const logs = (await db.execute(sql`
|
||||||
await db.execute(sql`
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM (
|
FROM (
|
||||||
SELECT *
|
SELECT *
|
||||||
@@ -14,8 +13,7 @@ export default async function AuditLogViewerPage() {
|
|||||||
LIMIT 1000
|
LIMIT 1000
|
||||||
) t
|
) t
|
||||||
ORDER BY id ASC;
|
ORDER BY id ASC;
|
||||||
`)
|
`)) as (typeof auditLog.$inferSelect)[];
|
||||||
).rows as (typeof auditLog.$inferSelect)[];
|
|
||||||
const users = await db
|
const users = await db
|
||||||
.select({ name: user.name, email: user.email })
|
.select({ name: user.name, email: user.email })
|
||||||
.from(user);
|
.from(user);
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ export default async function AdminLayout({
|
|||||||
}) {
|
}) {
|
||||||
if (!(await adminCheck()))
|
if (!(await adminCheck()))
|
||||||
redirect(`/login?next=${encodeURIComponent("/artifact/admin")}`);
|
redirect(`/login?next=${encodeURIComponent("/artifact/admin")}`);
|
||||||
const subs = (
|
const subs = (await db.execute(sql`
|
||||||
await db.execute(sql`
|
|
||||||
WITH max_checked AS (
|
WITH max_checked AS (
|
||||||
SELECT MAX(queue) AS max_queue
|
SELECT MAX(queue) AS max_queue
|
||||||
FROM artifact.submissions
|
FROM artifact.submissions
|
||||||
@@ -63,8 +62,7 @@ export default async function AdminLayout({
|
|||||||
|
|
||||||
ELSE s.queue
|
ELSE s.queue
|
||||||
END,
|
END,
|
||||||
s.id;`)
|
s.id;`)) as (typeof submissions.$inferSelect)[];
|
||||||
).rows as (typeof submissions.$inferSelect)[];
|
|
||||||
const config = await getArtifactConfig();
|
const config = await getArtifactConfig();
|
||||||
const count = await db
|
const count = await db
|
||||||
.select({ a: sql`NULL` })
|
.select({ a: sql`NULL` })
|
||||||
|
|||||||
+11
-10
@@ -17,16 +17,17 @@ export default function Home() {
|
|||||||
<div className="mx-auto flex min-h-dvh w-full max-w-6xl flex-col">
|
<div className="mx-auto flex min-h-dvh w-full max-w-6xl flex-col">
|
||||||
<section>
|
<section>
|
||||||
<center>
|
<center>
|
||||||
<Link href="https://www.youtube.com/@Genshinmaichaigamemurtur">
|
{/* TEMPORARY: Hacked channel */}
|
||||||
<Image
|
{/* <Link href="https://www.youtube.com/@Genshinmaichaigamemurtur"> */}
|
||||||
src={Banner}
|
<Image
|
||||||
alt="Banner"
|
src={Banner}
|
||||||
className="mt-24 w-3/4 rounded-t-xl sm:w-125"
|
alt="Banner"
|
||||||
width={500}
|
className="mt-24 w-3/4 rounded-t-xl sm:w-125"
|
||||||
height={100}
|
width={500}
|
||||||
fetchPriority="high"
|
height={100}
|
||||||
/>
|
fetchPriority="high"
|
||||||
</Link>
|
/>
|
||||||
|
{/* </Link> */}
|
||||||
</center>
|
</center>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export async function GET() {
|
|||||||
);
|
);
|
||||||
return Response.json(
|
return Response.json(
|
||||||
{ red, ...res },
|
{ red, ...res },
|
||||||
{ status: red ? (res.database ? 200 : 201) : 503 },
|
{ status: res.database && red ? 200 : 201 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ export async function GET(req: NextRequest) {
|
|||||||
const channelId = process.env.YOUTUBE_CHANNEL_ID;
|
const channelId = process.env.YOUTUBE_CHANNEL_ID;
|
||||||
const apiKey = process.env.YOUTUBE_API_KEY;
|
const apiKey = process.env.YOUTUBE_API_KEY;
|
||||||
|
|
||||||
if (!apiKey || !channelId) return NextResponse.json<YoutubeLiveInfo>("none");
|
// TEMPORARY: Hacked channel
|
||||||
|
if (!apiKey || !channelId && true) return NextResponse.json<YoutubeLiveInfo>("none");
|
||||||
|
|
||||||
const response = await youtubeCache.fetch(
|
const response = await youtubeCache.fetch(
|
||||||
`https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${channelId}&eventType=live&type=video&maxResults=1&key=${apiKey}`,
|
`https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${channelId}&eventType=live&type=video&maxResults=1&key=${apiKey}`,
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"@headless-tree/core": "^1.6.0",
|
"@headless-tree/core": "^1.6.0",
|
||||||
"@headless-tree/react": "^1.6.0",
|
"@headless-tree/react": "^1.6.0",
|
||||||
"@hookform/resolvers": "^5.2.2",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
"@neondatabase/serverless": "^1.1.0",
|
|
||||||
"@next/bundle-analyzer": "16.2.6",
|
"@next/bundle-analyzer": "16.2.6",
|
||||||
"@origin-space/image-cropper": "^0.1.9",
|
"@origin-space/image-cropper": "^0.1.9",
|
||||||
"@radix-ui/react-accordion": "^1.2.12",
|
"@radix-ui/react-accordion": "^1.2.12",
|
||||||
@@ -385,8 +384,6 @@
|
|||||||
|
|
||||||
"@mrleebo/prisma-ast": ["@mrleebo/[email protected]", "", { "dependencies": { "chevrotain": "^10.5.0", "lilconfig": "^2.1.0" } }, "sha512-VxS+okLpNp6YUDLz3rAXv6sE8G4W5cX039bumkPub65xRr9BFxjHaT5ebX4DsiixIGaBwitjWTvx3mAbyI2EUQ=="],
|
"@mrleebo/prisma-ast": ["@mrleebo/[email protected]", "", { "dependencies": { "chevrotain": "^10.5.0", "lilconfig": "^2.1.0" } }, "sha512-VxS+okLpNp6YUDLz3rAXv6sE8G4W5cX039bumkPub65xRr9BFxjHaT5ebX4DsiixIGaBwitjWTvx3mAbyI2EUQ=="],
|
||||||
|
|
||||||
"@neondatabase/serverless": ["@neondatabase/[email protected]", "", {}, "sha512-r3ZZhRjEcfEdKIZnoB1RusNgvHuaBRqfCzV4Gi+5A9yUX0S4HTws/ASWqt13wL4y4I+0rqsWGdA2w7EQXHi3+Q=="],
|
|
||||||
|
|
||||||
"@next/bundle-analyzer": ["@next/[email protected]", "", { "dependencies": { "webpack-bundle-analyzer": "4.10.1" } }, "sha512-amPkVtHCTJAdBwyhhl5+qztHk24O4JlASgrWqh15AmnYi74apfZR46NGC0u4pM6BMAU1mYld4WdzD3cRBP3dOA=="],
|
"@next/bundle-analyzer": ["@next/[email protected]", "", { "dependencies": { "webpack-bundle-analyzer": "4.10.1" } }, "sha512-amPkVtHCTJAdBwyhhl5+qztHk24O4JlASgrWqh15AmnYi74apfZR46NGC0u4pM6BMAU1mYld4WdzD3cRBP3dOA=="],
|
||||||
|
|
||||||
"@next/env": ["@next/[email protected]", "", {}, "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw=="],
|
"@next/env": ["@next/[email protected]", "", {}, "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw=="],
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { drizzle } from "drizzle-orm/neon-http";
|
import { drizzle } from "drizzle-orm/bun-sql";
|
||||||
import * as schema from "./schema";
|
import * as schema from "./schema";
|
||||||
import { withReplicas } from "drizzle-orm/pg-core";
|
import { withReplicas } from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
import ReconnectingEventSource from "reconnecting-eventsource";
|
import ReconnectingEventSource from "reconnecting-eventsource";
|
||||||
import type z from "zod";
|
import type z from "zod";
|
||||||
|
|
||||||
export const redis = typeof Bun !== "undefined" ? Bun.redis : null;
|
export const redis =
|
||||||
|
typeof Bun !== "undefined"
|
||||||
|
? new Bun.RedisClient(undefined, { maxRetries: 0xffffffff })
|
||||||
|
: null;
|
||||||
|
|
||||||
type PubPayload = { event?: string; data: unknown };
|
type PubPayload = { event?: string; data: unknown };
|
||||||
|
|
||||||
@@ -126,7 +129,7 @@ export class EventSourceEndpoint<T extends EventSourceEventMap> {
|
|||||||
throw new Error(
|
throw new Error(
|
||||||
"EventSourceEndpoint.pub(...) can only be called on the server.",
|
"EventSourceEndpoint.pub(...) can only be called on the server.",
|
||||||
);
|
);
|
||||||
return this.manager.publish(this.eventMap[event].parse(data), {
|
this.manager.publish(this.eventMap[event].parse(data), {
|
||||||
topic: this.endpoint,
|
topic: this.endpoint,
|
||||||
event: String(event),
|
event: String(event),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
"@headless-tree/core": "^1.6.0",
|
"@headless-tree/core": "^1.6.0",
|
||||||
"@headless-tree/react": "^1.6.0",
|
"@headless-tree/react": "^1.6.0",
|
||||||
"@hookform/resolvers": "^5.2.2",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
"@neondatabase/serverless": "^1.1.0",
|
|
||||||
"@next/bundle-analyzer": "16.2.6",
|
"@next/bundle-analyzer": "16.2.6",
|
||||||
"@origin-space/image-cropper": "^0.1.9",
|
"@origin-space/image-cropper": "^0.1.9",
|
||||||
"@radix-ui/react-accordion": "^1.2.12",
|
"@radix-ui/react-accordion": "^1.2.12",
|
||||||
|
|||||||
Reference in New Issue
Block a user