Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into io
Browse files Browse the repository at this point in the history
  • Loading branch information
SanMurakami committed Feb 1, 2022
2 parents f7ae4b9 + 1fd6c97 commit ba40208
Show file tree
Hide file tree
Showing 139 changed files with 2,068 additions and 1,528 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@
-->

## 12.103.1 (2022/02/02)

### Bugfixes
- クライアント: ツールチップの表示位置が正しくない問題を修正

## 12.103.0 (2022/02/02)

### Improvements
- クライアント: 連合インスタンスページからインスタンス情報再取得を行えるように

### Bugfixes
- クライアント: 投稿のNSFW画像を表示したあとにリアクションが更新されると画像が非表示になる問題を修正
- クライアント: 「クリップ」ページが開かない問題を修正
- クライアント: トレンドウィジェットが動作しないのを修正
- クライアント: フェデレーションウィジェットが動作しないのを修正
- クライアント: リアクション設定で絵文字ピッカーが開かないのを修正
- クライアント: DMページでメンションが含まれる問題を修正
- クライアント: 投稿フォームのハッシュタグ保持フィールドが動作しない問題を修正
- クライアント: サイドビューが動かないのを修正
- クライアント: ensure that specified users does not get duplicates
- Add `img-src` and `media-src` directives to `Content-Security-Policy` for
files and media proxy

## 12.102.1 (2022/01/27)
### Bugfixes
- チャットが表示できない問題を修正
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ We're glad you're interested in contributing Misskey! In this document you will

**ℹ️ Important:** This project uses Japanese as its major language, **but you do not need to translate and write the Issues/PRs in Japanese.**
Also, you might receive comments on your Issue/PR in Japanese, but you do not need to reply to them in Japanese as well.\
The accuracy of translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language.
The accuracy of machine translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language.
It will also allow the reader to use the translation tool of their preference if necessary.

## Issues
Expand Down
4 changes: 4 additions & 0 deletions cypress/integration/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,7 @@ describe('After user singed in', () => {
cy.contains('Hello, Misskey!');
});
});

// TODO: 投稿フォームの公開範囲指定のテスト
// TODO: 投稿フォームのファイル添付のテスト
// TODO: 投稿フォームのハッシュタグ保持フィールドのテスト
509 changes: 509 additions & 0 deletions locales/bn-BD.yml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions locales/de-DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ resetAreYouSure: "Wirklich zurücksetzen?"
saved: "Gespeichert"
messaging: "Chat"
upload: "Hochladen"
keepOriginalUploading: "Originalbild speichern"
keepOriginalUploadingDescription: "Speichert das Originalbild so, wie es ist. Ist dies deaktiviert, wird eine Version zum Anzeigen im Internet generiert."
fromDrive: "Aus Drive"
fromUrl: "Von einer URL"
uploadFromUrl: "Von einer URL hochladen"
Expand Down
2 changes: 2 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ resetAreYouSure: "Really reset?"
saved: "Saved"
messaging: "Chat"
upload: "Upload"
keepOriginalUploading: "Keep original image"
keepOriginalUploadingDescription: "Saves the originally uploaded image as-is. If turned off, a version to display on the web will be generated on upload."
fromDrive: "From Drive"
fromUrl: "From URL"
uploadFromUrl: "Upload from a URL"
Expand Down
4 changes: 4 additions & 0 deletions locales/fr-FR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ resetAreYouSure: "Voulez-vous réinitialiser ?"
saved: "Enregistré"
messaging: "Discuter"
upload: "Téléverser"
keepOriginalUploading: "Garder l’image d’origine"
fromDrive: "Depuis le Drive"
fromUrl: "Depuis une URL"
uploadFromUrl: "Téléverser via une URL"
Expand Down Expand Up @@ -743,6 +744,7 @@ notRecommended: "Déconseillé"
botProtection: "Protection contre les bots"
instanceBlocking: "Instances bloquées"
selectAccount: "Sélectionner un compte"
switchAccount: "Changer de compte"
enabled: "Activé"
disabled: "Désactivé"
quickAction: "Actions rapides"
Expand Down Expand Up @@ -803,6 +805,7 @@ makeReactionsPublic: "Rendre les réactions publiques"
makeReactionsPublicDescription: "Ceci rendra la liste de toutes vos réactions données publique."
classic: "Classique"
muteThread: "Mettre ce thread en sourdine"
unmuteThread: "Ne plus masquer le fil"
ffVisibility: "Visibilité des abonnés/abonnements"
ffVisibilityDescription: "Permet de configurer qui peut voir les personnes que tu suis et les personnes qui te suivent."
continueThread: "Afficher la suite du fil"
Expand Down Expand Up @@ -1241,6 +1244,7 @@ _exportOrImport:
muteList: "Comptes masqués"
blockingList: "Comptes bloqués"
userLists: "Listes"
excludeMutingUsers: "Exclure les utilisateur·rice·s mis en sourdine"
excludeInactiveUsers: "Exclure les utilisateur·rice·s inactifs"
_charts:
federationInstancesIncDec: "Variation du nombre d'instances fédérées"
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ resetAreYouSure: "リセットしますか?"
saved: "保存しました"
messaging: "チャット"
upload: "アップロード"
keepOriginalUploading: "オリジナル画像を保持"
keepOriginalUploadingDescription: "画像をアップロードする時にオリジナル版を保持します。オフにするとアップロード時にブラウザでWeb公開用画像を生成します。"
fromDrive: "ドライブから"
fromUrl: "URLから"
uploadFromUrl: "URLアップロード"
Expand Down
14 changes: 14 additions & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ clickToShow: "클릭하여 보기"
sensitive: "열람주의"
add: "추가"
reaction: "리액션"
reactionSetting: "선택기에 표시할 리액션"
reactionSettingDescription2: "끌어서 순서 변경, 클릭해서 삭제, +를 눌러서 추가할 수 있습니다."
rememberNoteVisibility: "공개 범위를 기억하기"
attachCancel: "첨부 취소"
Expand Down Expand Up @@ -234,6 +235,8 @@ resetAreYouSure: "초기화 하시겠습니까?"
saved: "저장하였습니다"
messaging: "대화"
upload: "업로드"
keepOriginalUploading: "원본 이미지를 유지"
keepOriginalUploadingDescription: "이미지를 업로드할 때에 원본을 그대로 유지합니다. 비활성화하면 업로드할 때 브라우저에서 웹 공개용 이미지를 생성합니다."
fromDrive: "드라이브에서"
fromUrl: "URL로부터"
uploadFromUrl: "URL 업로드"
Expand Down Expand Up @@ -446,6 +449,7 @@ uiLanguage: "UI 표시 언어"
groupInvited: "그룹에 초대되었습니다"
aboutX: "{x}에 대하여"
useOsNativeEmojis: "OS 기본 이모지를 사용"
disableDrawer: "드로어 메뉴를 사용하지 않기"
youHaveNoGroups: "그룹이 없습니다"
joinOrCreateGroup: "다른 그룹의 초대를 받거나, 직접 새 그룹을 만들어 보세요."
noHistory: "기록이 없습니다"
Expand Down Expand Up @@ -617,8 +621,11 @@ reportAbuse: "신고"
reportAbuseOf: "{name}을 신고하기"
fillAbuseReportDescription: "신고하려는 이유를 자세히 알려주세요. 특정 게시물을 신고할 때에는 게시물의 URL도 포함해 주세요."
abuseReported: "신고를 보냈습니다. 신고해 주셔서 감사합니다."
reporter: "신고자"
reporteeOrigin: "피신고자"
reporterOrigin: "신고자"
forwardReport: "리모트 인스턴스에도 신고 내용 보내기"
forwardReportIsAnonymous: "리모트 인스턴스에서는 나의 정보를 볼 수 없으며, 익명의 시스템 계정으로 표시됩니다."
send: "전송"
abuseMarkAsResolved: "해결됨으로 표시"
openInNewTab: "새 탭에서 열기"
Expand Down Expand Up @@ -680,6 +687,7 @@ center: "가운데"
wide: "넓게"
narrow: "좁게"
reloadToApplySetting: "이 설정을 적용하려면 페이지를 새로고침해야 합니다. 바로 새로고침하시겠습니까?"
needReloadToApply: "변경 사항은 새로고침하면 적용됩니다."
showTitlebar: "타이틀 바를 표시하기"
clearCache: "캐시 비우기"
onlineUsersCount: "{n}명이 접속 중"
Expand Down Expand Up @@ -740,6 +748,7 @@ notRecommended: "추천하지 않음"
botProtection: "Bot 방어"
instanceBlocking: "인스턴스 차단"
selectAccount: "계정 선택"
switchAccount: "계정 바꾸기"
enabled: "활성화"
disabled: "비활성화"
quickAction: "빠른 동작"
Expand Down Expand Up @@ -808,6 +817,11 @@ deleteAccountConfirm: "계정이 삭제되고 되돌릴 수 없게 됩니다.
incorrectPassword: "비밀번호가 올바르지 않습니다."
voteConfirm: "\"{choice}\"에 투표하시겠습니까?"
hide: "숨기기"
leaveGroup: "그룹 나가기"
leaveGroupConfirm: "\"{name}\"에서 나갈까요?"
useDrawerReactionPickerForMobile: "모바일에서 드로어 메뉴로 표시"
welcomeBackWithName: "환영합니다, {name}님"
clickToFinishEmailVerification: "[{ok}]를 눌러 이메일 인증을 완료하세요."
_emailUnavailable:
used: "이 메일 주소는 사용중입니다"
format: "형식이 올바르지 않습니다"
Expand Down
5 changes: 5 additions & 0 deletions locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ resetAreYouSure: "恢复默认设置?"
saved: "已保存"
messaging: "聊天"
upload: "本地上传"
keepOriginalUploading: "保留原图"
keepOriginalUploadingDescription: "上传图片时保留原始图片。关闭时,浏览器会在上传时生成一张用于web发布的图片。"
fromDrive: "从网盘中"
fromUrl: "从 URL"
uploadFromUrl: "从网址上传"
Expand Down Expand Up @@ -619,8 +621,11 @@ reportAbuse: "举报"
reportAbuseOf: "举报{name}"
fillAbuseReportDescription: "请填写举报的详细原因。如果有对方发的帖子,请同时填写URL地址。"
abuseReported: "内容已发送。感谢您的报告。"
reporter: "报告者"
reporteeOrigin: "举报来源"
reporterOrigin: "举报者来源"
forwardReport: "将报告转发给远程实例"
forwardReportIsAnonymous: "在远程实例上显示的报告者是匿名的系统账号,而不是您的账号。"
send: "发送"
abuseMarkAsResolved: "处理完毕"
openInNewTab: "在新标签页中打开"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.102.1",
"version": "12.103.1",
"codename": "indigo",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"langmap": "0.0.16",
"mfm-js": "0.21.0",
"mime-types": "2.1.34",
"misskey-js": "0.0.13",
"misskey-js": "0.0.14",
"mocha": "8.4.0",
"ms": "3.0.0-canary.1",
"multer": "1.4.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/api-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => {
// Authentication
authenticate(body['i']).then(([user, app]) => {
// API invoking
call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => {
call(endpoint.name, user, app, body, ctx).then((res: any) => {
reply(res);
}).catch((e: ApiError) => {
reply(e.httpStatusCode ? e.httpStatusCode : e.kind === 'client' ? 400 : 500, e);
Expand Down
16 changes: 14 additions & 2 deletions packages/backend/src/server/api/call.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as Koa from 'koa';
import { performance } from 'perf_hooks';
import { limiter } from './limiter';
import { User } from '@/models/entities/user';
Expand All @@ -12,7 +13,7 @@ const accessDenied = {
id: '56f35758-7dd5-468b-8439-5d6fb8ec9b8e',
};

export default async (endpoint: string, user: User | null | undefined, token: AccessToken | null | undefined, data: any, file?: any) => {
export default async (endpoint: string, user: User | null | undefined, token: AccessToken | null | undefined, data: any, ctx?: Koa.Context) => {
const isSecure = user != null && token == null;

const ep = endpoints.find(e => e.name === endpoint);
Expand Down Expand Up @@ -76,9 +77,20 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac
});
}

// Cast non JSON input
if (ep.meta.requireFile && ep.meta.params) {
const body = (ctx!.request as any).body;
for (const k of Object.keys(ep.meta.params)) {
const param = ep.meta.params[k];
if (['Boolean', 'Number'].includes(param.validator.name) && typeof body[k] === 'string') {
body[k] = JSON.parse(body[k]);
}
}
}

// API invoking
const before = performance.now();
return await ep.exec(data, user, token, file).catch((e: Error) => {
return await ep.exec(data, user, token, ctx!.file).catch((e: Error) => {
if (e instanceof ApiError) {
throw e;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ export const meta = {
},

isSensitive: {
validator: $.optional.either($.bool, $.str),
validator: $.optional.bool,
default: false,
transform: (v: any): boolean => v === true || v === 'true',
},

force: {
validator: $.optional.either($.bool, $.str),
validator: $.optional.bool,
default: false,
transform: (v: any): boolean => v === true || v === 'true',
},
},

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const _dirname = dirname(_filename);
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`);
ctx.set('Content-Security-Policy', `default-src 'none'; img-src 'self'; media-src 'self'; style-src 'unsafe-inline'`);
await next();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { proxyMedia } from './proxy-media';
const app = new Koa();
app.use(cors());
app.use(async (ctx, next) => {
ctx.set('Content-Security-Policy', `default-src 'none'; style-src 'unsafe-inline'`);
ctx.set('Content-Security-Policy', `default-src 'none'; img-src 'self'; media-src 'self'; style-src 'unsafe-inline'`);
await next();
});

Expand Down
8 changes: 4 additions & 4 deletions packages/backend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4967,10 +4967,10 @@ minizlib@^2.0.0, minizlib@^2.1.1:
minipass "^3.0.0"
yallist "^4.0.0"

[email protected].13:
version "0.0.13"
resolved "https://registry.yarnpkg.com/misskey-js/-/misskey-js-0.0.13.tgz#03a4e469186e28752d599dc4093519eb64647970"
integrity sha512-kBdJdfe281gtykzzsrN3IAxWUQIimzPiJGyKWf863ggWJlWYVPmP9hTFlX2z8oPOaypgVBPEPHyw/jNUdc2DbQ==
[email protected].14:
version "0.0.14"
resolved "https://registry.yarnpkg.com/misskey-js/-/misskey-js-0.0.14.tgz#1a616bdfbe81c6ee6900219eaf425bb5c714dd4d"
integrity sha512-bvLx6U3OwQwqHfp/WKwIVwdvNYAAPk0+YblXyxmSG3dwlzCgBRRLcB8o6bNruUDyJgh3t73pLDcOz3myxcUmww==
dependencies:
autobind-decorator "^2.4.0"
eventemitter3 "^4.0.7"
Expand Down
1 change: 1 addition & 0 deletions packages/client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
// data の禁止理由: 抽象的すぎるため
// e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため
"id-denylist": ["error", "window", "data", "e"],
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
"vue/attributes-order": ["error", {
"alphabetical": false
}],
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"langmap": "0.0.16",
"matter-js": "0.18.0",
"mfm-js": "0.21.0",
"misskey-js": "0.0.13",
"misskey-js": "0.0.14",
"mocha": "8.4.0",
"ms": "2.1.3",
"nested-property": "4.0.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/client/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,31 +192,31 @@ export async function openAccountMenu(opts: {
if (opts.withExtraOperation) {
popupMenu([...[{
type: 'link',
text: i18n.locale.profile,
text: i18n.ts.profile,
to: `/@${ $i.username }`,
avatar: $i,
}, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
icon: 'fas fa-plus',
text: i18n.locale.addAccount,
text: i18n.ts.addAccount,
action: () => {
popupMenu([{
text: i18n.locale.existingAccount,
text: i18n.ts.existingAccount,
action: () => { showSigninDialog(); },
}, {
text: i18n.locale.createAccount,
text: i18n.ts.createAccount,
action: () => { createAccount(); },
}], ev.currentTarget || ev.target);
}], ev.currentTarget ?? ev.target);
},
}, {
type: 'link',
icon: 'fas fa-users',
text: i18n.locale.manageAccounts,
text: i18n.ts.manageAccounts,
to: `/settings/accounts`,
}]], ev.currentTarget || ev.target, {
}]], ev.currentTarget ?? ev.target, {
align: 'left'
});
} else {
popupMenu([...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises], ev.currentTarget || ev.target, {
popupMenu([...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises], ev.currentTarget ?? ev.target, {
align: 'left'
});
}
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/components/abuse-report-window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<XWindow ref="window" :initial-width="400" :initial-height="500" :can-resize="true" @closed="emit('closed')">
<template #header>
<i class="fas fa-exclamation-circle" style="margin-right: 0.5em;"></i>
<I18n :src="i18n.locale.reportAbuseOf" tag="span">
<I18n :src="i18n.ts.reportAbuseOf" tag="span">
<template #name>
<b><MkAcct :user="user"/></b>
</template>
Expand All @@ -11,12 +11,12 @@
<div class="dpvffvvy _monolithic_">
<div class="_section">
<MkTextarea v-model="comment">
<template #label>{{ i18n.locale.details }}</template>
<template #caption>{{ i18n.locale.fillAbuseReportDescription }}</template>
<template #label>{{ i18n.ts.details }}</template>
<template #caption>{{ i18n.ts.fillAbuseReportDescription }}</template>
</MkTextarea>
</div>
<div class="_section">
<MkButton primary full :disabled="comment.length === 0" @click="send">{{ i18n.locale.send }}</MkButton>
<MkButton primary full :disabled="comment.length === 0" @click="send">{{ i18n.ts.send }}</MkButton>
</div>
</div>
</XWindow>
Expand Down Expand Up @@ -50,7 +50,7 @@ function send() {
}, undefined).then(res => {
os.alert({
type: 'success',
text: i18n.locale.abuseReported
text: i18n.ts.abuseReported
});
window.value?.close();
emit('closed');
Expand Down
Loading

0 comments on commit ba40208

Please sign in to comment.