期限切れ/未保存リモートファイルのローカルプロキシ (#5655)
* Media Proxy を実装 * サンプルを追加 * https://github.com/syuilo/misskey/pull/5649#discussion_r359967471 の修正 * https://github.com/syuilo/misskey/pull/5649#discussion_r359967966 の修正 * https://github.com/syuilo/misskey/pull/5649#discussion_r359968219 の修正 * 期限切れ/未保存リモートファイルのローカルプロキシ * 設定 * 説明 * comment out * fix Co-authored-by: 和風ドレッシング <37681609+CookieRamen@users.noreply.github.com>
This commit is contained in:
parent
307fc18138
commit
b0bb5d8dfc
11 changed files with 151 additions and 12 deletions
|
@ -424,6 +424,10 @@ export default async function(
|
|||
file.url = url;
|
||||
file.thumbnailUrl = url;
|
||||
file.webpublicUrl = url;
|
||||
// ローカルプロキシ用
|
||||
file.accessKey = uuid();
|
||||
file.thumbnailAccessKey = 'thumbnail-' + uuid();
|
||||
file.webpublicAccessKey = 'webpublic-' + uuid();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import { driveChart, perUserDriveChart, instanceChart } from '../chart';
|
|||
import { createDeleteObjectStorageFileJob } from '../../queue';
|
||||
import { fetchMeta } from '../../misc/fetch-meta';
|
||||
import { getS3 } from './s3';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
export async function deleteFile(file: DriveFile, isExpired = false) {
|
||||
if (file.storedInternal) {
|
||||
|
@ -71,6 +72,10 @@ function postProcess(file: DriveFile, isExpired = false) {
|
|||
thumbnailUrl: file.uri,
|
||||
webpublicUrl: file.uri,
|
||||
size: 0,
|
||||
// ローカルプロキシ用
|
||||
accessKey: uuid(),
|
||||
thumbnailAccessKey: 'thumbnail-' + uuid(),
|
||||
webpublicAccessKey: 'webpublic-' + uuid(),
|
||||
});
|
||||
} else {
|
||||
DriveFiles.delete(file.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue