Merge branch 'develop' into merge/2025-03-24

This commit is contained in:
Hazelnoot 2025-04-13 13:07:24 -04:00
commit 91fb75dece
11 changed files with 34 additions and 6 deletions

View file

@ -435,3 +435,11 @@ attachLdSignatureForRelays: true
# If you're not using jemalloc, this may cause memory fragmentation and performance issues! (https://www.npmjs.com/package/ws#websocket-compression) # If you're not using jemalloc, this may cause memory fragmentation and performance issues! (https://www.npmjs.com/package/ws#websocket-compression)
# jemalloc is used by default in the Sharkey Docker image and may be set up manually otherwise: https://github.com/jemalloc/jemalloc/wiki/getting-started # jemalloc is used by default in the Sharkey Docker image and may be set up manually otherwise: https://github.com/jemalloc/jemalloc/wiki/getting-started
websocketCompression: false websocketCompression: false
# Inject arbitrary HTML tags to customize Sharkey without having to fork it
#customHtml:
# head: |
# <!-- The possibilities are limitless! -->
# <script>console.log("Hello, world!")</script>
# <style>.whatever { color: red; }</style>
# <link rel="stylesheet" href="https://example.com/styles.css">

4
locales/index.d.ts vendored
View file

@ -12202,6 +12202,10 @@ export interface Locale extends ILocale {
* Cat friend :3 * Cat friend :3
*/ */
"oneko": string; "oneko": string;
/**
* This will irreversibly delete this account. Proceed?
*/
"deleteThisAccountConfirm": string;
/** /**
* Enable Achievements * Enable Achievements
*/ */

View file

@ -145,6 +145,10 @@ type Source = {
}; };
websocketCompression?: boolean; websocketCompression?: boolean;
customHtml?: {
head?: string;
}
}; };
export type Config = { export type Config = {
@ -270,6 +274,10 @@ export type Config = {
}; };
websocketCompression?: boolean; websocketCompression?: boolean;
customHtml: {
head: string;
}
}; };
export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch' | 'sqlTsvector'; export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch' | 'sqlTsvector';
@ -420,6 +428,9 @@ export function loadConfig(): Config {
maxAge: config.activityLogging?.maxAge ?? (1000 * 60 * 60 * 24 * 30), maxAge: config.activityLogging?.maxAge ?? (1000 * 60 * 60 * 24 * 30),
}, },
websocketCompression: config.websocketCompression ?? false, websocketCompression: config.websocketCompression ?? false,
customHtml: {
head: config.customHtml?.head ?? '',
},
}; };
} }
@ -572,4 +583,5 @@ function applyEnvOverrides(config: Source) {
_apply_top([['signToActivityPubGet', 'checkActivityPubGetSignature', 'setupPassword']]); _apply_top([['signToActivityPubGet', 'checkActivityPubGetSignature', 'setupPassword']]);
_apply_top(['logging', 'sql', ['disableQueryTruncation', 'enableQueryParamLogging']]); _apply_top(['logging', 'sql', ['disableQueryTruncation', 'enableQueryParamLogging']]);
_apply_top(['activityLogging', ['enabled', 'preSave', 'maxAge']]); _apply_top(['activityLogging', ['enabled', 'preSave', 'maxAge']]);
_apply_top(['customHtml', ['head']]);
} }

View file

@ -458,6 +458,7 @@ export class ClientServerService {
url: this.config.url, url: this.config.url,
title: this.meta.name ?? 'Sharkey', title: this.meta.name ?? 'Sharkey',
desc: this.meta.description, desc: this.meta.description,
customHead: this.config.customHtml.head,
...await this.generateCommonPugData(this.meta), ...await this.generateCommonPugData(this.meta),
...data, ...data,
}); });

View file

@ -45,6 +45,8 @@ html
link(rel='stylesheet' href=`/static-assets/fonts/sharkey-icons/style.css?version=${version}`) link(rel='stylesheet' href=`/static-assets/fonts/sharkey-icons/style.css?version=${version}`)
link(rel='modulepreload' href=`/vite/${entry.file}`) link(rel='modulepreload' href=`/vite/${entry.file}`)
| !{customHead}
if !config.frontendManifestExists if !config.frontendManifestExists
script(type="module" src="/vite/@vite/client") script(type="module" src="/vite/@vite/client")

View file

@ -65,7 +65,7 @@ const emits = defineEmits<{
async function deleteAccount() { async function deleteAccount() {
const confirm = await os.confirm({ const confirm = await os.confirm({
type: 'warning', type: 'warning',
text: i18n.ts.deleteAccountConfirm, text: i18n.ts.deleteThisAccountConfirm,
}); });
if (confirm.canceled) return; if (confirm.canceled) return;

View file

@ -1,5 +1,5 @@
<!-- <!--
SPDX-FileCopyrightText: marie and other Sharkey contributors SPDX-FileCopyrightText: puniko and other Sharkey contributors
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
--> -->

View file

@ -449,7 +449,7 @@ async function deleteAllFiles() {
async function deleteAccount() { async function deleteAccount() {
const confirm = await os.confirm({ const confirm = await os.confirm({
type: 'warning', type: 'warning',
text: i18n.ts.deleteAccountConfirm, text: i18n.ts.deleteThisAccountConfirm,
}); });
if (confirm.canceled) return; if (confirm.canceled) return;

View file

@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<Mfm :text="announcement.title"/> <Mfm :text="announcement.title"/>
</div> </div>
<div :class="$style.content"> <div :class="$style.content">
<Mfm :text="announcement.text"/> <Mfm :text="announcement.text" :isBlock="true"/>
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/> <img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
<div style="margin-top: 8px; opacity: 0.7; font-size: 85%;"> <div style="margin-top: 8px; opacity: 0.7; font-size: 85%;">
{{ i18n.ts.createdAt }}: <MkTime :time="announcement.createdAt" mode="detail"/> {{ i18n.ts.createdAt }}: <MkTime :time="announcement.createdAt" mode="detail"/>

View file

@ -1,6 +1,6 @@
/* /*
* SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-FileCopyrightText: Simon Gündling and other chiptune2.js contributors
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: MIT
*/ */
/* eslint-disable */ /* eslint-disable */

View file

@ -138,6 +138,7 @@ oneko: "Cat friend :3"
renotesList: "Boosts" renotesList: "Boosts"
lookupConfirm: "Are you sure that you want to look this up?" lookupConfirm: "Are you sure that you want to look this up?"
openTagPageConfirm: "Are you sure you want to open this hashtags page?" openTagPageConfirm: "Are you sure you want to open this hashtags page?"
deleteThisAccountConfirm: "This will irreversibly delete this account. Proceed?"
specifyHost: "Specify a host" specifyHost: "Specify a host"
goToMisskey: "To Sharkey" goToMisskey: "To Sharkey"
enableAchievements: "Enable Achievements" enableAchievements: "Enable Achievements"