diff --git a/packages/backend/src/boot/master.ts b/packages/backend/src/boot/master.ts index bb0c9e6c2..41fa5aba4 100644 --- a/packages/backend/src/boot/master.ts +++ b/packages/backend/src/boot/master.ts @@ -27,7 +27,7 @@ const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../../built/meta.json const logger = new Logger('core', 'cyan'); const bootLogger = logger.createSubLogger('boot', 'magenta'); -const themeColor = chalk.hex('#e1aac6'); +const themeColor = chalk.hex('#f7c3de'); function greet() { if (!envOption.quiet) { diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index c332e5a0a..79ca3baad 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -165,9 +165,9 @@ export class DriveService { // 拡張子からContent-Typeを設定してそうな挙動を示すオブジェクトストレージ (upcloud?) も存在するので、 // 許可されているファイル形式でしかURLに拡張子をつけない - if (!FILE_TYPE_BROWSERSAFE.includes(type)) { - ext = ''; - } + // if (!FILE_TYPE_BROWSERSAFE.includes(type)) { + // ext = ''; + // } const baseUrl = this.meta.objectStorageBaseUrl ?? `${ this.meta.objectStorageUseSSL ? 'https' : 'http' }://${ this.meta.objectStorageEndpoint }${ this.meta.objectStoragePort ? `:${this.meta.objectStoragePort}` : '' }/${ this.meta.objectStorageBucket }`; @@ -372,8 +372,8 @@ export class DriveService { */ @bindThis private async upload(key: string, stream: fs.ReadStream | Buffer, type: string, ext?: string | null, filename?: string) { - if (type === 'image/apng') type = 'image/png'; - if (!FILE_TYPE_BROWSERSAFE.includes(type)) type = 'application/octet-stream'; + // if (type === 'image/apng') type = 'image/png'; + // if (!FILE_TYPE_BROWSERSAFE.includes(type)) type = 'application/octet-stream'; const params = { Bucket: this.meta.objectStorageBucket, diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts index a176474b9..aaad681f9 100644 --- a/packages/backend/src/core/EmailService.ts +++ b/packages/backend/src/core/EmailService.ts @@ -59,6 +59,8 @@ export class EmailService { } : undefined, } as any); + const siteName = meta.name || this.config.host; + const htmlContent = `
@@ -78,7 +80,7 @@ export class EmailService { a { text-decoration: none; - color: #86b300; + color: #fa9bcc; } a:hover { text-decoration: underline; @@ -92,7 +94,7 @@ export class EmailService { } main > header { padding: 32px; - background: #86b300; + background: #fa9bcc; } main > header > img { max-width: 128px; @@ -135,7 +137,7 @@ export class EmailService { `; @@ -147,7 +149,7 @@ export class EmailService { const info = await transporter.sendMail({ from: this.meta.email!, to: to, - subject: subject, + subject: `[${siteName}] ${subject}`, text: text, html: inlinedHtml, }); diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 89e3eafa0..6c60b4f0d 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -257,7 +257,8 @@ export class NoteCreateService implements OnApplicationShutdown { if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', sensitiveWords)) { data.visibility = 'home'; } else if ((await this.roleService.getUserPolicies(user.id)).canPublicNote === false) { - data.visibility = 'home'; + // User are banned from creating public notes + data.visibility = 'followers'; } } diff --git a/packages/backend/src/misc/correct-filename.ts b/packages/backend/src/misc/correct-filename.ts index f7ee02781..95e1e8b03 100644 --- a/packages/backend/src/misc/correct-filename.ts +++ b/packages/backend/src/misc/correct-filename.ts @@ -25,7 +25,7 @@ const extRegExp = /\.[0-9a-zA-Z]+$/i; * extはfile-typeのextを想定 */ export function correctFilename(filename: string, ext: string | null) { - const dotExt = ext ? ext[0] === '.' ? ext : `.${ext}` : '.unknown'; + const dotExt = ext ? ext[0] === '.' ? ext : `.${ext}` : ''; const match = extRegExp.exec(filename); if (!match || !match[0]) { diff --git a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts index 728fc9e72..9bf141027 100644 --- a/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanRemoteFilesProcessorService.ts @@ -54,7 +54,12 @@ export class CleanRemoteFilesProcessorService { cursor = files.at(-1)?.id ?? null; - await Promise.all(files.map(file => this.driveService.deleteFileSync(file, true))); + try { + await Promise.all(files.map(file => this.driveService.deleteFileSync(file, true))); + } catch (err) { + // 打印错误日志,但不终止执行 + this.logger.error('Failed to delete some cached remote files:' + (err as Error).toString()); + } deletedCount += 8; diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index 41b6d2e83..6dc765402 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -228,7 +228,7 @@ export class FileServerService { if (file.fileRole !== 'original') { const filename = rename(file.filename, { suffix: file.fileRole === 'thumbnail' ? '-thumb' : '-web', - extname: file.ext ? `.${file.ext}` : '.unknown', + extname: file.ext ? `.${file.ext}` : '', }).toString(); reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(file.mime) ? file.mime : 'application/octet-stream'); diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 626ff080c..2066fa654 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -41,6 +41,7 @@ export const paramDef = { sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, + localHostOnly: { type: 'boolean', default: false }, tag: { type: 'string', minLength: 1 }, query: { @@ -133,6 +134,10 @@ export default class extends Endpoint