Compare commits
98 Commits
Author | SHA1 | Date | |
---|---|---|---|
60e0b19372 | |||
922eb937ff | |||
87573284f1 | |||
a91c585f55 | |||
953ea21d5e | |||
ecb00968bc | |||
50ad8adb2d | |||
16878caf09 | |||
5bc30c5493 | |||
85d89cf4c4 | |||
db693f598b | |||
0494c770a1 | |||
c473b62aed | |||
f19ac5320e | |||
612e3aafbc | |||
0e97fec451 | |||
e8c8626ee4 | |||
d89e0f07f8 | |||
e7f81a42ce | |||
ac614148b8 | |||
5eb02b4901 | |||
65631525f6 | |||
969435cfe9 | |||
c932f7a25b | |||
42d164dc57 | |||
a7e60f80bd | |||
3dd5f313b7 | |||
883962c393 | |||
8a30ff1c76 | |||
e47c354916 | |||
496f42805d | |||
c3d34bda37 | |||
bb6ede2b8f | |||
822400a1ba | |||
e3e08843f1 | |||
ce0d4f77fa | |||
94fdb4e974 | |||
4d425fc8a4 | |||
c6cdfa2f5a | |||
0fff2e4f16 | |||
80a2172715 | |||
5a0a297634 | |||
948a133b7b | |||
2ee826c958 | |||
539409faf8 | |||
606e46e4d7 | |||
a179cfd69a | |||
d8379253d4 | |||
c3344fbd68 | |||
4cebd6e84a | |||
90fbf9dbb0 | |||
d365b9f634 | |||
a2f06acaa4 | |||
8c90cbcbfb | |||
a4a47772dc | |||
5dde1f4602 | |||
9dc0909eeb | |||
0ed2592e41 | |||
76cff98220 | |||
60604b6f51 | |||
f410b7aecb | |||
1a61f2cee9 | |||
78a8293520 | |||
03cfb4fc8d | |||
144345a359 | |||
fd2c01515e | |||
219570e08b | |||
69df556ff5 | |||
5f4a52574f | |||
5a1f6c5839 | |||
91d0342fe8 | |||
8cc236daf8 | |||
d283ec69f7 | |||
d1aea7596c | |||
c934987b14 | |||
00c9f4a2e5 | |||
6605c1d07f | |||
7325d66c52 | |||
a485061e22 | |||
1f63f50343 | |||
cd3170dabd | |||
841cedc5f8 | |||
7f4882734d | |||
e7d647d412 | |||
913d14a58a | |||
909272ec3d | |||
7af40ffbbe | |||
9df79a3ec9 | |||
4f2eee06aa | |||
1b9cf76008 | |||
d035a43ed6 | |||
95ee9a6e09 | |||
02a63cdcb3 | |||
f02125dd47 | |||
c11e813146 | |||
a365849048 | |||
a493c9f769 | |||
a13f522b2a |
14
.github/ISSUE_TEMPLATE/01_bug-report.md
vendored
14
.github/ISSUE_TEMPLATE/01_bug-report.md
vendored
@ -1,30 +1,30 @@
|
||||
---
|
||||
name: Bug Report
|
||||
name: 🐛 Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
labels: ⚠️bug?
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
## Summary
|
||||
|
||||
<!-- Tell us what the bug is -->
|
||||
|
||||
# Expected Behavior
|
||||
## Expected Behavior
|
||||
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
# Actual Behavior
|
||||
## Actual Behavior
|
||||
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
# Steps to Reproduce
|
||||
## Steps to Reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Environment
|
||||
## Environment
|
||||
|
||||
<!-- Tell us where on the platform it happens -->
|
||||
|
@ -1,31 +0,0 @@
|
||||
---
|
||||
name: Client-side Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug, client-side
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
|
||||
<!-- Tell us what the bug is -->
|
||||
|
||||
# Expected Behavior
|
||||
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
# Actual Behavior
|
||||
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
# Steps to Reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Environment
|
||||
|
||||
<!-- Tell us where on the platform it happens -->
|
||||
<!-- e.g. desktop or mobile version, your browser, your OS -->
|
@ -1,12 +1,12 @@
|
||||
---
|
||||
name: Feature Request
|
||||
name: ✨ Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature
|
||||
labels: ✨Feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
## Summary
|
||||
|
||||
<!-- Tell us what the suggestion is -->
|
@ -1,31 +0,0 @@
|
||||
---
|
||||
name: Server-side Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug, server-side
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
|
||||
<!-- Tell us what the bug is -->
|
||||
|
||||
# Expected Behavior
|
||||
|
||||
<!--- Tell us what should happen -->
|
||||
|
||||
# Actual Behavior
|
||||
|
||||
<!--- Tell us what happens instead of the expected behavior -->
|
||||
|
||||
# Steps to Reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Environment
|
||||
|
||||
<!-- Tell us where on the platform it happens -->
|
||||
<!-- e.g. your Node.js version, your OS -->
|
@ -1,12 +0,0 @@
|
||||
---
|
||||
name: Client-side Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: client-side, feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
|
||||
<!-- Tell us what the suggestion is -->
|
@ -1,12 +0,0 @@
|
||||
---
|
||||
name: Server-side Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: feature, server-side
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Summary
|
||||
|
||||
<!-- Tell us what the suggestion is -->
|
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,4 +1,4 @@
|
||||
# Summary
|
||||
## Summary
|
||||
|
||||
<!--
|
||||
-
|
||||
|
38
CHANGELOG.md
38
CHANGELOG.md
@ -1,6 +1,44 @@
|
||||
ChangeLog
|
||||
=========
|
||||
|
||||
If you encounter any problems with updating, please try the following:
|
||||
1. `npm run clean` or `npm run cleanall`
|
||||
2. Retry update (Don't forget `npm i`)
|
||||
|
||||
10.93.0
|
||||
----------
|
||||
* フォローリストをインポートできるように
|
||||
* embedプレイヤーを閉じれるように
|
||||
* リストをインポートしたときにプロキシアカウントがフォローするように修正
|
||||
* Web Share Targetの動作を修正
|
||||
* おすすめアンケートのチョイスを修正
|
||||
* デザインの調整
|
||||
|
||||
10.92.4
|
||||
----------
|
||||
* リストのエクスポートをできるように
|
||||
* ジョブキューウィジェットを追加
|
||||
* URLプレビューのサムネイルが表示されないことがある問題を修正
|
||||
|
||||
10.92.3
|
||||
----------
|
||||
* 管理画面の各種ジョブ数がおかしい問題を修正
|
||||
* ジョブキューの動作を調整
|
||||
|
||||
10.92.2
|
||||
----------
|
||||
* 管理画面で各種ジョブ数を一覧できるように
|
||||
* ジョブキューの動作を修正
|
||||
* notes/children が遅い問題を修正
|
||||
|
||||
10.92.1
|
||||
----------
|
||||
* アンケートの結果をリモートと同期するように
|
||||
* ジョブキューを有効に
|
||||
* 投稿の返信一覧に引用Renoteも含めるように
|
||||
* robots.txt追加
|
||||
* デザインの調整
|
||||
|
||||
10.92.0
|
||||
----------
|
||||
* Mastodonのアンケートに対応
|
||||
|
10
README.md
10
README.md
@ -1,4 +1,4 @@
|
||||
<img src="https://github.com/syuilo/misskey/blob/develop/assets/ai-orig.png?raw=true" align="right" height="320px"/>
|
||||
<a href="https://ai.misskey.xyz/"><img src="https://github.com/syuilo/misskey/blob/develop/assets/ai-orig.png?raw=true" align="right" height="320px"/></a>
|
||||
|
||||
[](https://misskey.xyz/)
|
||||
================================================================
|
||||
@ -103,7 +103,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/1?token-time=2145916800&token-hash=WeuDzzz24cRXJogyIkU-mxARqkdyms-rcZKbO-GpGjw%3D" alt="weep" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/12059069" alt="naga_rus" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12913507/f7181eacafe8469a93033d85f5969c29/3?token-time=2145916800&token-hash=c8HeVqLtmdgH-gSBJg8i10gmOcwllM87MDHeznl3el0%3D" alt="Melilot" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12913507/f7181eacafe8469a93033d85f5969c29/4?token-time=2145916800&token-hash=vZdDTTF-ahiKBjjgppS2ev4rkD8H7TTKkXXoxsucs6Y%3D" alt="Melilot" width="100"></td>
|
||||
<td><img src="https://c8.patreon.com/2/200/16869916" alt="見当かなみ" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12999811/5f349fafcce44dd1824a8b1ebbec4564/3?token-time=2145916800&token-hash=LtV2lRi3L2jOWMLwccr9qWYfPrFlzIo2jYZHKzHEb6k%3D" alt="Xeltica" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12021162/963128bb8d14476dbd8407943db8f31a/1?token-time=2145916800&token-hash=1FlxS9MEgmNGH_RHUVHbO5hIXB5I1z0lvA33CTvYvjA%3D" alt="gutfuckllc" width="100"></td>
|
||||
@ -137,8 +137,9 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
|
||||
<td><a href="https://www.patreon.com/user?u=16900731">Atsuko Tominaga</a></td>
|
||||
</tr></table>
|
||||
<table><tr>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/4389829/9f709180ac714651a70f74a82f3ffdb9/2?token-time=2145916800&token-hash=zcwFxb2zopzWwksKVU1YpfAEjsl4yKT02aQ6yiAFRiQ%3D" alt="natalie" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/4389829/9f709180ac714651a70f74a82f3ffdb9/3?token-time=2145916800&token-hash=-iJszBqgYBhsM5qMdA1knf9wvprhEfESzKfR2oh7mIA%3D" alt="natalie" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/13034746/c711c7f58e204ecfbc2fd646bc8a4eee/1?token-time=2145916800&token-hash=5T8XcaAf9Zyzfg3QubR06s_kJZkArVEM2dwObrBVAU4%3D" alt="Hiratake" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/18072312/98e894d960314fa7bc236a72a39488fe/1?token-time=2145916800&token-hash=D6QK3fPyqiYKJfOzc-QqaSSairUrWdjld-ewp2waj6s%3D" alt="Hekovic" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=Ksk_2l3gjPDbnzMUOCSW1E-hdPJsNs2tSR4_RAakRK8%3D" alt="dansup" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=CXe9AqlZy9AsYfiWd3OBYVOzvODoN47Litz0Tu4BFpU%3D" alt="Gargron" width="100"></td>
|
||||
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5731881/4b6038e6cda34c04b83a5fcce3806a93/1?token-time=2145916800&token-hash=xhR1n6NAAyEb-IUXLD6_dshkFa3mefU5ZZuk1L8qKTs%3D" alt="Nokotaro Takeda" width="100"></td>
|
||||
@ -146,13 +147,14 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
|
||||
</tr><tr>
|
||||
<td><a href="https://www.patreon.com/user?u=4389829">natalie</a></td>
|
||||
<td><a href="https://www.patreon.com/hiratake">Hiratake</a></td>
|
||||
<td><a href="https://www.patreon.com/hekovic">Hekovic</a></td>
|
||||
<td><a href="https://www.patreon.com/dansup">dansup</a></td>
|
||||
<td><a href="https://www.patreon.com/mastodon">Gargron</a></td>
|
||||
<td><a href="https://www.patreon.com/takenoko">Nokotaro Takeda</a></td>
|
||||
<td><a href="https://www.patreon.com/user?u=12531784">Takashi Shibuya</a></td>
|
||||
</tr></table>
|
||||
|
||||
**Last updated:** Mon, 04 Mar 2019 09:06:05 UTC
|
||||
**Last updated:** Tue, 12 Mar 2019 00:50:06 UTC
|
||||
<!-- PATREON_END -->
|
||||
|
||||
:four_leaf_clover: Copyright
|
||||
|
4
assets/robots.txt
Normal file
4
assets/robots.txt
Normal file
@ -0,0 +1,4 @@
|
||||
user-agent: *
|
||||
allow: /
|
||||
|
||||
# todo: sitemap
|
@ -118,7 +118,7 @@ CentOSで1024以下のポートを使用してMisskeyを使用する場合は`Ex
|
||||
4. `NODE_ENV=production npm run build`
|
||||
5. [ChangeLog](../CHANGELOG.md)でマイグレーション情報を確認する
|
||||
|
||||
なにか問題が発生した場合は、`npm run clean`すると直る場合があります。
|
||||
なにか問題が発生した場合は、`npm run clean`または`npm run cleanall`すると直る場合があります。
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
|
@ -143,7 +143,12 @@ common:
|
||||
i-like-sushi: "Mam radši sushi (než puding)"
|
||||
show-reversi-board-labels: "Zobrazit označení řad a sloupců v Reversi"
|
||||
use-avatar-reversi-stones: "Použít avatar jako figurku v Reversi"
|
||||
disable-animated-mfm: "Vypnout pohyblivé texty v příspěvku"
|
||||
disable-showing-animated-images: "Nepřehrávat animované obrázky"
|
||||
suggest-recent-hashtags: "Navrhovat nedávné hashtagy v rámci psacího pole"
|
||||
always-show-nsfw: "Vždycky ukázat NSFW obsah"
|
||||
always-mark-nsfw: "Označovat všechny příspěvky za delikátní"
|
||||
show-full-acct: "Zaradit hostovací server jako součast přezdívky"
|
||||
show-via: "zobrazit přes"
|
||||
reduce-motion: "Snížit pohyb v rozhraní"
|
||||
this-setting-is-this-device-only: "Pouze pro toto zařízení"
|
||||
@ -185,6 +190,7 @@ common:
|
||||
remain-deleted-note: "I nadále zobrazovat odstraněné příspěvky"
|
||||
sound: "Zvuk"
|
||||
enable-sounds: "Povolit zvuk"
|
||||
enable-sounds-desc: "Přehrát zvuk, například při odeslání nebo přijetí příspěvku, či zprávy. Toto nastavení je uloženo v prohlížeči."
|
||||
volume: "Hlasitost"
|
||||
test: "Test"
|
||||
update: "Aktualizace Misskey"
|
||||
@ -198,6 +204,8 @@ common:
|
||||
update-available: "Je dostupná nová verze"
|
||||
update-available-desc: "Aktualizace budou aplikovány po znovunačtení stránky."
|
||||
advanced-settings: "Pokročilá nastavení"
|
||||
debug-mode: "Povolit režim ladění"
|
||||
debug-mode-desc: "Toto nastavení je uloženo v prohlížeči."
|
||||
navbar-position: "Poloha navigačního panelu"
|
||||
navbar-position-top: "Nahoře"
|
||||
navbar-position-left: "Vlevo"
|
||||
@ -274,21 +282,33 @@ auth/views/form.vue:
|
||||
share-access: "Chcete dovolit aplikaci <i>{name}</i> přístup k vašemu účtu?"
|
||||
permission-ask: "Tato aplikace vyžaduje následující oprávnění:"
|
||||
account-read: "Zobrazit informace účtu"
|
||||
note-write: "Odeslat."
|
||||
following-write: "Sledovat a přestat sledovat"
|
||||
drive-read: "Přečíst váš Disk"
|
||||
notification-read: "Sledovat oznámení."
|
||||
notification-write: "Zpravovat notifikace."
|
||||
cancel: "Zrušit"
|
||||
accept: "Povolit přístup"
|
||||
auth/views/index.vue:
|
||||
loading: "Načítám..."
|
||||
already-authorized: "Tato aplikace byla již autorizována."
|
||||
error: "Taková relace neexistuje."
|
||||
sign-in: "Prosím přihlaste se."
|
||||
common/views/pages/explore.vue:
|
||||
verified-users: "Ověřené účty"
|
||||
popular-users: "Populární uživatelé"
|
||||
recently-updated-users: "Nedávno aktívni uživatelé"
|
||||
recently-registered-users: "Nedávno registrovaní uživatelé"
|
||||
popular-tags: "Populární tagy"
|
||||
federated: "Z fediverse"
|
||||
explore: "Prozkoumat {host}"
|
||||
common/views/components/url-preview.vue:
|
||||
enable-player: "Otevřít v přehrávači"
|
||||
common/views/components/user-list.vue:
|
||||
no-users: "Žádní uživatelé"
|
||||
common/views/components/games/reversi/reversi.vue:
|
||||
matching:
|
||||
waiting-for: "Čeká se na {}"
|
||||
cancel: "Zrušit"
|
||||
common/views/components/games/reversi/reversi.game.vue:
|
||||
surrender: "Vzdát se"
|
||||
@ -302,14 +322,21 @@ common/views/components/games/reversi/reversi.index.vue:
|
||||
my-games: "Moje hra"
|
||||
all-games: "Všechny hry"
|
||||
enter-username: "Zadejte své uživatelské jméno"
|
||||
game-state:
|
||||
ended: "Ukončené"
|
||||
playing: "Probíhají"
|
||||
common/views/components/games/reversi/reversi.room.vue:
|
||||
settings-of-the-game: "Nastavení hry"
|
||||
choose-map: "Vybrat mapu"
|
||||
random: "Náhodně"
|
||||
black-or-white: "Černé/bílé"
|
||||
black-is: "Černá je {}"
|
||||
rules: "Pravidla"
|
||||
looped-map: "Zacyklená mapa"
|
||||
settings-of-the-bot: "Nastavení Botu"
|
||||
this-game-is-started-soon: "Hra začne za pár vteřin"
|
||||
waiting-for-other: "Čeká se na protivníka"
|
||||
waiting-for-me: "Čeká se na Vás"
|
||||
waiting-for-both: "Připravuji"
|
||||
cancel: "Zrušit"
|
||||
ready: "Připraveno"
|
||||
@ -322,7 +349,22 @@ common/views/components/connect-failed.troubleshooter.vue:
|
||||
checking-network: "Prověřit síťové připojení"
|
||||
internet: "Připojení k internetu"
|
||||
checking-internet: "Ověřuji připojení k internetu."
|
||||
server: "Připojení k serveru"
|
||||
no-network-desc: "Ujistěte se že jste připojeni k Internetu."
|
||||
no-internet: "Nejste připojeni k internetu"
|
||||
no-internet-desc: "Jste připojen k síti, ale zdá se že stále chybí připojení k Internetu. Prosím zkontrolujte Vaše připojení k Internetu."
|
||||
common/views/components/media-banner.vue:
|
||||
click-to-show: "Klikněte pro zobrazení"
|
||||
common/views/components/theme.vue:
|
||||
light-theme: "Šablona pro použití ve světlém vzhledu"
|
||||
dark-theme: "Šablona pro použití v tmavém vzhledu"
|
||||
light-themes: "Světlý vzhled"
|
||||
dark-themes: "Tmavý vzhled"
|
||||
install-a-theme: "Nainstalovat šablonu"
|
||||
theme-code: "Kód šablony"
|
||||
install: "Nainstalovat"
|
||||
installed: "\"{}\" byl nainstalován"
|
||||
create-a-theme: "Vytvořit motiv"
|
||||
base-theme: "Základní vzhled"
|
||||
find-more-theme: "Najít další vzhledy"
|
||||
theme-name: "Jméno vzhledu"
|
||||
@ -356,6 +398,7 @@ common/views/components/messaging-room.vue:
|
||||
only-one-file-attached: "Jenom JEDEN soubor může být přiložen ke zprávě."
|
||||
common/views/components/messaging-room.form.vue:
|
||||
send: "Odeslat"
|
||||
attach-from-local: "Přiložit soubory z Vašeho zařízení"
|
||||
only-one-file-attached: "Jenom JEDEN soubor může být přiložen ke zprávě."
|
||||
common/views/components/messaging-room.message.vue:
|
||||
is-read: "Přečtené"
|
||||
@ -368,16 +411,44 @@ common/views/components/nav.vue:
|
||||
donors: "Dárci"
|
||||
repository: "Úložiště"
|
||||
develop: "Vývojáři"
|
||||
feedback: "Zpětná vazba"
|
||||
common/views/components/note-menu.vue:
|
||||
mention: "Zmínění"
|
||||
detail: "Více"
|
||||
copy-content: "Zkopírovat obsah"
|
||||
copy-link: "Zkopírovat odkaz"
|
||||
favorite: "Přidat do oblíbených"
|
||||
unfavorite: "Odebrat z oblízených"
|
||||
watch: "Sledovat"
|
||||
unwatch: "Přestat sledovat"
|
||||
pin: "Připnout"
|
||||
unpin: "Odepnout"
|
||||
delete: "Odstranit"
|
||||
delete-confirm: "Opravdu chcete smazat tento příspěvek?"
|
||||
remote: "Ukázat originální poznámku"
|
||||
common/views/components/user-menu.vue:
|
||||
mention: "Zmínění"
|
||||
mute: "Umlčet"
|
||||
unmute: "Zrušit umlčení"
|
||||
block: "Blokován"
|
||||
unblock: "Odblokovat"
|
||||
push-to-list: "Přidat do seznamu"
|
||||
select-list: "Vyberte seznam"
|
||||
report-abuse-reported: "Problém byl nahlášen administrátorovi. Děkujeme za Vaší kooperaci."
|
||||
common/views/components/poll.vue:
|
||||
vote-count: "{} hlasů"
|
||||
vote: "Hlasovat"
|
||||
show-result: "Podívat se na výsledky"
|
||||
voted: "Už jste hlasovaly"
|
||||
remaining-days: "zbývá {d} dnů, {h} hodin"
|
||||
remaining-hours: "zbývá {h} hodin, a {m} minut"
|
||||
remaining-minutes: "zbývá {m} minut, a {s} sekund"
|
||||
remaining-seconds: "zbývá {s} sekund"
|
||||
common/views/components/poll-editor.vue:
|
||||
no-only-one-choice: "Musíte vybrat alespoň dvě možnosti"
|
||||
day: "Ne"
|
||||
common/views/components/emoji-picker.vue:
|
||||
custom-emoji: "Emoji"
|
||||
people: "Lidé"
|
||||
animals-and-nature: "Zvířata a příroda"
|
||||
food-and-drink: "Jídlo a pití"
|
||||
@ -430,20 +501,53 @@ common/views/components/notification-settings.vue:
|
||||
mark-as-read-all-notifications: "Označit všechna oznámení za přečtená"
|
||||
mark-as-read-all-unread-notes: "Označit všechny příspěvky za přečtené"
|
||||
mark-as-read-all-talk-messages: "Označit všechny zprávy za přečtené"
|
||||
common/views/components/integration-settings.vue:
|
||||
connect: "Připojit"
|
||||
disconnect: "Odpojit"
|
||||
common/views/components/github-setting.vue:
|
||||
description: "Jakmile spojíte Váš GitHub účet s Vaším Misskey účtem, uvidíte informace o Vašem GitHub účtu na Vašem profilu a budete se moci přihlásit skrze GitHub."
|
||||
connected-to: "Je připojen k tomuto GitHub účtu"
|
||||
detail: "Více…"
|
||||
reconnect: "Znovu připojit"
|
||||
connect: "Připojit Váš GitHub účet"
|
||||
disconnect: "Odpojit"
|
||||
common/views/components/discord-setting.vue:
|
||||
description: "Jakmile spojíte Váš Discord účet s Vaším Misskey účtem, uvidíte informace o Vašem Discord účtu na Vašem profilu a budete se moci přihlásit skrze Discord."
|
||||
connected-to: "Je připojen k tomuto Discord účtu"
|
||||
detail: "Více…"
|
||||
reconnect: "Znovu připojit"
|
||||
connect: "Připojit Váš Discord účet"
|
||||
disconnect: "Odpojit"
|
||||
common/views/components/uploader.vue:
|
||||
waiting: "Čekáme"
|
||||
common/views/components/visibility-chooser.vue:
|
||||
public: "Veřejné"
|
||||
home: "Domů"
|
||||
specified-desc: "Poslat pouze zmíněným uživatelům"
|
||||
local-public: "Veřejná (pouze místní)"
|
||||
local-home: "Domovská (pouze místní)"
|
||||
local-followers: "Pro sledující (pouze místní)"
|
||||
common/views/components/trends.vue:
|
||||
count: "{} zmíněných uživatelů"
|
||||
empty: "Žádný trend"
|
||||
common/views/components/language-settings.vue:
|
||||
title: "Zobrazit jazyky"
|
||||
pick-language: "Zvolte jazyk"
|
||||
recommended: "Doporučené"
|
||||
info: "Pro aktivování změn musíte znovu načíst stránky."
|
||||
common/views/components/profile-editor.vue:
|
||||
title: "Profil"
|
||||
name: "Jméno"
|
||||
account: "Účet"
|
||||
location: "Lokace"
|
||||
description: "O mně"
|
||||
you-can-include-hashtags: "V popisku o Vás můžete použít i hastagy."
|
||||
language: "Jazyk"
|
||||
birthday: "Datum narození"
|
||||
avatar: "Avatar"
|
||||
banner: "Baner"
|
||||
is-cat: "Tento účet je kočka"
|
||||
is-bot: "Tento účet je Bot"
|
||||
advanced: "Ostatní"
|
||||
privacy: "Osobní údaje"
|
||||
save: "Uložit"
|
||||
@ -455,10 +559,12 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "Váš e-mail byl ověřen"
|
||||
email-not-verified: "Váš email není potvrzen. Prosím zkontrolujte si svou schránku."
|
||||
export: "Exportovat"
|
||||
import: "Importovat"
|
||||
export-targets:
|
||||
following-list: "Seznam sledujících"
|
||||
mute-list: "Seznam ztlumených uživatelů"
|
||||
blocking-list: "Seznam blokovaných uživatelů"
|
||||
user-lists: "Seznamy"
|
||||
enter-password: "Prosím, zadejte Vaše heslo"
|
||||
danger-zone: "Nebezpečná zóna"
|
||||
delete-account: "Smazat účet"
|
||||
@ -471,6 +577,7 @@ common/views/components/user-list-editor.vue:
|
||||
delete-are-you-sure: "Smazat seznam \"$1\"?"
|
||||
deleted: "Smazáno"
|
||||
common/views/widgets/broadcast.vue:
|
||||
fetching: "Načítám"
|
||||
next: "Další"
|
||||
common/views/widgets/calendar.vue:
|
||||
year: "Rok {}"
|
||||
@ -483,10 +590,12 @@ common/views/widgets/photo-stream.vue:
|
||||
no-photos: "Žádné obrázky"
|
||||
common/views/widgets/posts-monitor.vue:
|
||||
title: "Grafy příspěvků"
|
||||
toggle: "Přepnout zobrazení"
|
||||
common/views/widgets/hashtags.vue:
|
||||
title: "Hashtagy"
|
||||
common/views/widgets/server.vue:
|
||||
title: "Informace o serveru"
|
||||
toggle: "Přepnout zobrazení"
|
||||
common/views/widgets/memo.vue:
|
||||
title: "Poznámky"
|
||||
memo: "Pište sem!"
|
||||
@ -495,6 +604,11 @@ common/views/widgets/slideshow.vue:
|
||||
no-image: "V této složce nebyly nalezeny žádné fotky."
|
||||
desktop:
|
||||
banner: "Baner"
|
||||
avatar-crop-title: "Vyberte část, která se zobrazí jako avatar"
|
||||
avatar: "Avatar"
|
||||
uploading-avatar: "Nahrál nový avatar"
|
||||
avatar-updated: "Vaše avatar byl aktualizován"
|
||||
invalid-filetype: "Tento formát souboru není podporován"
|
||||
desktop/views/components/activity.chart.vue:
|
||||
total: "Černá ... Celkem"
|
||||
notes: "Modrá ... Poznámky"
|
||||
@ -502,6 +616,7 @@ desktop/views/components/activity.chart.vue:
|
||||
renotes: "Zelená ... Renoty"
|
||||
desktop/views/components/activity.vue:
|
||||
title: "Aktivita"
|
||||
toggle: "Přepnout zobrazení"
|
||||
desktop/views/components/calendar.vue:
|
||||
title: "{month}. {year}"
|
||||
prev: "Předchozí měsíc"
|
||||
@ -519,6 +634,8 @@ desktop/views/components/choose-folder-from-drive-window.vue:
|
||||
desktop/views/components/crop-window.vue:
|
||||
cancel: "Zrušit"
|
||||
ok: "OK"
|
||||
desktop/views/components/drive-window.vue:
|
||||
used: "využito"
|
||||
desktop/views/components/drive.file.vue:
|
||||
avatar: "Avatar"
|
||||
banner: "Baner"
|
||||
@ -550,13 +667,42 @@ desktop/views/components/drive.vue:
|
||||
empty-folder: "Tato složka je prázdná"
|
||||
unable-to-process: "Operace nemohla být dokončena."
|
||||
unhandled-error: "Neznámá chyba"
|
||||
url-upload: "Nahrát z URL adresy"
|
||||
url-of-file: "URL adresa souboru, který chcete nahrát"
|
||||
may-take-time: "Může trvat nějakou dobu, dokud nebude dokončeno nahrávání."
|
||||
create-folder: "Vytvořit složku"
|
||||
folder-name: "Název složky"
|
||||
contextmenu:
|
||||
create-folder: "Vytvořit složku"
|
||||
upload: "Nahrát soubor"
|
||||
url-upload: "Nahrát z URL"
|
||||
desktop/views/components/media-video.vue:
|
||||
click-to-show: "Klikněte pro zobrazení"
|
||||
desktop/views/components/game-window.vue:
|
||||
game: "Reversi"
|
||||
desktop/views/components/home.vue:
|
||||
done: "Hotovo"
|
||||
add: "Přidat"
|
||||
desktop/views/input-dialog.vue:
|
||||
cancel: "Zrušit"
|
||||
ok: "OK"
|
||||
desktop/views/components/messaging-room-window.vue:
|
||||
title: "Zprávy:"
|
||||
desktop/views/components/messaging-window.vue:
|
||||
title: "Zprávy"
|
||||
desktop/views/components/note-detail.vue:
|
||||
private: "Tento příspěvek je soukromý"
|
||||
deleted: "Tento příspěvek byl odstraněn"
|
||||
renote: "Renotovat"
|
||||
add-reaction: "Přidat reakci"
|
||||
undo-reaction: "Odebrat reakci"
|
||||
desktop/views/components/note.vue:
|
||||
reply: "Odpovědět"
|
||||
renote: "Renote"
|
||||
add-reaction: "Přidat reakci"
|
||||
undo-reaction: "Odebrat reakci"
|
||||
detail: "Více"
|
||||
private: "Tento příspěvek je soukromý"
|
||||
deleted: "Tento příspěvek byl odstraněn"
|
||||
desktop/views/components/notes.vue:
|
||||
error: "Načítání selhalo."
|
||||
@ -567,22 +713,27 @@ desktop/views/components/post-form.vue:
|
||||
hide-contents: "Schovat obsah"
|
||||
reply-placeholder: "Odpovědět na tento příspěvěk"
|
||||
quote-placeholder: "Citovat tento příspěvek"
|
||||
submit: "Příspěvek"
|
||||
reply: "Odpovědět"
|
||||
renote: "Renotovat"
|
||||
posted: "Odesláno!"
|
||||
replied: "Odpověděno!"
|
||||
reposted: "Renotováno!"
|
||||
note-failed: "Nepodařilo se přidat příspěvek"
|
||||
renote-failed: "Renotování neuspělo"
|
||||
insert-a-kao: "v('ω')v"
|
||||
create-poll: "Vytvořit anketu"
|
||||
text-remain: "{0} znaků zbývá"
|
||||
recent-tags: "Nejnovější"
|
||||
visibility: "Viditelnost"
|
||||
geolocation-alert: "Vaše zařízení nepodporuje lokační službu"
|
||||
error: "Chyba"
|
||||
enter-username: "Zadejte své uživatelské jméno..."
|
||||
desktop/views/components/post-form-window.vue:
|
||||
note: "Nový příspěvek"
|
||||
reply: "Odpovědět"
|
||||
desktop/views/components/progress-dialog.vue:
|
||||
waiting: "Čekáme"
|
||||
desktop/views/components/renote-form.vue:
|
||||
quote: "Citovat..."
|
||||
cancel: "Zrušit"
|
||||
@ -596,14 +747,23 @@ desktop/views/components/renote-form-window.vue:
|
||||
desktop/views/components/settings.2fa.vue:
|
||||
detail: "Více…"
|
||||
url: "https://www.google.cz/landing/2step/"
|
||||
common/views/components/media-image.vue:
|
||||
click-to-show: "Klikněte pro zobrazení"
|
||||
common/views/components/api-settings.vue:
|
||||
token: "Token:"
|
||||
enter-password: "Prosím zadejte heslo"
|
||||
console:
|
||||
title: "API konzole"
|
||||
endpoint: "Endpoint"
|
||||
parameter: "Parametry"
|
||||
send: "Odeslat"
|
||||
sending: "Odesílám"
|
||||
response: "Výsledek"
|
||||
desktop/views/components/settings.apps.vue:
|
||||
no-apps: "Žádné připojené aplikace"
|
||||
common/views/components/drive-settings.vue:
|
||||
max: "Velikost úložiště"
|
||||
in-use: "využito"
|
||||
stats: "Statistiky"
|
||||
common/views/components/mute-and-block.vue:
|
||||
mute-and-block: "Umlčet/blokovat"
|
||||
@ -631,21 +791,55 @@ desktop/views/components/settings.tags.vue:
|
||||
desktop/views/components/taskmanager.vue:
|
||||
title: "Správce úloh"
|
||||
desktop/views/components/timeline.vue:
|
||||
home: "Domů"
|
||||
local: "Lokální"
|
||||
global: "Globální"
|
||||
mentions: "Zmínění"
|
||||
messages: "Zprávy"
|
||||
list: "Seznamy"
|
||||
hashtag: "Hashtag"
|
||||
add-list: "Přidat do seznamu"
|
||||
list-name: "Název seznamu"
|
||||
desktop/views/components/ui.header.vue:
|
||||
welcome-back: "Vítejte zpátky,"
|
||||
adjective: "Pán"
|
||||
desktop/views/components/ui.header.account.vue:
|
||||
profile: "Váš profil"
|
||||
lists: "Seznamy"
|
||||
admin: "Administrace"
|
||||
desktop/views/components/ui.header.nav.vue:
|
||||
game: "Hry"
|
||||
desktop/views/components/ui.header.notifications.vue:
|
||||
title: "Oznámení"
|
||||
desktop/views/components/ui.header.post.vue:
|
||||
post: "Nový příspěvek"
|
||||
desktop/views/components/ui.header.search.vue:
|
||||
placeholder: "Vyhledávání"
|
||||
desktop/views/components/received-follow-requests-window.vue:
|
||||
accept: "Přijmout"
|
||||
reject: "Odmítnout"
|
||||
desktop/views/components/user-lists-window.vue:
|
||||
title: "Seznamy uživatelů"
|
||||
create-list: "Vytvořit seznam"
|
||||
list-name: "Název seznamu"
|
||||
desktop/views/components/user-preview.vue:
|
||||
notes: "Příspěvky"
|
||||
desktop/views/components/users-list.vue:
|
||||
all: "Všechny"
|
||||
iknow: "Znáte"
|
||||
fetching: "Načítám…"
|
||||
desktop/views/components/window.vue:
|
||||
close: "Zavřít"
|
||||
admin/views/index.vue:
|
||||
instance: "Instance"
|
||||
emoji: "Emoji"
|
||||
moderators: "Moderátoři"
|
||||
users: "Uživatelé"
|
||||
federation: "Z fediversu"
|
||||
announcements: "Oznámení"
|
||||
hashtags: "Hashtagy"
|
||||
queue: "Fronta úloh"
|
||||
logs: "Logy"
|
||||
back-to-misskey: "Zpět na Misskey"
|
||||
admin/views/dashboard.vue:
|
||||
accounts: "Účty"
|
||||
@ -696,9 +890,19 @@ admin/views/instance.vue:
|
||||
saved: "Uloženo"
|
||||
user-recommendation-config: "Doporučení uživatelé"
|
||||
email: "Emailová adresa"
|
||||
smtp-port: "SMTP Port"
|
||||
smtp-auth: "Provést SMTP autentikaci"
|
||||
smtp-user: "SMTP uživatel"
|
||||
smtp-pass: "SMTP heslo"
|
||||
serviceworker-config: "ServiceWorker"
|
||||
enable-serviceworker: "Povolit ServiceWorker"
|
||||
vapid-publickey: "VAPID veřejný klíč"
|
||||
vapid-privatekey: "VAPID osobní klíč"
|
||||
admin/views/charts.vue:
|
||||
title: "Graf"
|
||||
per-day: "za den"
|
||||
per-hour: "za hodinu"
|
||||
federation: "Federace"
|
||||
notes: "Příspěvky"
|
||||
users: "Uživatelé"
|
||||
drive: "Disk"
|
||||
@ -706,11 +910,20 @@ admin/views/charts.vue:
|
||||
charts:
|
||||
federation-instances: "Počet instancí: zvýšení/snížení"
|
||||
federation-instances-total: "Celkový počet instancí"
|
||||
notes-total: "Celkem příspěvků"
|
||||
users-total: "Celkem uživatelů"
|
||||
active-users: "Aktivní uživatelé"
|
||||
network-requests: "Požadavek"
|
||||
network-time: "Doba odezvy"
|
||||
network-usage: "Síťový provoz"
|
||||
admin/views/drive.vue:
|
||||
operation: "Operace"
|
||||
fileid-or-url: "ID nebo URL souboru"
|
||||
file-not-found: "Soubor nebyl nalezen"
|
||||
sort:
|
||||
title: "Seřadit"
|
||||
createdAtAsc: "Věk - od nejstaršího"
|
||||
createdAtDesc: "Věk - od nejmladšího"
|
||||
sizeAsc: "Velikost - od nejmenších"
|
||||
sizeDesc: "Velikost – od největších"
|
||||
origin:
|
||||
@ -727,8 +940,17 @@ admin/views/users.vue:
|
||||
reset-password: "Resetovat heslo"
|
||||
reset-password-confirm: "Opravdu chcete resetovat Vaše heslo?"
|
||||
password-updated: "Heslo je nyní \"{password}\""
|
||||
verify: "Ověřit účet"
|
||||
verify-confirm: "Chcete aby toto byl ověřený účet?"
|
||||
verified: "Účet se nyní ověřuje"
|
||||
unverify: "Zrušit ověření účtu"
|
||||
unverify-confirm: "Opravdu chcete zrušit designaci \"ověřený účet\"?"
|
||||
unverified: "Ruší se potvrzení účtu"
|
||||
update-remote-user: "Aktualizovat informace o vzdáleném účtu"
|
||||
users:
|
||||
title: "Uživatel"
|
||||
state:
|
||||
all: "Všechny"
|
||||
moderator: "Moderátor"
|
||||
adminOrModerator: "Admin/Moderátor"
|
||||
verified: "Ověřený účet"
|
||||
@ -781,61 +1003,179 @@ admin/views/federation.vue:
|
||||
status: "Status"
|
||||
latest-request-received-at: "Poslední požadavek přijat"
|
||||
block: "Blokován"
|
||||
instances: "Instance"
|
||||
states:
|
||||
all: "Všechny"
|
||||
blocked: "Blokován"
|
||||
not-responding: "Bez odpovědi"
|
||||
marked-as-closed: "Označeno jako uzavřené"
|
||||
charts: "Graf"
|
||||
chart-srcs:
|
||||
requests: "Požadavek"
|
||||
users-total: "Celkem uživatelů"
|
||||
notes-total: "Celkem příspěvků"
|
||||
chart-spans:
|
||||
hour: "za hodinu"
|
||||
day: "za den"
|
||||
desktop/views/pages/welcome.vue:
|
||||
about: "O Misskey"
|
||||
timeline: "Časová osa"
|
||||
announcements: "Oznámení"
|
||||
photos: "Nedávné obrázky"
|
||||
powered-by-misskey: "Běží na <b>Misskey</b>."
|
||||
info: "Informace"
|
||||
desktop/views/pages/drive.vue:
|
||||
title: "Misskey Disk"
|
||||
desktop/views/pages/note.vue:
|
||||
prev: "Předchozí příspěvěk"
|
||||
next: "Následující příspěvek"
|
||||
desktop/views/pages/selectdrive.vue:
|
||||
title: "Vyberte soubor(y)"
|
||||
ok: "OK"
|
||||
cancel: "Zrušit"
|
||||
upload: "Nahrajte soubory z vašeho zařízení"
|
||||
desktop/views/pages/search.vue:
|
||||
not-available: "Vyhledávání je vypnuté pro tuto instanci."
|
||||
not-found: "Pro '{q}' nebyly nalezeny žádné příspěvky."
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "Nebyly nalezeny žádné příspěvky s \"{q}\"."
|
||||
desktop/views/pages/user-list.users.vue:
|
||||
users: "Uživatel"
|
||||
add-user: "Přidat uživatele"
|
||||
username: "Přezdívka"
|
||||
desktop/views/pages/user/user.followers-you-know.vue:
|
||||
loading: "Načítám..."
|
||||
desktop/views/pages/user/user.friends.vue:
|
||||
title: "Častá zmínění"
|
||||
loading: "Načítám..."
|
||||
no-users: "Žádná častá zmínění"
|
||||
desktop/views/pages/user/user.photos.vue:
|
||||
title: "Fotky"
|
||||
loading: "Načítám..."
|
||||
no-photos: "Žádné obrázky"
|
||||
desktop/views/pages/user/user.header.vue:
|
||||
posts: "Poznámky"
|
||||
month: "Po"
|
||||
day: "Ne"
|
||||
desktop/views/widgets/messaging.vue:
|
||||
title: "Zprávy"
|
||||
desktop/views/widgets/notifications.vue:
|
||||
title: "Oznámení"
|
||||
desktop/views/widgets/polls.vue:
|
||||
title: "Ankety"
|
||||
desktop/views/widgets/users.vue:
|
||||
title: "Doporučení uživatelé"
|
||||
mobile/views/components/drive.vue:
|
||||
used: "využito"
|
||||
file-count: "Soubor(ů)"
|
||||
folder-is-empty: "Tato složka je prázdná"
|
||||
deletion-alert: "Omlouváme se, ale mazání složek ještě nebylo implementováno."
|
||||
folder-name: "Název složky"
|
||||
url-prompt: "URL adresa souboru, který chcete nahrát"
|
||||
uploading: "Byl zahájen upload. Může chvilku trvat než bude dokončen."
|
||||
mobile/views/components/drive-file-chooser.vue:
|
||||
select-file: "Vybrat soubory"
|
||||
mobile/views/components/drive-folder-chooser.vue:
|
||||
select-folder: "Vyberte složku"
|
||||
mobile/views/components/drive.file-detail.vue:
|
||||
download: "Stáhnout"
|
||||
rename: "Přejmenovat"
|
||||
move: "Přesunout"
|
||||
hash: "Hash (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-video.vue:
|
||||
click-to-show: "Klikněte pro zobrazení"
|
||||
common/views/components/follow-button.vue:
|
||||
follow-processing: "Zpracovávám"
|
||||
mobile/views/components/note.vue:
|
||||
private: "Tento příspěvek je soukromý"
|
||||
deleted: "Tento příspěvek byl odstraněn"
|
||||
location: "Lokace"
|
||||
mobile/views/components/note-detail.vue:
|
||||
reply: "Odpovědět"
|
||||
reaction: "Reakce"
|
||||
private: "Tento příspěvek je soukromý"
|
||||
deleted: "Tento příspěvek byl odstraněn"
|
||||
location: "Lokace"
|
||||
mobile/views/components/note-preview.vue:
|
||||
admin: "admin"
|
||||
bot: "bot"
|
||||
cat: "kočka"
|
||||
mobile/views/components/note-sub.vue:
|
||||
admin: "admin"
|
||||
bot: "bot"
|
||||
cat: "kočka"
|
||||
mobile/views/components/post-form.vue:
|
||||
add-visible-user: "Přidat uživatele"
|
||||
submit: "Příspěvek"
|
||||
reply: "Odpovědět"
|
||||
renote: "Renotovat"
|
||||
reply-placeholder: "Odpovědět na tento příspěvěk"
|
||||
location-alert: "Vaše zařízení nepodporuje lokační službu"
|
||||
error: "Chyba"
|
||||
username-prompt: "Zadejte uživatelské jméno"
|
||||
mobile/views/components/sub-note-content.vue:
|
||||
private: "Tento příspěvek je soukromý"
|
||||
deleted: "Tento příspěvek byl odstraněn"
|
||||
poll: "Ankety"
|
||||
mobile/views/components/ui.header.vue:
|
||||
welcome-back: "Vítejte zpátky,"
|
||||
adjective: "Pán"
|
||||
mobile/views/components/ui.nav.vue:
|
||||
timeline: "Časová osa"
|
||||
notifications: "Oznámení"
|
||||
search: "Vyhledávání"
|
||||
user-lists: "Seznamy"
|
||||
widgets: "Widgety"
|
||||
game: "Hry"
|
||||
admin: "Administrace"
|
||||
about: "O Misskey"
|
||||
mobile/views/pages/user-lists.vue:
|
||||
title: "Seznamy"
|
||||
mobile/views/pages/signup.vue:
|
||||
lets-start: "Váš účet je připraven! 📦"
|
||||
mobile/views/pages/home.vue:
|
||||
home: "Domů"
|
||||
local: "Lokální"
|
||||
global: "Globální"
|
||||
mentions: "Zmínění"
|
||||
messages: "Zprávy"
|
||||
mobile/views/pages/tag.vue:
|
||||
no-posts-found: "Nebyly nalezeny žádné příspěvky s \"{q}\"."
|
||||
mobile/views/pages/widgets.vue:
|
||||
add-widget: "Přidat"
|
||||
customization-tips: "Tipy pro přizpůsobení"
|
||||
mobile/views/pages/widgets/activity.vue:
|
||||
activity: "Aktivita"
|
||||
mobile/views/pages/share.vue:
|
||||
share-with: "Sdílet na {name}"
|
||||
mobile/views/pages/received-follow-requests.vue:
|
||||
accept: "Přijmout"
|
||||
reject: "Odmítnout"
|
||||
mobile/views/pages/note.vue:
|
||||
prev: "Předchozí příspěvěk"
|
||||
next: "Následující příspěvek"
|
||||
mobile/views/pages/games/reversi.vue:
|
||||
reversi: "Reversi"
|
||||
mobile/views/pages/search.vue:
|
||||
not-found: "Pro '{q}' nebyly nalezeny žádné příspěvky."
|
||||
mobile/views/pages/selectdrive.vue:
|
||||
select-file: "Vybrat soubory"
|
||||
mobile/views/pages/user/home.vue:
|
||||
activity: "Aktivita"
|
||||
frequently-replied-users: "Častá zmínění"
|
||||
mobile/views/pages/user/home.photos.vue:
|
||||
no-photos: "Žádné obrázky"
|
||||
deck:
|
||||
widgets: "Widgety"
|
||||
home: "Domů"
|
||||
local: "Lokální"
|
||||
hashtag: "Hashtagy"
|
||||
global: "Globální"
|
||||
mentions: "Zmínění"
|
||||
notifications: "Oznámení"
|
||||
list: "Seznamy"
|
||||
select-list: "Vyberte seznam"
|
||||
swap-left: "Posunout doleva"
|
||||
swap-right: "Posunout doprava"
|
||||
rename: "Přejmenovat"
|
||||
@ -845,6 +1185,9 @@ dev/views/new-app.vue:
|
||||
app-name-desc: "Jméno vaší aplikace"
|
||||
app-desc: "Stručný popis nebo představení vaší aplikace."
|
||||
account-read: "Zobrazit informace účtu"
|
||||
note-write: "Odeslat."
|
||||
reaction-write: "Přidat nebo odebrat reakce."
|
||||
following-write: "Sledovat a přestat sledovat"
|
||||
drive-read: "Přečíst váš Disk"
|
||||
notification-read: "Sledovat oznámení."
|
||||
notification-write: "Zpravovat notifikace."
|
||||
|
@ -339,6 +339,9 @@ common/views/components/profile-editor.vue:
|
||||
banner: "Banner"
|
||||
save: "Speichern"
|
||||
export: "Exportieren"
|
||||
import: "Importieren"
|
||||
export-targets:
|
||||
user-lists: "Listen"
|
||||
enter-password: "Bitte Passwort eingeben"
|
||||
common/views/widgets/broadcast.vue:
|
||||
fetching: "Laden"
|
||||
|
@ -114,7 +114,7 @@ common:
|
||||
a: "What are you doing?"
|
||||
b: "What's happening?"
|
||||
c: "What’s on your mind?"
|
||||
d: "Would you post any words?"
|
||||
d: "What do you want to say?"
|
||||
e: "Write here"
|
||||
f: "Waiting for your writing."
|
||||
settings: "Settings"
|
||||
@ -223,8 +223,8 @@ common:
|
||||
search: "Search"
|
||||
delete: "Delete"
|
||||
loading: "Loading"
|
||||
ok: "It's OK"
|
||||
cancel: "Quit"
|
||||
ok: "Confirm"
|
||||
cancel: "Exit"
|
||||
update-available-title: "Update available"
|
||||
update-available: "A new version of Misskey is now available({newer}, the current version is {current}). Reload the page to apply updates."
|
||||
my-token-regenerated: "Your token has been regenerated, so you will be signed out."
|
||||
@ -285,7 +285,7 @@ auth/views/form.vue:
|
||||
account-read: "View account information."
|
||||
account-write: "Modify account information."
|
||||
note-write: "Post."
|
||||
like-write: "React to posts."
|
||||
like-write: "Express yourself about this post."
|
||||
following-write: "Follow and unfollow."
|
||||
drive-read: "Read your drive."
|
||||
drive-write: "Upload/delete files in your drive."
|
||||
@ -304,7 +304,7 @@ auth/views/index.vue:
|
||||
error: "Session does not exist."
|
||||
sign-in: "Please sign in."
|
||||
common/views/pages/explore.vue:
|
||||
verified-users: "Verified accounts"
|
||||
verified-users: "Official accounts"
|
||||
popular-users: "Popular users"
|
||||
recently-updated-users: "Recently active users"
|
||||
recently-registered-users: "Users who joined recently"
|
||||
@ -314,6 +314,7 @@ common/views/pages/explore.vue:
|
||||
users-info: "Currently, {users} users are registered here"
|
||||
common/views/components/url-preview.vue:
|
||||
enable-player: "Enable playback"
|
||||
disable-player: "Close the player"
|
||||
common/views/components/user-list.vue:
|
||||
no-users: "There are no users."
|
||||
common/views/components/games/reversi/reversi.vue:
|
||||
@ -489,15 +490,34 @@ common/views/components/user-menu.vue:
|
||||
common/views/components/poll.vue:
|
||||
vote-to: "Vote for '{}'"
|
||||
vote-count: "{} votes"
|
||||
total-votes: "{} votes in total"
|
||||
vote: "Vote"
|
||||
show-result: "Show results"
|
||||
voted: "Voted"
|
||||
closed: "Ended"
|
||||
remaining-days: "{d} days, {h} hours remain"
|
||||
remaining-hours: "{h} hours, and {m} minutes remain"
|
||||
remaining-minutes: "{m} minutes, and {s} seconds remaining"
|
||||
remaining-seconds: "{s} seconds remaining"
|
||||
common/views/components/poll-editor.vue:
|
||||
no-only-one-choice: "At least two choices are required"
|
||||
choice-n: "Choice {}"
|
||||
remove: "Delete the choice"
|
||||
add: "+ Add a choice"
|
||||
destroy: "Discard the poll"
|
||||
multiple: "More than one answer is allowed"
|
||||
expiration: "Valid until"
|
||||
infinite: "Indefinitely"
|
||||
at: "Date and time pick"
|
||||
after: "Progression specifics"
|
||||
no-more: "You cannot add any more"
|
||||
deadline-date: "Finish date"
|
||||
deadline-time: "Time duration"
|
||||
interval: "Duration"
|
||||
unit: "Unit"
|
||||
second: "Seconds"
|
||||
minute: "Minutes"
|
||||
hour: "Hours"
|
||||
day: "S"
|
||||
common/views/components/reaction-picker.vue:
|
||||
choose-reaction: "Send a reaction"
|
||||
@ -520,7 +540,7 @@ common/views/components/signin.vue:
|
||||
signin-with-twitter: "Log in with Twitter"
|
||||
signin-with-github: "Sign in with GitHub"
|
||||
signin-with-discord: "Sign in with Discord"
|
||||
login-failed: "Log in failed. Make sure you have entered your correct username and password."
|
||||
login-failed: "Logging in has failed. Make sure you have entered the correct username and password."
|
||||
common/views/components/signup.vue:
|
||||
invitation-code: "Invitation code"
|
||||
invitation-info: "If you do not have an invitation code, please contact an <a href=\"{}\">administrator</a>."
|
||||
@ -628,12 +648,16 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "Your email has been verified."
|
||||
email-not-verified: "Email address is not confirmed. Please check your inbox."
|
||||
export: "Export"
|
||||
import: "Import"
|
||||
export-and-import: "Export and Import"
|
||||
export-targets:
|
||||
all-notes: "All posted Notes"
|
||||
following-list: "List of followers"
|
||||
mute-list: "List of muted accounts"
|
||||
blocking-list: "List of blocked accounts"
|
||||
user-lists: "Lists"
|
||||
export-requested: "You have requested an export. This may take a while. After the export is complete, the resulting file will be added to the drive."
|
||||
import-requested: "You have initiated an import. This may take quite some time."
|
||||
enter-password: "Please enter your password"
|
||||
danger-zone: "Cautious options"
|
||||
delete-account: "Remove the account"
|
||||
@ -1328,8 +1352,6 @@ desktop/views/pages/selectdrive.vue:
|
||||
desktop/views/pages/search.vue:
|
||||
not-available: "Search feature is turned off in the settings for this instance."
|
||||
not-found: "No posts were found for '{q}'"
|
||||
desktop/views/pages/share.vue:
|
||||
share-with: "Share on {name}"
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "No posts contains \"{q}\" found."
|
||||
desktop/views/pages/user-list.users.vue:
|
||||
@ -1365,7 +1387,7 @@ desktop/views/pages/user/user.timeline.vue:
|
||||
with-media: "Media"
|
||||
my-posts: "My posts"
|
||||
desktop/views/widgets/messaging.vue:
|
||||
title: "Message"
|
||||
title: "Messaging"
|
||||
desktop/views/widgets/notifications.vue:
|
||||
title: "Notifications"
|
||||
desktop/views/widgets/polls.vue:
|
||||
|
@ -103,6 +103,32 @@ common:
|
||||
tags: "Etiquetas"
|
||||
blocking: "Bloquear"
|
||||
password: "Contraseña"
|
||||
use-os-default-emojis: "Usar los emoticonos estándar del sistema operativo"
|
||||
line-width: "Grosor de línea"
|
||||
line-width-thick: "Grosor"
|
||||
font-size: "Tamaño del texto"
|
||||
font-size-x-small: "Muy pequeño"
|
||||
font-size-small: "Pequeño"
|
||||
font-size-medium: "Normal"
|
||||
font-size-large: "Grande"
|
||||
font-size-x-large: "Muy grande"
|
||||
deck-column-align: "Alineamiento de las columnas"
|
||||
deck-column-align-center: "Centrar"
|
||||
deck-column-align-left: "Izquierda"
|
||||
deck-column-align-flexible: "Flexible"
|
||||
deck-column-width: "Ancho de las columnas"
|
||||
deck-column-width-narrow: "Estrecho"
|
||||
deck-column-width-narrower: "Un poco estrecho"
|
||||
deck-column-width-normal: "Normal"
|
||||
deck-column-width-wider: "Un poco ancho"
|
||||
deck-column-width-wide: "Ancho"
|
||||
use-shadow: "Usar sombras en la Interfaz de Usuario"
|
||||
rounded-corners: "Esquinas redondeadas en la Interfaz de Usuario"
|
||||
circle-icons: "Usar iconos circulares"
|
||||
contrasted-acct: "Añadir contraste al nombre de usuario"
|
||||
wallpaper: "Fondo de pantalla"
|
||||
choose-wallpaper: "Escoge un fondo de pantalla"
|
||||
navbar-position-left: "Izquierda"
|
||||
search: "Buscar"
|
||||
delete: "eliminar"
|
||||
loading: "cargando"
|
||||
@ -395,9 +421,11 @@ common/views/components/profile-editor.vue:
|
||||
save: "Guardar"
|
||||
email-address: "Correo electrónico"
|
||||
export: "Exportar"
|
||||
import: "Importar"
|
||||
export-targets:
|
||||
mute-list: "Silenciar"
|
||||
blocking-list: "Bloquear"
|
||||
user-lists: "Listas"
|
||||
enter-password: "Escribe una contraseña"
|
||||
common/views/components/user-list-editor.vue:
|
||||
users: "Usuarios"
|
||||
|
@ -522,11 +522,13 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "L’adresse du courrier électronique a été vérifiée."
|
||||
email-not-verified: "Adresse de courriel n’est pas confirmée. Veuillez vérifier votre boite de réception."
|
||||
export: "Exporter"
|
||||
import: "Importer"
|
||||
export-targets:
|
||||
all-notes: "Toutes les notes publiées"
|
||||
following-list: "Liste des abonnements"
|
||||
mute-list: "Liste des comptes mis en sourdine"
|
||||
blocking-list: "Liste des comptes bloqués"
|
||||
user-lists: "Listes"
|
||||
export-requested: "Vous avez demandé une exportation. Cela peut prendre un certain temps. Une fois l'exportation terminée, le fichier résultant sera ajouté dans le Drive."
|
||||
enter-password: "Veuillez saisir votre mot de passe"
|
||||
danger-zone: "Zone de danger"
|
||||
@ -1207,8 +1209,6 @@ desktop/views/pages/selectdrive.vue:
|
||||
desktop/views/pages/search.vue:
|
||||
not-available: "La fonction de recherche est désactivée dans les paramètres de l’instance."
|
||||
not-found: "Aucune publication trouvée pour « {q} »."
|
||||
desktop/views/pages/share.vue:
|
||||
share-with: "Partager avec {name}"
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "Aucune publication contenant « {q} » n’a été trouvée."
|
||||
desktop/views/pages/user-list.users.vue:
|
||||
|
@ -28,6 +28,7 @@ const languages = [
|
||||
|
||||
const primaries = {
|
||||
'ja': 'JP',
|
||||
'zh': 'CN',
|
||||
};
|
||||
|
||||
const locales = languages.reduce((a, c) => (a[c] = yaml.safeLoad(fs.readFileSync(`${__dirname}/${c}.yml`, 'utf-8')) || {}, a), {});
|
||||
|
@ -334,6 +334,7 @@ common/views/pages/explore.vue:
|
||||
|
||||
common/views/components/url-preview.vue:
|
||||
enable-player: "プレイヤーを開く"
|
||||
disable-player: "プレイヤーを閉じる"
|
||||
|
||||
common/views/components/user-list.vue:
|
||||
no-users: "ユーザーがいません"
|
||||
@ -701,12 +702,16 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "メールアドレスが確認されました"
|
||||
email-not-verified: "メールアドレスが確認されていません。メールボックスをご確認ください。"
|
||||
export: "エクスポート"
|
||||
import: "インポート"
|
||||
export-and-import: "エクスポートとインポート"
|
||||
export-targets:
|
||||
all-notes: "すべての投稿データ"
|
||||
following-list: "フォロー"
|
||||
mute-list: "ミュート"
|
||||
blocking-list: "ブロック"
|
||||
user-lists: "リスト"
|
||||
export-requested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、ドライブにファイルが追加されます。"
|
||||
import-requested: "インポートをリクエストしました。これには時間がかかる場合があります。"
|
||||
enter-password: "パスワードを入力してください"
|
||||
danger-zone: "危険な設定"
|
||||
delete-account: "アカウントを削除"
|
||||
@ -1175,7 +1180,7 @@ admin/views/dashboard.vue:
|
||||
federated: "連合"
|
||||
|
||||
admin/views/queue.vue:
|
||||
operation: "操作"
|
||||
title: "キュー"
|
||||
remove-all-jobs: "すべてのジョブをクリア"
|
||||
|
||||
admin/views/abuse.vue:
|
||||
@ -1486,9 +1491,6 @@ desktop/views/pages/search.vue:
|
||||
not-available: "検索機能はインスタンスの設定で無効になっています。"
|
||||
not-found: "「{q}」に関する投稿は見つかりませんでした。"
|
||||
|
||||
desktop/views/pages/share.vue:
|
||||
share-with: "{name}で共有"
|
||||
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "ハッシュタグ「{q}」が付けられた投稿は見つかりませんでした。"
|
||||
|
||||
|
@ -476,10 +476,12 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "このメールアドレスOKや!"
|
||||
email-not-verified: "メールアドレスが確認されとらん。メールボックスもっぺん見てくれへん?"
|
||||
export: "エクスポート"
|
||||
import: "インポート"
|
||||
export-targets:
|
||||
following-list: "フォロー"
|
||||
mute-list: "ミュート"
|
||||
blocking-list: "ブロック"
|
||||
user-lists: "リスト"
|
||||
enter-password: "パスワードを入れてや"
|
||||
common/views/components/user-list-editor.vue:
|
||||
users: "ユーザー"
|
||||
|
@ -489,15 +489,34 @@ common/views/components/user-menu.vue:
|
||||
common/views/components/poll.vue:
|
||||
vote-to: "\"{}\"에 투표하기"
|
||||
vote-count: "{}표"
|
||||
total-votes: "총 {}표"
|
||||
vote: "투표하기"
|
||||
show-result: "결과 보기"
|
||||
voted: "투표함"
|
||||
closed: "종료됨"
|
||||
remaining-days: "종료까지 앞으로 {d}일 {h}시간"
|
||||
remaining-hours: "종료까지 앞으로 {h}시간 {m}분"
|
||||
remaining-minutes: "종료까지 앞으로 {m}분 {s}초"
|
||||
remaining-seconds: "종료까지 앞으로 {s}초"
|
||||
common/views/components/poll-editor.vue:
|
||||
no-only-one-choice: "투표에는 선택지가 최소한 두 개 필요합니다"
|
||||
choice-n: "선택지 {}"
|
||||
remove: "이 선택지를 제거"
|
||||
add: "+선택지 추가"
|
||||
destroy: "투표 제거"
|
||||
multiple: "복수 응답 가능"
|
||||
expiration: "기한"
|
||||
infinite: "무기한"
|
||||
at: "일시 지정"
|
||||
after: "기간 지정"
|
||||
no-more: "더 이상 추가할 수 없습니다"
|
||||
deadline-date: "기한"
|
||||
deadline-time: "시간"
|
||||
interval: "기간"
|
||||
unit: "단위"
|
||||
second: "초"
|
||||
minute: "분"
|
||||
hour: "시간"
|
||||
day: "일"
|
||||
common/views/components/reaction-picker.vue:
|
||||
choose-reaction: "반응 선택"
|
||||
@ -628,12 +647,16 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "매일 주소가 확인되었습니다"
|
||||
email-not-verified: "메일 주소가 확인되지 않았습니다. 받은 편지함을 확인하여 주시기 바랍니다."
|
||||
export: "내보내기"
|
||||
import: "가져오기"
|
||||
export-and-import: "내보내기와 가져오기"
|
||||
export-targets:
|
||||
all-notes: "모든 글 데이터"
|
||||
following-list: "팔로잉"
|
||||
mute-list: "뮤트"
|
||||
blocking-list: "차단"
|
||||
user-lists: "리스트"
|
||||
export-requested: "내보내기를 요청하였습니다. 이 작업은 시간이 걸릴 수 있습니다. 내보내기가 완료되면 드라이브에 파일이 추가됩니다."
|
||||
import-requested: "가져오기를 요청하였습니다. 이 작업에는 시간이 걸릴 수 있습니다."
|
||||
enter-password: "비밀번호를 입력하여 주십시오"
|
||||
danger-zone: "위험한 설정"
|
||||
delete-account: "계정 삭제"
|
||||
@ -1328,8 +1351,6 @@ desktop/views/pages/selectdrive.vue:
|
||||
desktop/views/pages/search.vue:
|
||||
not-available: "검색 기능은 인스턴스 설정에서 비활성화되어 있습니다."
|
||||
not-found: "\"{q}\" 와 일치하는 글을 찾을 수 없습니다."
|
||||
desktop/views/pages/share.vue:
|
||||
share-with: "{name}(으)로 공유"
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "해시태그 \"{q}\"가 붙은 글을 찾을 수 없습니다."
|
||||
desktop/views/pages/user-list.users.vue:
|
||||
|
@ -196,6 +196,7 @@ common/views/components/profile-editor.vue:
|
||||
banner: "Omslagfoto"
|
||||
export-targets:
|
||||
following-list: "Volgend"
|
||||
user-lists: "Lijsten"
|
||||
enter-password: "Voer het wachtwoord in"
|
||||
common/views/components/user-list-editor.vue:
|
||||
users: "Gebruiker"
|
||||
|
@ -187,6 +187,7 @@ common/views/components/profile-editor.vue:
|
||||
save: "Lagre"
|
||||
export-targets:
|
||||
following-list: "Følger"
|
||||
user-lists: "Lister"
|
||||
common/views/components/user-list-editor.vue:
|
||||
users: "Bruker"
|
||||
common/views/widgets/broadcast.vue:
|
||||
|
@ -26,6 +26,7 @@ common:
|
||||
dark-mode: "Tryb ciemny"
|
||||
signin: "Zaloguj się"
|
||||
signup: "Rejestracja"
|
||||
signout: "Wyloguj się"
|
||||
got-it: "Rozumiem!"
|
||||
customization-tips:
|
||||
title: "Wskazówki o dostosowywaniu"
|
||||
@ -120,7 +121,24 @@ common:
|
||||
other: "Inne"
|
||||
appearance: "Wygląd"
|
||||
behavior: "Zachowanie"
|
||||
note-visibility: "Widoczność wpisów"
|
||||
line-width-thin: "Cienka"
|
||||
line-width-normal: "Normalna"
|
||||
line-width-thick: "Gruba"
|
||||
font-size: "Rozmiar tekstu"
|
||||
font-size-medium: "Normalna"
|
||||
font-size-x-large: "Duży"
|
||||
deck-column-align-center: "Po środku"
|
||||
deck-column-align-left: "Z lewej"
|
||||
deck-column-align-flexible: "Elastyczne"
|
||||
deck-column-width: "Szerokość kolumn w talii"
|
||||
deck-column-width-narrow: "Wąska"
|
||||
deck-column-width-narrower: "Trochę wąska"
|
||||
deck-column-width-normal: "Normalna"
|
||||
deck-column-width-wider: "Trochę szerokie"
|
||||
deck-column-width-wide: "Szeroka"
|
||||
timeline: "Oś czasu"
|
||||
navbar-position-left: "Z lewej"
|
||||
search: "Szukaj"
|
||||
delete: "Usuń"
|
||||
loading: "Ładowanie"
|
||||
@ -472,10 +490,12 @@ common/views/components/profile-editor.vue:
|
||||
email-address: "Adres e-mail"
|
||||
email-verified: "Twój adres e-mail został zweryfikowany."
|
||||
export: "Eksportuj"
|
||||
import: "Importuj"
|
||||
export-targets:
|
||||
following-list: "Śledzeni"
|
||||
mute-list: "Wycisz"
|
||||
blocking-list: "Zablokuj"
|
||||
user-lists: "Listy"
|
||||
enter-password: "Wprowadź hasło"
|
||||
common/views/components/user-list-editor.vue:
|
||||
users: "Użytkownicy"
|
||||
|
@ -489,15 +489,34 @@ common/views/components/user-menu.vue:
|
||||
common/views/components/poll.vue:
|
||||
vote-to: "为\"{}\"投票"
|
||||
vote-count: "{}票"
|
||||
total-votes: "总票数{}"
|
||||
vote: "投票"
|
||||
show-result: "显示结果"
|
||||
voted: "已投票"
|
||||
closed: "已截止"
|
||||
remaining-days: "{d}天{h}小时后截止"
|
||||
remaining-hours: "{h}小时{m}分后截止"
|
||||
remaining-minutes: "{m}分{s}秒后截止"
|
||||
remaining-seconds: "{s}秒后截止"
|
||||
common/views/components/poll-editor.vue:
|
||||
no-only-one-choice: "至少选择两个选项"
|
||||
choice-n: "选择{}"
|
||||
remove: "删除选项"
|
||||
add: "+添加一个选项"
|
||||
destroy: "放弃投票"
|
||||
multiple: "允许多个投票"
|
||||
expiration: "截止时间"
|
||||
infinite: "永久"
|
||||
at: "指定日期"
|
||||
after: "指定时间"
|
||||
no-more: "最多只能添加十个回答"
|
||||
deadline-date: "日期"
|
||||
deadline-time: "时间"
|
||||
interval: "时长"
|
||||
unit: "单位"
|
||||
second: "秒"
|
||||
minute: "分"
|
||||
hour: "小时"
|
||||
day: "日"
|
||||
common/views/components/reaction-picker.vue:
|
||||
choose-reaction: "选择回应"
|
||||
@ -628,12 +647,16 @@ common/views/components/profile-editor.vue:
|
||||
email-verified: "电子邮件地址已验证"
|
||||
email-not-verified: "邮件地址尚未验证。 请检查您的邮箱。"
|
||||
export: "导出"
|
||||
import: "导入"
|
||||
export-and-import: "导出/导入"
|
||||
export-targets:
|
||||
all-notes: "所有发帖"
|
||||
following-list: "关注列表"
|
||||
mute-list: "屏蔽列表"
|
||||
blocking-list: "黑名单"
|
||||
user-lists: "列表"
|
||||
export-requested: "导出请求已提交。可能需要花一些时间。导出的文件将保存到网盘中。"
|
||||
import-requested: "导入请求已提交。这可能需要花一点时间。"
|
||||
enter-password: "请输入您的密码"
|
||||
danger-zone: "危险选项"
|
||||
delete-account: "删除帐户"
|
||||
@ -1328,8 +1351,6 @@ desktop/views/pages/selectdrive.vue:
|
||||
desktop/views/pages/search.vue:
|
||||
not-available: "在此实例的设置中关闭搜索功能。"
|
||||
not-found: "没有找到“{q}”的帖子"
|
||||
desktop/views/pages/share.vue:
|
||||
share-with: "共享{name}"
|
||||
desktop/views/pages/tag.vue:
|
||||
no-posts-found: "没有找到带有主题标签“{q}”的帖子"
|
||||
desktop/views/pages/user-list.users.vue:
|
||||
|
88
locales/zh-TW.yml
Normal file
88
locales/zh-TW.yml
Normal file
@ -0,0 +1,88 @@
|
||||
---
|
||||
meta:
|
||||
lang: "中文(繁体)"
|
||||
common:
|
||||
intro:
|
||||
title: "什麽是 Misskey 呢?"
|
||||
rich-contents: "發佈"
|
||||
reaction: "回應"
|
||||
drive: "雲端硬碟"
|
||||
adblock:
|
||||
detected: "請禁用廣告封鎖器"
|
||||
close: "關閉"
|
||||
enter-password: "請輸入密碼"
|
||||
2fa: "雙重身份驗證"
|
||||
dark-mode: "夜間模式"
|
||||
signup: "註冊"
|
||||
signout: "登出"
|
||||
notification:
|
||||
reversi-invited: "您已被邀請加入壹場遊戲"
|
||||
reversi-invited-by: "來自{}的邀請"
|
||||
notified-by: "來自{}的邀請"
|
||||
time:
|
||||
future: "未來"
|
||||
just_now: "剛剛"
|
||||
drive: "雲端硬碟"
|
||||
weekday:
|
||||
sunday: "週日"
|
||||
monday: "週一"
|
||||
tuesday: "週二"
|
||||
wednesday: "週三"
|
||||
thursday: "週四"
|
||||
friday: "週五"
|
||||
saturday: "週六"
|
||||
reactions:
|
||||
like: "贊"
|
||||
love: "喜歡"
|
||||
congrats: "恭喜"
|
||||
_settings:
|
||||
password: "密碼"
|
||||
font-size: "字體大小"
|
||||
font-size-x-small: "小"
|
||||
font-size-small: "較小"
|
||||
deck-column-width-wide: "寬"
|
||||
timeline: "時間軸"
|
||||
common/views/components/connect-failed.troubleshooter.vue:
|
||||
flush: "清除快取"
|
||||
common/views/components/theme.vue:
|
||||
light-themes: "淺色主題"
|
||||
dark-themes: "深色主題"
|
||||
install-a-theme: "安裝主題"
|
||||
save-created-theme: "保存主題"
|
||||
common/views/components/signin.vue:
|
||||
signin-with-twitter: "用 Twitter 帳號登入"
|
||||
signin-with-github: "用 GitHub 帳號登入"
|
||||
signin-with-discord: "用 Discord 帳號登入"
|
||||
login-failed: "登錄失敗。 請檢查用戶名和密碼。"
|
||||
common/views/components/signup.vue:
|
||||
invitation-code: "邀請碼"
|
||||
username: "用戶名"
|
||||
available: "可用"
|
||||
too-long: "請不要超過20個字元"
|
||||
password: "密碼"
|
||||
password-placeholder: "建議至少8個字元"
|
||||
common/views/components/stream-indicator.vue:
|
||||
connecting: "正在連線"
|
||||
reconnecting: "正在重新連線"
|
||||
connected: "已建立連線"
|
||||
common/views/components/integration-settings.vue:
|
||||
disconnect: "中斷連線"
|
||||
common/views/components/github-setting.vue:
|
||||
reconnect: "重新連線"
|
||||
disconnect: "中斷連線"
|
||||
common/views/components/discord-setting.vue:
|
||||
reconnect: "重新連線"
|
||||
disconnect: "中斷連線"
|
||||
common/views/components/language-settings.vue:
|
||||
recommended: "推薦"
|
||||
auto: "自動"
|
||||
specify-language: "指定語言"
|
||||
common/views/components/profile-editor.vue:
|
||||
title: "個人資料"
|
||||
name: "名稱"
|
||||
birthday: "生日:"
|
||||
privacy: "隱私"
|
||||
admin/views/dashboard.vue:
|
||||
drive: "雲端硬碟"
|
||||
admin/views/charts.vue:
|
||||
drive: "雲端硬碟"
|
19
package.json
19
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "10.92.0",
|
||||
"version": "10.93.0",
|
||||
"codename": "nighthike",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -32,6 +32,7 @@
|
||||
"@prezzemolo/rap": "0.1.2",
|
||||
"@prezzemolo/zip": "0.0.3",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@types/bull": "3.5.8",
|
||||
"@types/chai-http": "3.0.5",
|
||||
"@types/dateformat": "3.0.0",
|
||||
"@types/deep-equal": "1.0.1",
|
||||
@ -58,7 +59,7 @@
|
||||
"@types/koa-logger": "3.1.1",
|
||||
"@types/koa-mount": "3.0.1",
|
||||
"@types/koa-multer": "1.0.0",
|
||||
"@types/koa-router": "7.0.39",
|
||||
"@types/koa-router": "7.0.40",
|
||||
"@types/koa-send": "4.1.1",
|
||||
"@types/koa-views": "2.0.3",
|
||||
"@types/koa__cors": "2.2.3",
|
||||
@ -66,7 +67,7 @@
|
||||
"@types/mkdirp": "0.5.2",
|
||||
"@types/mocha": "5.2.5",
|
||||
"@types/mongodb": "3.1.20",
|
||||
"@types/node": "10.12.24",
|
||||
"@types/node": "11.10.4",
|
||||
"@types/nodemailer": "4.6.6",
|
||||
"@types/nprogress": "0.0.29",
|
||||
"@types/oauth": "0.9.1",
|
||||
@ -84,7 +85,7 @@
|
||||
"@types/seedrandom": "2.4.27",
|
||||
"@types/sharp": "0.21.2",
|
||||
"@types/showdown": "1.9.2",
|
||||
"@types/speakeasy": "2.0.3",
|
||||
"@types/speakeasy": "2.0.4",
|
||||
"@types/systeminformation": "3.23.1",
|
||||
"@types/tinycolor2": "1.4.1",
|
||||
"@types/tmp": "0.0.33",
|
||||
@ -100,8 +101,8 @@
|
||||
"autosize": "4.0.2",
|
||||
"autwh": "0.1.0",
|
||||
"bcryptjs": "2.4.3",
|
||||
"bee-queue": "1.2.2",
|
||||
"bootstrap-vue": "2.0.0-rc.11",
|
||||
"bootstrap-vue": "2.0.0-rc.13",
|
||||
"bull": "3.7.0",
|
||||
"cafy": "15.1.0",
|
||||
"chai": "4.2.0",
|
||||
"chai-http": "4.2.1",
|
||||
@ -118,11 +119,11 @@
|
||||
"elasticsearch": "15.3.1",
|
||||
"emojilib": "2.4.0",
|
||||
"escape-regexp": "0.0.1",
|
||||
"eslint": "5.12.0",
|
||||
"eslint": "5.15.0",
|
||||
"eslint-plugin-vue": "5.2.2",
|
||||
"eventemitter3": "3.1.0",
|
||||
"feed": "2.0.2",
|
||||
"file-type": "10.7.1",
|
||||
"file-type": "10.9.0",
|
||||
"fuckadblock": "3.2.1",
|
||||
"gulp": "4.0.0",
|
||||
"gulp-cssnano": "2.1.3",
|
||||
@ -249,7 +250,7 @@
|
||||
"web-push": "3.3.3",
|
||||
"webfinger.js": "2.7.0",
|
||||
"webpack": "4.28.4",
|
||||
"webpack-cli": "3.2.1",
|
||||
"webpack-cli": "3.2.3",
|
||||
"websocket": "1.0.28",
|
||||
"ws": "6.1.4",
|
||||
"xev": "2.0.1"
|
||||
|
@ -5,8 +5,7 @@ program
|
||||
.version(pkg.version)
|
||||
.option('--no-daemons', 'Disable daemon processes (for debbuging)')
|
||||
.option('--disable-clustering', 'Disable clustering')
|
||||
.option('--disable-queue', 'Disable job queue processing')
|
||||
.option('--only-server', 'Run server only (without job queue)')
|
||||
.option('--only-server', 'Run server only (without job queue processing)')
|
||||
.option('--only-queue', 'Pocessing job queue only (without server)')
|
||||
.option('--quiet', 'Suppress all logs')
|
||||
.option('--verbose', 'Enable all logs')
|
||||
@ -15,7 +14,6 @@ program
|
||||
.option('--color', 'This option is a dummy for some external program\'s (e.g. forever) issue.')
|
||||
.parse(process.argv);
|
||||
|
||||
/*if (process.env.MK_DISABLE_QUEUE)*/ program.disableQueue = true;
|
||||
if (process.env.MK_ONLY_QUEUE) program.onlyQueue = true;
|
||||
|
||||
export { program };
|
||||
|
@ -85,11 +85,10 @@ export default Vue.extend({
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.nqjzuvev
|
||||
white-space nowrap
|
||||
overflow auto
|
||||
padding 8px
|
||||
background #000
|
||||
color #fff
|
||||
font-size 14px
|
||||
|
||||
> code
|
||||
display block
|
||||
|
@ -1,7 +1,37 @@
|
||||
<template>
|
||||
<div>
|
||||
<ui-card>
|
||||
<template #title>{{ $t('operation') }}</template>
|
||||
<template #title><fa :icon="faTasks"/> {{ $t('title') }}</template>
|
||||
<section class="wptihjuy">
|
||||
<header><fa :icon="faPaperPlane"/> Deliver</header>
|
||||
<ui-horizon-group inputs v-if="latestStats" class="fit-bottom">
|
||||
<ui-input :value="latestStats.deliver.waiting | number" type="text" readonly>
|
||||
<span>Waiting</span>
|
||||
</ui-input>
|
||||
<ui-input :value="latestStats.deliver.delayed | number" type="text" readonly>
|
||||
<span>Delayed</span>
|
||||
</ui-input>
|
||||
<ui-input :value="latestStats.deliver.active | number" type="text" readonly>
|
||||
<span>Active</span>
|
||||
</ui-input>
|
||||
</ui-horizon-group>
|
||||
<div ref="deliverChart" class="chart"></div>
|
||||
</section>
|
||||
<section class="wptihjuy">
|
||||
<header><fa :icon="faInbox"/> Inbox</header>
|
||||
<ui-horizon-group inputs v-if="latestStats" class="fit-bottom">
|
||||
<ui-input :value="latestStats.inbox.waiting | number" type="text" readonly>
|
||||
<span>Waiting</span>
|
||||
</ui-input>
|
||||
<ui-input :value="latestStats.inbox.delayed | number" type="text" readonly>
|
||||
<span>Delayed</span>
|
||||
</ui-input>
|
||||
<ui-input :value="latestStats.inbox.active | number" type="text" readonly>
|
||||
<span>Active</span>
|
||||
</ui-input>
|
||||
</ui-horizon-group>
|
||||
<div ref="inboxChart" class="chart"></div>
|
||||
</section>
|
||||
<section>
|
||||
<ui-button @click="removeAllJobs">{{ $t('remove-all-jobs') }}</ui-button>
|
||||
</section>
|
||||
@ -12,15 +42,128 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../i18n';
|
||||
import ApexCharts from 'apexcharts';
|
||||
import * as tinycolor from 'tinycolor2';
|
||||
import { faTasks, faInbox } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faPaperPlane } from '@fortawesome/free-regular-svg-icons';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('admin/views/queue.vue'),
|
||||
|
||||
data() {
|
||||
return {
|
||||
stats: [],
|
||||
deliverChart: null,
|
||||
inboxChart: null,
|
||||
faTasks, faPaperPlane, faInbox
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
latestStats(): any {
|
||||
return this.stats[this.stats.length - 1];
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
stats(stats) {
|
||||
this.inboxChart.updateSeries([{
|
||||
name: 'Active',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.inbox.activeSincePrevTick }))
|
||||
}, {
|
||||
name: 'Waiting',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.inbox.waiting }))
|
||||
}, {
|
||||
name: 'Delayed',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.inbox.delayed }))
|
||||
}]);
|
||||
this.deliverChart.updateSeries([{
|
||||
name: 'Active',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.deliver.activeSincePrevTick }))
|
||||
}, {
|
||||
name: 'Waiting',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.deliver.waiting }))
|
||||
}, {
|
||||
name: 'Delayed',
|
||||
data: stats.map((x, i) => ({ x: i, y: x.deliver.delayed }))
|
||||
}]);
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const chartOpts = {
|
||||
chart: {
|
||||
type: 'area',
|
||||
height: 200,
|
||||
animations: {
|
||||
dynamicAnimation: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
zoom: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
grid: {
|
||||
clipMarkers: false,
|
||||
borderColor: 'rgba(0, 0, 0, 0.1)'
|
||||
},
|
||||
stroke: {
|
||||
curve: 'straight',
|
||||
width: 2
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
},
|
||||
legend: {
|
||||
labels: {
|
||||
colors: tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--text')).toRgbString()
|
||||
},
|
||||
},
|
||||
series: [] as any,
|
||||
colors: ['#00BCD4', '#FFEB3B', '#e53935'],
|
||||
xaxis: {
|
||||
type: 'numeric',
|
||||
labels: {
|
||||
show: false
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
yaxis: {
|
||||
show: false,
|
||||
min: 0,
|
||||
}
|
||||
};
|
||||
|
||||
this.inboxChart = new ApexCharts(this.$refs.inboxChart, chartOpts);
|
||||
this.deliverChart = new ApexCharts(this.$refs.deliverChart, chartOpts);
|
||||
|
||||
this.inboxChart.render();
|
||||
this.deliverChart.render();
|
||||
|
||||
const connection = this.$root.stream.useSharedConnection('queueStats');
|
||||
connection.on('stats', this.onStats);
|
||||
connection.on('statsLog', this.onStatsLog);
|
||||
connection.send('requestLog', {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
length: 100
|
||||
});
|
||||
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
connection.dispose();
|
||||
this.inboxChart.destroy();
|
||||
this.deliverChart.destroy();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
async removeAllJobs() {
|
||||
const process = async () => {
|
||||
@ -38,6 +181,24 @@ export default Vue.extend({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onStats(stats) {
|
||||
this.stats.push(stats);
|
||||
if (this.stats.length > 100) this.stats.shift();
|
||||
},
|
||||
|
||||
onStatsLog(statsLog) {
|
||||
for (const stats of statsLog.reverse()) {
|
||||
this.onStats(stats);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.wptihjuy
|
||||
> .chart
|
||||
min-height 200px !important
|
||||
|
||||
</style>
|
||||
|
@ -88,7 +88,7 @@ export default Vue.extend({
|
||||
Vue.set(c, 'isVoted', true);
|
||||
}
|
||||
}
|
||||
this.showResult = !this.poll.multiple;
|
||||
if (!this.showResult) this.showResult = !this.poll.multiple;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -51,12 +51,12 @@
|
||||
<template #desc v-if="bannerUploading">{{ $t('uploading') }}<mk-ellipsis/></template>
|
||||
</ui-input>
|
||||
|
||||
<ui-button @click="save(true)">{{ $t('save') }}</ui-button>
|
||||
<ui-button @click="save(true)"><fa :icon="faSave"/> {{ $t('save') }}</ui-button>
|
||||
</ui-form>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('advanced') }}</header>
|
||||
<header><fa :icon="faCogs"/> {{ $t('advanced') }}</header>
|
||||
|
||||
<div>
|
||||
<ui-switch v-model="isCat" @change="save(false)">{{ $t('is-cat') }}</ui-switch>
|
||||
@ -66,7 +66,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('privacy') }}</header>
|
||||
<header><fa :icon="faUnlockAlt"/> {{ $t('privacy') }}</header>
|
||||
|
||||
<div>
|
||||
<ui-switch v-model="isLocked" @change="save(false)">{{ $t('is-locked') }}</ui-switch>
|
||||
@ -76,7 +76,7 @@
|
||||
</section>
|
||||
|
||||
<section v-if="enableEmail">
|
||||
<header>{{ $t('email') }}</header>
|
||||
<header><fa :icon="faEnvelope"/> {{ $t('email') }}</header>
|
||||
|
||||
<div>
|
||||
<template v-if="$store.state.i.email != null">
|
||||
@ -84,12 +84,12 @@
|
||||
<ui-info v-else warn>{{ $t('email-not-verified') }}</ui-info>
|
||||
</template>
|
||||
<ui-input v-model="email" type="email"><span>{{ $t('email-address') }}</span></ui-input>
|
||||
<ui-button @click="updateEmail()">{{ $t('save') }}</ui-button>
|
||||
<ui-button @click="updateEmail()"><fa :icon="faSave"/> {{ $t('save') }}</ui-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>{{ $t('export') }}</header>
|
||||
<header><fa :icon="faBoxes"/> {{ $t('export-and-import') }}</header>
|
||||
|
||||
<div>
|
||||
<ui-select v-model="exportTarget">
|
||||
@ -97,8 +97,12 @@
|
||||
<option value="following">{{ $t('export-targets.following-list') }}</option>
|
||||
<option value="mute">{{ $t('export-targets.mute-list') }}</option>
|
||||
<option value="blocking">{{ $t('export-targets.blocking-list') }}</option>
|
||||
<option value="user-lists">{{ $t('export-targets.user-lists') }}</option>
|
||||
</ui-select>
|
||||
<ui-horizon-group class="fit-bottom">
|
||||
<ui-button @click="doExport()"><fa :icon="faDownload"/> {{ $t('export') }}</ui-button>
|
||||
<ui-button @click="doImport()" :disabled="!['following', 'user-lists'].includes(exportTarget)"><fa :icon="faUpload"/> {{ $t('import') }}</ui-button>
|
||||
</ui-horizon-group>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -118,7 +122,8 @@ import { apiUrl, host } from '../../../../config';
|
||||
import { toUnicode } from 'punycode';
|
||||
import langmap from 'langmap';
|
||||
import { unique } from '../../../../../../prelude/array';
|
||||
import { faDownload } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faDownload, faUpload, faUnlockAlt, faBoxes, faCogs } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faSave, faEnvelope } from '@fortawesome/free-regular-svg-icons';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('common/views/components/profile-editor.vue'),
|
||||
@ -147,7 +152,7 @@ export default Vue.extend({
|
||||
avatarUploading: false,
|
||||
bannerUploading: false,
|
||||
exportTarget: 'notes',
|
||||
faDownload
|
||||
faDownload, faUpload, faSave, faEnvelope, faUnlockAlt, faBoxes, faCogs
|
||||
};
|
||||
},
|
||||
|
||||
@ -284,6 +289,7 @@ export default Vue.extend({
|
||||
this.exportTarget == 'following' ? 'i/export-following' :
|
||||
this.exportTarget == 'mute' ? 'i/export-mute' :
|
||||
this.exportTarget == 'blocking' ? 'i/export-blocking' :
|
||||
this.exportTarget == 'user-lists' ? 'i/export-user-lists' :
|
||||
null, {});
|
||||
|
||||
this.$root.dialog({
|
||||
@ -292,6 +298,22 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
doImport() {
|
||||
this.$chooseDriveFile().then(file => {
|
||||
this.$root.api(
|
||||
this.exportTarget == 'following' ? 'i/import-following' :
|
||||
this.exportTarget == 'user-lists' ? 'i/import-user-lists' :
|
||||
null, {
|
||||
fileId: file.id
|
||||
});
|
||||
|
||||
this.$root.dialog({
|
||||
type: 'info',
|
||||
text: this.$t('import-requested')
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
async deleteAccount() {
|
||||
const { canceled: canceled, result: password } = await this.$root.dialog({
|
||||
title: this.$t('enter-password'),
|
||||
|
@ -386,7 +386,7 @@ export default Vue.extend({
|
||||
height: 50px;
|
||||
background-color: #83D8FF;
|
||||
border-radius: 90px - 6;
|
||||
transition: background-color 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: background-color 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
|
||||
&:before {
|
||||
content: 'Light';
|
||||
@ -418,14 +418,14 @@ export default Vue.extend({
|
||||
background-color: #FFCF96;
|
||||
border-radius: 50px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,.3);
|
||||
transition: all 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
||||
transition: all 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
|
||||
transform: rotate(-45deg);
|
||||
|
||||
.crater {
|
||||
position: absolute;
|
||||
background-color: #E8CDA5;
|
||||
opacity: 0;
|
||||
transition: opacity 200ms ease-in-out;
|
||||
transition: opacity 200ms ease-in-out !important;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ export default Vue.extend({
|
||||
.star {
|
||||
position: absolute;
|
||||
background-color: #ffffff;
|
||||
transition: all 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: all 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
@ -486,7 +486,7 @@ export default Vue.extend({
|
||||
.star--5,
|
||||
.star--6 {
|
||||
opacity: 0;
|
||||
transition: all 300ms 0 cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: all 300ms 0 cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
}
|
||||
|
||||
.star--4 {
|
||||
@ -559,13 +559,13 @@ export default Vue.extend({
|
||||
transform: translate3d(0,0,0);
|
||||
}
|
||||
.star--4 {
|
||||
transition: all 300ms 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: all 300ms 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
}
|
||||
.star--5 {
|
||||
transition: all 300ms 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: all 300ms 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
}
|
||||
.star--6 {
|
||||
transition: all 300ms 400ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
|
||||
transition: all 300ms 400ms cubic-bezier(0.445, 0.05, 0.55, 0.95) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div v-if="playerEnabled" class="player" :style="`padding: ${(player.height || 0) / (player.width || 1) * 100}% 0 0`">
|
||||
<button class="disablePlayer" @click="playerEnabled = false" :title="$t('disable-player')"><fa icon="times"/></button>
|
||||
<iframe :src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')" :width="player.width || '100%'" :heigth="player.height || 250" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen />
|
||||
</div>
|
||||
<div v-else-if="tweetUrl && detail" class="twitter">
|
||||
@ -126,6 +127,22 @@ export default Vue.extend({
|
||||
position relative
|
||||
width 100%
|
||||
|
||||
> button
|
||||
position absolute
|
||||
top -1.5em
|
||||
right 0
|
||||
font-size 1em
|
||||
width 1.5em
|
||||
height 1.5em
|
||||
padding 0
|
||||
margin 0
|
||||
color var(--text)
|
||||
background rgba(128, 128, 128, 0.2)
|
||||
opacity 0.7
|
||||
|
||||
&:hover
|
||||
opacity 0.9
|
||||
|
||||
> iframe
|
||||
height 100%
|
||||
left 0
|
||||
|
@ -26,6 +26,7 @@
|
||||
<option value="hashtags">{{ $t('@.widgets.hashtags') }}</option>
|
||||
<option value="posts-monitor">{{ $t('@.widgets.posts-monitor') }}</option>
|
||||
<option value="server">{{ $t('@.widgets.server') }}</option>
|
||||
<option value="queue">{{ $t('@.widgets.queue') }}</option>
|
||||
<option value="nav">{{ $t('@.widgets.nav') }}</option>
|
||||
<option value="tips">{{ $t('@.widgets.tips') }}</option>
|
||||
</select>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<h1>{{ $t('share-with', { name }) }}</h1>
|
||||
<div>
|
||||
<mk-signin v-if="!$store.getters.isSignedIn"/>
|
||||
<mk-post-form v-else-if="!posted" :initial-text="text" :instant="true" @posted="posted = true"/>
|
||||
<mk-post-form v-else-if="!posted" :initial-text="template" :instant="true" @posted="posted = true"/>
|
||||
<p v-if="posted" class="posted"><fa icon="check"/></p>
|
||||
</div>
|
||||
<ui-button class="close" v-if="posted" @click="close">{{ $t('@.close') }}</ui-button>
|
||||
@ -20,9 +20,21 @@ export default Vue.extend({
|
||||
return {
|
||||
name: null,
|
||||
posted: false,
|
||||
text: new URLSearchParams(location.search).get('text')
|
||||
text: new URLSearchParams(location.search).get('text'),
|
||||
url: new URLSearchParams(location.search).get('url'),
|
||||
title: new URLSearchParams(location.search).get('title'),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
template(): string {
|
||||
let t = '';
|
||||
if (this.title && this.url) t += `【[${title}](${url})】\n`;
|
||||
if (this.title && !this.url) t += `【${title}】\n`;
|
||||
if (this.text) t += `${text}\n`;
|
||||
if (!this.title && this.url) t += `${url}`;
|
||||
return t.trim();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
window.close();
|
@ -31,3 +31,4 @@ Vue.component('mkw-version', wVersion);
|
||||
Vue.component('mkw-hashtags', wHashtags);
|
||||
Vue.component('mkw-instance', wInstance);
|
||||
Vue.component('mkw-post-form', wPostForm);
|
||||
Vue.component('mkw-queue', () => import('./queue.vue').then(m => m.default));
|
||||
|
157
src/client/app/common/views/widgets/queue.vue
Normal file
157
src/client/app/common/views/widgets/queue.vue
Normal file
@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div>
|
||||
<ui-container :show-header="!props.compact">
|
||||
<template #header><fa :icon="faTasks"/>Queue</template>
|
||||
|
||||
<div class="mntrproz">
|
||||
<div>
|
||||
<b>In</b>
|
||||
<span v-if="latestStats">{{ latestStats.inbox.activeSincePrevTick | number }} / {{ latestStats.inbox.delayed | number }}</span>
|
||||
<div ref="in"></div>
|
||||
</div>
|
||||
<div>
|
||||
<b>Out</b>
|
||||
<span v-if="latestStats">{{ latestStats.deliver.activeSincePrevTick | number }} / {{ latestStats.deliver.delayed | number }}</span>
|
||||
<div ref="out"></div>
|
||||
</div>
|
||||
</div>
|
||||
</ui-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import define from '../../define-widget';
|
||||
import { faTasks } from '@fortawesome/free-solid-svg-icons';
|
||||
import ApexCharts from 'apexcharts';
|
||||
|
||||
export default define({
|
||||
name: 'queue',
|
||||
props: () => ({
|
||||
compact: false
|
||||
})
|
||||
}).extend({
|
||||
data() {
|
||||
return {
|
||||
stats: [],
|
||||
inChart: null,
|
||||
outChart: null,
|
||||
faTasks
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
stats(stats) {
|
||||
this.inChart.updateSeries([{
|
||||
data: stats.map((x, i) => ({ x: i, y: x.inbox.activeSincePrevTick }))
|
||||
}, {
|
||||
data: stats.map((x, i) => ({ x: i, y: x.inbox.delayed }))
|
||||
}]);
|
||||
this.outChart.updateSeries([{
|
||||
data: stats.map((x, i) => ({ x: i, y: x.deliver.activeSincePrevTick }))
|
||||
}, {
|
||||
data: stats.map((x, i) => ({ x: i, y: x.deliver.delayed }))
|
||||
}]);
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
latestStats(): any {
|
||||
return this.stats[this.stats.length - 1];
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const chartOpts = {
|
||||
chart: {
|
||||
type: 'area',
|
||||
height: 70,
|
||||
animations: {
|
||||
dynamicAnimation: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
sparkline: {
|
||||
enabled: true,
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'straight',
|
||||
width: 1
|
||||
},
|
||||
series: [{
|
||||
data: [] as any
|
||||
}, {
|
||||
data: [] as any
|
||||
}],
|
||||
yaxis: {
|
||||
min: 0,
|
||||
}
|
||||
};
|
||||
|
||||
this.inChart = new ApexCharts(this.$refs.in, chartOpts);
|
||||
this.outChart = new ApexCharts(this.$refs.out, chartOpts);
|
||||
|
||||
this.inChart.render();
|
||||
this.outChart.render();
|
||||
|
||||
const connection = this.$root.stream.useSharedConnection('queueStats');
|
||||
connection.on('stats', this.onStats);
|
||||
connection.on('statsLog', this.onStatsLog);
|
||||
connection.send('requestLog', {
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
length: 50
|
||||
});
|
||||
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
connection.dispose();
|
||||
this.inChart.destroy();
|
||||
this.outChart.destroy();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
func() {
|
||||
this.props.compact = !this.props.compact;
|
||||
this.save();
|
||||
},
|
||||
|
||||
onStats(stats) {
|
||||
this.stats.push(stats);
|
||||
if (this.stats.length > 50) this.stats.shift();
|
||||
},
|
||||
|
||||
onStatsLog(statsLog) {
|
||||
for (const stats of statsLog.reverse()) {
|
||||
this.onStats(stats);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mntrproz
|
||||
display flex
|
||||
padding 4px
|
||||
|
||||
> div
|
||||
width 50%
|
||||
padding 4px
|
||||
|
||||
> b
|
||||
display block
|
||||
font-size 12px
|
||||
color var(--text)
|
||||
|
||||
> span
|
||||
position absolute
|
||||
top 4px
|
||||
right 4px
|
||||
opacity 0.7
|
||||
font-size 12px
|
||||
color var(--text)
|
||||
|
||||
</style>
|
@ -18,7 +18,7 @@ import MkSelectDrive from './views/pages/selectdrive.vue';
|
||||
import MkDrive from './views/pages/drive.vue';
|
||||
import MkMessagingRoom from './views/pages/messaging-room.vue';
|
||||
import MkReversi from './views/pages/games/reversi.vue';
|
||||
import MkShare from './views/pages/share.vue';
|
||||
import MkShare from '../common/views/pages/share.vue';
|
||||
import MkFollow from '../common/views/pages/follow.vue';
|
||||
import MkNotFound from '../common/views/pages/not-found.vue';
|
||||
import MkSettings from './views/pages/settings.vue';
|
||||
|
@ -129,9 +129,9 @@ export default Vue.extend({
|
||||
mounted() {
|
||||
// Get replies
|
||||
if (!this.compact) {
|
||||
this.$root.api('notes/replies', {
|
||||
this.$root.api('notes/children', {
|
||||
noteId: this.appearNote.id,
|
||||
limit: 8
|
||||
limit: 30
|
||||
}).then(replies => {
|
||||
this.replies = replies;
|
||||
});
|
||||
|
@ -123,9 +123,9 @@ export default Vue.extend({
|
||||
|
||||
created() {
|
||||
if (this.detail) {
|
||||
this.$root.api('notes/replies', {
|
||||
this.$root.api('notes/children', {
|
||||
noteId: this.appearNote.id,
|
||||
limit: 8
|
||||
limit: 30
|
||||
}).then(replies => {
|
||||
this.replies = replies;
|
||||
});
|
||||
|
@ -27,6 +27,7 @@
|
||||
<option value="hashtags">{{ $t('@.widgets.hashtags') }}</option>
|
||||
<option value="posts-monitor">{{ $t('@.widgets.posts-monitor') }}</option>
|
||||
<option value="server">{{ $t('@.widgets.server') }}</option>
|
||||
<option value="queue">{{ $t('@.widgets.queue') }}</option>
|
||||
<option value="nav">{{ $t('@.widgets.nav') }}</option>
|
||||
<option value="tips">{{ $t('@.widgets.tips') }}</option>
|
||||
</select>
|
||||
|
@ -1,66 +0,0 @@
|
||||
<template>
|
||||
<div class="pptjhabgjtt7kwskbfv4y3uml6fpuhmr">
|
||||
<h1>{{ this.$t('share-with', { name }) }}</h1>
|
||||
<div>
|
||||
<mk-signin v-if="!$store.getters.isSignedIn"/>
|
||||
<mk-post-form v-else-if="!posted" :initial-text="text" :instant="true" @posted="posted = true"/>
|
||||
<p v-if="posted" class="posted"><fa icon="check"/></p>
|
||||
</div>
|
||||
<button v-if="posted" class="ui button" @click="close">{{ $t('@.close') }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import i18n from '../../../i18n';
|
||||
|
||||
export default Vue.extend({
|
||||
i18n: i18n('desktop/views/pages/share.vue'),
|
||||
data() {
|
||||
return {
|
||||
name: null,
|
||||
posted: false,
|
||||
text: new URLSearchParams(location.search).get('text')
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$root.getMeta().then(meta => {
|
||||
this.name = meta.name;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.pptjhabgjtt7kwskbfv4y3uml6fpuhmr
|
||||
padding 16px
|
||||
|
||||
> h1
|
||||
margin 0 0 8px 0
|
||||
color #555
|
||||
font-size 20px
|
||||
text-align center
|
||||
|
||||
> div
|
||||
max-width 500px
|
||||
margin 0 auto
|
||||
background #fff
|
||||
border solid 1px rgba(#000, 0.1)
|
||||
border-radius 6px
|
||||
overflow hidden
|
||||
|
||||
> .posted
|
||||
display block
|
||||
margin 0
|
||||
padding 64px
|
||||
text-align center
|
||||
|
||||
> button
|
||||
display block
|
||||
margin 16px auto
|
||||
</style>
|
@ -26,7 +26,7 @@ import MkUserLists from './views/pages/user-lists.vue';
|
||||
import MkUserList from './views/pages/user-list.vue';
|
||||
import MkReversi from './views/pages/games/reversi.vue';
|
||||
import MkTag from './views/pages/tag.vue';
|
||||
import MkShare from './views/pages/share.vue';
|
||||
import MkShare from '../common/views/pages/share.vue';
|
||||
import MkFollow from '../common/views/pages/follow.vue';
|
||||
import MkNotFound from '../common/views/pages/not-found.vue';
|
||||
|
||||
|
@ -135,9 +135,9 @@ export default Vue.extend({
|
||||
methods: {
|
||||
fetchReplies() {
|
||||
if (this.compact) return;
|
||||
this.$root.api('notes/replies', {
|
||||
this.$root.api('notes/children', {
|
||||
noteId: this.appearNote.id,
|
||||
limit: 8
|
||||
limit: 30
|
||||
}).then(replies => {
|
||||
this.replies = replies;
|
||||
});
|
||||
|
@ -115,9 +115,9 @@ export default Vue.extend({
|
||||
|
||||
created() {
|
||||
if (this.detail) {
|
||||
this.$root.api('notes/replies', {
|
||||
this.$root.api('notes/children', {
|
||||
noteId: this.appearNote.id,
|
||||
limit: 8
|
||||
limit: 30
|
||||
}).then(replies => {
|
||||
this.replies = replies;
|
||||
});
|
||||
|
@ -19,6 +19,7 @@
|
||||
<option value="posts-monitor">{{ $t('@.widgets.posts-monitor') }}</option>
|
||||
<option value="version">{{ $t('@.widgets.version') }}</option>
|
||||
<option value="server">{{ $t('@.widgets.server') }}</option>
|
||||
<option value="queue">{{ $t('@.widgets.queue') }}</option>
|
||||
<option value="memo">{{ $t('@.widgets.memo') }}</option>
|
||||
<option value="nav">{{ $t('@.widgets.nav') }}</option>
|
||||
<option value="tips">{{ $t('@.widgets.tips') }}</option>
|
||||
|
@ -43,6 +43,11 @@
|
||||
}
|
||||
],
|
||||
"share_target": {
|
||||
"url_template": "share?text=【{title}】%0A{text}%0A{url}"
|
||||
"action": "/share/",
|
||||
"params": {
|
||||
"title": "title",
|
||||
"text": "text",
|
||||
"url": "url"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ html, body
|
||||
|
||||
html.changing-theme
|
||||
&, *
|
||||
transition background 1s ease
|
||||
transition background 1s ease !important
|
||||
|
||||
a
|
||||
text-decoration none
|
||||
|
@ -19,6 +19,8 @@ export type Source = {
|
||||
host: string;
|
||||
port: number;
|
||||
pass: string;
|
||||
db?: number;
|
||||
prefix?: string;
|
||||
};
|
||||
elasticsearch: {
|
||||
host: string;
|
||||
|
61
src/daemons/queue-stats.ts
Normal file
61
src/daemons/queue-stats.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import * as Deque from 'double-ended-queue';
|
||||
import Xev from 'xev';
|
||||
import { deliverQueue, inboxQueue } from '../queue';
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
const interval = 1000;
|
||||
|
||||
/**
|
||||
* Report queue stats regularly
|
||||
*/
|
||||
export default function() {
|
||||
const log = new Deque<any>();
|
||||
|
||||
ev.on('requestQueueStatsLog', x => {
|
||||
ev.emit(`queueStatsLog:${x.id}`, log.toArray().slice(0, x.length || 50));
|
||||
});
|
||||
|
||||
let activeDeliverJobs = 0;
|
||||
let activeInboxJobs = 0;
|
||||
|
||||
deliverQueue.on('global:active', () => {
|
||||
activeDeliverJobs++;
|
||||
});
|
||||
|
||||
inboxQueue.on('global:active', () => {
|
||||
activeInboxJobs++;
|
||||
});
|
||||
|
||||
async function tick() {
|
||||
const deliverJobCounts = await deliverQueue.getJobCounts();
|
||||
const inboxJobCounts = await inboxQueue.getJobCounts();
|
||||
|
||||
const stats = {
|
||||
deliver: {
|
||||
activeSincePrevTick: activeDeliverJobs,
|
||||
active: deliverJobCounts.active,
|
||||
waiting: deliverJobCounts.waiting,
|
||||
delayed: deliverJobCounts.delayed
|
||||
},
|
||||
inbox: {
|
||||
activeSincePrevTick: activeInboxJobs,
|
||||
active: inboxJobCounts.active,
|
||||
waiting: inboxJobCounts.waiting,
|
||||
delayed: inboxJobCounts.delayed
|
||||
}
|
||||
};
|
||||
|
||||
ev.emit('queueStats', stats);
|
||||
|
||||
log.unshift(stats);
|
||||
if (log.length > 200) log.pop();
|
||||
|
||||
activeDeliverJobs = 0;
|
||||
activeInboxJobs = 0;
|
||||
}
|
||||
|
||||
tick();
|
||||
|
||||
setInterval(tick, interval);
|
||||
}
|
@ -5,6 +5,8 @@ export default config.redis ? redis.createClient(
|
||||
config.redis.port,
|
||||
config.redis.host,
|
||||
{
|
||||
auth_pass: config.redis.pass
|
||||
auth_pass: config.redis.pass,
|
||||
prefix: config.redis.prefix,
|
||||
db: config.redis.db || 0
|
||||
}
|
||||
) : null;
|
||||
|
16
src/index.ts
16
src/index.ts
@ -16,6 +16,7 @@ import Xev from 'xev';
|
||||
import Logger from './services/logger';
|
||||
import serverStats from './daemons/server-stats';
|
||||
import notesStats from './daemons/notes-stats';
|
||||
import queueStats from './daemons/queue-stats';
|
||||
import loadConfig from './config/load';
|
||||
import { Config } from './config/types';
|
||||
import { lessThan } from './prelude/array';
|
||||
@ -50,6 +51,7 @@ function main() {
|
||||
if (program.daemons) {
|
||||
serverStats();
|
||||
notesStats();
|
||||
queueStats();
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +75,7 @@ function greet() {
|
||||
console.log(chalk.keyword('orange')(' If you like Misskey, please donate to support development. https://www.patreon.com/syuilo'));
|
||||
|
||||
console.log('');
|
||||
console.log(chalk`<${os.hostname()} {gray (PID: ${process.pid.toString()})}>`);
|
||||
console.log(chalk`< ${os.hostname()} {gray (PID: ${process.pid.toString()})} >`);
|
||||
}
|
||||
|
||||
bootLogger.info('Welcome to Misskey!');
|
||||
@ -117,9 +119,6 @@ async function masterMain() {
|
||||
await spawnWorkers(config.clusterLimit);
|
||||
}
|
||||
|
||||
// start queue
|
||||
require('./queue').default();
|
||||
|
||||
bootLogger.succ(`Now listening on port ${config.port} on ${config.url}`, null, true);
|
||||
}
|
||||
|
||||
@ -130,6 +129,9 @@ async function workerMain() {
|
||||
// start server
|
||||
await require('./server').default();
|
||||
|
||||
// start job queue
|
||||
require('./queue').default();
|
||||
|
||||
if (cluster.isWorker) {
|
||||
// Send a 'ready' message to parent process
|
||||
process.send('ready');
|
||||
@ -150,13 +152,9 @@ async function queueMain() {
|
||||
bootLogger.succ('Misskey initialized');
|
||||
|
||||
// start processor
|
||||
const queue = require('./queue').default();
|
||||
require('./queue').default();
|
||||
|
||||
if (queue) {
|
||||
bootLogger.succ('Queue started', null, true);
|
||||
} else {
|
||||
bootLogger.error('Queue not available');
|
||||
}
|
||||
}
|
||||
|
||||
const runningNodejsVersion = process.version.slice(1).split('.').map(x => parseInt(x, 10));
|
||||
|
79
src/misc/download-text-file.ts
Normal file
79
src/misc/download-text-file.ts
Normal file
@ -0,0 +1,79 @@
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as util from 'util';
|
||||
import chalk from 'chalk';
|
||||
import * as request from 'request';
|
||||
import Logger from '../services/logger';
|
||||
import config from '../config';
|
||||
|
||||
const logger = new Logger('download-text-file');
|
||||
|
||||
export async function downloadTextFile(url: string): Promise<string> {
|
||||
// Create temp file
|
||||
const [path, cleanup] = await new Promise<[string, any]>((res, rej) => {
|
||||
tmp.file((e, path, fd, cleanup) => {
|
||||
if (e) return rej(e);
|
||||
res([path, cleanup]);
|
||||
});
|
||||
});
|
||||
|
||||
logger.info(`Temp file is ${path}`);
|
||||
|
||||
// write content at URL to temp file
|
||||
await new Promise((res, rej) => {
|
||||
logger.info(`Downloading ${chalk.cyan(url)} ...`);
|
||||
|
||||
const writable = fs.createWriteStream(path);
|
||||
|
||||
writable.on('finish', () => {
|
||||
logger.succ(`Download finished: ${chalk.cyan(url)}`);
|
||||
res();
|
||||
});
|
||||
|
||||
writable.on('error', error => {
|
||||
logger.error(`Download failed: ${chalk.cyan(url)}: ${error}`, {
|
||||
url: url,
|
||||
e: error
|
||||
});
|
||||
rej(error);
|
||||
});
|
||||
|
||||
const requestUrl = new URL(url).pathname.match(/[^\u0021-\u00ff]/) ? encodeURI(url) : url;
|
||||
|
||||
const req = request({
|
||||
url: requestUrl,
|
||||
proxy: config.proxy,
|
||||
timeout: 10 * 1000,
|
||||
headers: {
|
||||
'User-Agent': config.userAgent
|
||||
}
|
||||
});
|
||||
|
||||
req.pipe(writable);
|
||||
|
||||
req.on('response', response => {
|
||||
if (response.statusCode !== 200) {
|
||||
logger.error(`Got ${response.statusCode} (${url})`);
|
||||
writable.close();
|
||||
rej(response.statusCode);
|
||||
}
|
||||
});
|
||||
|
||||
req.on('error', error => {
|
||||
logger.error(`Failed to start download: ${chalk.cyan(url)}: ${error}`, {
|
||||
url: url,
|
||||
e: error
|
||||
});
|
||||
writable.close();
|
||||
rej(error);
|
||||
});
|
||||
});
|
||||
|
||||
logger.succ(`Downloaded to: ${path}`);
|
||||
|
||||
const text = await util.promisify(fs.readFile)(path, 'utf8');
|
||||
|
||||
cleanup();
|
||||
|
||||
return text;
|
||||
}
|
@ -19,6 +19,7 @@ Note.createIndex('userId');
|
||||
Note.createIndex('mentions');
|
||||
Note.createIndex('visibleUserIds');
|
||||
Note.createIndex('replyId');
|
||||
Note.createIndex('renoteId');
|
||||
Note.createIndex('tagsLower');
|
||||
Note.createIndex('_user.host');
|
||||
Note.createIndex('_files._id');
|
||||
@ -35,6 +36,7 @@ export type INote = {
|
||||
_id: mongo.ObjectID;
|
||||
createdAt: Date;
|
||||
deletedAt: Date;
|
||||
updatedAt?: Date;
|
||||
fileIds: mongo.ObjectID[];
|
||||
replyId: mongo.ObjectID;
|
||||
renoteId: mongo.ObjectID;
|
||||
|
@ -1,164 +1,187 @@
|
||||
import * as Queue from 'bee-queue';
|
||||
import * as Queue from 'bull';
|
||||
import * as httpSignature from 'http-signature';
|
||||
|
||||
import config from '../config';
|
||||
import { ILocalUser } from '../models/user';
|
||||
import { program } from '../argv';
|
||||
import handler from './processors';
|
||||
|
||||
import processDeliver from './processors/deliver';
|
||||
import processInbox from './processors/inbox';
|
||||
import processDb from './processors/db';
|
||||
import { queueLogger } from './logger';
|
||||
import { IDriveFile } from '../models/drive-file';
|
||||
|
||||
const enableQueue = !program.disableQueue;
|
||||
const enableQueueProcessing = !program.onlyServer && enableQueue;
|
||||
const queueAvailable = config.redis != null;
|
||||
|
||||
const queue = initializeQueue();
|
||||
|
||||
function initializeQueue() {
|
||||
if (queueAvailable && enableQueue) {
|
||||
return new Queue('misskey-queue', {
|
||||
function initializeQueue(name: string) {
|
||||
return new Queue(name, config.redis != null ? {
|
||||
redis: {
|
||||
port: config.redis.port,
|
||||
host: config.redis.host,
|
||||
password: config.redis.pass
|
||||
password: config.redis.pass,
|
||||
db: config.redis.db || 0,
|
||||
},
|
||||
|
||||
removeOnSuccess: true,
|
||||
removeOnFailure: true,
|
||||
getEvents: false,
|
||||
sendEvents: false,
|
||||
storeJobs: false
|
||||
});
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : 'queue'
|
||||
} : null);
|
||||
}
|
||||
|
||||
export const deliverQueue = initializeQueue('deliver');
|
||||
export const inboxQueue = initializeQueue('inbox');
|
||||
export const dbQueue = initializeQueue('db');
|
||||
|
||||
const deliverLogger = queueLogger.createSubLogger('deliver');
|
||||
const inboxLogger = queueLogger.createSubLogger('inbox');
|
||||
|
||||
deliverQueue
|
||||
.on('waiting', (jobId) => deliverLogger.debug(`waiting id=${jobId}`))
|
||||
.on('active', (job) => deliverLogger.debug(`active id=${job.id} to=${job.data.to}`))
|
||||
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) id=${job.id} to=${job.data.to}`))
|
||||
.on('failed', (job, err) => deliverLogger.warn(`failed(${err}) id=${job.id} to=${job.data.to}`))
|
||||
.on('error', (error) => deliverLogger.error(`error ${error}`))
|
||||
.on('stalled', (job) => deliverLogger.warn(`stalled id=${job.id} to=${job.data.to}`));
|
||||
|
||||
inboxQueue
|
||||
.on('waiting', (jobId) => inboxLogger.debug(`waiting id=${jobId}`))
|
||||
.on('active', (job) => inboxLogger.debug(`active id=${job.id}`))
|
||||
.on('completed', (job, result) => inboxLogger.debug(`completed(${result}) id=${job.id}`))
|
||||
.on('failed', (job, err) => inboxLogger.warn(`failed(${err}) id=${job.id} activity=${job.data.activity ? job.data.activity.id : 'none'}`))
|
||||
.on('error', (error) => inboxLogger.error(`error ${error}`))
|
||||
.on('stalled', (job) => inboxLogger.warn(`stalled id=${job.id} activity=${job.data.activity ? job.data.activity.id : 'none'}`));
|
||||
|
||||
export function deliver(user: ILocalUser, content: any, to: any) {
|
||||
if (content == null) return;
|
||||
if (content == null) return null;
|
||||
|
||||
const data = {
|
||||
type: 'deliver',
|
||||
user,
|
||||
content,
|
||||
to
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data)
|
||||
.retries(8)
|
||||
.backoff('exponential', 1000)
|
||||
.save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
return deliverQueue.add(data, {
|
||||
attempts: 8,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 60 * 1000
|
||||
},
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function processInbox(activity: any, signature: httpSignature.IParsedSignature) {
|
||||
export function inbox(activity: any, signature: httpSignature.IParsedSignature) {
|
||||
const data = {
|
||||
type: 'processInbox',
|
||||
activity: activity,
|
||||
signature
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data)
|
||||
.retries(3)
|
||||
.backoff('exponential', 500)
|
||||
.save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
return inboxQueue.add(data, {
|
||||
attempts: 8,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 1000
|
||||
},
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createDeleteNotesJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'deleteNotes',
|
||||
return dbQueue.add('deleteNotes', {
|
||||
user: user
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createDeleteDriveFilesJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'deleteDriveFiles',
|
||||
return dbQueue.add('deleteDriveFiles', {
|
||||
user: user
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createExportNotesJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'exportNotes',
|
||||
return dbQueue.add('exportNotes', {
|
||||
user: user
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createExportFollowingJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'exportFollowing',
|
||||
return dbQueue.add('exportFollowing', {
|
||||
user: user
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createExportMuteJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'exportMute',
|
||||
return dbQueue.add('exportMute', {
|
||||
user: user
|
||||
};
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createExportBlockingJob(user: ILocalUser) {
|
||||
const data = {
|
||||
type: 'exportBlocking',
|
||||
return dbQueue.add('exportBlocking', {
|
||||
user: user
|
||||
};
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
return queue.createJob(data).save();
|
||||
} else {
|
||||
return handler({ data }, () => {});
|
||||
}
|
||||
export function createExportUserListsJob(user: ILocalUser) {
|
||||
return dbQueue.add('exportUserLists', {
|
||||
user: user
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createImportFollowingJob(user: ILocalUser, fileId: IDriveFile['_id']) {
|
||||
return dbQueue.add('importFollowing', {
|
||||
user: user,
|
||||
fileId: fileId
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export function createImportUserListsJob(user: ILocalUser, fileId: IDriveFile['_id']) {
|
||||
return dbQueue.add('importUserLists', {
|
||||
user: user,
|
||||
fileId: fileId
|
||||
}, {
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true
|
||||
});
|
||||
}
|
||||
|
||||
export default function() {
|
||||
if (queueAvailable && enableQueueProcessing) {
|
||||
queue.process(128, handler);
|
||||
queueLogger.succ('Processing started');
|
||||
if (!program.onlyServer) {
|
||||
deliverQueue.process(128, processDeliver);
|
||||
inboxQueue.process(128, processInbox);
|
||||
processDb(dbQueue);
|
||||
}
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
export function destroy() {
|
||||
queue.destroy().then(n => {
|
||||
queueLogger.succ(`All job removed (${n} jobs)`);
|
||||
deliverQueue.once('cleaned', (jobs, status) => {
|
||||
deliverLogger.succ(`Cleaned ${jobs.length} ${status} jobs`);
|
||||
});
|
||||
deliverQueue.clean(0, 'wait');
|
||||
|
||||
inboxQueue.once('cleaned', (jobs, status) => {
|
||||
inboxLogger.succ(`Cleaned ${jobs.length} ${status} jobs`);
|
||||
});
|
||||
inboxQueue.clean(0, 'wait');
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import User from '../../models/user';
|
||||
import DriveFile from '../../models/drive-file';
|
||||
import deleteFile from '../../services/drive/delete-file';
|
||||
import { queueLogger } from '../../logger';
|
||||
import User from '../../../models/user';
|
||||
import DriveFile from '../../../models/drive-file';
|
||||
import deleteFile from '../../../services/drive/delete-file';
|
||||
|
||||
const logger = queueLogger.createSubLogger('delete-drive-files');
|
||||
|
||||
export async function deleteDriveFiles(job: bq.Job, done: any): Promise<void> {
|
||||
export async function deleteDriveFiles(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Deleting drive files of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -32,7 +32,7 @@ export async function deleteDriveFiles(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (files.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ export async function deleteDriveFiles(job: bq.Job, done: any): Promise<void> {
|
||||
userId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(deletedCount / total);
|
||||
job.progress(deletedCount / total);
|
||||
}
|
||||
|
||||
logger.succ(`All drive files (${deletedCount}) of ${user._id} has been deleted.`);
|
@ -1,14 +1,14 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import Note from '../../models/note';
|
||||
import deleteNote from '../../services/note/delete';
|
||||
import User from '../../models/user';
|
||||
import { queueLogger } from '../../logger';
|
||||
import Note from '../../../models/note';
|
||||
import deleteNote from '../../../services/note/delete';
|
||||
import User from '../../../models/user';
|
||||
|
||||
const logger = queueLogger.createSubLogger('delete-notes');
|
||||
|
||||
export async function deleteNotes(job: bq.Job, done: any): Promise<void> {
|
||||
export async function deleteNotes(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Deleting notes of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -32,7 +32,7 @@ export async function deleteNotes(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (notes.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ export async function deleteNotes(job: bq.Job, done: any): Promise<void> {
|
||||
userId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(deletedCount / total);
|
||||
job.progress(deletedCount / total);
|
||||
}
|
||||
|
||||
logger.succ(`All notes (${deletedCount}) of ${user._id} has been deleted.`);
|
@ -1,18 +1,18 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import addFile from '../../services/drive/add-file';
|
||||
import User from '../../models/user';
|
||||
import { queueLogger } from '../../logger';
|
||||
import addFile from '../../../services/drive/add-file';
|
||||
import User from '../../../models/user';
|
||||
import dateFormat = require('dateformat');
|
||||
import Blocking from '../../models/blocking';
|
||||
import config from '../../config';
|
||||
import Blocking from '../../../models/blocking';
|
||||
import config from '../../../config';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-blocking');
|
||||
|
||||
export async function exportBlocking(job: bq.Job, done: any): Promise<void> {
|
||||
export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Exporting blocking of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -48,7 +48,7 @@ export async function exportBlocking(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (blockings.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ export async function exportBlocking(job: bq.Job, done: any): Promise<void> {
|
||||
blockerId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(exportedCount / total);
|
||||
job.progress(exportedCount / total);
|
||||
}
|
||||
|
||||
stream.end();
|
@ -1,18 +1,18 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import addFile from '../../services/drive/add-file';
|
||||
import User from '../../models/user';
|
||||
import { queueLogger } from '../../logger';
|
||||
import addFile from '../../../services/drive/add-file';
|
||||
import User from '../../../models/user';
|
||||
import dateFormat = require('dateformat');
|
||||
import Following from '../../models/following';
|
||||
import config from '../../config';
|
||||
import Following from '../../../models/following';
|
||||
import config from '../../../config';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-following');
|
||||
|
||||
export async function exportFollowing(job: bq.Job, done: any): Promise<void> {
|
||||
export async function exportFollowing(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Exporting following of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -48,7 +48,7 @@ export async function exportFollowing(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (followings.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ export async function exportFollowing(job: bq.Job, done: any): Promise<void> {
|
||||
followerId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(exportedCount / total);
|
||||
job.progress(exportedCount / total);
|
||||
}
|
||||
|
||||
stream.end();
|
@ -1,18 +1,18 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import addFile from '../../services/drive/add-file';
|
||||
import User from '../../models/user';
|
||||
import { queueLogger } from '../../logger';
|
||||
import addFile from '../../../services/drive/add-file';
|
||||
import User from '../../../models/user';
|
||||
import dateFormat = require('dateformat');
|
||||
import Mute from '../../models/mute';
|
||||
import config from '../../config';
|
||||
import Mute from '../../../models/mute';
|
||||
import config from '../../../config';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-mute');
|
||||
|
||||
export async function exportMute(job: bq.Job, done: any): Promise<void> {
|
||||
export async function exportMute(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Exporting mute of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -48,7 +48,7 @@ export async function exportMute(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (mutes.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ export async function exportMute(job: bq.Job, done: any): Promise<void> {
|
||||
muterId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(exportedCount / total);
|
||||
job.progress(exportedCount / total);
|
||||
}
|
||||
|
||||
stream.end();
|
@ -1,17 +1,17 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../logger';
|
||||
import Note, { INote } from '../../models/note';
|
||||
import addFile from '../../services/drive/add-file';
|
||||
import User from '../../models/user';
|
||||
import { queueLogger } from '../../logger';
|
||||
import Note, { INote } from '../../../models/note';
|
||||
import addFile from '../../../services/drive/add-file';
|
||||
import User from '../../../models/user';
|
||||
import dateFormat = require('dateformat');
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-notes');
|
||||
|
||||
export async function exportNotes(job: bq.Job, done: any): Promise<void> {
|
||||
export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Exporting notes of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
@ -58,7 +58,7 @@ export async function exportNotes(job: bq.Job, done: any): Promise<void> {
|
||||
|
||||
if (notes.length === 0) {
|
||||
ended = true;
|
||||
if (job.reportProgress) job.reportProgress(100);
|
||||
job.progress(100);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ export async function exportNotes(job: bq.Job, done: any): Promise<void> {
|
||||
userId: user._id,
|
||||
});
|
||||
|
||||
if (job.reportProgress) job.reportProgress(exportedNotesCount / total);
|
||||
job.progress(exportedNotesCount / total);
|
||||
}
|
||||
|
||||
await new Promise((res, rej) => {
|
73
src/queue/processors/db/export-user-lists.ts
Normal file
73
src/queue/processors/db/export-user-lists.ts
Normal file
@ -0,0 +1,73 @@
|
||||
import * as Bull from 'bull';
|
||||
import * as tmp from 'tmp';
|
||||
import * as fs from 'fs';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import addFile from '../../../services/drive/add-file';
|
||||
import User from '../../../models/user';
|
||||
import dateFormat = require('dateformat');
|
||||
import config from '../../../config';
|
||||
import UserList from '../../../models/user-list';
|
||||
|
||||
const logger = queueLogger.createSubLogger('export-user-lists');
|
||||
|
||||
export async function exportUserLists(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Exporting user lists of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
_id: new mongo.ObjectID(job.data.user._id.toString())
|
||||
});
|
||||
|
||||
const lists = await UserList.find({
|
||||
userId: user._id
|
||||
});
|
||||
|
||||
// Create temp file
|
||||
const [path, cleanup] = await new Promise<[string, any]>((res, rej) => {
|
||||
tmp.file((e, path, fd, cleanup) => {
|
||||
if (e) return rej(e);
|
||||
res([path, cleanup]);
|
||||
});
|
||||
});
|
||||
|
||||
logger.info(`Temp file is ${path}`);
|
||||
|
||||
const stream = fs.createWriteStream(path, { flags: 'a' });
|
||||
|
||||
for (const list of lists) {
|
||||
const users = await User.find({
|
||||
_id: { $in: list.userIds }
|
||||
}, {
|
||||
fields: {
|
||||
username: true,
|
||||
host: true
|
||||
}
|
||||
});
|
||||
|
||||
for (const u of users) {
|
||||
const acct = u.host ? `${u.username}@${u.host}` : `${u.username}@${config.host}`;
|
||||
const content = `${list.title},${acct}`;
|
||||
await new Promise((res, rej) => {
|
||||
stream.write(content + '\n', err => {
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
rej(err);
|
||||
} else {
|
||||
res();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'user-lists-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const driveFile = await addFile(user, path, fileName);
|
||||
|
||||
logger.succ(`Exported to: ${driveFile._id}`);
|
||||
cleanup();
|
||||
done();
|
||||
}
|
55
src/queue/processors/db/import-following.ts
Normal file
55
src/queue/processors/db/import-following.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import * as Bull from 'bull';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import User from '../../../models/user';
|
||||
import config from '../../../config';
|
||||
import follow from '../../../services/following/create';
|
||||
import DriveFile from '../../../models/drive-file';
|
||||
import { getOriginalUrl } from '../../../misc/get-drive-file-url';
|
||||
import parseAcct from '../../../misc/acct/parse';
|
||||
import resolveUser from '../../../remote/resolve-user';
|
||||
import { downloadTextFile } from '../../../misc/download-text-file';
|
||||
|
||||
const logger = queueLogger.createSubLogger('import-following');
|
||||
|
||||
export async function importFollowing(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Importing following of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
_id: new mongo.ObjectID(job.data.user._id.toString())
|
||||
});
|
||||
|
||||
const file = await DriveFile.findOne({
|
||||
_id: new mongo.ObjectID(job.data.fileId.toString())
|
||||
});
|
||||
|
||||
const url = getOriginalUrl(file);
|
||||
|
||||
const csv = await downloadTextFile(url);
|
||||
|
||||
for (const line of csv.trim().split('\n')) {
|
||||
const { username, host } = parseAcct(line.trim());
|
||||
|
||||
let target = host === config.host ? await User.findOne({
|
||||
host: null,
|
||||
usernameLower: username.toLowerCase()
|
||||
}) : await User.findOne({
|
||||
host: host,
|
||||
usernameLower: username.toLowerCase()
|
||||
});
|
||||
|
||||
if (host == null && target == null) continue;
|
||||
|
||||
if (target == null) {
|
||||
target = await resolveUser(username, host);
|
||||
}
|
||||
|
||||
logger.info(`Follow ${target._id} ...`);
|
||||
|
||||
follow(user, target);
|
||||
}
|
||||
|
||||
logger.succ('Imported');
|
||||
done();
|
||||
}
|
70
src/queue/processors/db/import-user-lists.ts
Normal file
70
src/queue/processors/db/import-user-lists.ts
Normal file
@ -0,0 +1,70 @@
|
||||
import * as Bull from 'bull';
|
||||
import * as mongo from 'mongodb';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import User from '../../../models/user';
|
||||
import config from '../../../config';
|
||||
import UserList from '../../../models/user-list';
|
||||
import DriveFile from '../../../models/drive-file';
|
||||
import { getOriginalUrl } from '../../../misc/get-drive-file-url';
|
||||
import parseAcct from '../../../misc/acct/parse';
|
||||
import resolveUser from '../../../remote/resolve-user';
|
||||
import { pushUserToUserList } from '../../../services/user-list/push';
|
||||
import { downloadTextFile } from '../../../misc/download-text-file';
|
||||
|
||||
const logger = queueLogger.createSubLogger('import-user-lists');
|
||||
|
||||
export async function importUserLists(job: Bull.Job, done: any): Promise<void> {
|
||||
logger.info(`Importing user lists of ${job.data.user._id} ...`);
|
||||
|
||||
const user = await User.findOne({
|
||||
_id: new mongo.ObjectID(job.data.user._id.toString())
|
||||
});
|
||||
|
||||
const file = await DriveFile.findOne({
|
||||
_id: new mongo.ObjectID(job.data.fileId.toString())
|
||||
});
|
||||
|
||||
const url = getOriginalUrl(file);
|
||||
|
||||
const csv = await downloadTextFile(url);
|
||||
|
||||
for (const line of csv.trim().split('\n')) {
|
||||
const listName = line.split(',')[0].trim();
|
||||
const { username, host } = parseAcct(line.split(',')[1].trim());
|
||||
|
||||
let list = await UserList.findOne({
|
||||
userId: user._id,
|
||||
title: listName
|
||||
});
|
||||
|
||||
if (list == null) {
|
||||
list = await UserList.insert({
|
||||
createdAt: new Date(),
|
||||
userId: user._id,
|
||||
title: listName,
|
||||
userIds: []
|
||||
});
|
||||
}
|
||||
|
||||
let target = host === config.host ? await User.findOne({
|
||||
host: null,
|
||||
usernameLower: username.toLowerCase()
|
||||
}) : await User.findOne({
|
||||
host: host,
|
||||
usernameLower: username.toLowerCase()
|
||||
});
|
||||
|
||||
if (host == null && target == null) continue;
|
||||
if (list.userIds.some(id => id.equals(target._id))) continue;
|
||||
|
||||
if (target == null) {
|
||||
target = await resolveUser(username, host);
|
||||
}
|
||||
|
||||
pushUserToUserList(target, list);
|
||||
}
|
||||
|
||||
logger.succ('Imported');
|
||||
done();
|
||||
}
|
@ -1,31 +1,28 @@
|
||||
import deliver from './http/deliver';
|
||||
import processInbox from './http/process-inbox';
|
||||
import * as Bull from 'bull';
|
||||
import { deleteNotes } from './delete-notes';
|
||||
import { deleteDriveFiles } from './delete-drive-files';
|
||||
import { exportNotes } from './export-notes';
|
||||
import { exportFollowing } from './export-following';
|
||||
import { exportMute } from './export-mute';
|
||||
import { exportBlocking } from './export-blocking';
|
||||
import { queueLogger } from '../logger';
|
||||
import { exportUserLists } from './export-user-lists';
|
||||
import { importFollowing } from './import-following';
|
||||
import { importUserLists } from './import-user-lists';
|
||||
|
||||
const handlers: any = {
|
||||
deliver,
|
||||
processInbox,
|
||||
const jobs = {
|
||||
deleteNotes,
|
||||
deleteDriveFiles,
|
||||
exportNotes,
|
||||
exportFollowing,
|
||||
exportMute,
|
||||
exportBlocking,
|
||||
};
|
||||
exportUserLists,
|
||||
importFollowing,
|
||||
importUserLists
|
||||
} as any;
|
||||
|
||||
export default (job: any, done: any) => {
|
||||
const handler = handlers[job.data.type];
|
||||
|
||||
if (handler) {
|
||||
handler(job, done);
|
||||
} else {
|
||||
queueLogger.error(`Unknown job: ${job.data.type}`);
|
||||
done();
|
||||
export default function(dbQueue: Bull.Queue) {
|
||||
for (const [k, v] of Object.entries(jobs)) {
|
||||
dbQueue.process(k, v as any);
|
||||
}
|
||||
};
|
||||
}
|
@ -1,19 +1,21 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import request from '../../remote/activitypub/request';
|
||||
import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc';
|
||||
import Instance from '../../models/instance';
|
||||
import instanceChart from '../../services/chart/instance';
|
||||
import Logger from '../../services/logger';
|
||||
|
||||
import request from '../../../remote/activitypub/request';
|
||||
import { queueLogger } from '../../logger';
|
||||
import { registerOrFetchInstanceDoc } from '../../../services/register-or-fetch-instance-doc';
|
||||
import Instance from '../../../models/instance';
|
||||
import instanceChart from '../../../services/chart/instance';
|
||||
const logger = new Logger('deliver');
|
||||
|
||||
let latest: string = null;
|
||||
|
||||
export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
export default async (job: Bull.Job) => {
|
||||
const { host } = new URL(job.data.to);
|
||||
|
||||
try {
|
||||
if (latest !== (latest = JSON.stringify(job.data.content, null, 2)))
|
||||
queueLogger.debug(`delivering ${latest}`);
|
||||
if (latest !== (latest = JSON.stringify(job.data.content, null, 2))) {
|
||||
logger.debug(`delivering ${latest}`);
|
||||
}
|
||||
|
||||
await request(job.data.user, job.data.to, job.data.content);
|
||||
|
||||
@ -31,7 +33,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
instanceChart.requestSent(i.host, true);
|
||||
});
|
||||
|
||||
done();
|
||||
return 'Success';
|
||||
} catch (res) {
|
||||
// Update stats
|
||||
registerOrFetchInstanceDoc(host).then(i => {
|
||||
@ -47,18 +49,21 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
});
|
||||
|
||||
if (res != null && res.hasOwnProperty('statusCode')) {
|
||||
queueLogger.warn(`deliver failed: ${res.statusCode} ${res.statusMessage} to=${job.data.to}`);
|
||||
logger.warn(`deliver failed: ${res.statusCode} ${res.statusMessage} to=${job.data.to}`);
|
||||
|
||||
// 4xx
|
||||
if (res.statusCode >= 400 && res.statusCode < 500) {
|
||||
// HTTPステータスコード4xxはクライアントエラーであり、それはつまり
|
||||
// 何回再送しても成功することはないということなのでエラーにはしないでおく
|
||||
done();
|
||||
} else {
|
||||
done(res.statusMessage);
|
||||
return `${res.statusCode} ${res.statusMessage}`;
|
||||
}
|
||||
|
||||
// 5xx etc.
|
||||
throw `${res.statusCode} ${res.statusMessage}`;
|
||||
} else {
|
||||
queueLogger.warn(`deliver failed: ${res} to=${job.data.to}`);
|
||||
done();
|
||||
// DNS error, socket error, timeout ...
|
||||
logger.warn(`deliver failed: ${res} to=${job.data.to}`);
|
||||
throw res;
|
||||
}
|
||||
}
|
||||
};
|
@ -1,21 +1,21 @@
|
||||
import * as bq from 'bee-queue';
|
||||
import * as Bull from 'bull';
|
||||
import * as httpSignature from 'http-signature';
|
||||
import parseAcct from '../../../misc/acct/parse';
|
||||
import User, { IRemoteUser } from '../../../models/user';
|
||||
import perform from '../../../remote/activitypub/perform';
|
||||
import { resolvePerson, updatePerson } from '../../../remote/activitypub/models/person';
|
||||
import parseAcct from '../../misc/acct/parse';
|
||||
import User, { IRemoteUser } from '../../models/user';
|
||||
import perform from '../../remote/activitypub/perform';
|
||||
import { resolvePerson, updatePerson } from '../../remote/activitypub/models/person';
|
||||
import { toUnicode } from 'punycode';
|
||||
import { URL } from 'url';
|
||||
import { publishApLogStream } from '../../../services/stream';
|
||||
import Logger from '../../../services/logger';
|
||||
import { registerOrFetchInstanceDoc } from '../../../services/register-or-fetch-instance-doc';
|
||||
import Instance from '../../../models/instance';
|
||||
import instanceChart from '../../../services/chart/instance';
|
||||
import { publishApLogStream } from '../../services/stream';
|
||||
import Logger from '../../services/logger';
|
||||
import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc';
|
||||
import Instance from '../../models/instance';
|
||||
import instanceChart from '../../services/chart/instance';
|
||||
|
||||
const logger = new Logger('inbox');
|
||||
|
||||
// ユーザーのinboxにアクティビティが届いた時の処理
|
||||
export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
export default async (job: Bull.Job): Promise<void> => {
|
||||
const signature = job.data.signature;
|
||||
const activity = job.data.activity;
|
||||
|
||||
@ -33,7 +33,6 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
const { username, host } = parseAcct(keyIdLower.slice('acct:'.length));
|
||||
if (host === null) {
|
||||
logger.warn(`request was made by local user: @${username}`);
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -42,7 +41,6 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
ValidateActivity(activity, host);
|
||||
} catch (e) {
|
||||
logger.warn(e.message);
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -50,8 +48,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
// TODO: いちいちデータベースにアクセスするのはコスト高そうなのでどっかにキャッシュしておく
|
||||
const instance = await Instance.findOne({ host: host.toLowerCase() });
|
||||
if (instance && instance.isBlocked) {
|
||||
logger.warn(`Blocked request: ${host}`);
|
||||
done();
|
||||
logger.info(`Blocked request: ${host}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -63,7 +60,6 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
ValidateActivity(activity, host);
|
||||
} catch (e) {
|
||||
logger.warn(e.message);
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -72,7 +68,6 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
const instance = await Instance.findOne({ host: host.toLowerCase() });
|
||||
if (instance && instance.isBlocked) {
|
||||
logger.warn(`Blocked request: ${host}`);
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -82,7 +77,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
}) as IRemoteUser;
|
||||
}
|
||||
|
||||
// Update activityの場合は、ここで署名検証/更新処理まで実施して終了
|
||||
// Update Person activityの場合は、ここで署名検証/更新処理まで実施して終了
|
||||
if (activity.type === 'Update') {
|
||||
if (activity.object && activity.object.type === 'Person') {
|
||||
if (user == null) {
|
||||
@ -92,10 +87,9 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
} else {
|
||||
updatePerson(activity.actor, null, activity.object);
|
||||
}
|
||||
}
|
||||
done();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する
|
||||
if (user === null) {
|
||||
@ -103,13 +97,11 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
}
|
||||
|
||||
if (user === null) {
|
||||
done(new Error('failed to resolve user'));
|
||||
return;
|
||||
throw new Error('failed to resolve user');
|
||||
}
|
||||
|
||||
if (!httpSignature.verifySignature(signature, user.publicKey.publicKeyPem)) {
|
||||
logger.error('signature verification failed');
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -136,12 +128,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
|
||||
});
|
||||
|
||||
// アクティビティを処理
|
||||
try {
|
||||
await perform(user, activity);
|
||||
done();
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
@ -29,7 +29,19 @@ export default async function(resolver: Resolver, actor: IRemoteUser, activity:
|
||||
return;
|
||||
}
|
||||
|
||||
const renote = await resolveNote(note);
|
||||
// Announce対象をresolve
|
||||
let renote;
|
||||
try {
|
||||
renote = await resolveNote(note);
|
||||
} catch (e) {
|
||||
// 対象が4xxならスキップ
|
||||
if (e.statusCode >= 400 && e.statusCode < 500) {
|
||||
logger.warn(`Ignored announce target ${note.inReplyTo} - ${e.statusCode}`);
|
||||
return;
|
||||
}
|
||||
logger.warn(`Error in announce target ${note.inReplyTo} - ${e.statusCode || e}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
logger.info(`Creating the (Re)Note: ${uri}`);
|
||||
|
||||
|
@ -2,6 +2,7 @@ import { Object } from '../type';
|
||||
import { IRemoteUser } from '../../../models/user';
|
||||
import create from './create';
|
||||
import performDeleteActivity from './delete';
|
||||
import performUpdateActivity from './update';
|
||||
import follow from './follow';
|
||||
import undo from './undo';
|
||||
import like from './like';
|
||||
@ -23,6 +24,10 @@ const self = async (actor: IRemoteUser, activity: Object): Promise<void> => {
|
||||
await performDeleteActivity(actor, activity);
|
||||
break;
|
||||
|
||||
case 'Update':
|
||||
await performUpdateActivity(actor, activity);
|
||||
break;
|
||||
|
||||
case 'Follow':
|
||||
await follow(actor, activity);
|
||||
break;
|
||||
|
28
src/remote/activitypub/kernel/update/index.ts
Normal file
28
src/remote/activitypub/kernel/update/index.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { IRemoteUser } from '../../../../models/user';
|
||||
import { IUpdate, IObject } from '../../type';
|
||||
import { apLogger } from '../../logger';
|
||||
import { updateQuestion } from '../../models/question';
|
||||
|
||||
/**
|
||||
* Updateアクティビティを捌きます
|
||||
*/
|
||||
export default async (actor: IRemoteUser, activity: IUpdate): Promise<void> => {
|
||||
if ('actor' in activity && actor.uri !== activity.actor) {
|
||||
throw new Error('invalid actor');
|
||||
}
|
||||
|
||||
apLogger.debug('Update');
|
||||
|
||||
const object = activity.object as IObject;
|
||||
|
||||
switch (object.type) {
|
||||
case 'Question':
|
||||
apLogger.debug('Question');
|
||||
await updateQuestion(object).catch(e => console.log(e));
|
||||
break;
|
||||
|
||||
default:
|
||||
apLogger.warn(`Unknown type: ${object.type}`);
|
||||
break;
|
||||
}
|
||||
};
|
@ -27,7 +27,17 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<IDriv
|
||||
const instance = await fetchMeta();
|
||||
const cache = instance.cacheRemoteFiles;
|
||||
|
||||
let file = await uploadFromUrl(image.url, actor, null, image.url, image.sensitive, false, !cache);
|
||||
let file;
|
||||
try {
|
||||
file = await uploadFromUrl(image.url, actor, null, image.url, image.sensitive, false, !cache);
|
||||
} catch (e) {
|
||||
// 4xxの場合は添付されてなかったことにする
|
||||
if (e >= 400 && e < 500) {
|
||||
logger.warn(`Ignored image: ${image.url} - ${e}`);
|
||||
return null;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (file.metadata.isRemote) {
|
||||
// URLが異なっている場合、同じ画像が以前に異なるURLで登録されていたということなので、
|
||||
|
@ -18,6 +18,7 @@ import { extractPollFromQuestion } from './question';
|
||||
import vote from '../../../services/note/polls/vote';
|
||||
import { apLogger } from '../logger';
|
||||
import { IDriveFile } from '../../../models/drive-file';
|
||||
import { deliverQuestionUpdate } from '../../../services/note/polls/update';
|
||||
|
||||
const logger = apLogger;
|
||||
|
||||
@ -110,11 +111,22 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||
note.attachment = Array.isArray(note.attachment) ? note.attachment : note.attachment ? [note.attachment] : [];
|
||||
const files = note.attachment
|
||||
.map(attach => attach.sensitive = note.sensitive)
|
||||
? await Promise.all(note.attachment.map(x => limit(() => resolveImage(actor, x)) as Promise<IDriveFile>))
|
||||
? (await Promise.all(note.attachment.map(x => limit(() => resolveImage(actor, x)) as Promise<IDriveFile>)))
|
||||
.filter(image => image != null)
|
||||
: [];
|
||||
|
||||
// リプライ
|
||||
const reply = note.inReplyTo ? await resolveNote(note.inReplyTo, resolver) : null;
|
||||
const reply = note.inReplyTo
|
||||
? await resolveNote(note.inReplyTo, resolver).catch(e => {
|
||||
// 4xxの場合はリプライしてないことにする
|
||||
if (e.statusCode >= 400 && e.statusCode < 500) {
|
||||
logger.warn(`Ignored inReplyTo ${note.inReplyTo} - ${e.statusCode} `);
|
||||
return null;
|
||||
}
|
||||
logger.warn(`Error in inReplyTo ${note.inReplyTo} - ${e.statusCode || e}`);
|
||||
throw e;
|
||||
})
|
||||
: null;
|
||||
|
||||
// 引用
|
||||
let quote: INote;
|
||||
@ -136,6 +148,9 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
|
||||
} else if (index >= 0) {
|
||||
logger.info(`vote from AP: actor=${actor.username}@${actor.host}, note=${note.id}, choice=${name}`);
|
||||
await vote(actor, reply, index);
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
deliverQuestionUpdate(reply._id);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
@ -1,18 +1,8 @@
|
||||
import { IChoice, IPoll } from '../../../models/note';
|
||||
import config from '../../../config';
|
||||
import Note, { IChoice, IPoll } from '../../../models/note';
|
||||
import Resolver from '../resolver';
|
||||
import { ICollection } from '../type';
|
||||
|
||||
interface IQuestionChoice {
|
||||
name?: string;
|
||||
replies?: ICollection;
|
||||
_misskey_votes?: number;
|
||||
}
|
||||
|
||||
interface IQuestion {
|
||||
oneOf?: IQuestionChoice[];
|
||||
anyOf?: IQuestionChoice[];
|
||||
endTime?: Date;
|
||||
}
|
||||
import { IQuestion } from '../type';
|
||||
import { apLogger } from '../logger';
|
||||
|
||||
export async function extractPollFromQuestion(source: string | IQuestion): Promise<IPoll> {
|
||||
const question = typeof source === 'string' ? await new Resolver().resolve(source) as IQuestion : source;
|
||||
@ -36,3 +26,54 @@ export async function extractPollFromQuestion(source: string | IQuestion): Promi
|
||||
expiresAt
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Update votes of Question
|
||||
* @param uri URI of AP Question object
|
||||
* @returns true if updated
|
||||
*/
|
||||
export async function updateQuestion(value: any) {
|
||||
const uri = typeof value == 'string' ? value : value.id;
|
||||
|
||||
// URIがこのサーバーを指しているならスキップ
|
||||
if (uri.startsWith(config.url + '/')) throw 'uri points local';
|
||||
|
||||
//#region このサーバーに既に登録されているか
|
||||
const note = await Note.findOne({ uri });
|
||||
|
||||
if (note == null) throw 'Question is not registed';
|
||||
//#endregion
|
||||
|
||||
// resolve new Question object
|
||||
const resolver = new Resolver();
|
||||
const question = await resolver.resolve(value) as IQuestion;
|
||||
apLogger.debug(`fetched question: ${JSON.stringify(question, null, 2)}`);
|
||||
|
||||
if (question.type !== 'Question') throw 'object is not a Question';
|
||||
|
||||
const apChoices = question.oneOf || question.anyOf;
|
||||
const dbChoices = note.poll.choices;
|
||||
|
||||
let changed = false;
|
||||
|
||||
for (const db of dbChoices) {
|
||||
const oldCount = db.votes;
|
||||
const newCount = apChoices.filter(ap => ap.name === db.text)[0].replies.totalItems;
|
||||
|
||||
if (oldCount != newCount) {
|
||||
changed = true;
|
||||
db.votes = newCount;
|
||||
}
|
||||
}
|
||||
|
||||
await Note.update({
|
||||
_id: note._id
|
||||
}, {
|
||||
$set: {
|
||||
'poll.choices': dbChoices,
|
||||
updatedAt: new Date(),
|
||||
}
|
||||
});
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import Instance from '../../models/instance';
|
||||
|
||||
export const logger = apLogger.createSubLogger('deliver');
|
||||
|
||||
export default (user: ILocalUser, url: string, object: any) => new Promise(async (resolve, reject) => {
|
||||
export default async (user: ILocalUser, url: string, object: any) => {
|
||||
logger.info(`--> ${url}`);
|
||||
|
||||
const timeout = 10 * 1000;
|
||||
@ -32,9 +32,10 @@ export default (user: ILocalUser, url: string, object: any) => new Promise(async
|
||||
sha256.update(data);
|
||||
const hash = sha256.digest('base64');
|
||||
|
||||
const addr = await resolveAddr(hostname).catch(e => reject(e));
|
||||
const addr = await resolveAddr(hostname);
|
||||
if (!addr) return;
|
||||
|
||||
const _ = new Promise((resolve, reject) => {
|
||||
const req = request({
|
||||
protocol,
|
||||
hostname: addr,
|
||||
@ -79,6 +80,9 @@ export default (user: ILocalUser, url: string, object: any) => new Promise(async
|
||||
});
|
||||
|
||||
req.end(data);
|
||||
});
|
||||
|
||||
await _;
|
||||
|
||||
//#region Log
|
||||
publishApLogStream({
|
||||
@ -88,7 +92,7 @@ export default (user: ILocalUser, url: string, object: any) => new Promise(async
|
||||
actor: user.username
|
||||
});
|
||||
//#endregion
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolve host (with cached, asynchrony)
|
||||
|
@ -1,9 +1,6 @@
|
||||
import * as request from 'request-promise-native';
|
||||
import { IObject } from './type';
|
||||
import config from '../../config';
|
||||
import { apLogger } from './logger';
|
||||
|
||||
export const logger = apLogger.createSubLogger('resolver');
|
||||
|
||||
export default class Resolver {
|
||||
private history: Set<string>;
|
||||
@ -34,7 +31,6 @@ export default class Resolver {
|
||||
}
|
||||
|
||||
default: {
|
||||
logger.error(`unknown collection type: ${collection.type}`);
|
||||
throw new Error(`unknown collection type: ${collection.type}`);
|
||||
}
|
||||
}
|
||||
@ -44,7 +40,6 @@ export default class Resolver {
|
||||
|
||||
public async resolve(value: any): Promise<IObject> {
|
||||
if (value == null) {
|
||||
logger.error('resolvee is null (or undefined)');
|
||||
throw new Error('resolvee is null (or undefined)');
|
||||
}
|
||||
|
||||
@ -53,7 +48,6 @@ export default class Resolver {
|
||||
}
|
||||
|
||||
if (this.history.has(value)) {
|
||||
logger.error(`cannot resolve already resolved one: ${value}`);
|
||||
throw new Error('cannot resolve already resolved one');
|
||||
}
|
||||
|
||||
@ -68,12 +62,6 @@ export default class Resolver {
|
||||
Accept: 'application/activity+json, application/ld+json'
|
||||
},
|
||||
json: true
|
||||
}).catch(e => {
|
||||
logger.error(`request error: ${value}: ${e.message}`, {
|
||||
url: value,
|
||||
e: e
|
||||
});
|
||||
throw new Error(`request error: ${e.message}`);
|
||||
});
|
||||
|
||||
if (object === null || (
|
||||
@ -81,10 +69,6 @@ export default class Resolver {
|
||||
!object['@context'].includes('https://www.w3.org/ns/activitystreams') :
|
||||
object['@context'] !== 'https://www.w3.org/ns/activitystreams'
|
||||
)) {
|
||||
logger.error(`invalid response: ${value}`, {
|
||||
url: value,
|
||||
object: object
|
||||
});
|
||||
throw new Error('invalid response');
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,28 @@ export interface IOrderedCollection extends IObject {
|
||||
}
|
||||
|
||||
export interface INote extends IObject {
|
||||
type: 'Note';
|
||||
type: 'Note' | 'Question';
|
||||
_misskey_content: string;
|
||||
_misskey_quote: string;
|
||||
_misskey_question: string;
|
||||
}
|
||||
|
||||
export interface IQuestion extends IObject {
|
||||
type: 'Note' | 'Question';
|
||||
_misskey_content: string;
|
||||
_misskey_quote: string;
|
||||
_misskey_question: string;
|
||||
oneOf?: IQuestionChoice[];
|
||||
anyOf?: IQuestionChoice[];
|
||||
endTime?: Date;
|
||||
}
|
||||
|
||||
interface IQuestionChoice {
|
||||
name?: string;
|
||||
replies?: ICollection;
|
||||
_misskey_votes?: number;
|
||||
}
|
||||
|
||||
export interface IPerson extends IObject {
|
||||
type: 'Person';
|
||||
name: string;
|
||||
@ -81,6 +97,10 @@ export interface IDelete extends IActivity {
|
||||
type: 'Delete';
|
||||
}
|
||||
|
||||
export interface IUpdate extends IActivity {
|
||||
type: 'Update';
|
||||
}
|
||||
|
||||
export interface IUndo extends IActivity {
|
||||
type: 'Undo';
|
||||
}
|
||||
@ -123,6 +143,7 @@ export type Object =
|
||||
IOrderedCollection |
|
||||
ICreate |
|
||||
IDelete |
|
||||
IUpdate |
|
||||
IUndo |
|
||||
IFollow |
|
||||
IAccept |
|
||||
|
@ -16,7 +16,7 @@ import Followers from './activitypub/followers';
|
||||
import Following from './activitypub/following';
|
||||
import Featured from './activitypub/featured';
|
||||
import renderQuestion from '../remote/activitypub/renderer/question';
|
||||
import { processInbox } from '../queue';
|
||||
import { inbox as processInbox } from '../queue';
|
||||
|
||||
// Init router
|
||||
const router = new Router();
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { performance } from 'perf_hooks';
|
||||
import limiter from './limiter';
|
||||
import { IUser } from '../../models/user';
|
||||
import { IApp } from '../../models/app';
|
||||
@ -71,6 +72,7 @@ export default async (endpoint: string, user: IUser, app: IApp, data: any, file?
|
||||
}
|
||||
|
||||
// API invoking
|
||||
const before = performance.now();
|
||||
return await ep.exec(data, user, app, file).catch((e: Error) => {
|
||||
if (e instanceof ApiError) {
|
||||
throw e;
|
||||
@ -88,5 +90,11 @@ export default async (endpoint: string, user: IUser, app: IApp, data: any, file?
|
||||
}
|
||||
});
|
||||
}
|
||||
}).finally(() => {
|
||||
const after = performance.now();
|
||||
const time = after - before;
|
||||
if (time > 1000) {
|
||||
apiLogger.warn(`SLOW API CALL DETECTED: ${ep.name} (${time}ms)`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
21
src/server/api/endpoints/admin/queue/stats.ts
Normal file
21
src/server/api/endpoints/admin/queue/stats.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import define from '../../../define';
|
||||
import { deliverQueue, inboxQueue } from '../../../../../queue';
|
||||
|
||||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
params: {}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps) => {
|
||||
const deliverJobCounts = await deliverQueue.getJobCounts();
|
||||
const inboxJobCounts = await inboxQueue.getJobCounts();
|
||||
|
||||
return {
|
||||
deliver: deliverJobCounts,
|
||||
inbox: inboxJobCounts
|
||||
};
|
||||
});
|
18
src/server/api/endpoints/i/export-user-lists.ts
Normal file
18
src/server/api/endpoints/i/export-user-lists.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import define from '../../define';
|
||||
import { createExportUserListsJob } from '../../../../queue';
|
||||
import ms = require('ms');
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
requireCredential: true,
|
||||
limit: {
|
||||
duration: ms('1min'),
|
||||
max: 1,
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
createExportUserListsJob(user);
|
||||
|
||||
return;
|
||||
});
|
64
src/server/api/endpoints/i/import-following.ts
Normal file
64
src/server/api/endpoints/i/import-following.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import $ from 'cafy';
|
||||
import ID, { transform } from '../../../../misc/cafy-id';
|
||||
import define from '../../define';
|
||||
import { createImportFollowingJob } from '../../../../queue';
|
||||
import ms = require('ms');
|
||||
import DriveFile from '../../../../models/drive-file';
|
||||
import { ApiError } from '../../error';
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
requireCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 1,
|
||||
},
|
||||
|
||||
params: {
|
||||
fileId: {
|
||||
validator: $.type(ID),
|
||||
transform: transform,
|
||||
}
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchFile: {
|
||||
message: 'No such file.',
|
||||
code: 'NO_SUCH_FILE',
|
||||
id: 'b98644cf-a5ac-4277-a502-0b8054a709a3'
|
||||
},
|
||||
|
||||
unexpectedFileType: {
|
||||
message: 'We need csv file.',
|
||||
code: 'UNEXPECTED_FILE_TYPE',
|
||||
id: '660f3599-bce0-4f95-9dde-311fd841c183'
|
||||
},
|
||||
|
||||
tooBigFile: {
|
||||
message: 'That file is too big.',
|
||||
code: 'TOO_BIG_FILE',
|
||||
id: 'dee9d4ed-ad07-43ed-8b34-b2856398bc60'
|
||||
},
|
||||
|
||||
emptyFile: {
|
||||
message: 'That file is empty.',
|
||||
code: 'EMPTY_FILE',
|
||||
id: '31a1b42c-06f7-42ae-8a38-a661c5c9f691'
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
const file = await DriveFile.findOne({
|
||||
_id: ps.fileId
|
||||
});
|
||||
|
||||
if (file == null) throw new ApiError(meta.errors.noSuchFile);
|
||||
//if (!file.contentType.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
|
||||
if (file.length > 50000) throw new ApiError(meta.errors.tooBigFile);
|
||||
if (file.length === 0) throw new ApiError(meta.errors.emptyFile);
|
||||
|
||||
createImportFollowingJob(user, file._id);
|
||||
|
||||
return;
|
||||
});
|
64
src/server/api/endpoints/i/import-user-lists.ts
Normal file
64
src/server/api/endpoints/i/import-user-lists.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import $ from 'cafy';
|
||||
import ID, { transform } from '../../../../misc/cafy-id';
|
||||
import define from '../../define';
|
||||
import { createImportUserListsJob } from '../../../../queue';
|
||||
import ms = require('ms');
|
||||
import DriveFile from '../../../../models/drive-file';
|
||||
import { ApiError } from '../../error';
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
requireCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 1,
|
||||
},
|
||||
|
||||
params: {
|
||||
fileId: {
|
||||
validator: $.type(ID),
|
||||
transform: transform,
|
||||
}
|
||||
},
|
||||
|
||||
errors: {
|
||||
noSuchFile: {
|
||||
message: 'No such file.',
|
||||
code: 'NO_SUCH_FILE',
|
||||
id: 'ea9cc34f-c415-4bc6-a6fe-28ac40357049'
|
||||
},
|
||||
|
||||
unexpectedFileType: {
|
||||
message: 'We need csv file.',
|
||||
code: 'UNEXPECTED_FILE_TYPE',
|
||||
id: 'a3c9edda-dd9b-4596-be6a-150ef813745c'
|
||||
},
|
||||
|
||||
tooBigFile: {
|
||||
message: 'That file is too big.',
|
||||
code: 'TOO_BIG_FILE',
|
||||
id: 'ae6e7a22-971b-4b52-b2be-fc0b9b121fe9'
|
||||
},
|
||||
|
||||
emptyFile: {
|
||||
message: 'That file is empty.',
|
||||
code: 'EMPTY_FILE',
|
||||
id: '99efe367-ce6e-4d44-93f8-5fae7b040356'
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
const file = await DriveFile.findOne({
|
||||
_id: ps.fileId
|
||||
});
|
||||
|
||||
if (file == null) throw new ApiError(meta.errors.noSuchFile);
|
||||
//if (!file.contentType.endsWith('/csv')) throw new ApiError(meta.errors.unexpectedFileType);
|
||||
if (file.length > 30000) throw new ApiError(meta.errors.tooBigFile);
|
||||
if (file.length === 0) throw new ApiError(meta.errors.emptyFile);
|
||||
|
||||
createImportUserListsJob(user, file._id);
|
||||
|
||||
return;
|
||||
});
|
132
src/server/api/endpoints/notes/children.ts
Normal file
132
src/server/api/endpoints/notes/children.ts
Normal file
@ -0,0 +1,132 @@
|
||||
import $ from 'cafy';
|
||||
import ID, { transform } from '../../../../misc/cafy-id';
|
||||
import Note, { packMany } from '../../../../models/note';
|
||||
import define from '../../define';
|
||||
import { getFriends } from '../../common/get-friends';
|
||||
import { getHideUserIds } from '../../common/get-hide-users';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
'ja-JP': '指定した投稿への返信/引用を取得します。',
|
||||
'en-US': 'Get replies/quotes of a note.'
|
||||
},
|
||||
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
validator: $.type(ID),
|
||||
transform: transform,
|
||||
desc: {
|
||||
'ja-JP': '対象の投稿のID',
|
||||
'en-US': 'Target note ID'
|
||||
}
|
||||
},
|
||||
|
||||
limit: {
|
||||
validator: $.optional.num.range(1, 100),
|
||||
default: 10
|
||||
},
|
||||
|
||||
sinceId: {
|
||||
validator: $.optional.type(ID),
|
||||
transform: transform,
|
||||
},
|
||||
|
||||
untilId: {
|
||||
validator: $.optional.type(ID),
|
||||
transform: transform,
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default define(meta, async (ps, user) => {
|
||||
const [followings, hideUserIds] = await Promise.all([
|
||||
// フォローを取得
|
||||
// Fetch following
|
||||
user ? getFriends(user._id) : [],
|
||||
|
||||
// 隠すユーザーを取得
|
||||
getHideUserIds(user)
|
||||
]);
|
||||
|
||||
const visibleQuery = user == null ? [{
|
||||
visibility: { $in: [ 'public', 'home' ] }
|
||||
}] : [{
|
||||
visibility: { $in: [ 'public', 'home' ] }
|
||||
}, {
|
||||
// myself (for followers/specified/private)
|
||||
userId: user._id
|
||||
}, {
|
||||
// to me (for specified)
|
||||
visibleUserIds: { $in: [ user._id ] }
|
||||
}, {
|
||||
visibility: 'followers',
|
||||
$or: [{
|
||||
// フォロワーの投稿
|
||||
userId: { $in: followings.map(f => f.id) },
|
||||
}, {
|
||||
// 自分の投稿へのリプライ
|
||||
'_reply.userId': user._id,
|
||||
}, {
|
||||
// 自分へのメンションが含まれている
|
||||
mentions: { $in: [ user._id ] }
|
||||
}]
|
||||
}];
|
||||
|
||||
const q = {
|
||||
$and: [{
|
||||
$or: [{
|
||||
replyId: ps.noteId,
|
||||
}, {
|
||||
renoteId: ps.noteId,
|
||||
$or: [{
|
||||
text: { $ne: null }
|
||||
}, {
|
||||
fileIds: { $ne: [] }
|
||||
}, {
|
||||
poll: { $ne: null }
|
||||
}]
|
||||
}]
|
||||
}, {
|
||||
$or: visibleQuery
|
||||
}]
|
||||
} as any;
|
||||
|
||||
if (hideUserIds && hideUserIds.length > 0) {
|
||||
q['userId'] = {
|
||||
$nin: hideUserIds
|
||||
};
|
||||
}
|
||||
|
||||
const sort = {
|
||||
_id: -1
|
||||
};
|
||||
|
||||
if (ps.sinceId) {
|
||||
sort._id = 1;
|
||||
q._id = {
|
||||
$gt: ps.sinceId
|
||||
};
|
||||
} else if (ps.untilId) {
|
||||
q._id = {
|
||||
$lt: ps.untilId
|
||||
};
|
||||
}
|
||||
|
||||
const notes = await Note.find(q, {
|
||||
limit: ps.limit,
|
||||
sort: sort
|
||||
});
|
||||
|
||||
return await packMany(notes, user);
|
||||
});
|
@ -52,10 +52,18 @@ export default define(meta, async (ps, user) => {
|
||||
$ne: user._id,
|
||||
$nin: hideUserIds
|
||||
},
|
||||
visibility: 'public',
|
||||
poll: {
|
||||
$exists: true,
|
||||
$ne: null
|
||||
},
|
||||
$or: [{
|
||||
'poll.expiresAt': null
|
||||
}, {
|
||||
'poll.expiresAt': {
|
||||
$gt: new Date()
|
||||
}
|
||||
}],
|
||||
}, {
|
||||
limit: ps.limit,
|
||||
skip: ps.offset,
|
||||
|
@ -13,6 +13,7 @@ import { getNote } from '../../../common/getters';
|
||||
import { deliver } from '../../../../../queue';
|
||||
import { renderActivity } from '../../../../../remote/activitypub/renderer';
|
||||
import renderVote from '../../../../../remote/activitypub/renderer/vote';
|
||||
import { deliverQuestionUpdate } from '../../../../../services/note/polls/update';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
@ -172,5 +173,8 @@ export default define(meta, async (ps, user) => {
|
||||
deliver(user, renderActivity(await renderVote(user, vote, note, pollOwner)), pollOwner.inbox);
|
||||
}
|
||||
|
||||
// リモートフォロワーにUpdate配信
|
||||
deliverQuestionUpdate(note._id);
|
||||
|
||||
return;
|
||||
});
|
||||
|
@ -1,14 +1,10 @@
|
||||
import $ from 'cafy';
|
||||
import ID, { transform } from '../../../../../misc/cafy-id';
|
||||
import UserList from '../../../../../models/user-list';
|
||||
import { pack as packUser, isRemoteUser, fetchProxyAccount } from '../../../../../models/user';
|
||||
import { publishUserListStream } from '../../../../../services/stream';
|
||||
import { renderActivity } from '../../../../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../../../../remote/activitypub/renderer/follow';
|
||||
import { deliver } from '../../../../../queue';
|
||||
import define from '../../../define';
|
||||
import { ApiError } from '../../../error';
|
||||
import { getUser } from '../../../common/getters';
|
||||
import { pushUserToUserList } from '../../../../../services/user-list/push';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
@ -81,18 +77,5 @@ export default define(meta, async (ps, me) => {
|
||||
}
|
||||
|
||||
// Push the user
|
||||
await UserList.update({ _id: userList._id }, {
|
||||
$push: {
|
||||
userIds: user._id
|
||||
}
|
||||
});
|
||||
|
||||
publishUserListStream(userList._id, 'userAdded', await packUser(user));
|
||||
|
||||
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
|
||||
if (isRemoteUser(user)) {
|
||||
const proxy = await fetchProxyAccount();
|
||||
const content = renderActivity(renderFollow(proxy, user));
|
||||
deliver(proxy, content, user.inbox);
|
||||
}
|
||||
pushUserToUserList(user, userList);
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ import hybridTimeline from './hybrid-timeline';
|
||||
import globalTimeline from './global-timeline';
|
||||
import notesStats from './notes-stats';
|
||||
import serverStats from './server-stats';
|
||||
import queueStats from './queue-stats';
|
||||
import userList from './user-list';
|
||||
import messaging from './messaging';
|
||||
import messagingIndex from './messaging-index';
|
||||
@ -23,6 +24,7 @@ export default {
|
||||
globalTimeline,
|
||||
notesStats,
|
||||
serverStats,
|
||||
queueStats,
|
||||
userList,
|
||||
messaging,
|
||||
messagingIndex,
|
||||
|
41
src/server/api/stream/channels/queue-stats.ts
Normal file
41
src/server/api/stream/channels/queue-stats.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import autobind from 'autobind-decorator';
|
||||
import Xev from 'xev';
|
||||
import Channel from '../channel';
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'queueStats';
|
||||
public static shouldShare = true;
|
||||
public static requireCredential = false;
|
||||
|
||||
@autobind
|
||||
public async init(params: any) {
|
||||
ev.addListener('queueStats', this.onStats);
|
||||
}
|
||||
|
||||
@autobind
|
||||
private onStats(stats: any) {
|
||||
this.send('stats', stats);
|
||||
}
|
||||
|
||||
@autobind
|
||||
public onMessage(type: string, body: any) {
|
||||
switch (type) {
|
||||
case 'requestLog':
|
||||
ev.once(`queueStatsLog:${body.id}`, statsLog => {
|
||||
this.send('statsLog', statsLog);
|
||||
});
|
||||
ev.emit('requestQueueStatsLog', {
|
||||
id: body.id,
|
||||
length: body.length
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
public dispose() {
|
||||
ev.removeListener('queueStats', this.onStats);
|
||||
}
|
||||
}
|
@ -3,10 +3,10 @@ import * as URL from 'url';
|
||||
import * as tmp from 'tmp';
|
||||
import * as Koa from 'koa';
|
||||
import * as request from 'request';
|
||||
import * as fileType from 'file-type';
|
||||
import fileType from 'file-type';
|
||||
import { serverLogger } from '..';
|
||||
import config from '../../config';
|
||||
import { IImage, ConvertToPng } from '../../services/drive/image-processor';
|
||||
import { IImage, ConvertToPng, ConvertToJpeg } from '../../services/drive/image-processor';
|
||||
import checkSvg from '../../misc/check-svg';
|
||||
|
||||
export async function proxyMedia(ctx: Koa.BaseContext) {
|
||||
@ -29,6 +29,8 @@ export async function proxyMedia(ctx: Koa.BaseContext) {
|
||||
|
||||
if ('static' in ctx.query && ['image/png', 'image/gif'].includes(type)) {
|
||||
image = await ConvertToPng(path, 498, 280);
|
||||
} else if ('preview' in ctx.query && ['image/jpeg', 'image/png', 'image/gif'].includes(type)) {
|
||||
image = await ConvertToJpeg(path, 200, 200);
|
||||
} else {
|
||||
image = {
|
||||
data: fs.readFileSync(path),
|
||||
|
@ -79,6 +79,12 @@ router.get('/manifest.json', async ctx => {
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/robots.txt', async ctx => {
|
||||
await send(ctx as any, '/assets/robots.txt', {
|
||||
root: client
|
||||
});
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
// Docs
|
||||
|
@ -3,6 +3,8 @@ import * as request from 'request-promise-native';
|
||||
import summaly from 'summaly';
|
||||
import fetchMeta from '../../misc/fetch-meta';
|
||||
import Logger from '../../services/logger';
|
||||
import config from '../../config';
|
||||
import { query } from '../../prelude/url';
|
||||
|
||||
const logger = new Logger('url-preview');
|
||||
|
||||
@ -44,7 +46,10 @@ module.exports = async (ctx: Koa.BaseContext) => {
|
||||
function wrap(url: string): string {
|
||||
return url != null
|
||||
? url.match(/^https?:\/\//)
|
||||
? `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, '').replace(/^https:\/\//, 'ssl:'))}&w=200&h=200`
|
||||
? `${config.url}/proxy/preview.jpg?${query({
|
||||
url,
|
||||
preview: '1'
|
||||
})}`
|
||||
: url
|
||||
: null;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ html
|
||||
| Misskey
|
||||
|
||||
block desc
|
||||
meta(name='description' content='A planet of fediverse')
|
||||
meta(name='description' content='✨🌎✨ A federated blogging platform ✨🚀✨')
|
||||
|
||||
block meta
|
||||
|
||||
|
@ -6,7 +6,7 @@ import * as crypto from 'crypto';
|
||||
import * as Minio from 'minio';
|
||||
import * as uuid from 'uuid';
|
||||
import * as sharp from 'sharp';
|
||||
import * as fileType from 'file-type';
|
||||
import fileType from 'file-type';
|
||||
|
||||
import DriveFile, { IMetadata, getDriveFileBucket, IDriveFile } from '../../models/drive-file';
|
||||
import DriveFolder from '../../models/drive-folder';
|
||||
|
@ -42,7 +42,7 @@ export default async (
|
||||
const writable = fs.createWriteStream(path);
|
||||
|
||||
writable.on('finish', () => {
|
||||
logger.succ(`Download succeeded: ${chalk.cyan(url)}`);
|
||||
logger.succ(`Download finished: ${chalk.cyan(url)}`);
|
||||
res();
|
||||
});
|
||||
|
||||
|
61
src/services/note/polls/update.ts
Normal file
61
src/services/note/polls/update.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import * as mongo from 'mongodb';
|
||||
import Note, { INote } from '../../../models/note';
|
||||
import { updateQuestion } from '../../../remote/activitypub/models/question';
|
||||
import ms = require('ms');
|
||||
import Logger from '../../logger';
|
||||
import User, { isLocalUser, isRemoteUser } from '../../../models/user';
|
||||
import Following from '../../../models/following';
|
||||
import renderUpdate from '../../../remote/activitypub/renderer/update';
|
||||
import { renderActivity } from '../../../remote/activitypub/renderer';
|
||||
import { deliver } from '../../../queue';
|
||||
import renderNote from '../../../remote/activitypub/renderer/note';
|
||||
|
||||
const logger = new Logger('pollsUpdate');
|
||||
|
||||
export async function triggerUpdate(note: INote) {
|
||||
if (!note.updatedAt || Date.now() - new Date(note.updatedAt).getTime() > ms('1min')) {
|
||||
logger.info(`Updating ${note._id}`);
|
||||
|
||||
try {
|
||||
const updated = await updateQuestion(note.uri);
|
||||
logger.info(`Updated ${note._id} ${updated ? 'changed' : 'nochange'}`);
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function deliverQuestionUpdate(noteId: mongo.ObjectID) {
|
||||
const note = await Note.findOne({
|
||||
_id: noteId,
|
||||
});
|
||||
|
||||
const user = await User.findOne({
|
||||
_id: note.userId
|
||||
});
|
||||
|
||||
const followers = await Following.find({
|
||||
followeeId: user._id
|
||||
});
|
||||
|
||||
const queue: string[] = [];
|
||||
|
||||
// フォロワーがリモートユーザーかつ投稿者がローカルユーザーならUpdateを配信
|
||||
if (isLocalUser(user)) {
|
||||
for (const following of followers) {
|
||||
const follower = following._follower;
|
||||
|
||||
if (isRemoteUser(follower)) {
|
||||
const inbox = follower.sharedInbox || follower.inbox;
|
||||
if (!queue.includes(inbox)) queue.push(inbox);
|
||||
}
|
||||
}
|
||||
|
||||
if (queue.length > 0) {
|
||||
const content = renderActivity(renderUpdate(await renderNote(note, false), user));
|
||||
for (const inbox of queue) {
|
||||
deliver(user, content, inbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
23
src/services/user-list/push.ts
Normal file
23
src/services/user-list/push.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { pack as packUser, IUser, isRemoteUser, fetchProxyAccount } from '../../models/user';
|
||||
import UserList, { IUserList } from '../../models/user-list';
|
||||
import { renderActivity } from '../../remote/activitypub/renderer';
|
||||
import { deliver } from '../../queue';
|
||||
import renderFollow from '../../remote/activitypub/renderer/follow';
|
||||
import { publishUserListStream } from '../stream';
|
||||
|
||||
export async function pushUserToUserList(target: IUser, list: IUserList) {
|
||||
await UserList.update({ _id: list._id }, {
|
||||
$push: {
|
||||
userIds: target._id
|
||||
}
|
||||
});
|
||||
|
||||
publishUserListStream(list._id, 'userAdded', await packUser(target));
|
||||
|
||||
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
|
||||
if (isRemoteUser(target)) {
|
||||
const proxy = await fetchProxyAccount();
|
||||
const content = renderActivity(renderFollow(proxy, target));
|
||||
deliver(proxy, content, target.inbox);
|
||||
}
|
||||
}
|
14
src/tools/refresh-question.ts
Normal file
14
src/tools/refresh-question.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { updateQuestion } from '../remote/activitypub/models/question';
|
||||
|
||||
async function main(uri: string): Promise<any> {
|
||||
return await updateQuestion(uri);
|
||||
}
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const uri = args[0];
|
||||
|
||||
main(uri).then(result => {
|
||||
console.log(`Done: ${result}`);
|
||||
}).catch(e => {
|
||||
console.warn(e);
|
||||
});
|
@ -132,7 +132,7 @@ module.exports = {
|
||||
new WebpackOnBuildPlugin((stats: any) => {
|
||||
fs.writeFileSync('./built/client/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');
|
||||
|
||||
fs.mkdirSync('./built/client/assets/locales', { recursive: true })
|
||||
fs.mkdirSync('./built/client/assets/locales', { recursive: true });
|
||||
|
||||
for (const [lang, locale] of Object.entries(locales))
|
||||
fs.writeFileSync(`./built/client/assets/locales/${lang}.json`, JSON.stringify(locale), 'utf-8');
|
||||
|
Reference in New Issue
Block a user