Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
c55237d09c | |||
ed698b7b82 | |||
d4ff19f013 | |||
972fb8eb40 | |||
4de75448b6 | |||
e8ef8f0004 | |||
a319b30382 | |||
8278616eeb | |||
771f011506 | |||
826865869a | |||
3c77ae7b62 | |||
60c30ece10 | |||
76a0d0fee9 | |||
d50624f0a0 |
@ -1,6 +1,12 @@
|
|||||||
ChangeLog
|
ChangeLog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
10.91.1
|
||||||
|
----------
|
||||||
|
* ログビューを強化
|
||||||
|
* テーマの切り替えをなめらかに
|
||||||
|
* SVGの判定を修正
|
||||||
|
|
||||||
10.91.0
|
10.91.0
|
||||||
----------
|
----------
|
||||||
* ログを管理画面で見れるように
|
* ログを管理画面で見れるように
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -972,7 +972,7 @@ desktop/views/components/timeline.vue:
|
|||||||
messages: "Messages"
|
messages: "Messages"
|
||||||
list: "Lists"
|
list: "Lists"
|
||||||
hashtag: "Hashtag"
|
hashtag: "Hashtag"
|
||||||
add-tag-timeline: "Add hashtag tl"
|
add-tag-timeline: "Add hashtag cloud"
|
||||||
add-list: "Add list"
|
add-list: "Add list"
|
||||||
list-name: "List name"
|
list-name: "List name"
|
||||||
desktop/views/components/ui.header.vue:
|
desktop/views/components/ui.header.vue:
|
||||||
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "Hashtags"
|
hashtags: "Hashtags"
|
||||||
abuse: "Abuse"
|
abuse: "Abuse"
|
||||||
queue: "Job Queue"
|
queue: "Job Queue"
|
||||||
|
logs: "Logs"
|
||||||
back-to-misskey: "Back to Misskey"
|
back-to-misskey: "Back to Misskey"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "Dashboard"
|
dashboard: "Dashboard"
|
||||||
@ -1558,8 +1559,8 @@ deck:
|
|||||||
stack-left: "Stack to the left"
|
stack-left: "Stack to the left"
|
||||||
pop-right: "Dock on the right"
|
pop-right: "Dock on the right"
|
||||||
disabled-timeline:
|
disabled-timeline:
|
||||||
title: "Timeline has been disabled"
|
title: "The timeline has been disabled"
|
||||||
description: "Timeline has been disabled by the administrator."
|
description: "This timeline has been disabled by the server's administrator."
|
||||||
deck/deck.tl-column.vue:
|
deck/deck.tl-column.vue:
|
||||||
is-media-only: "Only media posts"
|
is-media-only: "Only media posts"
|
||||||
edit: "Options"
|
edit: "Options"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "Hashtags"
|
hashtags: "Hashtags"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Volver a Misskey"
|
back-to-misskey: "Volver a Misskey"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "Panel de Control"
|
dashboard: "Panel de Control"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "Hashtags"
|
hashtags: "Hashtags"
|
||||||
abuse: "Abus"
|
abuse: "Abus"
|
||||||
queue: "File d’attente"
|
queue: "File d’attente"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Retour vers Misskey"
|
back-to-misskey: "Retour vers Misskey"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "Tableau de bord"
|
dashboard: "Tableau de bord"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "해시태그"
|
hashtags: "해시태그"
|
||||||
abuse: "스팸 신고"
|
abuse: "스팸 신고"
|
||||||
queue: "작업 대기열"
|
queue: "작업 대기열"
|
||||||
|
logs: "로그"
|
||||||
back-to-misskey: "Misskey로 돌아가기"
|
back-to-misskey: "Misskey로 돌아가기"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "대시보드"
|
dashboard: "대시보드"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -30,9 +30,9 @@ common:
|
|||||||
2fa: "Uwierzytelnienie dwuetapowe"
|
2fa: "Uwierzytelnienie dwuetapowe"
|
||||||
customize-home: "Dostosuj stronę główną"
|
customize-home: "Dostosuj stronę główną"
|
||||||
featured-notes: "ハイライト"
|
featured-notes: "ハイライト"
|
||||||
dark-mode: "ダークモード"
|
dark-mode: "Tryb ciemny"
|
||||||
signin: "ログイン"
|
signin: "Zaloguj się"
|
||||||
signup: "新規登録"
|
signup: "Rejestracja"
|
||||||
signout: "ログアウト"
|
signout: "ログアウト"
|
||||||
reload-to-apply-the-setting: "この設定を反映するにはページをリロードする必要があります。今すぐリロードしますか?"
|
reload-to-apply-the-setting: "この設定を反映するにはページをリロードする必要があります。今すぐリロードしますか?"
|
||||||
got-it: "Rozumiem!"
|
got-it: "Rozumiem!"
|
||||||
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "Hashtagi"
|
hashtags: "Hashtagi"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "ハッシュタグ"
|
hashtags: "ハッシュタグ"
|
||||||
abuse: "スパム報告"
|
abuse: "スパム報告"
|
||||||
queue: "ジョブキュー"
|
queue: "ジョブキュー"
|
||||||
|
logs: "ログ"
|
||||||
back-to-misskey: "Misskeyに戻る"
|
back-to-misskey: "Misskeyに戻る"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "ダッシュボード"
|
dashboard: "ダッシュボード"
|
||||||
|
@ -1023,6 +1023,7 @@ admin/views/index.vue:
|
|||||||
hashtags: "标签"
|
hashtags: "标签"
|
||||||
abuse: "举报垃圾信息"
|
abuse: "举报垃圾信息"
|
||||||
queue: "作业队列"
|
queue: "作业队列"
|
||||||
|
logs: "登录"
|
||||||
back-to-misskey: "返回 Misskey"
|
back-to-misskey: "返回 Misskey"
|
||||||
admin/views/dashboard.vue:
|
admin/views/dashboard.vue:
|
||||||
dashboard: "Dashboard"
|
dashboard: "Dashboard"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "10.91.0",
|
"version": "10.91.1",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -227,6 +227,7 @@
|
|||||||
"url-loader": "1.1.2",
|
"url-loader": "1.1.2",
|
||||||
"uuid": "3.3.2",
|
"uuid": "3.3.2",
|
||||||
"v-animate-css": "0.0.3",
|
"v-animate-css": "0.0.3",
|
||||||
|
"v-debounce": "0.1.2",
|
||||||
"video-thumbnail-generator": "1.1.3",
|
"video-thumbnail-generator": "1.1.3",
|
||||||
"vue": "2.6.8",
|
"vue": "2.6.8",
|
||||||
"vue-color": "2.7.0",
|
"vue-color": "2.7.0",
|
||||||
@ -234,6 +235,7 @@
|
|||||||
"vue-cropperjs": "3.0.0",
|
"vue-cropperjs": "3.0.0",
|
||||||
"vue-i18n": "8.8.2",
|
"vue-i18n": "8.8.2",
|
||||||
"vue-js-modal": "1.3.28",
|
"vue-js-modal": "1.3.28",
|
||||||
|
"vue-json-viewer": "2.0.6",
|
||||||
"vue-loader": "15.7.0",
|
"vue-loader": "15.7.0",
|
||||||
"vue-marquee-text-component": "1.1.1",
|
"vue-marquee-text-component": "1.1.1",
|
||||||
"vue-prism-component": "1.1.1",
|
"vue-prism-component": "1.1.1",
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<template #title><fa :icon="faStream"/> {{ $t('logs') }}</template>
|
<template #title><fa :icon="faStream"/> {{ $t('logs') }}</template>
|
||||||
<section class="fit-top">
|
<section class="fit-top">
|
||||||
<ui-horizon-group inputs>
|
<ui-horizon-group inputs>
|
||||||
<ui-input v-model="domain">
|
<ui-input v-model="domain" debounce>
|
||||||
<span>{{ $t('domain') }}</span>
|
<span>{{ $t('domain') }}</span>
|
||||||
</ui-input>
|
</ui-input>
|
||||||
<ui-select v-model="level">
|
<ui-select v-model="level">
|
||||||
@ -20,7 +20,10 @@
|
|||||||
|
|
||||||
<div class="nqjzuvev">
|
<div class="nqjzuvev">
|
||||||
<code v-for="log in logs" :key="log._id" :class="log.level">
|
<code v-for="log in logs" :key="log._id" :class="log.level">
|
||||||
<mk-time :time="log.createdAt"/> [{{ log.domain.join(' ') }}] {{ log.message }}
|
<details>
|
||||||
|
<summary><mk-time :time="log.createdAt"/> [{{ log.domain.join('.') }}] {{ log.message }}</summary>
|
||||||
|
<json-viewer v-if="log.data" :value="log.data"></json-viewer>
|
||||||
|
</details>
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -32,10 +35,15 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import i18n from '../../i18n';
|
import i18n from '../../i18n';
|
||||||
import { faStream } from '@fortawesome/free-solid-svg-icons';
|
import { faStream } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
import JsonViewer from 'vue-json-viewer';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
i18n: i18n('admin/views/logs.vue'),
|
i18n: i18n('admin/views/logs.vue'),
|
||||||
|
|
||||||
|
components: {
|
||||||
|
JsonViewer
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
logs: [],
|
logs: [],
|
||||||
@ -66,9 +74,9 @@ export default Vue.extend({
|
|||||||
this.$root.api('admin/logs', {
|
this.$root.api('admin/logs', {
|
||||||
level: this.level === 'all' ? null : this.level,
|
level: this.level === 'all' ? null : this.level,
|
||||||
domain: this.domain === '' ? null : this.domain,
|
domain: this.domain === '' ? null : this.domain,
|
||||||
limit: 50
|
limit: 100
|
||||||
}).then(logs => {
|
}).then(logs => {
|
||||||
this.logs = logs;
|
this.logs = logs.reverse();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,7 @@
|
|||||||
<x-mute-and-block/>
|
<x-mute-and-block/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!--
|
||||||
<template v-if="page == null || page == 'apps'">
|
<template v-if="page == null || page == 'apps'">
|
||||||
<ui-card>
|
<ui-card>
|
||||||
<template #title><fa icon="puzzle-piece"/> {{ $t('@._settings.apps') }}</template>
|
<template #title><fa icon="puzzle-piece"/> {{ $t('@._settings.apps') }}</template>
|
||||||
@ -187,6 +188,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</ui-card>
|
</ui-card>
|
||||||
</template>
|
</template>
|
||||||
|
-->
|
||||||
|
|
||||||
<template v-if="page == null || page == 'security'">
|
<template v-if="page == null || page == 'security'">
|
||||||
<ui-card>
|
<ui-card>
|
||||||
@ -203,12 +205,14 @@
|
|||||||
</section>
|
</section>
|
||||||
</ui-card>
|
</ui-card>
|
||||||
|
|
||||||
|
<!--
|
||||||
<ui-card>
|
<ui-card>
|
||||||
<template #title><fa icon="sign-in-alt"/> {{ $t('@._settings.signin') }}</template>
|
<template #title><fa icon="sign-in-alt"/> {{ $t('@._settings.signin') }}</template>
|
||||||
<section>
|
<section>
|
||||||
<x-signins/>
|
<x-signins/>
|
||||||
</section>
|
</section>
|
||||||
</ui-card>
|
</ui-card>
|
||||||
|
-->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="page == null || page == 'api'">
|
<template v-if="page == null || page == 'api'">
|
||||||
|
@ -9,7 +9,22 @@
|
|||||||
<span class="title" ref="title"><slot name="title"></slot></span>
|
<span class="title" ref="title"><slot name="title"></slot></span>
|
||||||
<div class="prefix" ref="prefix"><slot name="prefix"></slot></div>
|
<div class="prefix" ref="prefix"><slot name="prefix"></slot></div>
|
||||||
<template v-if="type != 'file'">
|
<template v-if="type != 'file'">
|
||||||
<input ref="input"
|
<input v-if="debounce" ref="input"
|
||||||
|
v-debounce="500"
|
||||||
|
:type="type"
|
||||||
|
v-model.lazy="v"
|
||||||
|
:disabled="disabled"
|
||||||
|
:required="required"
|
||||||
|
:readonly="readonly"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:pattern="pattern"
|
||||||
|
:autocomplete="autocomplete"
|
||||||
|
:spellcheck="spellcheck"
|
||||||
|
@focus="focused = true"
|
||||||
|
@blur="focused = false"
|
||||||
|
@keydown="$emit('keydown', $event)"
|
||||||
|
>
|
||||||
|
<input v-else ref="input"
|
||||||
:type="type"
|
:type="type"
|
||||||
v-model="v"
|
v-model="v"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@ -51,9 +66,13 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import debounce from 'v-debounce';
|
||||||
const getPasswordStrength = require('syuilo-password-strength');
|
const getPasswordStrength = require('syuilo-password-strength');
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
|
directives: {
|
||||||
|
debounce
|
||||||
|
},
|
||||||
inject: {
|
inject: {
|
||||||
horizonGrouped: {
|
horizonGrouped: {
|
||||||
default: false
|
default: false
|
||||||
@ -98,6 +117,9 @@ export default Vue.extend({
|
|||||||
spellcheck: {
|
spellcheck: {
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
|
debounce: {
|
||||||
|
required: false
|
||||||
|
},
|
||||||
withPasswordMeter: {
|
withPasswordMeter: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
|
@ -389,7 +389,7 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS], os: MiOS)
|
|||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
// Reapply current theme
|
/*// Reapply current theme
|
||||||
try {
|
try {
|
||||||
const themeName = os.store.state.device.darkmode ? os.store.state.device.darkTheme : os.store.state.device.lightTheme;
|
const themeName = os.store.state.device.darkmode ? os.store.state.device.darkTheme : os.store.state.device.lightTheme;
|
||||||
const themes = os.store.state.device.themes.concat(builtinThemes);
|
const themes = os.store.state.device.themes.concat(builtinThemes);
|
||||||
@ -399,7 +399,7 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS], os: MiOS)
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(`Cannot reapply theme. ${e}`);
|
console.log(`Cannot reapply theme. ${e}`);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//#region line width
|
//#region line width
|
||||||
document.documentElement.style.setProperty('--lineWidth', `${os.store.state.device.lineWidth}px`);
|
document.documentElement.style.setProperty('--lineWidth', `${os.store.state.device.lineWidth}px`);
|
||||||
|
@ -43,6 +43,12 @@ export const builtinThemes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export function applyTheme(theme: Theme, persisted = true) {
|
export function applyTheme(theme: Theme, persisted = true) {
|
||||||
|
document.documentElement.classList.add('change-theme');
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
document.documentElement.classList.remove('change-theme');
|
||||||
|
}, 500);
|
||||||
|
|
||||||
// Deep copy
|
// Deep copy
|
||||||
const _theme = JSON.parse(JSON.stringify(theme));
|
const _theme = JSON.parse(JSON.stringify(theme));
|
||||||
|
|
||||||
|
@ -20,6 +20,12 @@ html, body
|
|||||||
text-size-adjust 100%
|
text-size-adjust 100%
|
||||||
font-family sans-serif
|
font-family sans-serif
|
||||||
|
|
||||||
|
html.change-theme
|
||||||
|
&, *
|
||||||
|
transition-property all
|
||||||
|
transition-duration 0.5s
|
||||||
|
transition-timing-function ease
|
||||||
|
|
||||||
a
|
a
|
||||||
text-decoration none
|
text-decoration none
|
||||||
color var(--link)
|
color var(--link)
|
||||||
|
12
src/misc/check-svg.ts
Normal file
12
src/misc/check-svg.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
|
import * as isSvg from 'is-svg';
|
||||||
|
|
||||||
|
export default function(path: string) {
|
||||||
|
try {
|
||||||
|
const size = fs.statSync(path).size;
|
||||||
|
if (size > 1 * 1024 * 1024) return false;
|
||||||
|
return isSvg(fs.readFileSync(path));
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -49,7 +49,7 @@ export default class Resolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.history.has(value)) {
|
if (this.history.has(value)) {
|
||||||
logger.error(`cannot resolve already resolved one`);
|
logger.error(`cannot resolve already resolved one: ${value}`);
|
||||||
throw new Error('cannot resolve already resolved one');
|
throw new Error('cannot resolve already resolved one');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,10 @@ export default class Resolver {
|
|||||||
},
|
},
|
||||||
json: true
|
json: true
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
logger.error(`request error: ${e.message}`);
|
logger.error(`request error: ${value}: ${e.message}`, {
|
||||||
|
url: value,
|
||||||
|
e: e
|
||||||
|
});
|
||||||
throw new Error(`request error: ${e.message}`);
|
throw new Error(`request error: ${e.message}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -74,7 +77,10 @@ export default class Resolver {
|
|||||||
!object['@context'].includes('https://www.w3.org/ns/activitystreams') :
|
!object['@context'].includes('https://www.w3.org/ns/activitystreams') :
|
||||||
object['@context'] !== 'https://www.w3.org/ns/activitystreams'
|
object['@context'] !== 'https://www.w3.org/ns/activitystreams'
|
||||||
)) {
|
)) {
|
||||||
logger.error(`invalid response: ${value}`);
|
logger.error(`invalid response: ${value}`, {
|
||||||
|
url: value,
|
||||||
|
object: object
|
||||||
|
});
|
||||||
throw new Error('invalid response');
|
throw new Error('invalid response');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,11 @@ export default async (endpoint: string, user: IUser, app: IApp, data: any, file?
|
|||||||
if (e instanceof ApiError) {
|
if (e instanceof ApiError) {
|
||||||
throw e;
|
throw e;
|
||||||
} else {
|
} else {
|
||||||
apiLogger.error(e);
|
apiLogger.error(`Internal error occurred in ${ep.name}`, {
|
||||||
|
ep: ep.name,
|
||||||
|
ps: data,
|
||||||
|
e: e
|
||||||
|
});
|
||||||
throw new ApiError(null, {
|
throw new ApiError(null, {
|
||||||
e: {
|
e: {
|
||||||
message: e.message,
|
message: e.message,
|
||||||
|
@ -34,11 +34,27 @@ export default define(meta, async (ps) => {
|
|||||||
|
|
||||||
if (ps.level) query.level = ps.level;
|
if (ps.level) query.level = ps.level;
|
||||||
if (ps.domain) {
|
if (ps.domain) {
|
||||||
let i = 0;
|
|
||||||
for (const d of ps.domain.split(' ')) {
|
for (const d of ps.domain.split(' ')) {
|
||||||
query[`domain.${i}`] = d;
|
const qs: any[] = [];
|
||||||
|
let i = 0;
|
||||||
|
for (const sd of (d.startsWith('-') ? d.substr(1) : d).split('.')) {
|
||||||
|
qs.push({
|
||||||
|
[`domain.${i}`]: d.startsWith('-') ? { $ne: sd } : sd
|
||||||
|
});
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
if (d.startsWith('-')) {
|
||||||
|
if (query['$and'] == null) query['$and'] = [];
|
||||||
|
query['$and'].push({
|
||||||
|
$and: qs
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (query['$or'] == null) query['$or'] = [];
|
||||||
|
query['$or'].push({
|
||||||
|
$and: qs
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const logs = await Log
|
const logs = await Log
|
||||||
|
@ -4,10 +4,10 @@ import * as tmp from 'tmp';
|
|||||||
import * as Koa from 'koa';
|
import * as Koa from 'koa';
|
||||||
import * as request from 'request';
|
import * as request from 'request';
|
||||||
import * as fileType from 'file-type';
|
import * as fileType from 'file-type';
|
||||||
import * as isSvg from 'is-svg';
|
|
||||||
import { serverLogger } from '..';
|
import { serverLogger } from '..';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
import { IImage, ConvertToPng } from '../../services/drive/image-processor';
|
import { IImage, ConvertToPng } from '../../services/drive/image-processor';
|
||||||
|
import checkSvg from '../../misc/check-svg';
|
||||||
|
|
||||||
export async function proxyMedia(ctx: Koa.BaseContext) {
|
export async function proxyMedia(ctx: Koa.BaseContext) {
|
||||||
const url = 'url' in ctx.query ? ctx.query.url : 'https://' + ctx.params.url;
|
const url = 'url' in ctx.query ? ctx.query.url : 'https://' + ctx.params.url;
|
||||||
@ -102,7 +102,7 @@ async function detectMine(path: string) {
|
|||||||
const type = fileType(buffer);
|
const type = fileType(buffer);
|
||||||
if (type) {
|
if (type) {
|
||||||
res([type.mime, type.ext]);
|
res([type.mime, type.ext]);
|
||||||
} else if (isSvg(buffer)) {
|
} else if (checkSvg(path)) {
|
||||||
res(['image/svg+xml', 'svg']);
|
res(['image/svg+xml', 'svg']);
|
||||||
} else {
|
} else {
|
||||||
// 種類が同定できなかったら application/octet-stream にする
|
// 種類が同定できなかったら application/octet-stream にする
|
||||||
|
@ -7,7 +7,6 @@ import * as Minio from 'minio';
|
|||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
import * as sharp from 'sharp';
|
import * as sharp from 'sharp';
|
||||||
import * as fileType from 'file-type';
|
import * as fileType from 'file-type';
|
||||||
import * as isSvg from 'is-svg';
|
|
||||||
|
|
||||||
import DriveFile, { IMetadata, getDriveFileBucket, IDriveFile } from '../../models/drive-file';
|
import DriveFile, { IMetadata, getDriveFileBucket, IDriveFile } from '../../models/drive-file';
|
||||||
import DriveFolder from '../../models/drive-folder';
|
import DriveFolder from '../../models/drive-folder';
|
||||||
@ -26,6 +25,7 @@ import { GenerateVideoThumbnail } from './generate-video-thumbnail';
|
|||||||
import { driveLogger } from './logger';
|
import { driveLogger } from './logger';
|
||||||
import { IImage, ConvertToJpeg, ConvertToWebp, ConvertToPng } from './image-processor';
|
import { IImage, ConvertToJpeg, ConvertToWebp, ConvertToPng } from './image-processor';
|
||||||
import Instance from '../../models/instance';
|
import Instance from '../../models/instance';
|
||||||
|
import checkSvg from '../../misc/check-svg';
|
||||||
|
|
||||||
const logger = driveLogger.createSubLogger('register', 'yellow');
|
const logger = driveLogger.createSubLogger('register', 'yellow');
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ export default async function(
|
|||||||
const type = fileType(buffer);
|
const type = fileType(buffer);
|
||||||
if (type) {
|
if (type) {
|
||||||
res([type.mime, type.ext]);
|
res([type.mime, type.ext]);
|
||||||
} else if (isSvg(buffer)) {
|
} else if (checkSvg(path)) {
|
||||||
res(['image/svg+xml', 'svg']);
|
res(['image/svg+xml', 'svg']);
|
||||||
} else {
|
} else {
|
||||||
// 種類が同定できなかったら application/octet-stream にする
|
// 種類が同定できなかったら application/octet-stream にする
|
||||||
@ -378,7 +378,7 @@ export default async function(
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info(`drive usage is ${usage}`);
|
logger.debug(`drive usage is ${usage}`);
|
||||||
|
|
||||||
const instance = await fetchMeta();
|
const instance = await fetchMeta();
|
||||||
const driveCapacity = 1024 * 1024 * (isLocalUser(user) ? instance.localDriveCapacityMb : instance.remoteDriveCapacityMb);
|
const driveCapacity = 1024 * 1024 * (isLocalUser(user) ? instance.localDriveCapacityMb : instance.remoteDriveCapacityMb);
|
||||||
|
@ -47,7 +47,10 @@ export default async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
writable.on('error', error => {
|
writable.on('error', error => {
|
||||||
logger.error(error);
|
logger.error(`Download failed: ${chalk.cyan(url)}: ${error}`, {
|
||||||
|
url: url,
|
||||||
|
e: error
|
||||||
|
});
|
||||||
rej(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -73,7 +76,10 @@ export default async (
|
|||||||
});
|
});
|
||||||
|
|
||||||
req.on('error', error => {
|
req.on('error', error => {
|
||||||
logger.error(error);
|
logger.error(`Failed to start download: ${chalk.cyan(url)}: ${error}`, {
|
||||||
|
url: url,
|
||||||
|
e: error
|
||||||
|
});
|
||||||
writable.close();
|
writable.close();
|
||||||
rej(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
@ -87,7 +93,10 @@ export default async (
|
|||||||
logger.succ(`Got: ${driveFile._id}`);
|
logger.succ(`Got: ${driveFile._id}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = e;
|
error = e;
|
||||||
logger.error(`Failed: ${e}`);
|
logger.error(`Failed to create drive file: ${e}`, {
|
||||||
|
url: url,
|
||||||
|
e: e
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean-up
|
// clean-up
|
||||||
|
Reference in New Issue
Block a user