diff options
| author | Adam Soltys <[email protected]> | 2024-04-22 22:32:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-04-22 22:32:36 -0700 |
| commit | 1c184f2af7c6a11c779b64b936f45f3d4902c199 (patch) | |
| tree | 11d8bac2d8433eaff875a6c864efede1cf861016 | |
| parent | 0fb1c0363e3f3f87b5fc67b44027a263e269fa25 (diff) | |
| download | coinos-server-1c184f2af7c6a11c779b64b936f45f3d4902c199.tar.gz coinos-server-1c184f2af7c6a11c779b64b936f45f3d4902c199.zip | |
increase max file size
| -rw-r--r-- | lib/app.js | 2 | ||||
| -rw-r--r-- | lib/upload.js | 2 | ||||
| -rw-r--r-- | routes/lnurl.js | 12 |
3 files changed, 11 insertions, 5 deletions
@@ -35,7 +35,7 @@ app.register(fastifyPassport.secureSession()); fastifyPassport.use("jwt", jwtStrategy); -app.register(fastifyMultipart); + app.register(fastifyMultipart, { limits: { fileSize: 10 ** 7}}); app.register(fastifyStatic, { root: path.join("/app/data/uploads"), diff --git a/lib/upload.js b/lib/upload.js index 5a91caa4..0b558acf 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -45,7 +45,7 @@ export default async (req, res) => { if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) fail("unsupported file type"); - let t = sharp().rotate().resize(width).webp(); + let t = sharp({ failOnError: false }).rotate().resize(width).webp(); let processedBuffer = await streamToBuffer(s2.pipe(t)); let hash = crypto diff --git a/routes/lnurl.js b/routes/lnurl.js index 2a8f5564..ea99d488 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -46,7 +46,13 @@ export default { } }, - async lnurlp({ params: { username } }, res) { + async lnurlp( + { + params: { username }, + query: { minSendable = 1000, maxSendable = 100000000000 }, + }, + res, + ) { try { let { id: uid, pubkey: nostrPubkey } = await getUser(username); @@ -60,8 +66,8 @@ export default { res.send({ allowsNostr: true, - minSendable: 1000, - maxSendable: 100000000000, + minSendable, + maxSendable, metadata, nostrPubkey, callback: `${URL}/api/lnurl/${id}`, |
