diff --git a/compose_example.yml b/compose_example.yml index 15df128eff..0db8b04dc6 100644 --- a/compose_example.yml +++ b/compose_example.yml @@ -53,7 +53,7 @@ services: # restart: always # image: mcaptcha/mcaptcha:latest # networks: -# shonks: +# shonk: # aliases: # - localhost # ports: @@ -63,6 +63,8 @@ services: # environment: # PORT: 7493 # MCAPTCHA_redis_URL: "redis://mcaptcha_redis/" +# MCAPTCHA_allow_registration: true +# MCAPTCHA_server_DOMAIN: "example.tld" # depends_on: # db: # condition: service_healthy @@ -72,7 +74,7 @@ services: # mcaptcha_redis: # image: mcaptcha/cache:latest # networks: -# - shonks +# - shonk # healthcheck: # test: "redis-cli ping" # interval: 5s diff --git a/locales/en-US.yml b/locales/en-US.yml index f6861dcfb5..9c5237b3b7 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1456,6 +1456,9 @@ _serverSettings: appIconUsageExample: "E.g. As PWA, or when displayed as a home screen bookmark on a phone" appIconStyleRecommendation: "As the icon may be cropped to a square or circle, an icon with colored margin around the content is recommended." appIconResolutionMustBe: "The minimum resolution is {resolution}." + sidebarLogoUrl: "Logo URL" + sidebarLogoDescription: "Specifies the logo to use instead of the regular icon in high definition, dynamic-width scenarios." + sidebarLogoUsageExample: "E.g. In the sidebar, to visitors and in the \"About\" page." manifestJsonOverride: "manifest.json Override" shortName: "Short name" shortNameDescription: "A shorthand for the instance's name that can be displayed if the full official name is long." diff --git a/locales/index.d.ts b/locales/index.d.ts index 0456a947d3..bfa29e6e44 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5796,6 +5796,18 @@ export interface Locale extends ILocale { * 解像度は必ず{resolution}である必要があります。 */ "appIconResolutionMustBe": ParameterizedString<"resolution">; + /** + * ロゴURL + */ + "sidebarLogoUrl": string; + /** + * 高精細、ダイナミック幅のシナリオで通常のアイコンの代わりに使用するロゴを指定します。 + */ + "sidebarLogoDescription": string; + /** + * 例:サイドバー、訪問者用、「情報」ページ + */ + "sidebarLogoUsageExample": string; /** * manifest.jsonのオーバーライド */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index fd1a89b076..75866f2596 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1464,6 +1464,9 @@ _serverSettings: appIconUsageExample: "例: PWAや、スマートフォンのホーム画面にブックマークとして追加された時など" appIconStyleRecommendation: "円形もしくは角丸にクロップされる場合があるため、塗り潰された余白のある背景を持つことが推奨されます。" appIconResolutionMustBe: "解像度は必ず{resolution}である必要があります。" + sidebarLogoUrl: "ロゴURL" + sidebarLogoDescription: "高精細、ダイナミック幅のシナリオで通常のアイコンの代わりに使用するロゴを指定します。" + sidebarLogoUsageExample: "例:サイドバー、訪問者用、「情報」ページ" manifestJsonOverride: "manifest.jsonのオーバーライド" shortName: "略称" shortNameDescription: "サーバーの正式名称が長い場合に、代わりに表示することのできる略称や通称。" diff --git a/packages/backend/migration/1727027985575-SidebarLogo.js b/packages/backend/migration/1727027985575-SidebarLogo.js new file mode 100644 index 0000000000..03344a367f --- /dev/null +++ b/packages/backend/migration/1727027985575-SidebarLogo.js @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: piuvas and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class SidebarLogo1727027985575 { + name = 'SidebarLogo1727027985575'; + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "sidebarLogoUrl" character varying(1024)`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sidebarLogoUrl"`); + } +} diff --git a/packages/backend/src/core/entities/MetaEntityService.ts b/packages/backend/src/core/entities/MetaEntityService.ts index 3128b762f4..afeefc9033 100644 --- a/packages/backend/src/core/entities/MetaEntityService.ts +++ b/packages/backend/src/core/entities/MetaEntityService.ts @@ -105,6 +105,7 @@ export class MetaEntityService { serverErrorImageUrl: instance.serverErrorImageUrl, notFoundImageUrl: instance.notFoundImageUrl, iconUrl: instance.iconUrl, + sidebarLogoUrl: instance.sidebarLogoUrl, backgroundImageUrl: instance.backgroundImageUrl, logoImageUrl: instance.logoImageUrl, maxNoteTextLength: this.config.maxNoteLength, diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts index 1a07139a50..60dddee9a2 100644 --- a/packages/backend/src/misc/get-note-summary.ts +++ b/packages/backend/src/misc/get-note-summary.ts @@ -22,14 +22,14 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { // 本文 if (note.cw != null) { - summary += note.cw; - } else { - summary += note.text ? note.text : ''; + summary += `CW: ${note.cw}`; + } else if (note.text) { + summary += note.text; } // ファイルが添付されているとき - if ((note.files ?? []).length !== 0) { - summary += ` (📎${note.files!.length})`; + if (note.files && note.files.length !== 0) { + summary += ` (📎${note.files.length})`; } // 投票が添付されているとき @@ -39,7 +39,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { // 返信のとき if (note.replyId) { - if (note.reply) { + if (note.reply && !note.cw) { summary += `\n\nRE: ${getNoteSummary(note.reply)}`; } else { summary += '\n\nRE: ...'; @@ -48,7 +48,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { // Renoteのとき if (note.renoteId) { - if (note.renote) { + if (note.renote && !note.cw) { summary += `\n\nRN: ${getNoteSummary(note.renote)}`; } else { summary += '\n\nRN: ...'; diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 07c4e28b3a..29e1dd032a 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -139,6 +139,12 @@ export class MiMeta { }) public app512IconUrl: string | null; + @Column('varchar', { + length: 1024, + nullable: true, + }) + public sidebarLogoUrl: string | null; + @Column('varchar', { length: 1024, nullable: true, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 063bb6751b..5a69fbf679 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -110,6 +110,10 @@ export const meta = { type: 'string', optional: false, nullable: true, }, + sidebarLogoUrl: { + type: 'string', + optional: false, nullable: true, + }, enableEmail: { type: 'boolean', optional: false, nullable: false, @@ -582,6 +586,7 @@ export default class extends Endpoint { // eslint- iconUrl: instance.iconUrl, app192IconUrl: instance.app192IconUrl, app512IconUrl: instance.app512IconUrl, + sidebarLogoUrl: instance.sidebarLogoUrl, backgroundImageUrl: instance.backgroundImageUrl, logoImageUrl: instance.logoImageUrl, defaultLightTheme: instance.defaultLightTheme, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 6bda1ae6ad..c56dd053d3 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -55,6 +55,7 @@ export const paramDef = { iconUrl: { type: 'string', nullable: true }, app192IconUrl: { type: 'string', nullable: true }, app512IconUrl: { type: 'string', nullable: true }, + sidebarLogoUrl: { type: 'string', nullable: true }, backgroundImageUrl: { type: 'string', nullable: true }, logoImageUrl: { type: 'string', nullable: true }, name: { type: 'string', nullable: true }, @@ -250,6 +251,10 @@ export default class extends Endpoint { // eslint- set.app512IconUrl = ps.app512IconUrl; } + if (ps.sidebarLogoUrl !== undefined) { + set.sidebarLogoUrl = ps.sidebarLogoUrl; + } + if (ps.serverErrorImageUrl !== undefined) { set.serverErrorImageUrl = ps.serverErrorImageUrl; } diff --git a/packages/frontend/src/components/MkPostFormAttaches.vue b/packages/frontend/src/components/MkPostFormAttaches.vue index a3fb7c691f..7d24828e5b 100644 --- a/packages/frontend/src/components/MkPostFormAttaches.vue +++ b/packages/frontend/src/components/MkPostFormAttaches.vue @@ -7,7 +7,14 @@ SPDX-License-Identifier: AGPL-3.0-only