From acba96c1d34572ed7bd454462c2462d2a32369f4 Mon Sep 17 00:00:00 2001
From: "Acid Chicken (硫酸鶏)" <root@acid-chicken.com>
Date: Sat, 17 Feb 2024 13:34:50 +0900
Subject: feat: license violation protection (#13285)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* spec(frontend): aboutページにリポジトリ・フィードバックのURLを表示させる

Cherry-picked from MisskeyIO#441
Cherry-picked from MisskeyIO#438

* feat: license violation protection

* build: fix typo

* build: fix typo

* fix: farewell to the static type land

* fix: key typo

* fix: import typo

* fix: properly interpret `prominently`

* docs: add disclaimer

* docs: update CHANGELOG

* chore: add gap

---------

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
---
 .../src/components/MkSourceCodeAvailablePopup.vue  | 112 +++++++++++++++++++++
 1 file changed, 112 insertions(+)
 create mode 100644 packages/frontend/src/components/MkSourceCodeAvailablePopup.vue

(limited to 'packages/frontend/src/components/MkSourceCodeAvailablePopup.vue')

diff --git a/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
new file mode 100644
index 0000000000..80f3a6709c
--- /dev/null
+++ b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
@@ -0,0 +1,112 @@
+<!--
+SPDX-FileCopyrightText: syuilo and misskey-project
+SPDX-License-Identifier: AGPL-3.0-only
+-->
+
+<template>
+<div class="_panel _shadow" :class="$style.root">
+	<div :class="$style.icon">
+		<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-open-source" width="40" height="40" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
+			<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
+			<path d="M12 3a9 9 0 0 1 3.618 17.243l-2.193 -5.602a3 3 0 1 0 -2.849 0l-2.193 5.603a9 9 0 0 1 3.617 -17.244z"/>
+		</svg>
+	</div>
+	<div :class="$style.main">
+		<div :class="$style.title">
+			<I18n :src="i18n.ts.aboutX" tag="span">
+				<template #x>
+					{{ instance.name ?? host }}
+				</template>
+			</I18n>
+		</div>
+		<div :class="$style.text">
+			<I18n :src="i18n.ts._aboutMisskey.thisIsModifiedVersion" tag="span">
+				<template #name>
+					{{ instance.name ?? host }}
+				</template>
+			</I18n>
+			<I18n :src="i18n.ts.correspondingSourceIsAvailable" tag="span">
+				<template #anchor>
+					<MkA to="/about-misskey" class="_link">{{ i18n.ts.aboutMisskey }}</MkA>
+				</template>
+			</I18n>
+		</div>
+		<div class="_buttons">
+			<MkButton @click="close">{{ i18n.ts.gotIt }}</MkButton>
+		</div>
+	</div>
+	<button class="_button" :class="$style.close" @click="close"><i class="ti ti-x"></i></button>
+</div>
+</template>
+
+<script lang="ts" setup>
+import MkButton from '@/components/MkButton.vue';
+import { host } from '@/config.js';
+import { i18n } from '@/i18n.js';
+import { instance } from '@/instance.js';
+import { miLocalStorage } from '@/local-storage.js';
+import * as os from '@/os.js';
+
+const emit = defineEmits<{
+	(ev: 'closed'): void;
+}>();
+
+const zIndex = os.claimZIndex('low');
+
+function close() {
+	miLocalStorage.setItem('modifiedVersionMustProminentlyOfferInAgplV3Section13Read', 'true');
+	emit('closed');
+}
+</script>
+
+<style lang="scss" module>
+.root {
+	position: fixed;
+	z-index: v-bind(zIndex);
+	bottom: var(--margin);
+	left: 0;
+	right: 0;
+	margin: auto;
+	box-sizing: border-box;
+	width: calc(100% - (var(--margin) * 2));
+	max-width: 500px;
+	display: flex;
+}
+
+.icon {
+	text-align: center;
+	padding-top: 25px;
+	width: 100px;
+	color: var(--accent);
+}
+@media (max-width: 500px) {
+	.icon {
+		width: 80px;
+	}
+}
+@media (max-width: 450px) {
+	.icon {
+		width: 70px;
+	}
+}
+
+.main {
+	padding: 25px 25px 25px 0;
+	flex: 1;
+}
+
+.close {
+	position: absolute;
+	top: 8px;
+	right: 8px;
+	padding: 8px;
+}
+
+.title {
+	font-weight: bold;
+}
+
+.text {
+	margin: 0.7em 0 1em 0;
+}
+</style>
-- 
cgit v1.2.3-freya


From 70f7f976fbb841c5d354bc83aee3b7fbaa8f1458 Mon Sep 17 00:00:00 2001
From: Marie <marie@kaifa.ch>
Date: Mon, 19 Feb 2024 10:51:25 +0100
Subject: fix: url in new component

---
 locales/index.d.ts                                              | 2 +-
 packages/frontend/src/components/MkSourceCodeAvailablePopup.vue | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/MkSourceCodeAvailablePopup.vue')

diff --git a/locales/index.d.ts b/locales/index.d.ts
index bceef397e1..d9f5a1ea73 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -7055,7 +7055,7 @@ export interface Locale extends ILocale {
          */
         "thisIsModifiedVersion": ParameterizedString<"name">;
         /**
-         * Misskeyを翻訳
+         * Sharkeyを翻訳
          */
         "translation": string;
         /**
diff --git a/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
index 80f3a6709c..dcab80e758 100644
--- a/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
+++ b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
@@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 			</I18n>
 			<I18n :src="i18n.ts.correspondingSourceIsAvailable" tag="span">
 				<template #anchor>
-					<MkA to="/about-misskey" class="_link">{{ i18n.ts.aboutMisskey }}</MkA>
+					<MkA to="/about-sharkey" class="_link">{{ i18n.ts.aboutMisskey }}</MkA>
 				</template>
 			</I18n>
 		</div>
-- 
cgit v1.2.3-freya


From c9940b7359e72a3cd806b174e4a2a651f56d0e7a Mon Sep 17 00:00:00 2001
From: dakkar <dakkar@thenautilus.net>
Date: Tue, 20 Feb 2024 20:01:31 +0000
Subject: Switch source code bits

---
 locales/en-US.yml                                  | 13 +++++-
 locales/index.d.ts                                 | 16 +++++--
 locales/ja-JP.yml                                  |  8 ++--
 .../backend/src/server/api/openapi/gen-spec.ts     |  4 +-
 packages/frontend/src/boot/main-boot.ts            |  2 +-
 .../src/components/MkSourceCodeAvailablePopup.vue  |  1 +
 packages/frontend/src/pages/about-sharkey.vue      | 50 +++++++++++++---------
 7 files changed, 62 insertions(+), 32 deletions(-)

(limited to 'packages/frontend/src/components/MkSourceCodeAvailablePopup.vue')

diff --git a/locales/en-US.yml b/locales/en-US.yml
index 67791c98ae..64033d6a2b 100644
--- a/locales/en-US.yml
+++ b/locales/en-US.yml
@@ -1026,6 +1026,7 @@ remindMeLater: "Maybe later"
 didYouLikeMisskey: "Have you taken a liking to Sharkey?"
 pleaseDonate: "{host} uses the free software, Sharkey. We would highly appreciate your donations so development of Sharkey can continue!"
 pleaseDonateInstance: "You can also support {host} directly by donating to your instance administration."
+correspondingSourceIsAvailable: "The corresponding source code is available from {anchor}."
 roles: "Roles"
 role: "Role"
 noRole: "Role not found"
@@ -1214,6 +1215,12 @@ confirmShowRepliesAll: "This operation is irreversible. Would you really like to
 confirmHideRepliesAll: "This operation is irreversible. Would you really like to hide replies to others from everyone you follow in your timeline?"
 externalServices: "External Services"
 sourceCode: "Source code"
+sourceCodeIsNotYetProvided: "The source code is not yet available. Please contact your administrator to fix this issue."
+repositoryUrl: "Repository URL"
+repositoryUrlDescription: "If there is a repository where the source code is publicly available, enter its URL. If you are using Sharkey as-is (without any changes to the source code), enter https://activitypub.software/TransFem-org/Sharkey/."
+repositoryUrlOrTarballRequired: "If you don't have a public repository, you'll need to provide a tarball instead. See .config/example.yml for details."
+feedback: "Feedback"
+feedbackUrl: "Feedback URL"
 impressum: "Impressum"
 impressumUrl: "Impressum URL"
 impressumDescription: "In some countries, like germany, the inclusion of operator contact information (an Impressum) is legally required for commercial websites."
@@ -1808,8 +1815,12 @@ _aboutMisskey:
   contributors: "Main contributors"
   allContributors: "All contributors"
   source: "Source code"
+  original: "Misskey original"
+  original_sharkey: "Sharkey original"
+  thisIsModifiedVersion: "{name} uses a modified version of the original Sharkey"
   translation: "Translate Sharkey"
-  donate: "Donate to Sharkey"
+  donate: "Donate to Misskey"
+  donate_sharkey: "Donate to Sharkey"
   morePatrons: "We also appreciate the support of many other helpers not listed here. Thank you! 🥰"
   patrons: "Patrons"
   projectMembers: "Project members"
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 30ead15e13..f816feb108 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -7059,11 +7059,15 @@ export interface Locale extends ILocale {
          */
         "source": string;
         /**
-         * オリジナル
+         * Misskey オリジナル
          */
         "original": string;
         /**
-         * {name}はオリジナルのMisskeyを改変したバージョンを使用しています。
+         * Sharkey オリジナル
+         */
+        "original_sharkey": string;
+        /**
+         * {name}はオリジナルのSharkeyを改変したバージョンを使用しています。
          */
         "thisIsModifiedVersion": ParameterizedString<"name">;
         /**
@@ -7071,9 +7075,13 @@ export interface Locale extends ILocale {
          */
         "translation": string;
         /**
-         * Sharkeyに寄付
+         * Misskeyに寄付
          */
         "donate": string;
+        /**
+         * Sharkeyに寄付
+         */
+        "donate_sharkey": string;
         /**
          * 他にも多くの方が支援してくれています。ありがとうございます🥰
          */
@@ -9049,7 +9057,7 @@ export interface Locale extends ILocale {
          */
         "pollEnded": string;
         /**
-         * 注記が編集されました
+         * 投稿が編集されました
          */
         "edited": string;
         /**
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index db3ea6c653..439210f45e 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -1839,10 +1839,12 @@ _aboutMisskey:
   contributors: "主なコントリビューター"
   allContributors: "全てのコントリビューター"
   source: "ソースコード"
-  original: "オリジナル"
-  thisIsModifiedVersion: "{name}はオリジナルのMisskeyを改変したバージョンを使用しています。"
+  original: "Misskey オリジナル"
+  original_sharkey: "Sharkey オリジナル"
+  thisIsModifiedVersion: "{name}はオリジナルのSharkeyを改変したバージョンを使用しています。"
   translation: "Sharkeyを翻訳"
-  donate: "Sharkeyに寄付"
+  donate: "Misskeyに寄付"
+  donate_sharkey: "Sharkeyに寄付"
   morePatrons: "他にも多くの方が支援してくれています。ありがとうございます🥰"
   patrons: "支援者"
   projectMembers: "プロジェクトメンバー"
diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts
index 7679a9b464..b5f91ff542 100644
--- a/packages/backend/src/server/api/openapi/gen-spec.ts
+++ b/packages/backend/src/server/api/openapi/gen-spec.ts
@@ -20,7 +20,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
 
 		externalDocs: {
 			description: 'Repository',
-			url: 'https://github.com/misskey-dev/misskey',
+			url: 'https://activitypub.software/TransFem-org/Sharkey',
 		},
 
 		servers: [{
@@ -98,7 +98,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
 			description: desc,
 			externalDocs: {
 				description: 'Source code',
-				url: `https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/${endpoint.name}.ts`,
+				url: `https://activitypub.software/TransFem-org/Sharkey/-/tree/develop/packages/backend/src/server/api/endpoints/${endpoint.name}.ts`,
 			},
 			...(endpoint.meta.tags ? {
 				tags: [endpoint.meta.tags[0]],
diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts
index 324bc40146..66d9bf0680 100644
--- a/packages/frontend/src/boot/main-boot.ts
+++ b/packages/frontend/src/boot/main-boot.ts
@@ -235,7 +235,7 @@ export async function mainBoot() {
 
 		fetchInstance().then(() => {
 			const modifiedVersionMustProminentlyOfferInAgplV3Section13Read = miLocalStorage.getItem('modifiedVersionMustProminentlyOfferInAgplV3Section13Read');
-			if (modifiedVersionMustProminentlyOfferInAgplV3Section13Read !== 'true' && instance.repositoryUrl !== 'https://github.com/misskey-dev/misskey') {
+			if (modifiedVersionMustProminentlyOfferInAgplV3Section13Read !== 'true' && instance.repositoryUrl !== 'https://activitypub.software/TransFem-org/Sharkey/') {
 				popup(defineAsyncComponent(() => import('@/components/MkSourceCodeAvailablePopup.vue')), {}, {}, 'closed');
 			}
 		});
diff --git a/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
index dcab80e758..cd884f0b19 100644
--- a/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
+++ b/packages/frontend/src/components/MkSourceCodeAvailablePopup.vue
@@ -71,6 +71,7 @@ function close() {
 	width: calc(100% - (var(--margin) * 2));
 	max-width: 500px;
 	display: flex;
+	backdrop-filter: var(--blur, blur(15px));
 }
 
 .icon {
diff --git a/packages/frontend/src/pages/about-sharkey.vue b/packages/frontend/src/pages/about-sharkey.vue
index d3efb23033..954db9025a 100644
--- a/packages/frontend/src/pages/about-sharkey.vue
+++ b/packages/frontend/src/pages/about-sharkey.vue
@@ -27,21 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 				<div v-if="$i != null" style="text-align: center;">
 					<MkButton primary rounded inline @click="iLoveMisskey">I <Mfm text="$[jelly ❤]"/> #Sharkey</MkButton>
 				</div>
-				<FormSection>
-					<div class="_gaps_s">
-						<FormLink to="https://github.com/misskey-dev/misskey" external>
-							<template #icon><i class="ph-code ph-bold ph-lg"></i></template>
-							{{ i18n.ts._aboutMisskey.source }} ({{ i18n.ts._aboutMisskey.original }})
-							<template #suffix>GitHub</template>
-						</FormLink>
-						<FormLink to="https://www.patreon.com/syuilo" external>
-							<template #icon><i class="ph-piggy-bank ph-bold ph-lg"></i></template>
-							{{ i18n.ts._aboutMisskey.donate }}
-							<template #suffix>Patreon</template>
-						</FormLink>
-					</div>
-				</FormSection>
-				<FormSection v-if="instance.repositoryUrl !== 'https://github.com/misskey-dev/misskey'">
+				<FormSection v-if="instance.repositoryUrl !== 'https://activitypub.software/TransFem-org/Sharkey/'">
 					<div class="_gaps_s">
 						<MkInfo>
 							{{ i18n.tsx._aboutMisskey.thisIsModifiedVersion({ name: instance.name }) }}
@@ -49,12 +35,6 @@ SPDX-License-Identifier: AGPL-3.0-only
 						<FormLink v-if="instance.repositoryUrl" :to="instance.repositoryUrl" external>
 							<template #icon><i class="ph-code ph-bold ph-lg"></i></template>
 							{{ i18n.ts._aboutMisskey.source }}
-							<template #suffix>GitLab</template>
-						</FormLink>
-						<FormLink to="https://ko-fi.com/transfem" external>
-							<template #icon><i class="ph-piggy-bank ph-bold ph-lg"></i></template>
-							{{ i18n.ts._aboutMisskey.donate }}
-							<template #suffix>Ko-Fi</template>
 						</FormLink>
 						<FormLink v-if="instance.providesTarball" :to="`/tarball/sharkey-${version}.tar.gz`" external>
 							<template #icon><i class="ph-download ph-bold ph-lg"></i></template>
@@ -66,6 +46,34 @@ SPDX-License-Identifier: AGPL-3.0-only
 						</MkInfo>
 					</div>
 				</FormSection>
+				<FormSection>
+					<div class="_gaps_s">
+						<FormLink to="https://activitypub.software/TransFem-org/Sharkey/" external>
+							<template #icon><i class="ph-code ph-bold ph-lg"></i></template>
+							{{ i18n.ts._aboutMisskey.source }} ({{ i18n.ts._aboutMisskey.original_sharkey }})
+							<template #suffix>GitLab</template>
+						</FormLink>
+						<FormLink to="https://ko-fi.com/transfem" external>
+							<template #icon><i class="ph-piggy-bank ph-bold ph-lg"></i></template>
+							{{ i18n.ts._aboutMisskey.donate_sharkey }}
+							<template #suffix>Ko-Fi</template>
+						</FormLink>
+					</div>
+				</FormSection>
+				<FormSection>
+					<div class="_gaps_s">
+						<FormLink to="https://github.com/misskey-dev/misskey" external>
+							<template #icon><i class="ph-code ph-bold ph-lg"></i></template>
+							{{ i18n.ts._aboutMisskey.source }} ({{ i18n.ts._aboutMisskey.original }})
+							<template #suffix>GitHub</template>
+						</FormLink>
+						<FormLink to="https://www.patreon.com/syuilo" external>
+							<template #icon><i class="ph-piggy-bank ph-bold ph-lg"></i></template>
+							{{ i18n.ts._aboutMisskey.donate }}
+							<template #suffix>Patreon</template>
+						</FormLink>
+					</div>
+				</FormSection>
 				<FormSection>
 					<template #label>{{ i18n.ts._aboutMisskey.projectMembers }}</template>
 					<div :class="$style.contributors" style="margin-bottom: 8px;">
-- 
cgit v1.2.3-freya

