Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ These instructions apply to the entire repository.
Known environment variable names:

- `NEXT_PUBLIC_PROJECT_ID`
- `DEV_ALLOWED_ORIGINS`
- `S3_BUCKET`
- `S3_ENDPOINT`
- `S3_REGION`
- `S3_KEY`
Expand Down
4 changes: 2 additions & 2 deletions app/api/channel/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { verifyMessage } from "ethers";
import { NextResponse } from "next/server";

import { s3Client } from "../../config";
import { getS3Bucket, s3Client } from "../../config";
import {
MEMBER_SIGN_MESSAGE,
NOT_MEMBER_ERROR,
Expand Down Expand Up @@ -42,7 +42,7 @@ export async function POST(req: Request) {

if (members.includes(address.toLowerCase())) {
const bucketParams = {
Bucket: "raid-guild-valhalla",
Bucket: getS3Bucket(),
Key: requestBody.key,
};

Expand Down
4 changes: 2 additions & 2 deletions app/api/files/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "@aws-sdk/client-s3";
import { verifyMessage } from "ethers";
import { NextResponse } from "next/server";
import { s3Client } from "../../config";
import { getS3Bucket, s3Client } from "../../config";
import {
MEMBER_SIGN_MESSAGE,
NOT_MEMBER_ERROR,
Expand All @@ -14,7 +14,6 @@ import {
logServerError,
} from "../shared/memberAuth";

const bucketParams = { Bucket: "raid-guild-valhalla" };
const S3_LIST_PAGE_SIZE = 500;
const S3_LIST_MAX_PAGES = 10;
const S3_LIST_MAX_FILES = S3_LIST_PAGE_SIZE * S3_LIST_MAX_PAGES;
Expand Down Expand Up @@ -69,6 +68,7 @@ export async function POST(req: Request) {
const members = await fetchMemberAddresses();

if (members.includes(address.toLowerCase())) {
const bucketParams = { Bucket: getS3Bucket() };
const files: ValhallaFile[] = [];
let continuationToken: string | undefined;
let pagesFetched = 0;
Expand Down
10 changes: 10 additions & 0 deletions app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ export const CONFIG = {
THE_GRAPH_API_KEY: process.env.THE_GRAPH_API_KEY,
};

export function getS3Bucket() {
const bucket = process.env.S3_BUCKET?.trim();

if (!bucket) {
throw new Error("S3_BUCKET is not configured.");
}

return bucket;
}

const hasS3Key = Boolean(process.env.S3_KEY);
const hasS3Secret = Boolean(process.env.S3_SECRET);

Expand Down
Binary file removed app/favicon.ico
Binary file not shown.
39 changes: 39 additions & 0 deletions app/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { EB_Garamond, Ubuntu_Mono } from "next/font/google";
import localFont from "next/font/local";

export const maziusDisplay = localFont({
src: [
{
path: "../public/fonts/MAZIUSREVIEW20.09-Regular.woff",
weight: "400",
style: "normal",
},
{
path: "../public/fonts/MaziusDisplay-Bold.otf",
weight: "700",
style: "normal",
},
{
path: "../public/fonts/MaziusDisplay-Extraitalic.otf",
weight: "400",
style: "italic",
},
],
variable: "--font-display",
display: "swap",
});

export const ebGaramond = EB_Garamond({
subsets: ["latin"],
variable: "--font-body",
weight: ["400", "500", "600", "700"],
style: ["normal", "italic"],
display: "swap",
});

export const ubuntuMono = Ubuntu_Mono({
subsets: ["latin"],
variable: "--font-mono",
weight: ["400", "700"],
display: "swap",
});
Loading