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)
- 👻 [KeyDB](https://keydb.dev/)
- 🍱 Another [Redis](https://redis.io/) server
### 🏗️ Build dependencies
- 🦀 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 { IdentifiableError } from "@/misc/identifiable-error.js";
import { fetchMeta } from "@/misc/fetch-meta.js";
import { HOUR } from "@/const.js";
import { MINUTE } from "@/const.js";
import define from "../../../define.js";
import { apiLogger } from "../../../logger.js";
import { ApiError } from "../../../error.js";
@ -14,8 +14,8 @@ export const meta = {
requireCredential: true,
limit: {
duration: HOUR,
max: 120,
duration: MINUTE * 10,
max: 250,
},
requireFile: true,
@ -40,7 +40,7 @@ export const meta = {
inappropriate: {
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",
id: "bec5bd69-fba3-43c9-b4fb-2894b66ad5d2",
},
@ -95,7 +95,7 @@ export default define(
name = null;
}
const meta = await fetchMeta();
const instanceMeta = await fetchMeta();
try {
// Create file
@ -107,8 +107,8 @@ export default define(
folderId: ps.folderId,
force: ps.force,
sensitive: ps.isSensitive,
requestIp: meta.enableIpLogging ? ip : null,
requestHeaders: meta.enableIpLogging ? headers : null,
requestIp: instanceMeta.enableIpLogging ? ip : null,
requestHeaders: instanceMeta.enableIpLogging ? headers : null,
});
return await DriveFiles.pack(driveFile, { self: true });
} catch (e) {
@ -123,7 +123,9 @@ export default define(
}
throw new ApiError();
} finally {
cleanup!();
if (cleanup !== undefined) {
cleanup();
}
}
},
);

View File

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