Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 外部サイトへのリンクは移動の前に警告を表示するように #13557

Closed
wants to merge 31 commits into from

Conversation

camilla-ett
Copy link
Contributor

@camilla-ett camilla-ett commented Mar 11, 2024

What

Cherry-picked from MisskeyIO#558 MisskeyIO@f7ec503

書いてあるとおり

Why

Fix #13614

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 83.19672% with 41 lines in your changes missing coverage. Please review.

Project coverage is 66.33%. Comparing base (61978cb) to head (c2fae88).
Report is 873 commits behind head on develop.

Files with missing lines Patch % Lines
...s/frontend/src/scripts/warning-external-website.ts 29.78% 33 Missing ⚠️
...kend/src/server/api/endpoints/admin/update-meta.ts 50.00% 5 Missing ⚠️
...ges/backend/src/core/entities/MetaEntityService.ts 0.00% 1 Missing ⚠️
...ges/backend/src/server/api/endpoints/admin/meta.ts 88.88% 1 Missing ⚠️
packages/frontend/src/instance.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13557       +/-   ##
============================================
- Coverage    77.99%   66.33%   -11.67%     
============================================
  Files          185      991      +806     
  Lines        25443   116414    +90971     
  Branches       485     4448     +3963     
============================================
+ Hits         19845    77219    +57374     
- Misses        5591    39163    +33572     
- Partials         7       32       +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

kakkokari-gtyih

This comment was marked as outdated.

@kakkokari-gtyih kakkokari-gtyih linked an issue Mar 22, 2024 that may be closed by this pull request
1 task
@kakkokari-gtyih kakkokari-gtyih self-assigned this Mar 22, 2024
@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/misskey-js labels Mar 22, 2024
@kakkokari-gtyih
Copy link
Contributor

↑ひきつぎした

Copy link
Contributor

github-actions bot commented Mar 22, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -416,6 +416,12 @@
                     "notesPerOneAd": {
                       "type": "number"
                     },
+                    "trustedLinkUrlPatterns": {
+                      "type": "array",
+                      "items": {
+                        "type": "string"
+                      }
+                    },
                     "backgroundImageUrl": {
                       "type": [
                         "string",
@@ -627,6 +633,7 @@
                     "perUserHomeTimelineCacheMax",
                     "perUserListTimelineCacheMax",
                     "notesPerOneAd",
+                    "trustedLinkUrlPatterns",
                     "backgroundImageUrl",
                     "deeplAuthKey",
                     "deeplIsPro",
@@ -12957,6 +12964,15 @@
                     ],
                     "description": "[Deprecated] Use \"urlPreviewSummaryProxyUrl\" instead."
                   },
+                  "trustedLinkUrlPatterns": {
+                    "type": [
+                      "array",
+                      "null"
+                    ],
+                    "items": {
+                      "type": "string"
+                    }
+                  },
                   "urlPreviewEnabled": {
                     "type": "boolean"
                   },
@@ -78670,6 +78686,12 @@
               ]
             }
           },
+          "trustedLinkUrlPatterns": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            }
+          },
           "notesPerOneAd": {
             "type": "number",
             "default": 0
@@ -78765,6 +78787,7 @@
           "iconUrl",
           "maxNoteTextLength",
           "ads",
+          "trustedLinkUrlPatterns",
           "notesPerOneAd",
           "enableEmail",
           "enableServiceWorker",

Get diff files from Workflow Page

@kakkokari-gtyih
Copy link
Contributor

image

@kakkokari-gtyih kakkokari-gtyih marked this pull request as ready for review March 22, 2024 08:59
@kakkokari-gtyih kakkokari-gtyih changed the title ノートに含まれたURLが外部サイトの場合、警告ダイアログを表示するか設定できるように feat: 外部サイトへのリンクは移動の前に警告を表示するように Mar 22, 2024
This reverts commit abf6a74.
locales/ja-JP.yml Outdated Show resolved Hide resolved
@syuilo
Copy link
Member

syuilo commented Mar 25, 2024

引き継ぎます

@syuilo
Copy link
Member

syuilo commented Mar 25, 2024

リンク先の安全性を十分に確認した上で進んでください。

実際に進んでみないと安全かどうか確認できない気もする

@syuilo
Copy link
Member

syuilo commented Mar 27, 2024

image

@syuilo
Copy link
Member

syuilo commented Mar 28, 2024

checkRedirectingOtherHost がlocaleに定義されてなさそう
(なんで型エラーにならないのかしら)

@syuilo
Copy link
Member

syuilo commented Mar 29, 2024

そもそも checkRedirectingOtherHost はどこでも使われてないわね

@kakkokari-gtyih
Copy link
Contributor

コンフリクト解消

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

外部サイトにリンクする際に警告を表示する
4 participants