Merge branch 'develop' of https://codeberg.org/calckey/calckey into upstream

This commit is contained in:
freeplay 2023-07-20 19:17:21 -04:00
commit d5abff3c84
6 changed files with 32 additions and 17 deletions

View File

@ -116,7 +116,7 @@ If you have access to a server that supports one of the sources below, I recomme
- 🐲 [DragonflyDB](https://www.dragonflydb.io/) (recommended) - 🐲 [DragonflyDB](https://www.dragonflydb.io/) (recommended)
- 👻 [KeyDB](https://keydb.dev/) - 👻 [KeyDB](https://keydb.dev/)
- 🍱 Another [Redis](https://redis.io/) server - 🍱 Another [Redis](https://redis.io/) server
### 🏗️ Build dependencies ### 🏗️ Build dependencies
- 🦀 At least [Rust](https://www.rust-lang.org/) v1.68.0 - 🦀 At least [Rust](https://www.rust-lang.org/) v1.68.0

13
calckey.apache.conf Normal file
View File

@ -0,0 +1,13 @@
# Replace example.tld with your domain
<VirtualHost *:80>
ServerName example.tld
# For WebSocket
ProxyPass "/streaming" "ws://127.0.0.1:3000/streaming/"
# Proxy to Node
ProxyPass "/" "http://127.0.0.1:3000/"
ProxyPassReverse "/" "http://127.0.0.1:3000/"
ProxyPreserveHost On
# For files proxy
AllowEncodedSlashes On
</VirtualHost>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -3,7 +3,7 @@ import { DriveFiles } from "@/models/index.js";
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js"; import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
import { IdentifiableError } from "@/misc/identifiable-error.js"; import { IdentifiableError } from "@/misc/identifiable-error.js";
import { fetchMeta } from "@/misc/fetch-meta.js"; import { fetchMeta } from "@/misc/fetch-meta.js";
import { HOUR } from "@/const.js"; import { MINUTE } from "@/const.js";
import define from "../../../define.js"; import define from "../../../define.js";
import { apiLogger } from "../../../logger.js"; import { apiLogger } from "../../../logger.js";
import { ApiError } from "../../../error.js"; import { ApiError } from "../../../error.js";
@ -14,8 +14,8 @@ export const meta = {
requireCredential: true, requireCredential: true,
limit: { limit: {
duration: HOUR, duration: MINUTE * 10,
max: 120, max: 250,
}, },
requireFile: true, requireFile: true,
@ -40,7 +40,7 @@ export const meta = {
inappropriate: { inappropriate: {
message: message:
"Cannot upload the file because it has been determined that it possibly contains inappropriate content.", "Cannot upload due to the file possibly containing inappropriate content.",
code: "INAPPROPRIATE", code: "INAPPROPRIATE",
id: "bec5bd69-fba3-43c9-b4fb-2894b66ad5d2", id: "bec5bd69-fba3-43c9-b4fb-2894b66ad5d2",
}, },
@ -95,7 +95,7 @@ export default define(
name = null; name = null;
} }
const meta = await fetchMeta(); const instanceMeta = await fetchMeta();
try { try {
// Create file // Create file
@ -107,8 +107,8 @@ export default define(
folderId: ps.folderId, folderId: ps.folderId,
force: ps.force, force: ps.force,
sensitive: ps.isSensitive, sensitive: ps.isSensitive,
requestIp: meta.enableIpLogging ? ip : null, requestIp: instanceMeta.enableIpLogging ? ip : null,
requestHeaders: meta.enableIpLogging ? headers : null, requestHeaders: instanceMeta.enableIpLogging ? headers : null,
}); });
return await DriveFiles.pack(driveFile, { self: true }); return await DriveFiles.pack(driveFile, { self: true });
} catch (e) { } catch (e) {
@ -123,7 +123,9 @@ export default define(
} }
throw new ApiError(); throw new ApiError();
} finally { } finally {
cleanup!(); if (cleanup !== undefined) {
cleanup();
}
} }
}, },
); );

View File

@ -9,25 +9,25 @@
"orientation": "portrait-primary", "orientation": "portrait-primary",
"icons": [ "icons": [
{ {
"src": "/static-assets/icons/192.png", "src": "/static-assets/icons/192.png?v=2",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png", "type": "image/png",
"purpose": "any" "purpose": "any"
}, },
{ {
"src": "/static-assets/icons/512.png", "src": "/static-assets/icons/512.png?v=2",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png", "type": "image/png",
"purpose": "any" "purpose": "any"
}, },
{ {
"src": "/static-assets/icons/maskable.png", "src": "/static-assets/icons/maskable.png?v=2",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png", "type": "image/png",
"purpose": "maskable" "purpose": "maskable"
}, },
{ {
"src": "/static-assets/icons/monochrome.png", "src": "/static-assets/icons/monochrome.png?v=2",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png", "type": "image/png",
"purpose": "monochrome" "purpose": "monochrome"
@ -43,15 +43,15 @@
}, },
"screenshots": [ "screenshots": [
{ {
"src": "/static-assets/screenshots/1.webp", "src": "/static-assets/screenshots/1.webp?v=2",
"sizes": "1195x579", "sizes": "1080x2340",
"type": "image/webp", "type": "image/webp",
"platform": "narrow", "platform": "narrow",
"label": "Profile page" "label": "Profile page"
}, },
{ {
"src": "/static-assets/screenshots/2.webp", "src": "/static-assets/screenshots/2.webp?v=2",
"sizes": "1195x579", "sizes": "1080x2340",
"type": "image/webp", "type": "image/webp",
"platform": "narrow", "platform": "narrow",
"label": "Posts" "label": "Posts"