Skip to content

Commit

Permalink
Add MAX_FILE_SIZE to .env
Browse files Browse the repository at this point in the history
Addresses #104
  • Loading branch information
pietvanzoen committed Jul 6, 2024
1 parent f5d4069 commit 80c40ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ DEBUG="app:*"

# Disable public user registration.
# DISABLE_SIGNUP=1

# Set maximum file size. Defaults to 10MB
# MAX_FILE_SIZE=20MB
3 changes: 2 additions & 1 deletion app/utils/media.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { db } from "./db.server";
import { LRUCache } from "lru-cache";
import ms from "ms";
import { getImageData } from "./image.server";
import envServer from "./env.server";
const log = debug("app:media-helpers");

const MAX_FILE_SIZE = bytes("10MB");
const MAX_FILE_SIZE = bytes(envServer.get('MAX_FILE_SIZE') ?? "10MB");

type UploadOutput = {
url: string;
Expand Down

0 comments on commit 80c40ed

Please sign in to comment.