57
.config/example.yml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# サーバーのメンテナ情報
|
||||||
|
maintainer:
|
||||||
|
# メンテナの名前
|
||||||
|
name:
|
||||||
|
|
||||||
|
# メンテナの連絡先(URLかmailto形式のURL)
|
||||||
|
url:
|
||||||
|
|
||||||
|
# (Misskeyを動かす)URL
|
||||||
|
url:
|
||||||
|
|
||||||
|
# 待受ポート
|
||||||
|
port:
|
||||||
|
|
||||||
|
# TLSの設定(利用しない場合は省略可能)
|
||||||
|
https:
|
||||||
|
# 証明書のパス...
|
||||||
|
key:
|
||||||
|
cert:
|
||||||
|
|
||||||
|
# MongoDBの設定
|
||||||
|
mongodb:
|
||||||
|
host: localhost
|
||||||
|
port: 27017
|
||||||
|
db: misskey
|
||||||
|
user:
|
||||||
|
pass:
|
||||||
|
|
||||||
|
# Redisの設定
|
||||||
|
redis:
|
||||||
|
host: localhost
|
||||||
|
port: 6379
|
||||||
|
pass:
|
||||||
|
|
||||||
|
# reCAPTCHAの設定
|
||||||
|
recaptcha:
|
||||||
|
site_key:
|
||||||
|
secret_key:
|
||||||
|
|
||||||
|
# ServiceWrokerの設定
|
||||||
|
sw:
|
||||||
|
# VAPIDの公開鍵
|
||||||
|
public_key:
|
||||||
|
|
||||||
|
# VAPIDの秘密鍵
|
||||||
|
private_key:
|
||||||
|
|
||||||
|
# Google Maps API
|
||||||
|
google_maps_api_key:
|
||||||
|
|
||||||
|
# Twitterインテグレーションの設定(利用しない場合は省略可能)
|
||||||
|
twitter:
|
||||||
|
# インテグレーション用アプリのコンシューマーキー
|
||||||
|
consumer_key:
|
||||||
|
|
||||||
|
# インテグレーション用アプリのコンシューマーシークレット
|
||||||
|
consumer_secret:
|
26
.eslintrc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "typescript-eslint-parser"
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:vue/recommended"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"vue/require-v-for-key": false,
|
||||||
|
"vue/max-attributes-per-line": false,
|
||||||
|
"vue/html-indent": false,
|
||||||
|
"vue/html-self-closing": false,
|
||||||
|
"vue/no-unused-vars": false,
|
||||||
|
"vue/attributes-order": false,
|
||||||
|
"vue/require-prop-types": false,
|
||||||
|
"no-console": 0,
|
||||||
|
"no-unused-vars": 0,
|
||||||
|
"no-empty": 0
|
||||||
|
},
|
||||||
|
"globals": {
|
||||||
|
"ENV": true,
|
||||||
|
"VERSION": true,
|
||||||
|
"API": true
|
||||||
|
}
|
||||||
|
}
|
2
.gitattributes
vendored
@ -1,5 +1,3 @@
|
|||||||
*.svg -diff -text
|
*.svg -diff -text
|
||||||
*.psd -diff -text
|
*.psd -diff -text
|
||||||
*.ai -diff -text
|
*.ai -diff -text
|
||||||
|
|
||||||
*.tag linguist-language=HTML
|
|
||||||
|
5
.gitignore
vendored
@ -1,6 +1,8 @@
|
|||||||
/.config
|
/.config/*
|
||||||
|
!/.config/example.yml
|
||||||
/.vscode
|
/.vscode
|
||||||
/node_modules
|
/node_modules
|
||||||
|
/build
|
||||||
/built
|
/built
|
||||||
/data
|
/data
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
@ -8,3 +10,4 @@ npm-debug.log
|
|||||||
run.bat
|
run.bat
|
||||||
api-docs.json
|
api-docs.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
version.json
|
||||||
|
17
.travis.yml
@ -1,14 +1,13 @@
|
|||||||
# travis file
|
# travis file
|
||||||
# https://docs.travis-ci.com/user/customizing-the-build
|
# https://docs.travis-ci.com/user/customizing-the-build
|
||||||
|
|
||||||
branches:
|
notifications:
|
||||||
except:
|
email: false
|
||||||
- release
|
|
||||||
|
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
- 8.4.0
|
- 9.8.0
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- CXX=g++-4.8 NODE_ENV=production
|
- CXX=g++-4.8 NODE_ENV=production
|
||||||
@ -37,14 +36,8 @@ before_script:
|
|||||||
# --only=dev オプションを付けてそれらもインストールされるようにする:
|
# --only=dev オプションを付けてそれらもインストールされるようにする:
|
||||||
- npm install --only=dev
|
- npm install --only=dev
|
||||||
|
|
||||||
# 設定ファイルを設定
|
# 設定ファイルを配置
|
||||||
- mkdir ./.config
|
|
||||||
- cp ./.travis/default.yml ./.config
|
- cp ./.travis/default.yml ./.config
|
||||||
- cp ./.travis/test.yml ./.config
|
- cp ./.travis/test.yml ./.config
|
||||||
|
|
||||||
- npm run build
|
- travis_wait npm run build
|
||||||
|
|
||||||
after_success:
|
|
||||||
# リリース
|
|
||||||
- chmod u+x ./.travis/release.sh
|
|
||||||
- if [ $TRAVIS_BRANCH = "master" ] && [ $TRAVIS_PULL_REQUEST = "false" ]; then ./.travis/release.sh; else echo "Skipping releasing task"; fi
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
# Realizing whitelist by excluding everything and specifying exceptions.
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
!/built
|
|
||||||
!/tools
|
|
||||||
!/elasticsearch
|
|
||||||
!/package.json
|
|
||||||
!/.travis.yml
|
|
||||||
!/appveyor.yml
|
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "Starting releasing task"
|
|
||||||
openssl aes-256-cbc -K $encrypted_ceda82069128_key -iv $encrypted_ceda82069128_iv -in ./.travis/travis_rsa.enc -out travis_rsa -d
|
|
||||||
cp travis_rsa ~/.ssh/id_rsa
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
|
||||||
git checkout -b release
|
|
||||||
cp -f ./.travis/.gitignore-release .gitignore
|
|
||||||
node ./.travis/shapeup.js
|
|
||||||
git add --all
|
|
||||||
git rm --cached `git ls-files --full-name -i --exclude-standard`
|
|
||||||
git config --global user.email "AyaMorisawa4869@gmail.com"
|
|
||||||
git config --global user.name "Aya Morisawa"
|
|
||||||
git commit -m "Release build for $TRAVIS_COMMIT"
|
|
||||||
git push -f git@github.com:syuilo/misskey release
|
|
||||||
echo "Finished releasing task"
|
|
@ -1,13 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
const fs = require('fs')
|
|
||||||
const filename = process.argv[2] || 'package.json'
|
|
||||||
|
|
||||||
fs.readFile(filename, (err, data) => {
|
|
||||||
if (err) process.exit(2)
|
|
||||||
const object = JSON.parse(data)
|
|
||||||
delete object.devDependencies
|
|
||||||
fs.writeFile(filename, JSON.stringify(object, null, '\t') + '\n', err => {
|
|
||||||
if (err) process.exit(3)
|
|
||||||
})
|
|
||||||
})
|
|
457
CHANGELOG.md
@ -1,457 +0,0 @@
|
|||||||
ChangeLog (Release Notes)
|
|
||||||
=========================
|
|
||||||
主に notable な changes を書いていきます
|
|
||||||
|
|
||||||
3322 (2017/12/10)
|
|
||||||
-----------------
|
|
||||||
* :art:
|
|
||||||
|
|
||||||
3320 (2017/12/10)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
3310 (2017/12/09)
|
|
||||||
-----------------
|
|
||||||
* i18nなど
|
|
||||||
|
|
||||||
3308 (2017/12/09)
|
|
||||||
-----------------
|
|
||||||
* :art:
|
|
||||||
|
|
||||||
3294 (2017/12/09)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3292 (2017/12/09)
|
|
||||||
-----------------
|
|
||||||
* ユーザビリティの向上
|
|
||||||
|
|
||||||
3281 (2017/12/08)
|
|
||||||
-----------------
|
|
||||||
* 二段階認証の実装 (#967)
|
|
||||||
|
|
||||||
3278 (2017/12/08)
|
|
||||||
-----------------
|
|
||||||
* :v:
|
|
||||||
|
|
||||||
3272 (2017/12/08)
|
|
||||||
-----------------
|
|
||||||
* Fix bug
|
|
||||||
|
|
||||||
3268 (2017/12/08)
|
|
||||||
-----------------
|
|
||||||
* :v:
|
|
||||||
|
|
||||||
3263 (2017/12/08)
|
|
||||||
-----------------
|
|
||||||
* FontAwesome5に移行
|
|
||||||
|
|
||||||
3230 (2017/11/28)
|
|
||||||
-----------------
|
|
||||||
* :v:
|
|
||||||
|
|
||||||
3219 (2017/11/28)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
3212 (2017/11/27)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
3201 (2017/11/23)
|
|
||||||
-----------------
|
|
||||||
* Twitterログインを実装 (#939)
|
|
||||||
|
|
||||||
3196 (2017/11/23)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3194 (2017/11/23)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3191 (2017/11/23)
|
|
||||||
-----------------
|
|
||||||
* :v:
|
|
||||||
|
|
||||||
3188 (2017/11/22)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3180 (2017/11/21)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3177 (2017/11/21)
|
|
||||||
-----------------
|
|
||||||
* ServiceWorker support
|
|
||||||
* Misskeyを開いていないときでも通知を受け取れるように(Chromeのみ)
|
|
||||||
|
|
||||||
3165 (2017/11/20)
|
|
||||||
-----------------
|
|
||||||
* デスクトップ版でも通知バッジを表示 (#918)
|
|
||||||
* デザインの調整
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3155 (2017/11/20)
|
|
||||||
-----------------
|
|
||||||
* デスクトップ版でユーザーの投稿グラフを見れるように
|
|
||||||
|
|
||||||
3142 (2017/11/18)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3140 (2017/11/18)
|
|
||||||
-----------------
|
|
||||||
* ウィジェットをスクロールに追従させるように
|
|
||||||
|
|
||||||
3136 (2017/11/17)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
* 通信の最適化
|
|
||||||
|
|
||||||
3131 (2017/11/17)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
* 通信の最適化
|
|
||||||
|
|
||||||
3124 (2017/11/16)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3121 (2017/11/16)
|
|
||||||
-----------------
|
|
||||||
* ブロードキャストウィジェットの強化
|
|
||||||
* デザインのグリッチの修正
|
|
||||||
* 通信の最適化
|
|
||||||
|
|
||||||
3113 (2017/11/15)
|
|
||||||
-----------------
|
|
||||||
* アクティビティのレンダリングの問題の修正など
|
|
||||||
|
|
||||||
3110 (2017/11/15)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整など
|
|
||||||
|
|
||||||
3107 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
3104 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* デスクトップ版ユーザーページのデザインの改良
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3099 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* デスクトップ版ユーザーページの強化
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3093 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* やった
|
|
||||||
|
|
||||||
3089 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
3069 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* ドライブウィンドウもポップアウトできるように
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
3066 (2017/11/14)
|
|
||||||
-----------------
|
|
||||||
* メッセージウィジェット追加
|
|
||||||
* アクセスログウィジェット追加
|
|
||||||
|
|
||||||
3057 (2017/11/13)
|
|
||||||
-----------------
|
|
||||||
* グリッチ修正
|
|
||||||
|
|
||||||
3055 (2017/11/13)
|
|
||||||
-----------------
|
|
||||||
* メッセージのウィンドウのポップアウト (#911)
|
|
||||||
|
|
||||||
3050 (2017/11/13)
|
|
||||||
-----------------
|
|
||||||
* 通信の最適化
|
|
||||||
* これで例えばサーバー情報ウィジェットを5000兆個設置しても利用するコネクションは一つだけになりウィジェットを1つ設置したときと(ネットワーク的な)負荷は変わらなくなる
|
|
||||||
* デザインの調整
|
|
||||||
* ユーザビリティの向上
|
|
||||||
|
|
||||||
3040 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3038 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* 投稿フォームウィジェットの追加
|
|
||||||
* タイムライン上部にもウィジェットを配置できるように
|
|
||||||
|
|
||||||
3035 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* ウィジェットの強化
|
|
||||||
|
|
||||||
3033 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
3031 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* ウィジェットの強化
|
|
||||||
|
|
||||||
3028 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* ウィジェットの表示をコンパクトにできるように
|
|
||||||
|
|
||||||
3026 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
|
|
||||||
3024 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* いい感じにするなど
|
|
||||||
|
|
||||||
3020 (2017/11/12)
|
|
||||||
-----------------
|
|
||||||
* 通信の最適化
|
|
||||||
|
|
||||||
3017 (2017/11/11)
|
|
||||||
-----------------
|
|
||||||
* 誤字修正など
|
|
||||||
|
|
||||||
3012 (2017/11/11)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
3010 (2017/11/11)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
3008 (2017/11/11)
|
|
||||||
-----------------
|
|
||||||
* カレンダー(タイムマシン)ウィジェットの追加
|
|
||||||
|
|
||||||
3006 (2017/11/11)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
* など
|
|
||||||
|
|
||||||
2996 (2017/11/10)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
* など
|
|
||||||
|
|
||||||
2991 (2017/11/09)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2988 (2017/11/09)
|
|
||||||
-----------------
|
|
||||||
* チャンネルウィジェットを追加
|
|
||||||
|
|
||||||
2984 (2017/11/09)
|
|
||||||
-----------------
|
|
||||||
* スライドショーウィジェットを追加
|
|
||||||
|
|
||||||
2974 (2017/11/08)
|
|
||||||
-----------------
|
|
||||||
* ホームのカスタマイズを実装するなど
|
|
||||||
|
|
||||||
2971 (2017/11/08)
|
|
||||||
-----------------
|
|
||||||
* バグ修正
|
|
||||||
* デザインの調整
|
|
||||||
* i18n
|
|
||||||
|
|
||||||
2944 (2017/11/07)
|
|
||||||
-----------------
|
|
||||||
* パフォーマンスの向上
|
|
||||||
* GirdFSになるなどした
|
|
||||||
* 依存関係の更新
|
|
||||||
|
|
||||||
2807 (2017/11/02)
|
|
||||||
-----------------
|
|
||||||
* いい感じに
|
|
||||||
|
|
||||||
2805 (2017/11/02)
|
|
||||||
-----------------
|
|
||||||
* いい感じに
|
|
||||||
|
|
||||||
2801 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* チャンネルのWatch実装
|
|
||||||
|
|
||||||
2799 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* いい感じに
|
|
||||||
|
|
||||||
2795 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* いい感じに
|
|
||||||
|
|
||||||
2793 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
2783 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* なんか
|
|
||||||
|
|
||||||
2777 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* 細かいブラッシュアップ
|
|
||||||
|
|
||||||
2775 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* Fix: バグ修正
|
|
||||||
|
|
||||||
2769 (2017/11/01)
|
|
||||||
-----------------
|
|
||||||
* New: チャンネルシステム
|
|
||||||
|
|
||||||
2752 (2017/10/30)
|
|
||||||
-----------------
|
|
||||||
* New: 未読の通知がある場合アイコンを表示するように
|
|
||||||
|
|
||||||
2747 (2017/10/25)
|
|
||||||
-----------------
|
|
||||||
* Fix: 非ログイン状態ですべてのページが致命的な問題を発生させる (#89)
|
|
||||||
|
|
||||||
2742 (2017/10/25)
|
|
||||||
-----------------
|
|
||||||
* New: トラブルシューティングを実装するなど
|
|
||||||
|
|
||||||
2735 (2017/10/22)
|
|
||||||
-----------------
|
|
||||||
* New: モバイル版からでもクライアントバージョンを確認できるように
|
|
||||||
|
|
||||||
2732 (2017/10/22)
|
|
||||||
-----------------
|
|
||||||
* 依存関係の更新など
|
|
||||||
|
|
||||||
2584 (2017/09/08)
|
|
||||||
-----------------
|
|
||||||
* New: ユーザーページによく使うドメインを表示 (#771)
|
|
||||||
* New: よくリプライするユーザーをユーザーページに表示 (#770)
|
|
||||||
|
|
||||||
2566 (2017/09/07)
|
|
||||||
-----------------
|
|
||||||
* New: 投稿することの多いキーワードをユーザーページに表示する (#768)
|
|
||||||
* l10n
|
|
||||||
* デザインの修正
|
|
||||||
|
|
||||||
2544 (2017/09/06)
|
|
||||||
-----------------
|
|
||||||
* 投稿のカテゴリに関する実験的な実装
|
|
||||||
* l10n
|
|
||||||
* ユーザビリティの向上
|
|
||||||
|
|
||||||
2520 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2518 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* Fix: モバイル版のタイムラインからリアクションやメニューを開けない
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2515 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* New: 投稿のピン留め (#746)
|
|
||||||
* New: モバイル版のユーザーページに知り合いのフォロワーを表示するように
|
|
||||||
* New: ホームストリームにメッセージを流すことでlast_used_atを更新できるようにする (#745)
|
|
||||||
* その他細かな修正
|
|
||||||
|
|
||||||
2508 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* New: モバイル版のユーザーページのアクティビティチャートを変更
|
|
||||||
* New: モバイル版のユーザーページに最終ログイン日時を表示するように
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2503 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2502 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* デザインの修正・調整
|
|
||||||
|
|
||||||
2501 (2017/08/30)
|
|
||||||
-----------------
|
|
||||||
* New: モバイルのユーザーページを刷新
|
|
||||||
|
|
||||||
2498 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* Fix: repostのborder-radiusが効いていない (#743)
|
|
||||||
* テーマカラーを赤に戻してみた
|
|
||||||
* ユーザビリティの向上
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2493-2 (2017/08/29)
|
|
||||||
-------------------
|
|
||||||
* デザインの修正
|
|
||||||
|
|
||||||
2493 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* デザインの変更など
|
|
||||||
|
|
||||||
2491 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* デザインの修正と調整
|
|
||||||
|
|
||||||
2489 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* ユーザビリティの向上
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2487 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* New: パスワードを変更する際に新しいパスワードを二度入力させる (#739)
|
|
||||||
* New: ドナーを表示する (#738)
|
|
||||||
* Fix: 投稿のリンクが機能していない問題を修正
|
|
||||||
* Fix: アカウント作成フォームのユーザーページURLプレビューが正しく機能していなかった問題を修正
|
|
||||||
* l10n
|
|
||||||
* デザインの調整
|
|
||||||
|
|
||||||
2470 (2017/08/29)
|
|
||||||
-----------------
|
|
||||||
* New: トークンを再生成できるように (#497)
|
|
||||||
* New: パスワードを変更する機能 (#364)
|
|
||||||
|
|
||||||
2461 (2017/08/28)
|
|
||||||
-----------------
|
|
||||||
* Fix: モバイル版からアバターとバナーの設定を行えなかった問題を修正
|
|
||||||
* デザインの修正
|
|
||||||
|
|
||||||
2458 (2017/08/28)
|
|
||||||
-----------------
|
|
||||||
* New: モバイル版からプロフィールを設定できるように
|
|
||||||
* New: モバイル版からサインアウトを行えるように
|
|
||||||
* New: 投稿ページに次の投稿/前の投稿リンクを作成 (#734)
|
|
||||||
* New: タイムラインの投稿をダブルクリックすることで詳細な情報が見れるように
|
|
||||||
* Fix: モバイル版でおすすめユーザーをフォローしてもタイムラインが更新されない (#736)
|
|
||||||
* Fix: モバイル版で設定にアクセスできない
|
|
||||||
* デザインの調整
|
|
||||||
* 依存関係の更新
|
|
||||||
|
|
||||||
2380
|
|
||||||
----
|
|
||||||
アプリケーションが作れない問題を修正
|
|
||||||
|
|
||||||
2367
|
|
||||||
----
|
|
||||||
Statsのユーザー数グラフに「アカウントが作成された**回数**」(その日時点での「アカウント数」**ではなく**)グラフも併記するようにした
|
|
||||||
|
|
||||||
2364
|
|
||||||
----
|
|
||||||
デザインの微調整
|
|
||||||
|
|
||||||
2361
|
|
||||||
----
|
|
||||||
Statsを実装するなど
|
|
||||||
|
|
||||||
2357
|
|
||||||
----
|
|
||||||
Statusを実装するなど
|
|
@ -10,6 +10,8 @@ The list of people who have sent donation for Misskey.
|
|||||||
* スルメ https://surume.tk/
|
* スルメ https://surume.tk/
|
||||||
* 藍
|
* 藍
|
||||||
* 音船 https://otofune.me/
|
* 音船 https://otofune.me/
|
||||||
|
* aqz https://misskey.xyz/aqz
|
||||||
|
* kotodu "虚無創作中"
|
||||||
|
|
||||||
:heart: Thanks for donating, guys!
|
:heart: Thanks for donating, guys!
|
||||||
|
|
||||||
|
674
LICENSE
@ -1,21 +1,661 @@
|
|||||||
The MIT License (MIT)
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (c) 2014-2017 syuilo
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Preamble
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
copies or substantial portions of the Software.
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
The licenses for most software and other practical works are designed
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
to take away your freedom to share and change the works. By contrast,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
share and change all versions of a program--to make sure it remains free
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
software for all its users.
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
61
README.md
@ -1,62 +1,59 @@
|
|||||||
![Misskey](./assets/title.png)
|
<img src="https://github.com/syuilo/misskey/blob/b3f42e62af698a67c2250533c437569559f1fdf9/src/himasaku/resources/himasaku.png?raw=true" align="right" width="320px"/>
|
||||||
|
|
||||||
|
[![Misskey](/assets/title.png)](https://misskey.xyz/)
|
||||||
================================================================
|
================================================================
|
||||||
|
|
||||||
[![][travis-badge]][travis-link]
|
[![][travis-badge]][travis-link]
|
||||||
[![][dependencies-badge]][dependencies-link]
|
[![][dependencies-badge]][dependencies-link]
|
||||||
[![][himawari-badge]][himasaku]
|
[![][himawari-badge]][himasaku]
|
||||||
[![][sakurako-badge]][himasaku]
|
[![][sakurako-badge]][himasaku]
|
||||||
[![][mit-badge]][mit]
|
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
|
||||||
|
|
||||||
[Misskey](https://misskey.xyz) is a completely open source,
|
> Lead Maintainer: [syuilo][syuilo-link]
|
||||||
|
|
||||||
|
**[Misskey](https://misskey.xyz)** is a completely open source,
|
||||||
ultimately sophisticated new type of mini-blog based SNS.
|
ultimately sophisticated new type of mini-blog based SNS.
|
||||||
|
|
||||||
![ss](./assets/ss.jpg)
|
:sparkles: Features
|
||||||
|
|
||||||
Key features
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
* Automatically updated timeline
|
* Automatically updated timeline
|
||||||
* Private messages
|
* Private messages
|
||||||
* Two-Factor Authentication support
|
* Two-Factor Authentication support
|
||||||
* ServiceWorker support
|
* ServiceWorker support
|
||||||
* Web API for third-party applications
|
* Web API for third-party applications
|
||||||
* No ads
|
* ActivityPub compatible
|
||||||
|
|
||||||
and more! You can touch with your own eyes at https://misskey.xyz/.
|
and more! You can touch with your own eyes at https://misskey.xyz/.
|
||||||
|
|
||||||
Setup and Installation
|
:package: Setup
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
If you want to run your own instance of Misskey,
|
If you want to run your own instance of Misskey,
|
||||||
please see [Setup and installation guide](./docs/setup.en.md).
|
please see [Setup and installation guide](./docs/setup.en.md).
|
||||||
|
|
||||||
Contribution
|
:yen: Donation
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Please see [Contribution guide](./CONTRIBUTING.md).
|
If you want to donate to Misskey, please see [this](./docs/donate.ja.md).
|
||||||
|
|
||||||
Release Notes
|
[List of all donors](./DONORS.md)
|
||||||
|
|
||||||
|
:mortar_board: Notable contributors
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Please see [ChangeLog](./CHANGELOG.md).
|
| ![syuilo][syuilo-icon] | ![Morisawa Aya][ayamorisawa-icon] | ![otofune][otofune-icon] | ![akihikodaki][akihikodaki-icon] | ![rinsuki][rinsuki-icon] |
|
||||||
|
|:-:|:-:|:-:|:-:|:-:|
|
||||||
Sponsors & Backers
|
| [syuilo][syuilo-link]<br>Owner | [Aya Morisawa][ayamorisawa-link]<br>Collaborator | [otofune][otofune-link]<br>Collaborator | [akihikodaki][akihikodaki-link] | [rinsuki][rinsuki-link] |
|
||||||
----------------------------------------------------------------
|
|
||||||
Misskey has no 100+ GitHub stars currently. However, a donation is always welcome!
|
|
||||||
If you want to donate to Misskey, please get in touch with [@syuilo][syuilo-link].
|
|
||||||
|
|
||||||
**Note:** When you donate to Misskey, your name will be listed in [donors](./DONORS.md).
|
|
||||||
|
|
||||||
Collaborators
|
|
||||||
----------------------------------------------------------------
|
|
||||||
| ![syuilo][syuilo-icon] | ![Morisawa Aya][ayamorisawa-icon] | ![otofune][otofune-icon] |
|
|
||||||
|------------------------|-----------------------------------|---------------------------------|
|
|
||||||
| [syuilo][syuilo-link] | [Aya Morisawa][ayamorisawa-link] | [otofune][otofune-link] |
|
|
||||||
|
|
||||||
[List of all contributors](https://github.com/syuilo/misskey/graphs/contributors)
|
[List of all contributors](https://github.com/syuilo/misskey/graphs/contributors)
|
||||||
|
|
||||||
Copyright
|
:four_leaf_clover: Copyright
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Misskey is an open-source software licensed under [The MIT License](LICENSE).
|
> Copyright (c) 2014-2018 syuilo
|
||||||
|
|
||||||
[mit]: http://opensource.org/licenses/MIT
|
Misskey is an open-source software licensed under [GNU AGPLv3](LICENSE).
|
||||||
[mit-badge]: https://img.shields.io/badge/license-MIT-444444.svg?style=flat-square
|
|
||||||
|
[![][agpl-3.0-badge]][AGPL-3.0]
|
||||||
|
|
||||||
|
[agpl-3.0]: https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
[agpl-3.0-badge]: https://img.shields.io/badge/license-AGPL--3.0-444444.svg?style=flat-square
|
||||||
[travis-link]: https://travis-ci.org/syuilo/misskey
|
[travis-link]: https://travis-ci.org/syuilo/misskey
|
||||||
[travis-badge]: http://img.shields.io/travis/syuilo/misskey/master.svg?style=flat-square
|
[travis-badge]: http://img.shields.io/travis/syuilo/misskey/master.svg?style=flat-square
|
||||||
[dependencies-link]: https://david-dm.org/syuilo/misskey
|
[dependencies-link]: https://david-dm.org/syuilo/misskey
|
||||||
@ -65,10 +62,14 @@ Misskey is an open-source software licensed under [The MIT License](LICENSE).
|
|||||||
[himawari-badge]: https://img.shields.io/badge/%E5%8F%A4%E8%B0%B7-%E5%90%91%E6%97%A5%E8%91%B5-1684c5.svg?style=flat-square
|
[himawari-badge]: https://img.shields.io/badge/%E5%8F%A4%E8%B0%B7-%E5%90%91%E6%97%A5%E8%91%B5-1684c5.svg?style=flat-square
|
||||||
[sakurako-badge]: https://img.shields.io/badge/%E5%A4%A7%E5%AE%A4-%E6%AB%BB%E5%AD%90-efb02a.svg?style=flat-square
|
[sakurako-badge]: https://img.shields.io/badge/%E5%A4%A7%E5%AE%A4-%E6%AB%BB%E5%AD%90-efb02a.svg?style=flat-square
|
||||||
|
|
||||||
<!-- Collaborators Info -->
|
<!-- Contributors Info -->
|
||||||
[syuilo-link]: https://syuilo.com
|
[syuilo-link]: https://syuilo.com
|
||||||
[syuilo-icon]: https://avatars2.githubusercontent.com/u/4439005?v=3&s=70
|
[syuilo-icon]: https://avatars2.githubusercontent.com/u/4439005?v=3&s=70
|
||||||
[ayamorisawa-link]: https://github.com/ayamorisawa
|
[ayamorisawa-link]: https://github.com/ayamorisawa
|
||||||
[ayamorisawa-icon]: https://avatars0.githubusercontent.com/u/10798641?v=3&s=70
|
[ayamorisawa-icon]: https://avatars0.githubusercontent.com/u/10798641?v=3&s=70
|
||||||
[otofune-link]: https://github.com/otofune
|
[otofune-link]: https://github.com/otofune
|
||||||
[otofune-icon]: https://avatars0.githubusercontent.com/u/15062473?v=3&s=70
|
[otofune-icon]: https://avatars0.githubusercontent.com/u/15062473?v=3&s=70
|
||||||
|
[akihikodaki-link]: https://github.com/akihikodaki
|
||||||
|
[akihikodaki-icon]: https://avatars2.githubusercontent.com/u/17036990?s=70&v=4
|
||||||
|
[rinsuki-link]: https://github.com/rinsuki
|
||||||
|
[rinsuki-icon]: https://avatars0.githubusercontent.com/u/6533808?s=70&v=4
|
||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.7 KiB |
BIN
assets/favicon.ico
Normal file
After Width: | Height: | Size: 352 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.3 KiB |
161
assets/favicon/128.svg
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="896"
|
||||||
|
height="896"
|
||||||
|
viewBox="0 0 237.06667 237.06667"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="128.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\128.png"
|
||||||
|
inkscape:export-xdpi="13.714286"
|
||||||
|
inkscape:export-ydpi="13.714286">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="0.7071068"
|
||||||
|
inkscape:cx="908.16505"
|
||||||
|
inkscape:cy="468.2779"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="g4502"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="true"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="true"
|
||||||
|
inkscape:snap-others="false"
|
||||||
|
inkscape:bbox-paths="true"
|
||||||
|
inkscape:snap-bbox-midpoints="true">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-10.18601)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,47.839369,-94.823577)"
|
||||||
|
inkscape:export-xdpi="6"
|
||||||
|
inkscape:export-ydpi="6">
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#2fa1bb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.96554804;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.97647059"
|
||||||
|
id="rect4506"
|
||||||
|
width="216.28276"
|
||||||
|
height="216.28278"
|
||||||
|
x="-15.537212"
|
||||||
|
y="95.803268" />
|
||||||
|
<g
|
||||||
|
style="fill:#ffffff;fill-opacity:1"
|
||||||
|
transform="translate(-1.3333333e-6,-1.3439941e-6)"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#ffffff;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#ffffff;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 518 B |
149
assets/favicon/16.svg
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="512"
|
||||||
|
height="512"
|
||||||
|
viewBox="0 0 135.46667 135.46667"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="16.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\16.png"
|
||||||
|
inkscape:export-xdpi="3"
|
||||||
|
inkscape:export-ydpi="3">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1.4142136"
|
||||||
|
inkscape:cx="110.21885"
|
||||||
|
inkscape:cy="235.92965"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="g4502"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="false"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-others="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-111.78601)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,-2.960633,-44.023579)">
|
||||||
|
<g
|
||||||
|
style="fill:#2fa1bb;fill-opacity:1"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#2fa1bb;fill-opacity:1;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.7 KiB |
161
assets/favicon/256.svg
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="896"
|
||||||
|
height="896"
|
||||||
|
viewBox="0 0 237.06667 237.06667"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="256.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\256.png"
|
||||||
|
inkscape:export-xdpi="27.428572"
|
||||||
|
inkscape:export-ydpi="27.428572">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="0.7071068"
|
||||||
|
inkscape:cx="908.16505"
|
||||||
|
inkscape:cy="468.2779"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="g4502"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="true"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="true"
|
||||||
|
inkscape:snap-others="false"
|
||||||
|
inkscape:bbox-paths="true"
|
||||||
|
inkscape:snap-bbox-midpoints="true">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-10.18601)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,47.839369,-94.823577)"
|
||||||
|
inkscape:export-xdpi="6"
|
||||||
|
inkscape:export-ydpi="6">
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#2fa1bb;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.96554804;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.97647059"
|
||||||
|
id="rect4506"
|
||||||
|
width="216.28276"
|
||||||
|
height="216.28278"
|
||||||
|
x="-15.537212"
|
||||||
|
y="95.803268" />
|
||||||
|
<g
|
||||||
|
style="fill:#ffffff;fill-opacity:1"
|
||||||
|
transform="translate(-1.3333333e-6,-1.3439941e-6)"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#ffffff;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#ffffff;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 761 B |
152
assets/favicon/32.svg
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="640"
|
||||||
|
height="640"
|
||||||
|
viewBox="0 0 169.33333 169.33333"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="32.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\32.png"
|
||||||
|
inkscape:export-xdpi="4.8000002"
|
||||||
|
inkscape:export-ydpi="4.8000002">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="0.7071068"
|
||||||
|
inkscape:cx="16.781901"
|
||||||
|
inkscape:cy="343.6089"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="g4502"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="false"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-others="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-77.919343)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,13.972699,-60.956914)"
|
||||||
|
inkscape:export-xdpi="6"
|
||||||
|
inkscape:export-ydpi="6">
|
||||||
|
<g
|
||||||
|
style="fill:#2fa1bb;fill-opacity:1"
|
||||||
|
transform="translate(-1.7127735e-6,-1.5982974e-6)"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#2fa1bb;fill-opacity:1;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 1.2 KiB |
152
assets/favicon/64.svg
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="768"
|
||||||
|
height="768"
|
||||||
|
viewBox="0 0 203.2 203.2"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="64.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\64.png"
|
||||||
|
inkscape:export-xdpi="8"
|
||||||
|
inkscape:export-ydpi="8">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="0.7071068"
|
||||||
|
inkscape:cx="16.781901"
|
||||||
|
inkscape:cy="343.6089"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="g5125"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="false"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-others="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-44.052677)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,30.906034,-77.890245)"
|
||||||
|
inkscape:export-xdpi="6"
|
||||||
|
inkscape:export-ydpi="6">
|
||||||
|
<g
|
||||||
|
style="fill:#2fa1bb;fill-opacity:0.94117647"
|
||||||
|
transform="translate(-1.3333333e-6,-1.3439941e-6)"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719903,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#2fa1bb;fill-opacity:1;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:1;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.0 KiB |
4612
assets/icon.ai
150
assets/mi.svg
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="512"
|
||||||
|
height="512"
|
||||||
|
viewBox="0 0 135.46667 135.46667"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="0.92.1 r15371"
|
||||||
|
sodipodi:docname="mi.svg"
|
||||||
|
inkscape:export-filename="C:\Users\syuilo\projects\misskey\assets\favicon\32.png"
|
||||||
|
inkscape:export-xdpi="6"
|
||||||
|
inkscape:export-ydpi="6">
|
||||||
|
<defs
|
||||||
|
id="defs2">
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5115"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5111"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="1.4142136"
|
||||||
|
inkscape:cx="232.39583"
|
||||||
|
inkscape:cy="251.50613"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="false"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:snap-object-midpoints="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
objecttolerance="1"
|
||||||
|
guidetolerance="1"
|
||||||
|
inkscape:snap-nodes="false"
|
||||||
|
inkscape:snap-others="false">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4504"
|
||||||
|
spacingx="4.2333334"
|
||||||
|
spacingy="4.2333334"
|
||||||
|
empcolor="#ff3fff"
|
||||||
|
empopacity="0.25098039"
|
||||||
|
empspacing="4" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-30.809093,-111.78601)">
|
||||||
|
<g
|
||||||
|
id="g4502"
|
||||||
|
transform="matrix(1.096096,0,0,1.096096,-2.960633,-44.023579)">
|
||||||
|
<g
|
||||||
|
style="fill:#2fa1bb;fill-opacity:0.94117647"
|
||||||
|
transform="translate(-1.3333333e-6,-1.3439941e-6)"
|
||||||
|
id="g5125">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.91391326,0,0,0.91391326,7.9719907,17.595761)"
|
||||||
|
id="text4489"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#2fa1bb;fill-opacity:0.94117647;stroke:none;stroke-width:0.28950602px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:0.94117647;stroke-width:0.28950602px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#2fa1bb;fill-opacity:0.94117647;stroke-width:0.28950602px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.0 KiB |
BIN
assets/ss.jpg
Before Width: | Height: | Size: 300 KiB |
BIN
assets/title.png
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 6.6 KiB |
189
assets/title.svg
@ -1,55 +1,140 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="248px"
|
<svg
|
||||||
height="80px" viewBox="0 0 248 80" enable-background="new 0 0 248 80" xml:space="preserve">
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
<g id="レイヤー_1">
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
<g>
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
<path fill="#1D2022" d="M126.516,17.676v44.355h-1.152V19.26l-19.297,27.363h-0.936L85.833,19.26v42.771H84.68V17.676h1.44
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
l19.514,27.723l19.441-27.723H126.516z"/>
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
<path fill="#1D2022" d="M136.448,40.142c-0.576,0-1.008-0.432-1.008-1.008s0.432-1.008,1.008-1.008s1.008,0.432,1.008,1.008
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
S137.024,40.142,136.448,40.142z M135.872,62.031V44.895h1.152v17.137H135.872z"/>
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
<path fill="#1D2022" d="M149.769,54.471c-2.88-0.791-4.752-2.447-4.752-5.04c0-3.097,2.52-4.968,5.472-4.968
|
width="614.71039"
|
||||||
c1.872,0,3.384,0.791,4.393,1.943l-0.792,0.721c-0.936-1.152-2.088-1.729-3.672-1.729c-2.521,0-4.249,1.584-4.249,3.816
|
height="205.08009"
|
||||||
c0,2.376,1.44,3.6,4.249,4.32c3.096,0.791,4.608,2.305,4.608,4.752c0,2.664-2.592,4.32-5.473,4.32
|
viewBox="0 0 162.64213 54.260776"
|
||||||
c-1.872,0-3.384-0.432-5.112-1.729l0.648-0.863c1.8,1.225,2.952,1.656,4.537,1.656c2.448,0,4.248-1.297,4.248-3.313
|
version="1.1"
|
||||||
S152.577,55.264,149.769,54.471z"/>
|
id="svg8"
|
||||||
<path fill="#1D2022" d="M165.896,54.471c-2.88-0.791-4.752-2.447-4.752-5.04c0-3.097,2.52-4.968,5.472-4.968
|
inkscape:version="0.92.1 r15371"
|
||||||
c1.872,0,3.384,0.791,4.393,1.943l-0.792,0.721c-0.936-1.152-2.088-1.729-3.672-1.729c-2.521,0-4.249,1.584-4.249,3.816
|
sodipodi:docname="misskey.svg"
|
||||||
c0,2.376,1.44,3.6,4.249,4.32c3.096,0.791,4.608,2.305,4.608,4.752c0,2.664-2.592,4.32-5.473,4.32
|
inkscape:export-filename="C:\Users\Takumiya_Cho\Desktop\misskey.png"
|
||||||
c-1.872,0-3.384-0.432-5.112-1.729l0.648-0.863c1.8,1.225,2.952,1.656,4.537,1.656c2.448,0,4.248-1.297,4.248-3.313
|
inkscape:export-xdpi="96"
|
||||||
S168.705,55.264,165.896,54.471z"/>
|
inkscape:export-ydpi="96">
|
||||||
<path fill="#1D2022" d="M178.64,62.031V5.291h1.152v49.324l10.513-9.721h1.656l-9.289,8.353l9.577,8.784h-1.728l-8.713-8.064
|
<defs
|
||||||
l-2.016,1.873v6.191H178.64z"/>
|
id="defs2">
|
||||||
<path fill="#1D2022" d="M196.927,53.823c0-6.265,3.889-9.36,8.713-9.36c5.185,0,7.777,4.031,7.777,7.848v1.08h-15.266
|
<inkscape:path-effect
|
||||||
c0,5.256,3.384,8.281,7.777,8.281c2.664,0,4.608-1.152,6.265-3.24l0.648,0.648c-1.656,2.232-3.888,3.527-7.272,3.527
|
effect="simplify"
|
||||||
C200.672,62.607,196.927,59.223,196.927,53.823z M198.224,52.383h13.897c0-4.176-2.52-6.984-6.552-6.984
|
id="path-effect5115"
|
||||||
C201.464,45.398,198.728,47.99,198.224,52.383z"/>
|
is_visible="true"
|
||||||
<path fill="#1D2022" d="M217.807,44.895h1.368l6.625,15.77l6.625-15.77h1.296l-7.489,17.137
|
steps="1"
|
||||||
c-1.656,3.744-4.464,8.641-7.272,12.674l-0.936-0.721c2.736-3.816,5.977-9.145,7.201-12.096L217.807,44.895z"/>
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
<inkscape:path-effect
|
||||||
|
effect="simplify"
|
||||||
|
id="path-effect5104"
|
||||||
|
is_visible="true"
|
||||||
|
steps="1"
|
||||||
|
threshold="0.000408163"
|
||||||
|
smooth_angles="360"
|
||||||
|
helper_size="0"
|
||||||
|
simplify_individual_paths="false"
|
||||||
|
simplify_just_coalesce="false"
|
||||||
|
simplifyindividualpaths="false"
|
||||||
|
simplifyJustCoalesce="false" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="0.9899495"
|
||||||
|
inkscape:cx="370.82839"
|
||||||
|
inkscape:cy="79.043895"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="false"
|
||||||
|
inkscape:snap-smooth-nodes="true"
|
||||||
|
inkscape:snap-center="true"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1017"
|
||||||
|
inkscape:window-x="-8"
|
||||||
|
inkscape:window-y="1072"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
inkscape:bbox-paths="true"
|
||||||
|
fit-margin-top="50"
|
||||||
|
fit-margin-left="50"
|
||||||
|
fit-margin-bottom="20"
|
||||||
|
fit-margin-right="50" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="レイヤー 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-11.097531,-173.29664)">
|
||||||
|
<g
|
||||||
|
transform="matrix(0.28612302,0,0,0.28612302,17.176981,141.74334)"
|
||||||
|
id="text4489-6"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:141.03404236px;line-height:476.69509888px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.92471898px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
aria-label="Mi">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="zccssscssccscczzzccsccsscscsccz"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5210"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#212d3a;fill-opacity:1;stroke-width:0.92471898px"
|
||||||
|
d="m 75.196381,231.17126 c -5.855419,0.0202 -10.885068,-3.50766 -13.2572,-7.61584 -1.266603,-1.79454 -3.772419,-2.43291 -3.807919,0 v 11.2332 c 0,4.51309 -1.645397,8.41504 -4.936191,11.70583 -3.196772,3.19677 -7.098714,4.79516 -11.705826,4.79516 -4.513089,0 -8.415031,-1.59839 -11.705825,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -61.7729 c 0,-3.47884 0.987238,-6.6286 2.961715,-9.44928 2.068499,-2.91471 4.701135,-4.9362 7.897906,-6.06447 1.786431,-0.65816 3.666885,-0.98724 5.641362,-0.98724 5.077225,0 9.308247,1.97448 12.693064,5.92343 1.786431,1.97448 2.820681,3.00873 3.102749,3.10275 0,0 13.408119,16.21319 13.78421,16.49526 0.376091,0.28206 1.480789,2.43848 4.127113,2.43848 2.646324,0 3.89218,-2.15642 4.26827,-2.43848 0.376091,-0.28207 13.784088,-16.49526 13.784088,-16.49526 0.09402,0.094 1.081261,-0.94022 2.961715,-3.10275 3.478837,-3.94895 7.756866,-5.92343 12.834096,-5.92343 1.88045,0 3.76091,0.32908 5.64136,0.98724 3.19677,1.12827 5.7824,3.14976 7.75688,6.06447 2.06849,2.82068 3.10274,5.97044 3.10274,9.44928 v 61.7729 c 0,4.51309 -1.6454,8.41504 -4.93619,11.70583 -3.19677,3.19677 -7.09871,4.79516 -11.70582,4.79516 -4.51309,0 -8.41504,-1.59839 -11.705828,-4.79516 -3.196772,-3.29079 -4.795158,-7.19274 -4.795158,-11.70583 v -11.2332 c -0.277898,-3.06563 -2.987588,-1.13379 -3.948953,0 -2.538613,4.70114 -7.401781,7.59567 -13.2572,7.61584 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5212"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';fill:#212d3a;fill-opacity:1;stroke-width:0.92471898px"
|
||||||
|
d="m 145.83461,185.00361 q -5.92343,0 -10.15445,-4.08999 -4.08999,-4.23102 -4.08999,-10.15445 0,-5.92343 4.08999,-10.01342 4.23102,-4.23102 10.15445,-4.23102 5.92343,0 10.15445,4.23102 4.23102,4.08999 4.23102,10.01342 0,5.92343 -4.23102,10.15445 -4.23102,4.08999 -10.15445,4.08999 z m 0.14103,2.82068 q 5.92343,0 10.01342,4.23102 4.23102,4.23102 4.23102,10.15445 v 34.83541 q 0,5.92343 -4.23102,10.15445 -4.08999,4.08999 -10.01342,4.08999 -5.92343,0 -10.15445,-4.08999 -4.23102,-4.23102 -4.23102,-10.15445 v -34.83541 q 0,-5.92343 4.23102,-10.15445 4.23102,-4.23102 10.15445,-4.23102 z" />
|
||||||
</g>
|
</g>
|
||||||
<path fill="#1D2022" d="M72,20c0-6.627-5.373-12-12-12H20C13.373,8,8,13.373,8,20v40c0,6.627,5.373,12,12,12h40
|
<path
|
||||||
c6.627,0,12-5.373,12-12V20z"/>
|
inkscape:connector-curvature="0"
|
||||||
</g>
|
id="path5199"
|
||||||
<g id="レイヤー_2">
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:136.34428406px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
<polyline fill="none" stroke="#FFFFFF" stroke-width="3" stroke-miterlimit="10" points="20.8,46.133 30.4,33.333 40,46.133
|
d="m 72.022691,200.53715 q 0.968125,0.24203 2.420312,0.5244 2.420313,0.40339 3.791824,1.29083 2.581666,1.69422 2.581666,5.08266 0,2.74302 -1.815234,4.47758 -2.097604,2.01693 -5.849089,2.01693 -2.743021,0 -6.131458,-0.76644 -1.089141,-0.24203 -1.774896,-1.08914 -0.645417,-0.84711 -0.645417,-1.89591 0,-1.29083 0.887448,-2.17828 0.927786,-0.92779 2.178281,-0.92779 0.363047,0 0.685756,0.0807 1.169817,0.24203 4.477578,0.60508 0.443724,0 0.968125,-0.0403 0.201693,0 0.201693,-0.24203 0.04034,-0.20169 -0.242032,-0.28237 -1.37151,-0.24203 -2.541328,-0.5244 -1.331172,-0.28237 -1.895911,-0.48406 -1.12948,-0.32271 -1.895912,-0.84711 -2.581667,-1.69422 -2.622005,-5.08266 0,-2.70268 1.855573,-4.47758 2.258958,-2.17828 6.413828,-1.97659 2.783359,0.12102 5.566719,0.7261 1.048802,0.24203 1.734557,1.08914 0.685756,0.84711 0.685756,1.93625 0,1.25049 -0.927787,2.17828 -0.887448,0.88745 -2.178281,0.88745 -0.322709,0 -0.645417,-0.0807 -1.169818,-0.24203 -4.517917,-0.56474 -0.403385,-0.0403 -0.766432,0 -0.322708,0.0403 -0.322708,0.24203 0.04034,0.24203 0.322708,0.32271 z" />
|
||||||
49.6,33.333 59.2,46.133 "/>
|
<path
|
||||||
<circle fill="#FFFFFF" cx="49.6" cy="33.333" r="4.8"/>
|
inkscape:connector-curvature="0"
|
||||||
<circle fill="#FFFFFF" cx="40" cy="46.133" r="4.8"/>
|
id="path5201"
|
||||||
<circle fill="#FFFFFF" cx="20.8" cy="46.133" r="4.8"/>
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:136.34428406px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
<circle fill="#FFFFFF" cx="59.2" cy="46.133" r="4.8"/>
|
d="m 89.577027,200.53715 q 0.968125,0.24203 2.420312,0.5244 2.420313,0.40339 3.791823,1.29083 2.581667,1.69422 2.581667,5.08266 0,2.74302 -1.815234,4.47758 -2.097604,2.01693 -5.849089,2.01693 -2.743021,0 -6.131458,-0.76644 -1.089141,-0.24203 -1.774896,-1.08914 -0.645417,-0.84711 -0.645417,-1.89591 0,-1.29083 0.887448,-2.17828 0.927786,-0.92779 2.178281,-0.92779 0.363047,0 0.685755,0.0807 1.169818,0.24203 4.477579,0.60508 0.443724,0 0.968125,-0.0403 0.201692,0 0.201692,-0.24203 0.04034,-0.20169 -0.242031,-0.28237 -1.37151,-0.24203 -2.541328,-0.5244 -1.331172,-0.28237 -1.895912,-0.48406 -1.129479,-0.32271 -1.895911,-0.84711 -2.581667,-1.69422 -2.622005,-5.08266 0,-2.70268 1.855573,-4.47758 2.258958,-2.17828 6.413828,-1.97659 2.783359,0.12102 5.566719,0.7261 1.048802,0.24203 1.734557,1.08914 0.685755,0.84711 0.685755,1.93625 0,1.25049 -0.927786,2.17828 -0.887448,0.88745 -2.178281,0.88745 -0.322709,0 -0.645417,-0.0807 -1.169818,-0.24203 -4.517917,-0.56474 -0.403385,-0.0403 -0.766432,0 -0.322708,0.0403 -0.322708,0.24203 0.04034,0.24203 0.322708,0.32271 z" />
|
||||||
<circle fill="#FFFFFF" cx="30.4" cy="33.333" r="4.8"/>
|
<path
|
||||||
<g>
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5203"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:136.34428406px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
d="m 115.65209,203.87137 q 0.12101,0.0807 2.86404,2.78336 1.25049,1.21016 1.25049,2.94471 0,1.61354 -1.16982,2.86404 -1.16982,1.21016 -2.90437,1.21016 -1.65388,0 -2.86404,-1.16982 l -4.03385,-3.91284 q -0.16136,-0.12102 -0.32271,-0.12102 -0.32271,0 -0.32271,1.21016 0,1.69422 -1.21016,2.90438 -1.21015,1.16981 -2.90437,1.16981 -1.69422,0 -2.90438,-1.16981 -1.169807,-1.21016 -1.169807,-2.90438 v -18.79776 q 0,-1.69422 1.169807,-2.86404 1.21016,-1.21015 2.90438,-1.21015 1.69422,0 2.90437,1.21015 1.21016,1.16982 1.21016,2.86404 v 6.29281 q 0,0.40339 0.28237,0.5244 0.24203,0.12102 0.5244,-0.0807 0.16135,-0.0807 4.84063,-3.18675 1.0488,-0.64542 2.25895,-0.64542 2.21862,0 3.42878,1.81524 0.64542,1.0488 0.64542,2.25896 0,2.21862 -1.81524,3.42877 l -2.54133,1.61354 v 0.0403 l -0.0807,0.0403 q -0.56474,0.36305 -0.0403,0.88745 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5205"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:136.34428406px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
d="m 131.25181,213.92955 q -4.19521,0 -7.18026,-2.94472 -2.94472,-2.98505 -2.94472,-7.18026 0,-4.15487 2.94472,-7.09958 2.98505,-2.98505 7.18026,-2.98505 4.15487,0 6.97857,2.78335 0.92778,0.92779 0.92778,2.25896 0,1.33118 -0.92778,2.25896 l -4.67928,4.63893 q -1.00846,1.00847 -2.01692,1.00847 -1.45219,0 -2.25896,-0.80677 -0.80677,-0.80677 -0.80677,-2.13795 0,-1.29083 0.92778,-2.21862 l 0.80678,-0.84711 q 0.16135,-0.12101 0.0807,-0.24203 -0.12101,-0.0807 -0.32271,-0.0403 -0.80677,0.20169 -1.37151,0.80677 -1.12948,1.08914 -1.12948,2.622 0,1.5732 1.08915,2.70268 1.12947,1.08914 2.70268,1.08914 1.53286,0 2.622,-1.12947 0.92779,-0.92779 2.25896,-0.92779 1.33117,0 2.25896,0.92779 0.92779,0.92778 0.92779,2.25895 0,1.33118 -0.92779,2.25896 -2.98505,2.94472 -7.13992,2.94472 z" />
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path5207"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:136.34428406px;font-family:'OTADESIGN Rounded';-inkscape-font-specification:'OTADESIGN Rounded';letter-spacing:0px;word-spacing:0px;fill:#212d3a;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
d="m 160.51049,198.1433 v 5.60705 q 0,0.56474 -0.0807,1.21016 v 7.38195 q 0,4.51792 -2.74302,7.2206 -2.70268,2.70269 -7.30128,2.70269 -2.66234,0 -4.80028,-1.00847 -2.13795,-0.96812 -2.13795,-3.3481 0,-0.80677 0.36305,-1.53286 0.96812,-2.17828 3.3481,-2.17828 0.56474,0 1.5732,0.32271 1.00847,0.3227 1.65388,0.3227 1.69422,0 2.21862,-0.72609 0.20169,-0.28237 0.0807,-0.44372 -0.16136,-0.24204 -0.56474,-0.16136 -0.68576,0.12102 -1.49253,0.12102 -4.07419,0 -6.97856,-2.90438 -2.90438,-2.90437 -2.90438,-6.97857 v -5.60705 q 0,-1.69422 1.16982,-2.86404 1.21015,-1.21016 2.90437,-1.21016 1.69422,0 2.90438,1.21016 1.21015,1.16982 1.21015,2.86404 v 5.60705 q 0,0.68576 0.48407,1.21016 0.5244,0.48406 1.21015,0.48406 0.7261,0 1.21016,-0.48406 0.48406,-0.5244 0.48406,-1.21016 v -5.60705 q 0,-1.69422 1.21016,-2.86404 1.21015,-1.21016 2.90437,-1.21016 1.69422,0 2.86404,1.21016 1.21016,1.16982 1.21016,2.86404 z" />
|
||||||
</g>
|
</g>
|
||||||
<g>
|
|
||||||
</g>
|
|
||||||
<g>
|
|
||||||
</g>
|
|
||||||
<g>
|
|
||||||
</g>
|
|
||||||
<g>
|
|
||||||
</g>
|
|
||||||
<g>
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 13 KiB |
9
binding.gyp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
'targets': [
|
||||||
|
{
|
||||||
|
'target_name': 'crypto_key',
|
||||||
|
'sources': ['src/crypto_key.cc'],
|
||||||
|
'include_dirs': ['<!(node -e "require(\'nan\')")']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -14,7 +14,7 @@ RUN pacman -S --noconfirm pacman
|
|||||||
RUN pacman-db-upgrade
|
RUN pacman-db-upgrade
|
||||||
RUN pacman -S --noconfirm archlinux-keyring
|
RUN pacman -S --noconfirm archlinux-keyring
|
||||||
RUN pacman -Syyu --noconfirm
|
RUN pacman -Syyu --noconfirm
|
||||||
RUN pacman -S --noconfirm git nodejs npm mongodb redis graphicsmagick
|
RUN pacman -S --noconfirm git nodejs npm mongodb redis imagemagick
|
||||||
|
|
||||||
COPY misskey.sh /root/misskey.sh
|
COPY misskey.sh /root/misskey.sh
|
||||||
RUN chmod u+x /root/misskey.sh
|
RUN chmod u+x /root/misskey.sh
|
||||||
|
@ -7,7 +7,7 @@ Make sure **mongodb-tools** installed.
|
|||||||
|
|
||||||
In your shell:
|
In your shell:
|
||||||
``` shell
|
``` shell
|
||||||
$ mongodump --archive=db-backup
|
$ mongodump --archive=db-backup -u <YourUserName> -p <YourPassword>
|
||||||
```
|
```
|
||||||
|
|
||||||
For details, plese see [mongodump docs](https://docs.mongodb.com/manual/reference/program/mongodump/).
|
For details, plese see [mongodump docs](https://docs.mongodb.com/manual/reference/program/mongodump/).
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
``` yaml
|
|
||||||
# サーバーのメンテナ情報
|
|
||||||
maintainer:
|
|
||||||
# メンテナの名前
|
|
||||||
name:
|
|
||||||
|
|
||||||
# メンテナの連絡先(URLかmailto形式のURL)
|
|
||||||
url:
|
|
||||||
|
|
||||||
# プライマリURL
|
|
||||||
url:
|
|
||||||
|
|
||||||
# セカンダリURL
|
|
||||||
secondary_url:
|
|
||||||
|
|
||||||
# 待受ポート
|
|
||||||
port:
|
|
||||||
|
|
||||||
# TLSの設定(利用しない場合は省略可能)
|
|
||||||
https:
|
|
||||||
# 証明書のパス...
|
|
||||||
key:
|
|
||||||
cert:
|
|
||||||
|
|
||||||
# MongoDBの設定
|
|
||||||
mongodb:
|
|
||||||
host: localhost
|
|
||||||
port: 27017
|
|
||||||
db: misskey
|
|
||||||
user:
|
|
||||||
pass:
|
|
||||||
|
|
||||||
# Redisの設定
|
|
||||||
redis:
|
|
||||||
host: localhost
|
|
||||||
port: 6379
|
|
||||||
pass:
|
|
||||||
|
|
||||||
# reCAPTCHAの設定
|
|
||||||
recaptcha:
|
|
||||||
site_key:
|
|
||||||
secret_key:
|
|
||||||
|
|
||||||
# ServiceWrokerの設定
|
|
||||||
sw:
|
|
||||||
# VAPIDの公開鍵
|
|
||||||
public_key:
|
|
||||||
|
|
||||||
# VAPIDの秘密鍵
|
|
||||||
private_key:
|
|
||||||
|
|
||||||
```
|
|
26
docs/donate.ja.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Misskeyにカンパする方法
|
||||||
|
Misskeyのサポートにご興味をお持ちいただきありがとうございます!
|
||||||
|
Misskeyにカンパをしていただくと、貴方のお名前と好きなURLなどをMisskeyのリポジトリに刻む権利がもらえます。
|
||||||
|
|
||||||
|
Misskeyにカンパして開発・運営をサポートするには、次のいくつかの方法があります:
|
||||||
|
|
||||||
|
## ConoHaカードを購入する
|
||||||
|
(本家)Misskeyは、ConoHaというVPSサービスを利用しています。ConoHaカードを購入して、
|
||||||
|
カードに記載されているクーポンコードを syuilotan@yahoo.co.jp までお送りいただければ、
|
||||||
|
そのクーポンをチャージしてサーバーの運営費に充てることができます。
|
||||||
|
|
||||||
|
ConoHaカードについてはこちらをご覧ください: https://www.conoha.jp/conohacard/
|
||||||
|
|
||||||
|
Amazonでも買えます: https://www.amazon.co.jp/dp/B01N9E3416
|
||||||
|
|
||||||
|
## Amazonギフトカード
|
||||||
|
これは間接的な方法です。
|
||||||
|
|
||||||
|
## 銀行振込
|
||||||
|
syuilotan@yahoo.co.jp までお問い合わせください。
|
||||||
|
|
||||||
|
## 手渡し
|
||||||
|
オフ会を行ったときなどに行使できる方法です。
|
||||||
|
|
||||||
|
## その他
|
||||||
|
なにかいいアイデアがあればお教えください。
|
@ -8,30 +8,7 @@ This guide describes how to install and setup Misskey.
|
|||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
If you can use Docker, please see [Setup with Docker](./docker.en.md).
|
*1.* reCAPTCHA tokens
|
||||||
|
|
||||||
*1.* Domains
|
|
||||||
----------------------------------------------------------------
|
|
||||||
Misskey requires two domains called the primary domain and the secondary domain.
|
|
||||||
|
|
||||||
* The primary domain is used to provide main service of Misskey.
|
|
||||||
* The secondary domain is used to avoid vulnerabilities such as XSS.
|
|
||||||
|
|
||||||
**Ensure that the secondary domain is not a subdomain of the primary domain.**
|
|
||||||
|
|
||||||
### Subdomains
|
|
||||||
Note that Misskey uses following subdomains:
|
|
||||||
|
|
||||||
* **api**.*{primary domain}*
|
|
||||||
* **auth**.*{primary domain}*
|
|
||||||
* **about**.*{primary domain}*
|
|
||||||
* **ch**.*{primary domain}*
|
|
||||||
* **stats**.*{primary domain}*
|
|
||||||
* **status**.*{primary domain}*
|
|
||||||
* **dev**.*{primary domain}*
|
|
||||||
* **file**.*{secondary domain}*
|
|
||||||
|
|
||||||
*2.* reCAPTCHA tokens
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Misskey requires reCAPTCHA tokens.
|
Misskey requires reCAPTCHA tokens.
|
||||||
Please visit https://www.google.com/recaptcha/intro/ and generate keys.
|
Please visit https://www.google.com/recaptcha/intro/ and generate keys.
|
||||||
@ -45,7 +22,7 @@ npm install web-push -g
|
|||||||
web-push generate-vapid-keys
|
web-push generate-vapid-keys
|
||||||
```
|
```
|
||||||
|
|
||||||
*3.* Install dependencies
|
*2.* Install dependencies
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Please install and setup these softwares:
|
Please install and setup these softwares:
|
||||||
|
|
||||||
@ -58,29 +35,34 @@ Please install and setup these softwares:
|
|||||||
##### Optional
|
##### Optional
|
||||||
* [Elasticsearch](https://www.elastic.co/) - used to provide searching feature instead of MongoDB
|
* [Elasticsearch](https://www.elastic.co/) - used to provide searching feature instead of MongoDB
|
||||||
|
|
||||||
*4.* Install Misskey
|
*3.* Install Misskey
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
1. `git clone -b master git://github.com/syuilo/misskey.git`
|
1. `git clone -b master git://github.com/syuilo/misskey.git`
|
||||||
2. `cd misskey`
|
2. `cd misskey`
|
||||||
3. `npm install`
|
3. `npm install`
|
||||||
4. `npm run build`
|
|
||||||
|
|
||||||
#### Update
|
*4.* Prepare configuration
|
||||||
1. `git pull origin master`
|
----------------------------------------------------------------
|
||||||
2. `npm install`
|
1. Copy `example.yml` of `.config` directory
|
||||||
3. `npm run build`
|
2. Rename it to `default.yml`
|
||||||
|
3. Edit it
|
||||||
|
|
||||||
*5.* That is it.
|
---
|
||||||
|
|
||||||
|
Or you can generate config file via `npm run config` command.
|
||||||
|
|
||||||
|
*5.* Build Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1. `npm run build`
|
||||||
|
|
||||||
|
*6.* That is it.
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
Well done! Now, you have an environment that run to Misskey.
|
Well done! Now, you have an environment that run to Misskey.
|
||||||
|
|
||||||
### Launch
|
### Launch
|
||||||
Just `sudo npm start`. GLHF!
|
Just `sudo npm start`. GLHF!
|
||||||
|
|
||||||
### Testing
|
### Way to Update to latest version of your Misskey
|
||||||
Run `npm test` after building
|
1. `git reset --hard && git pull origin master`
|
||||||
|
2. `npm install`
|
||||||
### Debugging :bug:
|
3. `npm run build`
|
||||||
#### Show debug messages
|
|
||||||
Misskey uses [debug](https://github.com/visionmedia/debug) and the namespace is `misskey:*`.
|
|
||||||
|
@ -8,31 +8,7 @@ Misskeyサーバーの構築にご関心をお寄せいただきありがとう
|
|||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
Dockerを利用してMisskeyを構築することもできます: [Setup with Docker](./docker.en.md)。
|
*1.* reCAPTCHAトークンの用意
|
||||||
その場合、*3番目*以降の手順はスキップできます。
|
|
||||||
|
|
||||||
*1.* ドメインの用意
|
|
||||||
----------------------------------------------------------------
|
|
||||||
Misskeyはプライマリ ドメインとセカンダリ ドメインを必要とします。
|
|
||||||
|
|
||||||
* プライマリ ドメインはMisskeyの主要な部分を提供するために使われます。
|
|
||||||
* セカンダリ ドメインはXSSといった脆弱性の対策に使われます。
|
|
||||||
|
|
||||||
**セカンダリ ドメインがプライマリ ドメインのサブドメインであってはなりません。**
|
|
||||||
|
|
||||||
### サブドメイン
|
|
||||||
Misskeyは以下のサブドメインを使います:
|
|
||||||
|
|
||||||
* **api**.*{primary domain}*
|
|
||||||
* **auth**.*{primary domain}*
|
|
||||||
* **about**.*{primary domain}*
|
|
||||||
* **ch**.*{primary domain}*
|
|
||||||
* **stats**.*{primary domain}*
|
|
||||||
* **status**.*{primary domain}*
|
|
||||||
* **dev**.*{primary domain}*
|
|
||||||
* **file**.*{secondary domain}*
|
|
||||||
|
|
||||||
*2.* reCAPTCHAトークンの用意
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
MisskeyはreCAPTCHAトークンを必要とします。
|
MisskeyはreCAPTCHAトークンを必要とします。
|
||||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを生成してください。
|
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを生成してください。
|
||||||
@ -46,7 +22,7 @@ npm install web-push -g
|
|||||||
web-push generate-vapid-keys
|
web-push generate-vapid-keys
|
||||||
```
|
```
|
||||||
|
|
||||||
*3.* 依存関係をインストールする
|
*2.* 依存関係をインストールする
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
これらのソフトウェアをインストール・設定してください:
|
これらのソフトウェアをインストール・設定してください:
|
||||||
|
|
||||||
@ -59,29 +35,35 @@ web-push generate-vapid-keys
|
|||||||
##### オプション
|
##### オプション
|
||||||
* [Elasticsearch](https://www.elastic.co/) - 検索機能を向上させるために用います。
|
* [Elasticsearch](https://www.elastic.co/) - 検索機能を向上させるために用います。
|
||||||
|
|
||||||
*4.* Misskeyのインストール
|
*3.* Misskeyのインストール
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
1. `git clone -b master git://github.com/syuilo/misskey.git`
|
1. `git clone -b master git://github.com/syuilo/misskey.git`
|
||||||
2. `cd misskey`
|
2. `cd misskey`
|
||||||
3. `npm install`
|
3. `npm install`
|
||||||
4. `npm run build`
|
|
||||||
|
|
||||||
#### アップデートするには:
|
*4.* 設定ファイルを用意する
|
||||||
1. `git pull origin master`
|
----------------------------------------------------------------
|
||||||
2. `npm install`
|
1. `.config`ディレクトリ内の`example.yml`をコピー
|
||||||
3. `npm run build`
|
2. `default.yml`にリネーム
|
||||||
|
3. 編集する
|
||||||
|
|
||||||
*5.* 以上です!
|
---
|
||||||
|
|
||||||
|
または、`npm run config`コマンドを利用して、ガイドに従って情報を
|
||||||
|
入力して設定ファイルを生成することもできます。
|
||||||
|
|
||||||
|
*5.* Misskeyのビルド
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1. `npm run build`
|
||||||
|
|
||||||
|
*6.* 以上です!
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
||||||
|
|
||||||
### 起動
|
### 起動
|
||||||
`sudo npm start`するだけです。GLHF!
|
`sudo npm start`するだけです。GLHF!
|
||||||
|
|
||||||
### テスト
|
### Misskeyを最新バージョンにアップデートする方法:
|
||||||
(ビルドされている状態で)`npm test`
|
1. `git reset --hard && git pull origin master`
|
||||||
|
2. `npm install`
|
||||||
### デバッグ :bug:
|
3. `npm run build`
|
||||||
#### デバッグメッセージを表示するようにする
|
|
||||||
Misskeyは[debug](https://github.com/visionmedia/debug)モジュールを利用しており、ネームスペースは`misskey:*`となっています。
|
|
||||||
|
85
gulpfile.ts
@ -8,8 +8,8 @@ import * as Path from 'path';
|
|||||||
import * as gulp from 'gulp';
|
import * as gulp from 'gulp';
|
||||||
import * as gutil from 'gulp-util';
|
import * as gutil from 'gulp-util';
|
||||||
import * as ts from 'gulp-typescript';
|
import * as ts from 'gulp-typescript';
|
||||||
|
const sourcemaps = require('gulp-sourcemaps');
|
||||||
import tslint from 'gulp-tslint';
|
import tslint from 'gulp-tslint';
|
||||||
import * as es from 'event-stream';
|
|
||||||
import cssnano = require('gulp-cssnano');
|
import cssnano = require('gulp-cssnano');
|
||||||
import * as uglifyComposer from 'gulp-uglify/composer';
|
import * as uglifyComposer from 'gulp-uglify/composer';
|
||||||
import pug = require('gulp-pug');
|
import pug = require('gulp-pug');
|
||||||
@ -21,21 +21,14 @@ import * as mocha from 'gulp-mocha';
|
|||||||
import * as replace from 'gulp-replace';
|
import * as replace from 'gulp-replace';
|
||||||
import * as htmlmin from 'gulp-htmlmin';
|
import * as htmlmin from 'gulp-htmlmin';
|
||||||
const uglifyes = require('uglify-es');
|
const uglifyes = require('uglify-es');
|
||||||
import * as fontawesome from '@fortawesome/fontawesome';
|
|
||||||
import * as regular from '@fortawesome/fontawesome-free-regular';
|
|
||||||
import * as solid from '@fortawesome/fontawesome-free-solid';
|
|
||||||
import * as brands from '@fortawesome/fontawesome-free-brands';
|
|
||||||
|
|
||||||
// Add icons
|
|
||||||
fontawesome.library.add(regular);
|
|
||||||
fontawesome.library.add(solid);
|
|
||||||
fontawesome.library.add(brands);
|
|
||||||
|
|
||||||
|
import { fa } from './src/build/fa';
|
||||||
import version from './src/version';
|
import version from './src/version';
|
||||||
|
import config from './src/config';
|
||||||
|
|
||||||
const uglify = uglifyComposer(uglifyes, console);
|
const uglify = uglifyComposer(uglifyes, console);
|
||||||
|
|
||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV || 'development';
|
||||||
const isProduction = env === 'production';
|
const isProduction = env === 'production';
|
||||||
const isDebug = !isProduction;
|
const isDebug = !isProduction;
|
||||||
|
|
||||||
@ -46,40 +39,34 @@ if (isDebug) {
|
|||||||
|
|
||||||
const constants = require('./src/const.json');
|
const constants = require('./src/const.json');
|
||||||
|
|
||||||
|
require('./src/client/docs/gulpfile.ts');
|
||||||
|
|
||||||
gulp.task('build', [
|
gulp.task('build', [
|
||||||
'build:js',
|
|
||||||
'build:ts',
|
'build:ts',
|
||||||
'build:copy',
|
'build:copy',
|
||||||
'build:client'
|
'build:client',
|
||||||
|
'doc'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
gulp.task('rebuild', ['clean', 'build']);
|
gulp.task('rebuild', ['clean', 'build']);
|
||||||
|
|
||||||
gulp.task('build:js', () =>
|
|
||||||
gulp.src(['./src/**/*.js', '!./src/web/**/*.js'])
|
|
||||||
.pipe(gulp.dest('./built/'))
|
|
||||||
);
|
|
||||||
|
|
||||||
gulp.task('build:ts', () => {
|
gulp.task('build:ts', () => {
|
||||||
const tsProject = ts.createProject('./src/tsconfig.json');
|
const tsProject = ts.createProject('./tsconfig.json');
|
||||||
|
|
||||||
return tsProject
|
return tsProject
|
||||||
.src()
|
.src()
|
||||||
|
.pipe(sourcemaps.init())
|
||||||
.pipe(tsProject())
|
.pipe(tsProject())
|
||||||
|
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '../built' }))
|
||||||
.pipe(gulp.dest('./built/'));
|
.pipe(gulp.dest('./built/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build:copy', () =>
|
gulp.task('build:copy', () =>
|
||||||
es.merge(
|
|
||||||
gulp.src([
|
gulp.src([
|
||||||
|
'./build/Release/crypto_key.node',
|
||||||
'./src/**/assets/**/*',
|
'./src/**/assets/**/*',
|
||||||
'!./src/web/app/**/assets/**/*'
|
'!./src/client/app/**/assets/**/*'
|
||||||
]).pipe(gulp.dest('./built/')) as any,
|
]).pipe(gulp.dest('./built/'))
|
||||||
gulp.src([
|
|
||||||
'./src/web/about/**/*',
|
|
||||||
'!./src/web/about/**/*.pug'
|
|
||||||
]).pipe(gulp.dest('./built/web/about/')) as any
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('test', ['lint', 'mocha']);
|
gulp.task('test', ['lint', 'mocha']);
|
||||||
@ -104,8 +91,8 @@ gulp.src('./src/**/*.ts')
|
|||||||
gulp.task('mocha', () =>
|
gulp.task('mocha', () =>
|
||||||
gulp.src([])
|
gulp.src([])
|
||||||
.pipe(mocha({
|
.pipe(mocha({
|
||||||
exit: true
|
exit: true,
|
||||||
//compilers: 'ts:ts-node/register'
|
compilers: 'ts:ts-node/register'
|
||||||
} as any))
|
} as any))
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -121,55 +108,43 @@ gulp.task('default', ['build']);
|
|||||||
|
|
||||||
gulp.task('build:client', [
|
gulp.task('build:client', [
|
||||||
'build:ts',
|
'build:ts',
|
||||||
'build:js',
|
|
||||||
'webpack',
|
|
||||||
'build:client:script',
|
'build:client:script',
|
||||||
'build:client:pug',
|
'build:client:pug',
|
||||||
'copy:client'
|
'copy:client'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
gulp.task('webpack', done => {
|
|
||||||
const webpack = childProcess.spawn(
|
|
||||||
Path.join('.', 'node_modules', '.bin', 'webpack'),
|
|
||||||
['--config', './webpack/webpack.config.ts'], {
|
|
||||||
shell: true,
|
|
||||||
stdio: 'inherit'
|
|
||||||
});
|
|
||||||
|
|
||||||
webpack.on('exit', done);
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build:client:script', () =>
|
gulp.task('build:client:script', () =>
|
||||||
gulp.src(['./src/web/app/boot.js', './src/web/app/safe.js'])
|
gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
|
||||||
.pipe(replace('VERSION', JSON.stringify(version)))
|
.pipe(replace('VERSION', JSON.stringify(version)))
|
||||||
|
.pipe(replace('API', JSON.stringify(config.api_url)))
|
||||||
|
.pipe(replace('ENV', JSON.stringify(env)))
|
||||||
.pipe(isProduction ? uglify({
|
.pipe(isProduction ? uglify({
|
||||||
toplevel: true
|
toplevel: true
|
||||||
} as any) : gutil.noop())
|
} as any) : gutil.noop())
|
||||||
.pipe(gulp.dest('./built/web/assets/')) as any
|
.pipe(gulp.dest('./built/client/assets/')) as any
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('build:client:styles', () =>
|
gulp.task('build:client:styles', () =>
|
||||||
gulp.src('./src/web/app/init.css')
|
gulp.src('./src/client/app/init.css')
|
||||||
.pipe(isProduction
|
.pipe(isProduction
|
||||||
? (cssnano as any)()
|
? (cssnano as any)()
|
||||||
: gutil.noop())
|
: gutil.noop())
|
||||||
.pipe(gulp.dest('./built/web/assets/'))
|
.pipe(gulp.dest('./built/client/assets/'))
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('copy:client', [
|
gulp.task('copy:client', [
|
||||||
'build:client:script',
|
'build:client:script'
|
||||||
'webpack'
|
|
||||||
], () =>
|
], () =>
|
||||||
gulp.src([
|
gulp.src([
|
||||||
'./assets/**/*',
|
'./assets/**/*',
|
||||||
'./src/web/assets/**/*',
|
'./src/client/assets/**/*',
|
||||||
'./src/web/app/*/assets/**/*'
|
'./src/client/app/*/assets/**/*'
|
||||||
])
|
])
|
||||||
.pipe(isProduction ? (imagemin as any)() : gutil.noop())
|
.pipe(isProduction ? (imagemin as any)() : gutil.noop())
|
||||||
.pipe(rename(path => {
|
.pipe(rename(path => {
|
||||||
path.dirname = path.dirname.replace('assets', '.');
|
path.dirname = path.dirname.replace('assets', '.');
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('./built/web/assets/'))
|
.pipe(gulp.dest('./built/client/assets/'))
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('build:client:pug', [
|
gulp.task('build:client:pug', [
|
||||||
@ -177,13 +152,13 @@ gulp.task('build:client:pug', [
|
|||||||
'build:client:script',
|
'build:client:script',
|
||||||
'build:client:styles'
|
'build:client:styles'
|
||||||
], () =>
|
], () =>
|
||||||
gulp.src('./src/web/app/base.pug')
|
gulp.src('./src/client/app/base.pug')
|
||||||
.pipe(pug({
|
.pipe(pug({
|
||||||
locals: {
|
locals: {
|
||||||
themeColor: constants.themeColor,
|
themeColor: constants.themeColor,
|
||||||
facss: fontawesome.dom.css(),
|
facss: fa.dom.css(),
|
||||||
//hljscss: fs.readFileSync('./node_modules/highlight.js/styles/default.css', 'utf8')
|
//hljscss: fs.readFileSync('./node_modules/highlight.js/styles/default.css', 'utf8')
|
||||||
hljscss: fs.readFileSync('./src/web/assets/code-highlight.css', 'utf8')
|
hljscss: fs.readFileSync('./src/client/assets/code-highlight.css', 'utf8')
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.pipe(htmlmin({
|
.pipe(htmlmin({
|
||||||
@ -218,5 +193,5 @@ gulp.task('build:client:pug', [
|
|||||||
// CSSも圧縮する
|
// CSSも圧縮する
|
||||||
minifyCSS: true
|
minifyCSS: true
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('./built/web/app/'))
|
.pipe(gulp.dest('./built/client/app/'))
|
||||||
);
|
);
|
||||||
|
124
locales/en.yml
@ -33,7 +33,7 @@ common:
|
|||||||
confused: "Confused"
|
confused: "Confused"
|
||||||
pudding: "Pudding"
|
pudding: "Pudding"
|
||||||
|
|
||||||
post_categories:
|
note_categories:
|
||||||
music: "Music"
|
music: "Music"
|
||||||
game: "Video Game"
|
game: "Video Game"
|
||||||
anime: "Anime"
|
anime: "Anime"
|
||||||
@ -124,7 +124,7 @@ common:
|
|||||||
show-result: "Show result"
|
show-result: "Show result"
|
||||||
voted: "Voted"
|
voted: "Voted"
|
||||||
|
|
||||||
mk-post-menu:
|
mk-note-menu:
|
||||||
pin: "Pin"
|
pin: "Pin"
|
||||||
pinned: "Pinned"
|
pinned: "Pinned"
|
||||||
select: "Select category"
|
select: "Select category"
|
||||||
@ -183,6 +183,24 @@ common:
|
|||||||
mk-uploader:
|
mk-uploader:
|
||||||
waiting: "Waiting"
|
waiting: "Waiting"
|
||||||
|
|
||||||
|
docs:
|
||||||
|
edit-this-page-on-github: "Caught a mistake or want to contribute to the documentation? "
|
||||||
|
edit-this-page-on-github-link: "Edit this page on Github!"
|
||||||
|
|
||||||
|
api:
|
||||||
|
entities:
|
||||||
|
properties: "Properties"
|
||||||
|
endpoints:
|
||||||
|
params: "Parameters"
|
||||||
|
res: "Response"
|
||||||
|
props:
|
||||||
|
name: "Name"
|
||||||
|
type: "Type"
|
||||||
|
optional: "Optional"
|
||||||
|
description: "Description"
|
||||||
|
yes: "Yes"
|
||||||
|
no: "No"
|
||||||
|
|
||||||
ch:
|
ch:
|
||||||
tags:
|
tags:
|
||||||
mk-index:
|
mk-index:
|
||||||
@ -193,13 +211,17 @@ ch:
|
|||||||
textarea: "Write here"
|
textarea: "Write here"
|
||||||
upload: "Upload"
|
upload: "Upload"
|
||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
post: "Do"
|
note: "Do"
|
||||||
posting: "Doing"
|
posting: "Doing"
|
||||||
|
|
||||||
desktop:
|
desktop:
|
||||||
tags:
|
tags:
|
||||||
mk-api-info:
|
mk-api-info:
|
||||||
regenerate-token: "Please enter the password"
|
intro: "APIを利用するには、上記のトークンを「i」というキーでパラメータに付加してリクエストします。"
|
||||||
|
caution: "アカウントを不正利用される可能性があるため、このトークンは第三者に教えないでください(アプリなどにも入力しないでください)。"
|
||||||
|
regeneration-of-token: "万が一このトークンが漏れたりその可能性がある場合はトークンを再生成できます。"
|
||||||
|
regenerate-token: "Regenerate the token"
|
||||||
|
enter-password: "Please enter the password"
|
||||||
|
|
||||||
mk-drive-browser-base-contextmenu:
|
mk-drive-browser-base-contextmenu:
|
||||||
create-folder: "Create a folder"
|
create-folder: "Create a folder"
|
||||||
@ -282,8 +304,8 @@ desktop:
|
|||||||
settings: "Settings"
|
settings: "Settings"
|
||||||
signout: "Sign out"
|
signout: "Sign out"
|
||||||
|
|
||||||
mk-ui-header-post-button:
|
mk-ui-header-note-button:
|
||||||
post: "Compose new Post"
|
note: "Compose new Post"
|
||||||
|
|
||||||
mk-ui-header-notifications:
|
mk-ui-header-notifications:
|
||||||
title: "Notifications"
|
title: "Notifications"
|
||||||
@ -324,19 +346,22 @@ desktop:
|
|||||||
failed: "Failed to setup. please ensure that the token is correct."
|
failed: "Failed to setup. please ensure that the token is correct."
|
||||||
info: "From the next sign in, enter the token that is displayed on the device in addition to the password."
|
info: "From the next sign in, enter the token that is displayed on the device in addition to the password."
|
||||||
|
|
||||||
|
mk-mute-setting:
|
||||||
|
no-users: "No muted users"
|
||||||
|
|
||||||
mk-post-form:
|
mk-post-form:
|
||||||
post-placeholder: "What's happening?"
|
note-placeholder: "What's happening?"
|
||||||
reply-placeholder: "Reply to this post..."
|
reply-placeholder: "Reply to this note..."
|
||||||
quote-placeholder: "Quote this post..."
|
quote-placeholder: "Quote this note..."
|
||||||
post: "Post"
|
note: "Post"
|
||||||
reply: "Reply"
|
reply: "Reply"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
posted: "Posted!"
|
posted: "Posted!"
|
||||||
replied: "Replied!"
|
replied: "Replied!"
|
||||||
reposted: "Reposted!"
|
reposted: "Reposted!"
|
||||||
post-failed: "Failed to post"
|
note-failed: "Failed to note"
|
||||||
reply-failed: "Failed to reply"
|
reply-failed: "Failed to reply"
|
||||||
repost-failed: "Failed to repost"
|
renote-failed: "Failed to renote"
|
||||||
posting: "Posting"
|
posting: "Posting"
|
||||||
attach-media-from-local: "Attach media from your pc"
|
attach-media-from-local: "Attach media from your pc"
|
||||||
attach-media-from-drive: "Attach media from the drive"
|
attach-media-from-drive: "Attach media from the drive"
|
||||||
@ -346,26 +371,29 @@ desktop:
|
|||||||
text-remain: "{} chars remaining"
|
text-remain: "{} chars remaining"
|
||||||
|
|
||||||
mk-post-form-window:
|
mk-post-form-window:
|
||||||
post: "New post"
|
note: "New note"
|
||||||
reply: "Reply"
|
reply: "Reply"
|
||||||
attaches: "{} media attached"
|
attaches: "{} media attached"
|
||||||
uploading-media: "Uploading {} media"
|
uploading-media: "Uploading {} media"
|
||||||
|
|
||||||
mk-post-page:
|
mk-note-page:
|
||||||
prev: "Previous post"
|
prev: "Previous note"
|
||||||
next: "Next post"
|
next: "Next note"
|
||||||
|
|
||||||
mk-settings:
|
mk-settings:
|
||||||
profile: "Profile"
|
profile: "Profile"
|
||||||
|
mute: "Mute"
|
||||||
drive: "Drive"
|
drive: "Drive"
|
||||||
security: "Security"
|
security: "Security"
|
||||||
password: "Password"
|
password: "Password"
|
||||||
2fa: "Two-factor authentication"
|
2fa: "Two-factor authentication"
|
||||||
|
other: "Other"
|
||||||
|
license: "License"
|
||||||
|
|
||||||
mk-timeline-post:
|
mk-timeline-note:
|
||||||
reposted-by: "Reposted by {}"
|
reposted-by: "Reposted by {}"
|
||||||
reply: "Reply"
|
reply: "Reply"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
add-reaction: "Add your reaction"
|
add-reaction: "Add your reaction"
|
||||||
detail: "Show detail"
|
detail: "Show detail"
|
||||||
|
|
||||||
@ -420,7 +448,7 @@ desktop:
|
|||||||
|
|
||||||
mk-post-form-home-widget:
|
mk-post-form-home-widget:
|
||||||
title: "Post"
|
title: "Post"
|
||||||
post: "Post"
|
note: "Post"
|
||||||
placeholder: "What's happening?"
|
placeholder: "What's happening?"
|
||||||
|
|
||||||
mk-access-log-home-widget:
|
mk-access-log-home-widget:
|
||||||
@ -435,20 +463,25 @@ desktop:
|
|||||||
have-a-nice-day: "Have a nice day!"
|
have-a-nice-day: "Have a nice day!"
|
||||||
next: "Next"
|
next: "Next"
|
||||||
|
|
||||||
mk-repost-form:
|
mk-renote-form:
|
||||||
quote: "Quote..."
|
quote: "Quote..."
|
||||||
cancel: "Cancel"
|
cancel: "Cancel"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
reposting: "Reposting..."
|
reposting: "Reposting..."
|
||||||
success: "Reposted!"
|
success: "Reposted!"
|
||||||
failure: "Failed to Repost"
|
failure: "Failed to Renote"
|
||||||
|
|
||||||
mk-repost-form-window:
|
mk-renote-form-window:
|
||||||
title: "Are you sure you want to repost this post?"
|
title: "Are you sure you want to renote this note?"
|
||||||
|
|
||||||
mk-user:
|
mk-user:
|
||||||
last-used-at: "Last used at"
|
last-used-at: "Last used at"
|
||||||
|
|
||||||
|
follows-you: "Follows you"
|
||||||
|
mute: "Mute"
|
||||||
|
muted: "Muting"
|
||||||
|
unmute: "Unmute"
|
||||||
|
|
||||||
photos:
|
photos:
|
||||||
title: "Photos"
|
title: "Photos"
|
||||||
loading: "Loading"
|
loading: "Loading"
|
||||||
@ -508,10 +541,10 @@ mobile:
|
|||||||
notifications: "Notifications"
|
notifications: "Notifications"
|
||||||
read-all: "Are you sure you want to mark all unread notifications as read?"
|
read-all: "Are you sure you want to mark all unread notifications as read?"
|
||||||
|
|
||||||
mk-post-page:
|
mk-note-page:
|
||||||
title: "Post"
|
title: "Post"
|
||||||
prev: "Previous post"
|
prev: "Previous note"
|
||||||
next: "Next post"
|
next: "Next note"
|
||||||
|
|
||||||
mk-search-page:
|
mk-search-page:
|
||||||
search: "Search"
|
search: "Search"
|
||||||
@ -524,7 +557,6 @@ mobile:
|
|||||||
applications: "Applications"
|
applications: "Applications"
|
||||||
twitter-integration: "Twitter integration"
|
twitter-integration: "Twitter integration"
|
||||||
signin-history: "Sign in history"
|
signin-history: "Sign in history"
|
||||||
api: "API"
|
|
||||||
link: "MisskeyLink"
|
link: "MisskeyLink"
|
||||||
settings: "Settings"
|
settings: "Settings"
|
||||||
signout: "Sign out"
|
signout: "Sign out"
|
||||||
@ -574,34 +606,33 @@ mobile:
|
|||||||
unfollow: "Unfollow"
|
unfollow: "Unfollow"
|
||||||
|
|
||||||
mk-home-timeline:
|
mk-home-timeline:
|
||||||
empty-timeline: "There is no posts"
|
empty-timeline: "There is no notes"
|
||||||
|
|
||||||
mk-notifications:
|
mk-notifications:
|
||||||
more: "More"
|
more: "More"
|
||||||
empty: "No notifications"
|
empty: "No notifications"
|
||||||
|
|
||||||
mk-post-detail:
|
mk-note-detail:
|
||||||
reply: "Reply"
|
reply: "Reply"
|
||||||
reaction: "Reaction"
|
reaction: "Reaction"
|
||||||
|
|
||||||
mk-post-form:
|
mk-post-form:
|
||||||
submit: "Post"
|
submit: "Post"
|
||||||
reply-placeholder: "Reply to this post..."
|
reply-placeholder: "Reply to this note..."
|
||||||
post-placeholder: "What's happening?"
|
note-placeholder: "What's happening?"
|
||||||
attach-media-from-local: "Attach media from your device"
|
|
||||||
|
|
||||||
mk-search-posts:
|
mk-search-notes:
|
||||||
empty: "There is no post related to the 「{}」"
|
empty: "There is no note related to the 「{}」"
|
||||||
|
|
||||||
mk-sub-post-content:
|
mk-sub-note-content:
|
||||||
media-count: "{} media"
|
media-count: "{} media"
|
||||||
poll: "Poll"
|
poll: "Poll"
|
||||||
|
|
||||||
mk-timeline-post:
|
mk-timeline-note:
|
||||||
reposted-by: "Reposted by {}"
|
reposted-by: "Reposted by {}"
|
||||||
|
|
||||||
mk-timeline:
|
mk-timeline:
|
||||||
empty: "No posts"
|
empty: "No notes"
|
||||||
load-more: "More"
|
load-more: "More"
|
||||||
|
|
||||||
mk-ui-nav:
|
mk-ui-nav:
|
||||||
@ -621,20 +652,21 @@ mobile:
|
|||||||
no-users: "No following."
|
no-users: "No following."
|
||||||
|
|
||||||
mk-user-timeline:
|
mk-user-timeline:
|
||||||
no-posts: "This user seems never post"
|
no-notes: "This user seems never note"
|
||||||
no-posts-with-media: "There is no posts with media"
|
no-notes-with-media: "There is no notes with media"
|
||||||
|
load-more: "More"
|
||||||
|
|
||||||
mk-user:
|
mk-user:
|
||||||
follows-you: "Follows you"
|
follows-you: "Follows you"
|
||||||
following: "Following"
|
following: "Following"
|
||||||
followers: "Followers"
|
followers: "Followers"
|
||||||
posts: "Posts"
|
notes: "Posts"
|
||||||
overview: "Overview"
|
overview: "Overview"
|
||||||
timeline: "Timeline"
|
timeline: "Timeline"
|
||||||
media: "Media"
|
media: "Media"
|
||||||
|
|
||||||
mk-user-overview:
|
mk-user-overview:
|
||||||
recent-posts: "Recent posts"
|
recent-notes: "Recent notes"
|
||||||
images: "Images"
|
images: "Images"
|
||||||
activity: "Activity"
|
activity: "Activity"
|
||||||
keywords: "Keywords"
|
keywords: "Keywords"
|
||||||
@ -643,9 +675,9 @@ mobile:
|
|||||||
followers-you-know: "Followers you know"
|
followers-you-know: "Followers you know"
|
||||||
last-used-at: "Last used at"
|
last-used-at: "Last used at"
|
||||||
|
|
||||||
mk-user-overview-posts:
|
mk-user-overview-notes:
|
||||||
loading: "Loading"
|
loading: "Loading"
|
||||||
no-posts: "No posts"
|
no-notes: "No notes"
|
||||||
|
|
||||||
mk-user-overview-photos:
|
mk-user-overview-photos:
|
||||||
loading: "Loading"
|
loading: "Loading"
|
||||||
@ -671,7 +703,7 @@ mobile:
|
|||||||
load-more: "More"
|
load-more: "More"
|
||||||
|
|
||||||
stats:
|
stats:
|
||||||
posts-count: "Number of all posts"
|
notes-count: "Number of all notes"
|
||||||
users-count: "Number of all users"
|
users-count: "Number of all users"
|
||||||
|
|
||||||
status:
|
status:
|
||||||
|
23
locales/index.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Languages Loader
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as yaml from 'js-yaml';
|
||||||
|
|
||||||
|
const loadLang = lang => yaml.safeLoad(
|
||||||
|
fs.readFileSync(`./locales/${lang}.yml`, 'utf-8'));
|
||||||
|
|
||||||
|
const native = loadLang('ja');
|
||||||
|
|
||||||
|
const langs = {
|
||||||
|
//'en': loadLang('en'),
|
||||||
|
'ja': native
|
||||||
|
};
|
||||||
|
|
||||||
|
Object.entries(langs).map(([, locale]) => {
|
||||||
|
// Extend native language (Japanese)
|
||||||
|
locale = Object.assign({}, native, locale);
|
||||||
|
});
|
||||||
|
|
||||||
|
export default langs;
|
124
locales/ja.yml
@ -24,7 +24,7 @@ common:
|
|||||||
|
|
||||||
reactions:
|
reactions:
|
||||||
like: "いいね"
|
like: "いいね"
|
||||||
love: "ハート"
|
love: "しゅき"
|
||||||
laugh: "笑"
|
laugh: "笑"
|
||||||
hmm: "ふぅ~む"
|
hmm: "ふぅ~む"
|
||||||
surprise: "わお"
|
surprise: "わお"
|
||||||
@ -33,7 +33,7 @@ common:
|
|||||||
confused: "こまこまのこまり"
|
confused: "こまこまのこまり"
|
||||||
pudding: "Pudding"
|
pudding: "Pudding"
|
||||||
|
|
||||||
post_categories:
|
note_categories:
|
||||||
music: "音楽"
|
music: "音楽"
|
||||||
game: "ゲーム"
|
game: "ゲーム"
|
||||||
anime: "アニメ"
|
anime: "アニメ"
|
||||||
@ -124,7 +124,7 @@ common:
|
|||||||
show-result: "結果を見る"
|
show-result: "結果を見る"
|
||||||
voted: "投票済み"
|
voted: "投票済み"
|
||||||
|
|
||||||
mk-post-menu:
|
mk-note-menu:
|
||||||
pin: "ピン留め"
|
pin: "ピン留め"
|
||||||
pinned: "ピン留めしました"
|
pinned: "ピン留めしました"
|
||||||
select: "カテゴリを選択"
|
select: "カテゴリを選択"
|
||||||
@ -147,8 +147,8 @@ common:
|
|||||||
available: "利用できます"
|
available: "利用できます"
|
||||||
unavailable: "既に利用されています"
|
unavailable: "既に利用されています"
|
||||||
error: "通信エラー"
|
error: "通信エラー"
|
||||||
invalid-format: "a~z、A~Z、0~9、-(ハイフン)が使えます"
|
invalid-format: "a~z、A~Z、0~9、_が使えます"
|
||||||
too-short: "3文字以上でお願いします!"
|
too-short: "1文字以上でお願いします!"
|
||||||
too-long: "20文字以内でお願いします"
|
too-long: "20文字以内でお願いします"
|
||||||
password: "パスワード"
|
password: "パスワード"
|
||||||
password-placeholder: "8文字以上を推奨します"
|
password-placeholder: "8文字以上を推奨します"
|
||||||
@ -183,6 +183,24 @@ common:
|
|||||||
mk-uploader:
|
mk-uploader:
|
||||||
waiting: "待機中"
|
waiting: "待機中"
|
||||||
|
|
||||||
|
docs:
|
||||||
|
edit-this-page-on-github: "間違いや改善点を見つけましたか?"
|
||||||
|
edit-this-page-on-github-link: "このページをGitHubで編集"
|
||||||
|
|
||||||
|
api:
|
||||||
|
entities:
|
||||||
|
properties: "プロパティ"
|
||||||
|
endpoints:
|
||||||
|
params: "パラメータ"
|
||||||
|
res: "レスポンス"
|
||||||
|
props:
|
||||||
|
name: "名前"
|
||||||
|
type: "型"
|
||||||
|
optional: "オプション"
|
||||||
|
description: "説明"
|
||||||
|
yes: "はい"
|
||||||
|
no: "いいえ"
|
||||||
|
|
||||||
ch:
|
ch:
|
||||||
tags:
|
tags:
|
||||||
mk-index:
|
mk-index:
|
||||||
@ -193,13 +211,17 @@ ch:
|
|||||||
textarea: "書いて"
|
textarea: "書いて"
|
||||||
upload: "アップロード"
|
upload: "アップロード"
|
||||||
drive: "ドライブ"
|
drive: "ドライブ"
|
||||||
post: "やる"
|
note: "やる"
|
||||||
posting: "やってます"
|
posting: "やってます"
|
||||||
|
|
||||||
desktop:
|
desktop:
|
||||||
tags:
|
tags:
|
||||||
mk-api-info:
|
mk-api-info:
|
||||||
regenerate-token: "パスワードを入力してください"
|
intro: "APIを利用するには、上記のトークンを「i」というキーでパラメータに付加してリクエストします。"
|
||||||
|
caution: "アカウントを不正利用される可能性があるため、このトークンは第三者に教えないでください(アプリなどにも入力しないでください)。"
|
||||||
|
regeneration-of-token: "万が一このトークンが漏れたりその可能性がある場合はトークンを再生成できます。"
|
||||||
|
regenerate-token: "トークンを再生成"
|
||||||
|
enter-password: "パスワードを入力してください"
|
||||||
|
|
||||||
mk-drive-browser-base-contextmenu:
|
mk-drive-browser-base-contextmenu:
|
||||||
create-folder: "フォルダーを作成"
|
create-folder: "フォルダーを作成"
|
||||||
@ -282,8 +304,8 @@ desktop:
|
|||||||
settings: "設定"
|
settings: "設定"
|
||||||
signout: "サインアウト"
|
signout: "サインアウト"
|
||||||
|
|
||||||
mk-ui-header-post-button:
|
mk-ui-header-note-button:
|
||||||
post: "新規投稿"
|
note: "新規投稿"
|
||||||
|
|
||||||
mk-ui-header-notifications:
|
mk-ui-header-notifications:
|
||||||
title: "通知"
|
title: "通知"
|
||||||
@ -324,19 +346,22 @@ desktop:
|
|||||||
failed: "設定に失敗しました。トークンに誤りがないかご確認ください。"
|
failed: "設定に失敗しました。トークンに誤りがないかご確認ください。"
|
||||||
info: "次回サインインからは、同様にパスワードに加えてデバイスに表示されているトークンを入力します。"
|
info: "次回サインインからは、同様にパスワードに加えてデバイスに表示されているトークンを入力します。"
|
||||||
|
|
||||||
|
mk-mute-setting:
|
||||||
|
no-users: "ミュートしているユーザーはいません"
|
||||||
|
|
||||||
mk-post-form:
|
mk-post-form:
|
||||||
post-placeholder: "いまどうしてる?"
|
note-placeholder: "いまどうしてる?"
|
||||||
reply-placeholder: "この投稿への返信..."
|
reply-placeholder: "この投稿への返信..."
|
||||||
quote-placeholder: "この投稿を引用..."
|
quote-placeholder: "この投稿を引用..."
|
||||||
post: "投稿"
|
note: "投稿"
|
||||||
reply: "返信"
|
reply: "返信"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
posted: "投稿しました!"
|
posted: "投稿しました!"
|
||||||
replied: "返信しました!"
|
replied: "返信しました!"
|
||||||
reposted: "Repostしました!"
|
reposted: "Renoteしました!"
|
||||||
post-failed: "投稿に失敗しました"
|
note-failed: "投稿に失敗しました"
|
||||||
reply-failed: "返信に失敗しました"
|
reply-failed: "返信に失敗しました"
|
||||||
repost-failed: "Repostに失敗しました"
|
renote-failed: "Renoteに失敗しました"
|
||||||
posting: "投稿中"
|
posting: "投稿中"
|
||||||
attach-media-from-local: "PCからメディアを添付"
|
attach-media-from-local: "PCからメディアを添付"
|
||||||
attach-media-from-drive: "ドライブからメディアを添付"
|
attach-media-from-drive: "ドライブからメディアを添付"
|
||||||
@ -346,26 +371,29 @@ desktop:
|
|||||||
text-remain: "のこり{}文字"
|
text-remain: "のこり{}文字"
|
||||||
|
|
||||||
mk-post-form-window:
|
mk-post-form-window:
|
||||||
post: "新規投稿"
|
note: "新規投稿"
|
||||||
reply: "返信"
|
reply: "返信"
|
||||||
attaches: "添付: {}メディア"
|
attaches: "添付: {}メディア"
|
||||||
uploading-media: "{}個のメディアをアップロード中"
|
uploading-media: "{}個のメディアをアップロード中"
|
||||||
|
|
||||||
mk-post-page:
|
mk-note-page:
|
||||||
prev: "前の投稿"
|
prev: "前の投稿"
|
||||||
next: "次の投稿"
|
next: "次の投稿"
|
||||||
|
|
||||||
mk-settings:
|
mk-settings:
|
||||||
profile: "プロフィール"
|
profile: "プロフィール"
|
||||||
|
mute: "ミュート"
|
||||||
drive: "ドライブ"
|
drive: "ドライブ"
|
||||||
security: "セキュリティ"
|
security: "セキュリティ"
|
||||||
password: "パスワード"
|
password: "パスワード"
|
||||||
2fa: "二段階認証"
|
2fa: "二段階認証"
|
||||||
|
other: "その他"
|
||||||
|
license: "ライセンス"
|
||||||
|
|
||||||
mk-timeline-post:
|
mk-timeline-note:
|
||||||
reposted-by: "{}がRepost"
|
reposted-by: "{}がRenote"
|
||||||
reply: "返信"
|
reply: "返信"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
add-reaction: "リアクション"
|
add-reaction: "リアクション"
|
||||||
detail: "詳細"
|
detail: "詳細"
|
||||||
|
|
||||||
@ -414,13 +442,13 @@ desktop:
|
|||||||
|
|
||||||
mk-calendar-widget:
|
mk-calendar-widget:
|
||||||
title: "{1}年 {2}月"
|
title: "{1}年 {2}月"
|
||||||
prev: "先月"
|
prev: "前の月"
|
||||||
next: "来月"
|
next: "次の月"
|
||||||
go: "クリックして時間遡行"
|
go: "クリックして時間遡行"
|
||||||
|
|
||||||
mk-post-form-home-widget:
|
mk-post-form-home-widget:
|
||||||
title: "投稿"
|
title: "投稿"
|
||||||
post: "投稿"
|
note: "投稿"
|
||||||
placeholder: "いまどうしてる?"
|
placeholder: "いまどうしてる?"
|
||||||
|
|
||||||
mk-access-log-home-widget:
|
mk-access-log-home-widget:
|
||||||
@ -435,20 +463,25 @@ desktop:
|
|||||||
have-a-nice-day: "良い一日を!"
|
have-a-nice-day: "良い一日を!"
|
||||||
next: "次"
|
next: "次"
|
||||||
|
|
||||||
mk-repost-form:
|
mk-renote-form:
|
||||||
quote: "引用する..."
|
quote: "引用する..."
|
||||||
cancel: "キャンセル"
|
cancel: "キャンセル"
|
||||||
repost: "Repost"
|
renote: "Renote"
|
||||||
reposting: "しています..."
|
reposting: "しています..."
|
||||||
success: "Repostしました!"
|
success: "Renoteしました!"
|
||||||
failure: "Repostに失敗しました"
|
failure: "Renoteに失敗しました"
|
||||||
|
|
||||||
mk-repost-form-window:
|
mk-renote-form-window:
|
||||||
title: "この投稿をRepostしますか?"
|
title: "この投稿をRenoteしますか?"
|
||||||
|
|
||||||
mk-user:
|
mk-user:
|
||||||
last-used-at: "最終アクセス"
|
last-used-at: "最終アクセス"
|
||||||
|
|
||||||
|
follows-you: "フォローされています"
|
||||||
|
mute: "ミュートする"
|
||||||
|
muted: "ミュートしています"
|
||||||
|
unmute: "ミュート解除"
|
||||||
|
|
||||||
photos:
|
photos:
|
||||||
title: "フォト"
|
title: "フォト"
|
||||||
loading: "読み込み中"
|
loading: "読み込み中"
|
||||||
@ -508,7 +541,7 @@ mobile:
|
|||||||
notifications: "通知"
|
notifications: "通知"
|
||||||
read-all: "すべての通知を既読にしますか?"
|
read-all: "すべての通知を既読にしますか?"
|
||||||
|
|
||||||
mk-post-page:
|
mk-note-page:
|
||||||
title: "投稿"
|
title: "投稿"
|
||||||
prev: "前の投稿"
|
prev: "前の投稿"
|
||||||
next: "次の投稿"
|
next: "次の投稿"
|
||||||
@ -523,8 +556,7 @@ mobile:
|
|||||||
profile: "プロフィール"
|
profile: "プロフィール"
|
||||||
applications: "アプリケーション"
|
applications: "アプリケーション"
|
||||||
twitter-integration: "Twitter連携"
|
twitter-integration: "Twitter連携"
|
||||||
signin-history: "ログイン履歴"
|
signin-history: "サインイン履歴"
|
||||||
api: "API"
|
|
||||||
link: "Misskeyリンク"
|
link: "Misskeyリンク"
|
||||||
settings: "設定"
|
settings: "設定"
|
||||||
signout: "サインアウト"
|
signout: "サインアウト"
|
||||||
@ -580,25 +612,24 @@ mobile:
|
|||||||
more: "もっと見る"
|
more: "もっと見る"
|
||||||
empty: "ありません!"
|
empty: "ありません!"
|
||||||
|
|
||||||
mk-post-detail:
|
mk-note-detail:
|
||||||
reply: "返信"
|
reply: "返信"
|
||||||
reaction: "リアクション"
|
reaction: "リアクション"
|
||||||
|
|
||||||
mk-post-form:
|
mk-post-form:
|
||||||
submit: "投稿"
|
submit: "投稿"
|
||||||
reply-placeholder: "この投稿への返信..."
|
reply-placeholder: "この投稿への返信..."
|
||||||
post-placeholder: "いまどうしてる?"
|
note-placeholder: "いまどうしてる?"
|
||||||
attach-media-from-local: "デバイスからメディアを添付"
|
|
||||||
|
|
||||||
mk-search-posts:
|
mk-search-notes:
|
||||||
empty: "「{}」に関する投稿は見つかりませんでした。"
|
empty: "「{}」に関する投稿は見つかりませんでした。"
|
||||||
|
|
||||||
mk-sub-post-content:
|
mk-sub-note-content:
|
||||||
media-count: "{}個のメディア"
|
media-count: "{}個のメディア"
|
||||||
poll: "投票"
|
poll: "投票"
|
||||||
|
|
||||||
mk-timeline-post:
|
mk-timeline-note:
|
||||||
reposted-by: "{}がRepost"
|
reposted-by: "{}がRenote"
|
||||||
|
|
||||||
mk-timeline:
|
mk-timeline:
|
||||||
empty: "表示するものがありません"
|
empty: "表示するものがありません"
|
||||||
@ -621,20 +652,21 @@ mobile:
|
|||||||
no-users: "フォロー中のユーザーはいないようです。"
|
no-users: "フォロー中のユーザーはいないようです。"
|
||||||
|
|
||||||
mk-user-timeline:
|
mk-user-timeline:
|
||||||
no-posts: "このユーザーはまだ投稿していないようです。"
|
no-notes: "このユーザーはまだ投稿していないようです。"
|
||||||
no-posts-with-media: "メディア付き投稿はありません。"
|
no-notes-with-media: "メディア付き投稿はありません。"
|
||||||
|
load-more: "もっとみる"
|
||||||
|
|
||||||
mk-user:
|
mk-user:
|
||||||
follows-you: "フォローされています"
|
follows-you: "フォローされています"
|
||||||
following: "フォロー"
|
following: "フォロー"
|
||||||
followers: "フォロワー"
|
followers: "フォロワー"
|
||||||
posts: "投稿"
|
notes: "投稿"
|
||||||
overview: "概要"
|
overview: "概要"
|
||||||
timeline: "タイムライン"
|
timeline: "タイムライン"
|
||||||
media: "メディア"
|
media: "メディア"
|
||||||
|
|
||||||
mk-user-overview:
|
mk-user-overview:
|
||||||
recent-posts: "最近の投稿"
|
recent-notes: "最近の投稿"
|
||||||
images: "画像"
|
images: "画像"
|
||||||
activity: "アクティビティ"
|
activity: "アクティビティ"
|
||||||
keywords: "キーワード"
|
keywords: "キーワード"
|
||||||
@ -643,9 +675,9 @@ mobile:
|
|||||||
followers-you-know: "知り合いのフォロワー"
|
followers-you-know: "知り合いのフォロワー"
|
||||||
last-used-at: "最終ログイン"
|
last-used-at: "最終ログイン"
|
||||||
|
|
||||||
mk-user-overview-posts:
|
mk-user-overview-notes:
|
||||||
loading: "読み込み中"
|
loading: "読み込み中"
|
||||||
no-posts: "投稿はありません"
|
no-notes: "投稿はありません"
|
||||||
|
|
||||||
mk-user-overview-photos:
|
mk-user-overview-photos:
|
||||||
loading: "読み込み中"
|
loading: "読み込み中"
|
||||||
@ -671,7 +703,7 @@ mobile:
|
|||||||
load-more: "もっと"
|
load-more: "もっと"
|
||||||
|
|
||||||
stats:
|
stats:
|
||||||
posts-count: "投稿の数"
|
notes-count: "投稿の数"
|
||||||
users-count: "アカウントの数"
|
users-count: "アカウントの数"
|
||||||
|
|
||||||
status:
|
status:
|
||||||
|
203
package.json
@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "0.0.3322",
|
"version": "0.0.4771",
|
||||||
|
"codename": "nighthike",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "A miniblog-based SNS",
|
"description": "A miniblog-based SNS",
|
||||||
"bugs": "https://github.com/syuilo/misskey/issues",
|
"bugs": "https://github.com/syuilo/misskey/issues",
|
||||||
@ -13,7 +14,10 @@
|
|||||||
"start": "node ./built",
|
"start": "node ./built",
|
||||||
"debug": "DEBUG=misskey:* node ./built",
|
"debug": "DEBUG=misskey:* node ./built",
|
||||||
"swagger": "node ./swagger.js",
|
"swagger": "node ./swagger.js",
|
||||||
"build": "gulp build",
|
"build": "node --max_old_space_size=16384 ./node_modules/webpack/bin/webpack.js && gulp build",
|
||||||
|
"webpack": "node --max_old_space_size=16384 ./node_modules/webpack/bin/webpack.js",
|
||||||
|
"watch": "node --max_old_space_size=16384 ./node_modules/webpack/bin/webpack.js --watch",
|
||||||
|
"gulp": "gulp build",
|
||||||
"rebuild": "gulp rebuild",
|
"rebuild": "gulp rebuild",
|
||||||
"clean": "gulp clean",
|
"clean": "gulp clean",
|
||||||
"cleanall": "gulp cleanall",
|
"cleanall": "gulp cleanall",
|
||||||
@ -23,154 +27,193 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome": "1.0.1",
|
"@fortawesome/fontawesome": "1.0.1",
|
||||||
"@fortawesome/fontawesome-free-brands": "5.0.1",
|
"@fortawesome/fontawesome-free-brands": "5.0.2",
|
||||||
"@fortawesome/fontawesome-free-regular": "5.0.1",
|
"@fortawesome/fontawesome-free-regular": "5.0.2",
|
||||||
"@fortawesome/fontawesome-free-solid": "5.0.1",
|
"@fortawesome/fontawesome-free-solid": "5.0.2",
|
||||||
"@prezzemolo/rap": "0.1.2",
|
"@prezzemolo/rap": "0.1.2",
|
||||||
"@prezzemolo/zip": "0.0.3",
|
"@prezzemolo/zip": "0.0.3",
|
||||||
"@types/bcryptjs": "2.4.1",
|
"@types/bcryptjs": "2.4.1",
|
||||||
"@types/body-parser": "1.16.8",
|
"@types/body-parser": "1.16.8",
|
||||||
"@types/chai": "4.0.8",
|
"@types/chai": "4.1.2",
|
||||||
"@types/chai-http": "3.0.3",
|
"@types/chai-http": "3.0.4",
|
||||||
"@types/compression": "0.0.35",
|
"@types/compression": "0.0.36",
|
||||||
"@types/cookie": "0.3.1",
|
"@types/cookie": "0.3.1",
|
||||||
"@types/cors": "2.8.3",
|
"@types/cors": "2.8.3",
|
||||||
"@types/debug": "0.0.30",
|
"@types/debug": "0.0.30",
|
||||||
"@types/deep-equal": "1.0.1",
|
"@types/deep-equal": "1.0.1",
|
||||||
"@types/elasticsearch": "5.0.19",
|
"@types/elasticsearch": "5.0.22",
|
||||||
"@types/event-stream": "3.3.33",
|
|
||||||
"@types/eventemitter3": "2.0.2",
|
"@types/eventemitter3": "2.0.2",
|
||||||
"@types/express": "4.0.39",
|
"@types/express": "4.11.1",
|
||||||
"@types/gm": "1.17.33",
|
"@types/gm": "1.17.33",
|
||||||
"@types/gulp": "4.0.3",
|
"@types/gulp": "3.8.36",
|
||||||
"@types/gulp-htmlmin": "1.3.31",
|
"@types/gulp-htmlmin": "1.3.32",
|
||||||
"@types/gulp-mocha": "0.0.31",
|
"@types/gulp-mocha": "0.0.32",
|
||||||
"@types/gulp-rename": "0.0.33",
|
"@types/gulp-rename": "0.0.33",
|
||||||
"@types/gulp-replace": "0.0.31",
|
"@types/gulp-replace": "0.0.31",
|
||||||
"@types/gulp-uglify": "3.0.3",
|
"@types/gulp-uglify": "3.0.5",
|
||||||
"@types/gulp-util": "3.0.34",
|
"@types/gulp-util": "3.0.34",
|
||||||
"@types/inquirer": "0.0.35",
|
"@types/inquirer": "0.0.41",
|
||||||
"@types/is-root": "1.0.0",
|
"@types/is-root": "1.0.0",
|
||||||
"@types/is-url": "1.2.28",
|
"@types/is-url": "1.2.28",
|
||||||
"@types/js-yaml": "3.10.1",
|
"@types/js-yaml": "3.11.1",
|
||||||
"@types/mocha": "2.2.44",
|
"@types/kue": "^0.11.8",
|
||||||
"@types/mongodb": "2.2.16",
|
"@types/license-checker": "15.0.0",
|
||||||
"@types/monk": "1.0.6",
|
"@types/mkdirp": "0.5.2",
|
||||||
|
"@types/mocha": "5.0.0",
|
||||||
|
"@types/mongodb": "3.0.12",
|
||||||
|
"@types/monk": "6.0.0",
|
||||||
"@types/morgan": "1.7.35",
|
"@types/morgan": "1.7.35",
|
||||||
"@types/ms": "0.7.30",
|
"@types/ms": "0.7.30",
|
||||||
"@types/multer": "1.3.6",
|
"@types/multer": "1.3.6",
|
||||||
"@types/node": "8.0.57",
|
"@types/node": "9.6.2",
|
||||||
"@types/page": "1.5.32",
|
"@types/nopt": "3.0.29",
|
||||||
"@types/proxy-addr": "2.0.0",
|
"@types/proxy-addr": "2.0.0",
|
||||||
"@types/qrcode": "0.8.0",
|
"@types/pug": "2.0.4",
|
||||||
|
"@types/qrcode": "0.8.1",
|
||||||
"@types/ratelimiter": "2.1.28",
|
"@types/ratelimiter": "2.1.28",
|
||||||
"@types/redis": "2.8.2",
|
"@types/redis": "2.8.6",
|
||||||
"@types/request": "2.0.8",
|
"@types/request": "2.47.0",
|
||||||
|
"@types/request-promise-native": "1.0.14",
|
||||||
"@types/rimraf": "2.0.2",
|
"@types/rimraf": "2.0.2",
|
||||||
"@types/riot": "3.6.1",
|
|
||||||
"@types/seedrandom": "2.4.27",
|
"@types/seedrandom": "2.4.27",
|
||||||
"@types/serve-favicon": "2.2.30",
|
"@types/serve-favicon": "2.2.30",
|
||||||
"@types/speakeasy": "2.0.1",
|
"@types/speakeasy": "2.0.2",
|
||||||
"@types/tmp": "0.0.33",
|
"@types/tmp": "0.0.33",
|
||||||
"@types/uuid": "3.4.3",
|
"@types/uuid": "3.4.3",
|
||||||
"@types/webpack": "3.8.1",
|
"@types/webpack": "4.1.3",
|
||||||
"@types/webpack-stream": "3.2.8",
|
"@types/webpack-stream": "3.2.10",
|
||||||
"@types/websocket": "0.0.35",
|
"@types/websocket": "0.0.38",
|
||||||
|
"@types/ws": "4.0.2",
|
||||||
"accesses": "2.5.0",
|
"accesses": "2.5.0",
|
||||||
"animejs": "2.2.0",
|
"animejs": "2.2.0",
|
||||||
"autwh": "0.0.1",
|
"autosize": "4.0.1",
|
||||||
"awesome-typescript-loader": "3.4.1",
|
"autwh": "0.1.0",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"body-parser": "1.18.2",
|
"body-parser": "1.18.2",
|
||||||
"cafy": "3.2.0",
|
"bootstrap-vue": "2.0.0-rc.6",
|
||||||
|
"cafy": "3.2.1",
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
"chai-http": "3.0.0",
|
"chai-http": "4.0.0",
|
||||||
"chalk": "2.3.0",
|
"chalk": "2.3.2",
|
||||||
"compression": "1.7.1",
|
"compression": "1.7.2",
|
||||||
"cookie": "0.3.1",
|
"cookie": "0.3.1",
|
||||||
"cors": "2.8.4",
|
"cors": "2.8.4",
|
||||||
"cropperjs": "1.1.3",
|
"crc-32": "1.2.0",
|
||||||
"css-loader": "0.28.7",
|
"css-loader": "0.28.11",
|
||||||
"debug": "3.1.0",
|
"debug": "3.1.0",
|
||||||
"deep-equal": "1.0.1",
|
"deep-equal": "1.0.1",
|
||||||
"deepcopy": "0.6.3",
|
"deepcopy": "0.6.3",
|
||||||
"diskusage": "0.2.4",
|
"diskusage": "0.2.4",
|
||||||
"elasticsearch": "14.0.0",
|
"dompurify": "^1.0.3",
|
||||||
|
"elasticsearch": "14.2.2",
|
||||||
|
"element-ui": "2.3.3",
|
||||||
|
"emojilib": "2.2.12",
|
||||||
"escape-regexp": "0.0.1",
|
"escape-regexp": "0.0.1",
|
||||||
"event-stream": "3.3.4",
|
"eslint": "4.19.1",
|
||||||
"eventemitter3": "3.0.0",
|
"eslint-plugin-vue": "4.4.0",
|
||||||
|
"eventemitter3": "3.0.1",
|
||||||
"exif-js": "2.3.0",
|
"exif-js": "2.3.0",
|
||||||
"express": "4.16.2",
|
"express": "4.16.3",
|
||||||
"file-type": "7.4.0",
|
"file-loader": "1.1.11",
|
||||||
|
"file-type": "7.6.0",
|
||||||
"fuckadblock": "3.2.1",
|
"fuckadblock": "3.2.1",
|
||||||
"gm": "1.23.0",
|
"gm": "1.23.1",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-cssnano": "2.1.2",
|
"gulp-cssnano": "2.1.3",
|
||||||
"gulp-htmlmin": "3.0.0",
|
"gulp-htmlmin": "4.0.0",
|
||||||
"gulp-imagemin": "4.0.0",
|
"gulp-imagemin": "4.1.0",
|
||||||
"gulp-mocha": "4.3.1",
|
"gulp-mocha": "5.0.0",
|
||||||
"gulp-pug": "3.3.0",
|
"gulp-pug": "4.0.0",
|
||||||
"gulp-rename": "1.2.2",
|
"gulp-rename": "1.2.2",
|
||||||
"gulp-replace": "0.6.1",
|
"gulp-replace": "0.6.1",
|
||||||
"gulp-tslint": "8.1.2",
|
"gulp-sourcemaps": "2.6.4",
|
||||||
"gulp-typescript": "3.2.3",
|
"gulp-stylus": "2.7.0",
|
||||||
|
"gulp-tslint": "8.1.3",
|
||||||
|
"gulp-typescript": "4.0.2",
|
||||||
"gulp-uglify": "3.0.0",
|
"gulp-uglify": "3.0.0",
|
||||||
"gulp-util": "3.0.8",
|
"gulp-util": "3.0.8",
|
||||||
|
"hard-source-webpack-plugin": "0.6.4",
|
||||||
"highlight.js": "9.12.0",
|
"highlight.js": "9.12.0",
|
||||||
"inquirer": "4.0.1",
|
"html-minifier": "3.5.14",
|
||||||
"is-root": "1.0.0",
|
"http-signature": "^1.2.0",
|
||||||
"is-url": "1.2.2",
|
"inquirer": "5.2.0",
|
||||||
"js-yaml": "3.10.0",
|
"is-root": "2.0.0",
|
||||||
|
"is-url": "1.2.4",
|
||||||
|
"js-yaml": "3.11.0",
|
||||||
|
"jsdom": "11.7.0",
|
||||||
|
"kue": "0.11.6",
|
||||||
|
"license-checker": "18.0.0",
|
||||||
|
"loader-utils": "1.1.0",
|
||||||
"mecab-async": "0.1.2",
|
"mecab-async": "0.1.2",
|
||||||
"mocha": "4.0.1",
|
"mkdirp": "0.5.1",
|
||||||
|
"mocha": "5.0.5",
|
||||||
"moji": "0.5.1",
|
"moji": "0.5.1",
|
||||||
"mongodb": "2.2.33",
|
"mongodb": "3.0.6",
|
||||||
"monk": "6.0.5",
|
"monk": "6.0.5",
|
||||||
"morgan": "1.9.0",
|
"morgan": "1.9.0",
|
||||||
"ms": "2.1.1",
|
"ms": "2.1.1",
|
||||||
"multer": "1.3.0",
|
"multer": "1.3.0",
|
||||||
|
"nan": "2.10.0",
|
||||||
|
"node-sass": "4.8.3",
|
||||||
|
"node-sass-json-importer": "3.1.6",
|
||||||
|
"nopt": "4.0.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
|
"object-assign-deep": "0.4.0",
|
||||||
|
"on-build-webpack": "0.1.0",
|
||||||
"os-utils": "0.0.14",
|
"os-utils": "0.0.14",
|
||||||
"page": "1.7.1",
|
"progress-bar-webpack-plugin": "1.11.0",
|
||||||
"pictograph": "2.1.5",
|
|
||||||
"prominence": "0.2.0",
|
"prominence": "0.2.0",
|
||||||
"proxy-addr": "2.0.2",
|
"proxy-addr": "2.0.3",
|
||||||
"pug": "2.0.0-rc.4",
|
"pug": "2.0.3",
|
||||||
"qrcode": "1.0.0",
|
"punycode": "2.1.0",
|
||||||
|
"qrcode": "1.2.0",
|
||||||
"ratelimiter": "3.0.3",
|
"ratelimiter": "3.0.3",
|
||||||
"recaptcha-promise": "0.1.3",
|
"recaptcha-promise": "0.1.3",
|
||||||
"reconnecting-websocket": "3.2.2",
|
"reconnecting-websocket": "3.2.2",
|
||||||
"redis": "2.8.0",
|
"redis": "2.8.0",
|
||||||
"request": "2.83.0",
|
"request": "2.85.0",
|
||||||
|
"request-promise-native": "1.0.5",
|
||||||
"rimraf": "2.6.2",
|
"rimraf": "2.6.2",
|
||||||
"riot": "3.7.4",
|
|
||||||
"riot-tag-loader": "1.0.0",
|
|
||||||
"rndstr": "1.0.0",
|
"rndstr": "1.0.0",
|
||||||
"s-age": "1.1.0",
|
"s-age": "1.1.2",
|
||||||
|
"sass-loader": "6.0.7",
|
||||||
"seedrandom": "2.4.3",
|
"seedrandom": "2.4.3",
|
||||||
"serve-favicon": "2.4.5",
|
"serve-favicon": "2.5.0",
|
||||||
"sortablejs": "1.7.0",
|
|
||||||
"speakeasy": "2.0.0",
|
"speakeasy": "2.0.0",
|
||||||
"string-replace-webpack-plugin": "0.1.3",
|
"style-loader": "0.20.3",
|
||||||
"style-loader": "0.19.0",
|
|
||||||
"stylus": "0.54.5",
|
"stylus": "0.54.5",
|
||||||
"stylus-loader": "3.0.1",
|
"stylus-loader": "3.0.2",
|
||||||
"summaly": "2.0.3",
|
"summaly": "2.0.3",
|
||||||
"swagger-jsdoc": "1.9.7",
|
"swagger-jsdoc": "1.9.7",
|
||||||
"syuilo-password-strength": "0.0.1",
|
"syuilo-password-strength": "0.0.1",
|
||||||
"tcp-port-used": "0.1.2",
|
"tcp-port-used": "0.1.2",
|
||||||
"textarea-caret": "3.0.2",
|
"textarea-caret": "3.1.0",
|
||||||
"tmp": "0.0.33",
|
"tmp": "0.0.33",
|
||||||
"ts-node": "3.3.0",
|
"ts-loader": "4.1.0",
|
||||||
"tslint": "5.8.0",
|
"ts-node": "5.0.1",
|
||||||
"typescript": "2.6.2",
|
"tslint": "5.9.1",
|
||||||
"uglify-es": "3.2.0",
|
"typescript": "2.8.1",
|
||||||
"uglifyjs-webpack-plugin": "1.1.2",
|
"typescript-eslint-parser": "14.0.0",
|
||||||
"uuid": "3.1.0",
|
"uglify-es": "3.3.9",
|
||||||
|
"url-loader": "1.0.1",
|
||||||
|
"uuid": "3.2.1",
|
||||||
|
"v-animate-css": "0.0.2",
|
||||||
"vhost": "3.0.2",
|
"vhost": "3.0.2",
|
||||||
"web-push": "3.2.5",
|
"vue": "2.5.16",
|
||||||
"webpack": "3.10.0",
|
"vue-cropperjs": "2.2.0",
|
||||||
|
"vue-js-modal": "1.3.12",
|
||||||
|
"vue-json-tree-view": "2.1.3",
|
||||||
|
"vue-loader": "14.2.2",
|
||||||
|
"vue-router": "3.0.1",
|
||||||
|
"vue-template-compiler": "2.5.16",
|
||||||
|
"vuedraggable": "2.16.0",
|
||||||
|
"web-push": "3.3.0",
|
||||||
|
"webfinger.js": "2.6.6",
|
||||||
|
"webpack": "4.5.0",
|
||||||
|
"webpack-cli": "2.0.14",
|
||||||
|
"webpack-replace-loader": "1.3.0",
|
||||||
"websocket": "1.0.25",
|
"websocket": "1.0.25",
|
||||||
|
"ws": "5.1.1",
|
||||||
"xev": "2.0.0"
|
"xev": "2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
src/acct/parse.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export default acct => {
|
||||||
|
const splitted = acct.split('@', 2);
|
||||||
|
return { username: splitted[0], host: splitted[1] || null };
|
||||||
|
};
|
3
src/acct/render.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default user => {
|
||||||
|
return user.host === null ? user.username : `${user.username}@${user.host}`;
|
||||||
|
};
|
@ -1,56 +0,0 @@
|
|||||||
import * as express from 'express';
|
|
||||||
|
|
||||||
import { Endpoint } from './endpoints';
|
|
||||||
import authenticate from './authenticate';
|
|
||||||
import { IAuthContext } from './authenticate';
|
|
||||||
import _reply from './reply';
|
|
||||||
import limitter from './limitter';
|
|
||||||
|
|
||||||
export default async (endpoint: Endpoint, req: express.Request, res: express.Response) => {
|
|
||||||
const reply = _reply.bind(null, res);
|
|
||||||
let ctx: IAuthContext;
|
|
||||||
|
|
||||||
// Authentication
|
|
||||||
try {
|
|
||||||
ctx = await authenticate(req);
|
|
||||||
} catch (e) {
|
|
||||||
return reply(403, 'AUTHENTICATION_FAILED');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (endpoint.secure && !ctx.isSecure) {
|
|
||||||
return reply(403, 'ACCESS_DENIED');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (endpoint.withCredential && ctx.user == null) {
|
|
||||||
return reply(401, 'PLZ_SIGNIN');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx.app && endpoint.kind) {
|
|
||||||
if (!ctx.app.permission.some(p => p === endpoint.kind)) {
|
|
||||||
return reply(403, 'ACCESS_DENIED');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (endpoint.withCredential && endpoint.limit) {
|
|
||||||
try {
|
|
||||||
await limitter(endpoint, ctx); // Rate limit
|
|
||||||
} catch (e) {
|
|
||||||
// drop request if limit exceeded
|
|
||||||
return reply(429);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let exec = require(`${__dirname}/endpoints/${endpoint.name}`);
|
|
||||||
|
|
||||||
if (endpoint.withFile) {
|
|
||||||
exec = exec.bind(null, req.file);
|
|
||||||
}
|
|
||||||
|
|
||||||
// API invoking
|
|
||||||
try {
|
|
||||||
const res = await exec(req.body, ctx.user, ctx.app, ctx.isSecure);
|
|
||||||
reply(res);
|
|
||||||
} catch (e) {
|
|
||||||
reply(400, e);
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,69 +0,0 @@
|
|||||||
import * as express from 'express';
|
|
||||||
import App from './models/app';
|
|
||||||
import { default as User, IUser } from './models/user';
|
|
||||||
import AccessToken from './models/access-token';
|
|
||||||
import isNativeToken from './common/is-native-token';
|
|
||||||
|
|
||||||
export interface IAuthContext {
|
|
||||||
/**
|
|
||||||
* App which requested
|
|
||||||
*/
|
|
||||||
app: any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Authenticated user
|
|
||||||
*/
|
|
||||||
user: IUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether requested with a User-Native Token
|
|
||||||
*/
|
|
||||||
isSecure: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default (req: express.Request) => new Promise<IAuthContext>(async (resolve, reject) => {
|
|
||||||
const token = req.body['i'] as string;
|
|
||||||
|
|
||||||
if (token == null) {
|
|
||||||
return resolve({
|
|
||||||
app: null,
|
|
||||||
user: null,
|
|
||||||
isSecure: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isNativeToken(token)) {
|
|
||||||
const user: IUser = await User
|
|
||||||
.findOne({ token: token });
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return reject('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolve({
|
|
||||||
app: null,
|
|
||||||
user: user,
|
|
||||||
isSecure: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const accessToken = await AccessToken.findOne({
|
|
||||||
hash: token.toLowerCase()
|
|
||||||
});
|
|
||||||
|
|
||||||
if (accessToken === null) {
|
|
||||||
return reject('invalid signature');
|
|
||||||
}
|
|
||||||
|
|
||||||
const app = await App
|
|
||||||
.findOne({ _id: accessToken.app_id });
|
|
||||||
|
|
||||||
const user = await User
|
|
||||||
.findOne({ _id: accessToken.user_id });
|
|
||||||
|
|
||||||
return resolve({
|
|
||||||
app: app,
|
|
||||||
user: user,
|
|
||||||
isSecure: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,503 +0,0 @@
|
|||||||
import * as EventEmitter from 'events';
|
|
||||||
import * as bcrypt from 'bcryptjs';
|
|
||||||
|
|
||||||
import User, { IUser, init as initUser } from '../models/user';
|
|
||||||
|
|
||||||
import getPostSummary from '../../common/get-post-summary';
|
|
||||||
import getUserSummary from '../../common/get-user-summary';
|
|
||||||
import getNotificationSummary from '../../common/get-notification-summary';
|
|
||||||
|
|
||||||
import Othello, { ai as othelloAi } from '../../common/othello';
|
|
||||||
|
|
||||||
const hmm = [
|
|
||||||
'?',
|
|
||||||
'ふぅ~む...?',
|
|
||||||
'ちょっと何言ってるかわからないです',
|
|
||||||
'「ヘルプ」と言うと利用可能な操作が確認できますよ'
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Botの頭脳
|
|
||||||
*/
|
|
||||||
export default class BotCore extends EventEmitter {
|
|
||||||
public user: IUser = null;
|
|
||||||
|
|
||||||
private context: Context = null;
|
|
||||||
|
|
||||||
constructor(user?: IUser) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.user = user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public clearContext() {
|
|
||||||
this.setContext(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public setContext(context: Context) {
|
|
||||||
this.context = context;
|
|
||||||
this.emit('updated');
|
|
||||||
|
|
||||||
if (context) {
|
|
||||||
context.on('updated', () => {
|
|
||||||
this.emit('updated');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
user: this.user,
|
|
||||||
context: this.context ? this.context.export() : null
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected _import(data) {
|
|
||||||
this.user = data.user ? initUser(data.user) : null;
|
|
||||||
this.setContext(data.context ? Context.import(this, data.context) : null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(data) {
|
|
||||||
const bot = new BotCore();
|
|
||||||
bot._import(data);
|
|
||||||
return bot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (this.context != null) {
|
|
||||||
return await this.context.q(query);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (/^@[a-zA-Z0-9-]+$/.test(query)) {
|
|
||||||
return await this.showUserCommand(query);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (query) {
|
|
||||||
case 'ping':
|
|
||||||
return 'PONG';
|
|
||||||
|
|
||||||
case 'help':
|
|
||||||
case 'ヘルプ':
|
|
||||||
return '利用可能なコマンド一覧です:\n' +
|
|
||||||
'help: これです\n' +
|
|
||||||
'me: アカウント情報を見ます\n' +
|
|
||||||
'login, signin: サインインします\n' +
|
|
||||||
'logout, signout: サインアウトします\n' +
|
|
||||||
'post: 投稿します\n' +
|
|
||||||
'tl: タイムラインを見ます\n' +
|
|
||||||
'no: 通知を見ます\n' +
|
|
||||||
'@<ユーザー名>: ユーザーを表示します\n' +
|
|
||||||
'\n' +
|
|
||||||
'タイムラインや通知を見た後、「次」というとさらに遡ることができます。';
|
|
||||||
|
|
||||||
case 'me':
|
|
||||||
return this.user ? `${this.user.name}としてサインインしています。\n\n${getUserSummary(this.user)}` : 'サインインしていません';
|
|
||||||
|
|
||||||
case 'login':
|
|
||||||
case 'signin':
|
|
||||||
case 'ログイン':
|
|
||||||
case 'サインイン':
|
|
||||||
if (this.user != null) return '既にサインインしていますよ!';
|
|
||||||
this.setContext(new SigninContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
case 'logout':
|
|
||||||
case 'signout':
|
|
||||||
case 'ログアウト':
|
|
||||||
case 'サインアウト':
|
|
||||||
if (this.user == null) return '今はサインインしてないですよ!';
|
|
||||||
this.signout();
|
|
||||||
return 'ご利用ありがとうございました <3';
|
|
||||||
|
|
||||||
case 'post':
|
|
||||||
case '投稿':
|
|
||||||
if (this.user == null) return 'まずサインインしてください。';
|
|
||||||
this.setContext(new PostContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
case 'tl':
|
|
||||||
case 'タイムライン':
|
|
||||||
if (this.user == null) return 'まずサインインしてください。';
|
|
||||||
this.setContext(new TlContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
case 'no':
|
|
||||||
case 'notifications':
|
|
||||||
case '通知':
|
|
||||||
if (this.user == null) return 'まずサインインしてください。';
|
|
||||||
this.setContext(new NotificationsContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
case 'guessing-game':
|
|
||||||
case '数当てゲーム':
|
|
||||||
this.setContext(new GuessingGameContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
case 'othello':
|
|
||||||
case 'オセロ':
|
|
||||||
this.setContext(new OthelloContext(this));
|
|
||||||
return await this.context.greet();
|
|
||||||
|
|
||||||
default:
|
|
||||||
return hmm[Math.floor(Math.random() * hmm.length)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public signin(user: IUser) {
|
|
||||||
this.user = user;
|
|
||||||
this.emit('signin', user);
|
|
||||||
this.emit('updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
public signout() {
|
|
||||||
const user = this.user;
|
|
||||||
this.user = null;
|
|
||||||
this.emit('signout', user);
|
|
||||||
this.emit('updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
public async refreshUser() {
|
|
||||||
this.user = await User.findOne({
|
|
||||||
_id: this.user._id
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
data: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.emit('updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
public async showUserCommand(q: string): Promise<string> {
|
|
||||||
try {
|
|
||||||
const user = await require('../endpoints/users/show')({
|
|
||||||
username: q.substr(1)
|
|
||||||
}, this.user);
|
|
||||||
|
|
||||||
const text = getUserSummary(user);
|
|
||||||
|
|
||||||
return text;
|
|
||||||
} catch (e) {
|
|
||||||
return `問題が発生したようです...: ${e}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class Context extends EventEmitter {
|
|
||||||
protected bot: BotCore;
|
|
||||||
|
|
||||||
public abstract async greet(): Promise<string>;
|
|
||||||
public abstract async q(query: string): Promise<string>;
|
|
||||||
public abstract export(): any;
|
|
||||||
|
|
||||||
constructor(bot: BotCore) {
|
|
||||||
super();
|
|
||||||
this.bot = bot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
if (data.type == 'guessing-game') return GuessingGameContext.import(bot, data.content);
|
|
||||||
if (data.type == 'othello') return OthelloContext.import(bot, data.content);
|
|
||||||
if (data.type == 'post') return PostContext.import(bot, data.content);
|
|
||||||
if (data.type == 'tl') return TlContext.import(bot, data.content);
|
|
||||||
if (data.type == 'notifications') return NotificationsContext.import(bot, data.content);
|
|
||||||
if (data.type == 'signin') return SigninContext.import(bot, data.content);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SigninContext extends Context {
|
|
||||||
private temporaryUser: IUser = null;
|
|
||||||
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
return 'まずユーザー名を教えてください:';
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (this.temporaryUser == null) {
|
|
||||||
// Fetch user
|
|
||||||
const user: IUser = await User.findOne({
|
|
||||||
username_lower: query.toLowerCase()
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
data: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return `${query}というユーザーは存在しませんでした... もう一度教えてください:`;
|
|
||||||
} else {
|
|
||||||
this.temporaryUser = user;
|
|
||||||
this.emit('updated');
|
|
||||||
return `パスワードを教えてください:`;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Compare password
|
|
||||||
const same = await bcrypt.compare(query, this.temporaryUser.password);
|
|
||||||
|
|
||||||
if (same) {
|
|
||||||
this.bot.signin(this.temporaryUser);
|
|
||||||
this.bot.clearContext();
|
|
||||||
return `${this.temporaryUser.name}さん、おかえりなさい!`;
|
|
||||||
} else {
|
|
||||||
return `パスワードが違います... もう一度教えてください:`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'signin',
|
|
||||||
content: {
|
|
||||||
temporaryUser: this.temporaryUser
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new SigninContext(bot);
|
|
||||||
context.temporaryUser = data.temporaryUser;
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class PostContext extends Context {
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
return '内容:';
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
await require('../endpoints/posts/create')({
|
|
||||||
text: query
|
|
||||||
}, this.bot.user);
|
|
||||||
this.bot.clearContext();
|
|
||||||
return '投稿しましたよ!';
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'post'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new PostContext(bot);
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TlContext extends Context {
|
|
||||||
private next: string = null;
|
|
||||||
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
return await this.getTl();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (query == '次') {
|
|
||||||
return await this.getTl();
|
|
||||||
} else {
|
|
||||||
this.bot.clearContext();
|
|
||||||
return await this.bot.q(query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async getTl() {
|
|
||||||
const tl = await require('../endpoints/posts/timeline')({
|
|
||||||
limit: 5,
|
|
||||||
max_id: this.next ? this.next : undefined
|
|
||||||
}, this.bot.user);
|
|
||||||
|
|
||||||
if (tl.length > 0) {
|
|
||||||
this.next = tl[tl.length - 1].id;
|
|
||||||
this.emit('updated');
|
|
||||||
|
|
||||||
const text = tl
|
|
||||||
.map(post => `${post.user.name}\n「${getPostSummary(post)}」`)
|
|
||||||
.join('\n-----\n');
|
|
||||||
|
|
||||||
return text;
|
|
||||||
} else {
|
|
||||||
return 'タイムラインに表示するものがありません...';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'tl',
|
|
||||||
content: {
|
|
||||||
next: this.next,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new TlContext(bot);
|
|
||||||
context.next = data.next;
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class NotificationsContext extends Context {
|
|
||||||
private next: string = null;
|
|
||||||
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
return await this.getNotifications();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (query == '次') {
|
|
||||||
return await this.getNotifications();
|
|
||||||
} else {
|
|
||||||
this.bot.clearContext();
|
|
||||||
return await this.bot.q(query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async getNotifications() {
|
|
||||||
const notifications = await require('../endpoints/i/notifications')({
|
|
||||||
limit: 5,
|
|
||||||
max_id: this.next ? this.next : undefined
|
|
||||||
}, this.bot.user);
|
|
||||||
|
|
||||||
if (notifications.length > 0) {
|
|
||||||
this.next = notifications[notifications.length - 1].id;
|
|
||||||
this.emit('updated');
|
|
||||||
|
|
||||||
const text = notifications
|
|
||||||
.map(notification => getNotificationSummary(notification))
|
|
||||||
.join('\n-----\n');
|
|
||||||
|
|
||||||
return text;
|
|
||||||
} else {
|
|
||||||
return '通知はありません';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'notifications',
|
|
||||||
content: {
|
|
||||||
next: this.next,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new NotificationsContext(bot);
|
|
||||||
context.next = data.next;
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GuessingGameContext extends Context {
|
|
||||||
private secret: number;
|
|
||||||
private history: number[] = [];
|
|
||||||
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
this.secret = Math.floor(Math.random() * 100);
|
|
||||||
this.emit('updated');
|
|
||||||
return '0~100の秘密の数を当ててみてください:';
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (query == 'やめる') {
|
|
||||||
this.bot.clearContext();
|
|
||||||
return 'やめました。';
|
|
||||||
}
|
|
||||||
|
|
||||||
const guess = parseInt(query, 10);
|
|
||||||
|
|
||||||
if (isNaN(guess)) {
|
|
||||||
return '整数で推測してください。「やめる」と言うとゲームをやめます。';
|
|
||||||
}
|
|
||||||
|
|
||||||
const firsttime = this.history.indexOf(guess) === -1;
|
|
||||||
|
|
||||||
this.history.push(guess);
|
|
||||||
this.emit('updated');
|
|
||||||
|
|
||||||
if (this.secret < guess) {
|
|
||||||
return firsttime ? `${guess}よりも小さいですね` : `もう一度言いますが${guess}より小さいですよ`;
|
|
||||||
} else if (this.secret > guess) {
|
|
||||||
return firsttime ? `${guess}よりも大きいですね` : `もう一度言いますが${guess}より大きいですよ`;
|
|
||||||
} else {
|
|
||||||
this.bot.clearContext();
|
|
||||||
return `正解です🎉 (${this.history.length}回目で当てました)`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'guessing-game',
|
|
||||||
content: {
|
|
||||||
secret: this.secret,
|
|
||||||
history: this.history
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new GuessingGameContext(bot);
|
|
||||||
context.secret = data.secret;
|
|
||||||
context.history = data.history;
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OthelloContext extends Context {
|
|
||||||
private othello: Othello = null;
|
|
||||||
|
|
||||||
constructor(bot: BotCore) {
|
|
||||||
super(bot);
|
|
||||||
|
|
||||||
this.othello = new Othello();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async greet(): Promise<string> {
|
|
||||||
return this.othello.toPatternString('black');
|
|
||||||
}
|
|
||||||
|
|
||||||
public async q(query: string): Promise<string> {
|
|
||||||
if (query == 'やめる') {
|
|
||||||
this.bot.clearContext();
|
|
||||||
return 'オセロをやめました。';
|
|
||||||
}
|
|
||||||
|
|
||||||
const n = parseInt(query, 10);
|
|
||||||
|
|
||||||
if (isNaN(n)) {
|
|
||||||
return '番号で指定してください。「やめる」と言うとゲームをやめます。';
|
|
||||||
}
|
|
||||||
|
|
||||||
this.othello.setByNumber('black', n);
|
|
||||||
const s = this.othello.toString() + '\n\n...(AI)...\n\n';
|
|
||||||
othelloAi('white', this.othello);
|
|
||||||
if (this.othello.getPattern('black').length === 0) {
|
|
||||||
this.bot.clearContext();
|
|
||||||
const blackCount = this.othello.board.map(row => row.filter(s => s == 'black').length).reduce((a, b) => a + b);
|
|
||||||
const whiteCount = this.othello.board.map(row => row.filter(s => s == 'white').length).reduce((a, b) => a + b);
|
|
||||||
const winner = blackCount == whiteCount ? '引き分け' : blackCount > whiteCount ? '黒の勝ち' : '白の勝ち';
|
|
||||||
return this.othello.toString() + `\n\n~終了~\n\n黒${blackCount}、白${whiteCount}で${winner}です。`;
|
|
||||||
} else {
|
|
||||||
this.emit('updated');
|
|
||||||
return s + this.othello.toPatternString('black');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public export() {
|
|
||||||
return {
|
|
||||||
type: 'othello',
|
|
||||||
content: {
|
|
||||||
board: this.othello.board
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(bot: BotCore, data: any) {
|
|
||||||
const context = new OthelloContext(bot);
|
|
||||||
context.othello = new Othello();
|
|
||||||
context.othello.board = data.board;
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,236 +0,0 @@
|
|||||||
import * as EventEmitter from 'events';
|
|
||||||
import * as express from 'express';
|
|
||||||
import * as request from 'request';
|
|
||||||
import * as crypto from 'crypto';
|
|
||||||
import User from '../../models/user';
|
|
||||||
import config from '../../../conf';
|
|
||||||
import BotCore from '../core';
|
|
||||||
import _redis from '../../../db/redis';
|
|
||||||
import prominence = require('prominence');
|
|
||||||
import getPostSummary from '../../../common/get-post-summary';
|
|
||||||
|
|
||||||
const redis = prominence(_redis);
|
|
||||||
|
|
||||||
// SEE: https://developers.line.me/media/messaging-api/messages/sticker_list.pdf
|
|
||||||
const stickers = [
|
|
||||||
'297',
|
|
||||||
'298',
|
|
||||||
'299',
|
|
||||||
'300',
|
|
||||||
'301',
|
|
||||||
'302',
|
|
||||||
'303',
|
|
||||||
'304',
|
|
||||||
'305',
|
|
||||||
'306',
|
|
||||||
'307'
|
|
||||||
];
|
|
||||||
|
|
||||||
class LineBot extends BotCore {
|
|
||||||
private replyToken: string;
|
|
||||||
|
|
||||||
private reply(messages: any[]) {
|
|
||||||
request.post({
|
|
||||||
url: 'https://api.line.me/v2/bot/message/reply',
|
|
||||||
headers: {
|
|
||||||
'Authorization': `Bearer ${config.line_bot.channel_access_token}`
|
|
||||||
},
|
|
||||||
json: {
|
|
||||||
replyToken: this.replyToken,
|
|
||||||
messages: messages
|
|
||||||
}
|
|
||||||
}, (err, res, body) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public async react(ev: any): Promise<void> {
|
|
||||||
this.replyToken = ev.replyToken;
|
|
||||||
|
|
||||||
switch (ev.type) {
|
|
||||||
// メッセージ
|
|
||||||
case 'message':
|
|
||||||
switch (ev.message.type) {
|
|
||||||
// テキスト
|
|
||||||
case 'text':
|
|
||||||
const res = await this.q(ev.message.text);
|
|
||||||
if (res == null) return;
|
|
||||||
// 返信
|
|
||||||
this.reply([{
|
|
||||||
type: 'text',
|
|
||||||
text: res
|
|
||||||
}]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// スタンプ
|
|
||||||
case 'sticker':
|
|
||||||
// スタンプで返信
|
|
||||||
this.reply([{
|
|
||||||
type: 'sticker',
|
|
||||||
packageId: '4',
|
|
||||||
stickerId: stickers[Math.floor(Math.random() * stickers.length)]
|
|
||||||
}]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
// postback
|
|
||||||
case 'postback':
|
|
||||||
const data = ev.postback.data;
|
|
||||||
const cmd = data.split('|')[0];
|
|
||||||
const arg = data.split('|')[1];
|
|
||||||
switch (cmd) {
|
|
||||||
case 'showtl':
|
|
||||||
this.showUserTimelinePostback(arg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static import(data) {
|
|
||||||
const bot = new LineBot();
|
|
||||||
bot._import(data);
|
|
||||||
return bot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async showUserCommand(q: string) {
|
|
||||||
const user = await require('../../endpoints/users/show')({
|
|
||||||
username: q.substr(1)
|
|
||||||
}, this.user);
|
|
||||||
|
|
||||||
const actions = [];
|
|
||||||
|
|
||||||
actions.push({
|
|
||||||
type: 'postback',
|
|
||||||
label: 'タイムラインを見る',
|
|
||||||
data: `showtl|${user.id}`
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user.twitter) {
|
|
||||||
actions.push({
|
|
||||||
type: 'uri',
|
|
||||||
label: 'Twitterアカウントを見る',
|
|
||||||
uri: `https://twitter.com/${user.twitter.screen_name}`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
actions.push({
|
|
||||||
type: 'uri',
|
|
||||||
label: 'Webで見る',
|
|
||||||
uri: `${config.url}/${user.username}`
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reply([{
|
|
||||||
type: 'template',
|
|
||||||
altText: await super.showUserCommand(q),
|
|
||||||
template: {
|
|
||||||
type: 'buttons',
|
|
||||||
thumbnailImageUrl: `${user.avatar_url}?thumbnail&size=1024`,
|
|
||||||
title: `${user.name} (@${user.username})`,
|
|
||||||
text: user.description || '(no description)',
|
|
||||||
actions: actions
|
|
||||||
}
|
|
||||||
}]);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async showUserTimelinePostback(userId: string) {
|
|
||||||
const tl = await require('../../endpoints/users/posts')({
|
|
||||||
user_id: userId,
|
|
||||||
limit: 5
|
|
||||||
}, this.user);
|
|
||||||
|
|
||||||
const text = `${tl[0].user.name}さんのタイムラインはこちらです:\n\n` + tl
|
|
||||||
.map(post => getPostSummary(post))
|
|
||||||
.join('\n-----\n');
|
|
||||||
|
|
||||||
this.reply([{
|
|
||||||
type: 'text',
|
|
||||||
text: text
|
|
||||||
}]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = async (app: express.Application) => {
|
|
||||||
if (config.line_bot == null) return;
|
|
||||||
|
|
||||||
const handler = new EventEmitter();
|
|
||||||
|
|
||||||
handler.on('event', async (ev) => {
|
|
||||||
|
|
||||||
const sourceId = ev.source.userId;
|
|
||||||
const sessionId = `line-bot-sessions:${sourceId}`;
|
|
||||||
|
|
||||||
const session = await redis.get(sessionId);
|
|
||||||
let bot: LineBot;
|
|
||||||
|
|
||||||
if (session == null) {
|
|
||||||
const user = await User.findOne({
|
|
||||||
line: {
|
|
||||||
user_id: sourceId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bot = new LineBot(user);
|
|
||||||
|
|
||||||
bot.on('signin', user => {
|
|
||||||
User.update(user._id, {
|
|
||||||
$set: {
|
|
||||||
line: {
|
|
||||||
user_id: sourceId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on('signout', user => {
|
|
||||||
User.update(user._id, {
|
|
||||||
$set: {
|
|
||||||
line: {
|
|
||||||
user_id: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
redis.set(sessionId, JSON.stringify(bot.export()));
|
|
||||||
} else {
|
|
||||||
bot = LineBot.import(JSON.parse(session));
|
|
||||||
}
|
|
||||||
|
|
||||||
bot.on('updated', () => {
|
|
||||||
redis.set(sessionId, JSON.stringify(bot.export()));
|
|
||||||
});
|
|
||||||
|
|
||||||
if (session != null) bot.refreshUser();
|
|
||||||
|
|
||||||
bot.react(ev);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.post('/hooks/line', (req, res, next) => {
|
|
||||||
// req.headers['x-line-signature'] は常に string ですが、型定義の都合上
|
|
||||||
// string | string[] になっているので string を明示しています
|
|
||||||
const sig1 = req.headers['x-line-signature'] as string;
|
|
||||||
|
|
||||||
const hash = crypto.createHmac('SHA256', config.line_bot.channel_secret)
|
|
||||||
.update((req as any).rawBody);
|
|
||||||
|
|
||||||
const sig2 = hash.digest('base64');
|
|
||||||
|
|
||||||
// シグネチャ比較
|
|
||||||
if (sig1 === sig2) {
|
|
||||||
req.body.events.forEach(ev => {
|
|
||||||
handler.emit('event', ev);
|
|
||||||
});
|
|
||||||
|
|
||||||
res.sendStatus(200);
|
|
||||||
} else {
|
|
||||||
res.sendStatus(400);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,271 +0,0 @@
|
|||||||
import { Buffer } from 'buffer';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as tmp from 'tmp';
|
|
||||||
import * as stream from 'stream';
|
|
||||||
|
|
||||||
import * as mongodb from 'mongodb';
|
|
||||||
import * as crypto from 'crypto';
|
|
||||||
import * as _gm from 'gm';
|
|
||||||
import * as debug from 'debug';
|
|
||||||
import fileType = require('file-type');
|
|
||||||
import prominence = require('prominence');
|
|
||||||
|
|
||||||
import DriveFile, { getGridFSBucket } from '../models/drive-file';
|
|
||||||
import DriveFolder from '../models/drive-folder';
|
|
||||||
import serialize from '../serializers/drive-file';
|
|
||||||
import event, { publishDriveStream } from '../event';
|
|
||||||
import config from '../../conf';
|
|
||||||
|
|
||||||
const gm = _gm.subClass({
|
|
||||||
imageMagick: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const log = debug('misskey:register-drive-file');
|
|
||||||
|
|
||||||
const tmpFile = (): Promise<string> => new Promise((resolve, reject) => {
|
|
||||||
tmp.file((e, path) => {
|
|
||||||
if (e) return reject(e);
|
|
||||||
resolve(path);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const addToGridFS = (name: string, readable: stream.Readable, type: string, metadata: any): Promise<any> =>
|
|
||||||
getGridFSBucket()
|
|
||||||
.then(bucket => new Promise((resolve, reject) => {
|
|
||||||
const writeStream = bucket.openUploadStream(name, { contentType: type, metadata });
|
|
||||||
writeStream.once('finish', (doc) => { resolve(doc); });
|
|
||||||
writeStream.on('error', reject);
|
|
||||||
readable.pipe(writeStream);
|
|
||||||
}));
|
|
||||||
|
|
||||||
const addFile = async (
|
|
||||||
user: any,
|
|
||||||
path: string,
|
|
||||||
name: string = null,
|
|
||||||
comment: string = null,
|
|
||||||
folderId: mongodb.ObjectID = null,
|
|
||||||
force: boolean = false
|
|
||||||
) => {
|
|
||||||
log(`registering ${name} (user: ${user.username}, path: ${path})`);
|
|
||||||
|
|
||||||
// Calculate hash, get content type and get file size
|
|
||||||
const [hash, [mime, ext], size] = await Promise.all([
|
|
||||||
// hash
|
|
||||||
((): Promise<string> => new Promise((res, rej) => {
|
|
||||||
const readable = fs.createReadStream(path);
|
|
||||||
const hash = crypto.createHash('md5');
|
|
||||||
const chunks = [];
|
|
||||||
readable
|
|
||||||
.on('error', rej)
|
|
||||||
.pipe(hash)
|
|
||||||
.on('error', rej)
|
|
||||||
.on('data', (chunk) => chunks.push(chunk))
|
|
||||||
.on('end', () => {
|
|
||||||
const buffer = Buffer.concat(chunks);
|
|
||||||
res(buffer.toString('hex'));
|
|
||||||
});
|
|
||||||
}))(),
|
|
||||||
// mime
|
|
||||||
((): Promise<[string, string | null]> => new Promise((res, rej) => {
|
|
||||||
const readable = fs.createReadStream(path);
|
|
||||||
readable
|
|
||||||
.on('error', rej)
|
|
||||||
.once('data', (buffer: Buffer) => {
|
|
||||||
readable.destroy();
|
|
||||||
const type = fileType(buffer);
|
|
||||||
if (type) {
|
|
||||||
return res([type.mime, type.ext]);
|
|
||||||
} else {
|
|
||||||
// 種類が同定できなかったら application/octet-stream にする
|
|
||||||
return res(['application/octet-stream', null]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}))(),
|
|
||||||
// size
|
|
||||||
((): Promise<number> => new Promise((res, rej) => {
|
|
||||||
fs.stat(path, (err, stats) => {
|
|
||||||
if (err) return rej(err);
|
|
||||||
res(stats.size);
|
|
||||||
});
|
|
||||||
}))()
|
|
||||||
]);
|
|
||||||
|
|
||||||
log(`hash: ${hash}, mime: ${mime}, ext: ${ext}, size: ${size}`);
|
|
||||||
|
|
||||||
// detect name
|
|
||||||
const detectedName: string = name || (ext ? `untitled.${ext}` : 'untitled');
|
|
||||||
|
|
||||||
if (!force) {
|
|
||||||
// Check if there is a file with the same hash
|
|
||||||
const much = await DriveFile.findOne({
|
|
||||||
md5: hash,
|
|
||||||
'metadata.user_id': user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (much !== null) {
|
|
||||||
log('file with same hash is found');
|
|
||||||
return much;
|
|
||||||
} else {
|
|
||||||
log('file with same hash is not found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const [wh, folder] = await Promise.all([
|
|
||||||
// Width and height (when image)
|
|
||||||
(async () => {
|
|
||||||
// 画像かどうか
|
|
||||||
if (!/^image\/.*$/.test(mime)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const imageType = mime.split('/')[1];
|
|
||||||
|
|
||||||
// 画像でもPNGかJPEGかGIFでないならスキップ
|
|
||||||
if (imageType != 'png' && imageType != 'jpeg' && imageType != 'gif') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate width and height
|
|
||||||
const g = gm(fs.createReadStream(path), name);
|
|
||||||
const size = await prominence(g).size();
|
|
||||||
|
|
||||||
log('image width and height is calculated');
|
|
||||||
|
|
||||||
return [size.width, size.height];
|
|
||||||
})(),
|
|
||||||
// folder
|
|
||||||
(async () => {
|
|
||||||
if (!folderId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const driveFolder = await DriveFolder.findOne({
|
|
||||||
_id: folderId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
if (!driveFolder) {
|
|
||||||
throw 'folder-not-found';
|
|
||||||
}
|
|
||||||
return driveFolder;
|
|
||||||
})(),
|
|
||||||
// usage checker
|
|
||||||
(async () => {
|
|
||||||
// Calculate drive usage
|
|
||||||
const usage = await DriveFile
|
|
||||||
.aggregate([{
|
|
||||||
$match: { 'metadata.user_id': user._id }
|
|
||||||
}, {
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}])
|
|
||||||
.then((aggregates: any[]) => {
|
|
||||||
if (aggregates.length > 0) {
|
|
||||||
return aggregates[0].usage;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
log(`drive usage is ${usage}`);
|
|
||||||
|
|
||||||
// If usage limit exceeded
|
|
||||||
if (usage + size > user.drive_capacity) {
|
|
||||||
throw 'no-free-space';
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
]);
|
|
||||||
|
|
||||||
const readable = fs.createReadStream(path);
|
|
||||||
|
|
||||||
const properties = {};
|
|
||||||
|
|
||||||
if (wh) {
|
|
||||||
properties['width'] = wh[0];
|
|
||||||
properties['height'] = wh[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return addToGridFS(detectedName, readable, mime, {
|
|
||||||
user_id: user._id,
|
|
||||||
folder_id: folder !== null ? folder._id : null,
|
|
||||||
comment: comment,
|
|
||||||
properties: properties
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add file to drive
|
|
||||||
*
|
|
||||||
* @param user User who wish to add file
|
|
||||||
* @param file File path or readableStream
|
|
||||||
* @param comment Comment
|
|
||||||
* @param type File type
|
|
||||||
* @param folderId Folder ID
|
|
||||||
* @param force If set to true, forcibly upload the file even if there is a file with the same hash.
|
|
||||||
* @return Object that represents added file
|
|
||||||
*/
|
|
||||||
export default (user: any, file: string | stream.Readable, ...args) => new Promise<any>((resolve, reject) => {
|
|
||||||
// Get file path
|
|
||||||
new Promise((res: (v: [string, boolean]) => void, rej) => {
|
|
||||||
if (typeof file === 'string') {
|
|
||||||
res([file, false]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof file === 'object' && typeof file.read === 'function') {
|
|
||||||
tmpFile()
|
|
||||||
.then(path => {
|
|
||||||
const readable: stream.Readable = file;
|
|
||||||
const writable = fs.createWriteStream(path);
|
|
||||||
readable
|
|
||||||
.on('error', rej)
|
|
||||||
.on('end', () => {
|
|
||||||
res([path, true]);
|
|
||||||
})
|
|
||||||
.pipe(writable)
|
|
||||||
.on('error', rej);
|
|
||||||
})
|
|
||||||
.catch(rej);
|
|
||||||
}
|
|
||||||
rej(new Error('un-compatible file.'));
|
|
||||||
})
|
|
||||||
.then(([path, remove]): Promise<any> => new Promise((res, rej) => {
|
|
||||||
addFile(user, path, ...args)
|
|
||||||
.then(file => {
|
|
||||||
res(file);
|
|
||||||
if (remove) {
|
|
||||||
fs.unlink(path, (e) => {
|
|
||||||
if (e) log(e.stack);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(rej);
|
|
||||||
}))
|
|
||||||
.then(file => {
|
|
||||||
log(`drive file has been created ${file._id}`);
|
|
||||||
resolve(file);
|
|
||||||
|
|
||||||
serialize(file).then(serializedFile => {
|
|
||||||
// Publish drive_file_created event
|
|
||||||
event(user._id, 'drive_file_created', serializedFile);
|
|
||||||
publishDriveStream(user._id, 'file_created', serializedFile);
|
|
||||||
|
|
||||||
// Register to search database
|
|
||||||
if (config.elasticsearch.enable) {
|
|
||||||
const es = require('../../db/elasticsearch');
|
|
||||||
es.index({
|
|
||||||
index: 'misskey',
|
|
||||||
type: 'drive_file',
|
|
||||||
id: file._id.toString(),
|
|
||||||
body: {
|
|
||||||
name: file.name,
|
|
||||||
user_id: user._id.toString()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(reject);
|
|
||||||
});
|
|
@ -1,26 +0,0 @@
|
|||||||
import * as mongodb from 'mongodb';
|
|
||||||
import Following from '../models/following';
|
|
||||||
|
|
||||||
export default async (me: mongodb.ObjectID, includeMe: boolean = true) => {
|
|
||||||
// Fetch relation to other users who the I follows
|
|
||||||
// SELECT followee
|
|
||||||
const myfollowing = await Following
|
|
||||||
.find({
|
|
||||||
follower_id: me,
|
|
||||||
// 削除されたドキュメントは除く
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
followee_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// ID list of other users who the I follows
|
|
||||||
const myfollowingIds = myfollowing.map(follow => follow.followee_id);
|
|
||||||
|
|
||||||
if (includeMe) {
|
|
||||||
myfollowingIds.push(me);
|
|
||||||
}
|
|
||||||
|
|
||||||
return myfollowingIds;
|
|
||||||
};
|
|
@ -1,38 +0,0 @@
|
|||||||
import * as mongo from 'mongodb';
|
|
||||||
import Notification from '../models/notification';
|
|
||||||
import event from '../event';
|
|
||||||
import serialize from '../serializers/notification';
|
|
||||||
|
|
||||||
export default (
|
|
||||||
notifiee: mongo.ObjectID,
|
|
||||||
notifier: mongo.ObjectID,
|
|
||||||
type: string,
|
|
||||||
content?: any
|
|
||||||
) => new Promise<any>(async (resolve, reject) => {
|
|
||||||
if (notifiee.equals(notifier)) {
|
|
||||||
return resolve();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create notification
|
|
||||||
const notification = await Notification.insert(Object.assign({
|
|
||||||
created_at: new Date(),
|
|
||||||
notifiee_id: notifiee,
|
|
||||||
notifier_id: notifier,
|
|
||||||
type: type,
|
|
||||||
is_read: false
|
|
||||||
}, content));
|
|
||||||
|
|
||||||
resolve(notification);
|
|
||||||
|
|
||||||
// Publish notification event
|
|
||||||
event(notifiee, 'notification',
|
|
||||||
await serialize(notification));
|
|
||||||
|
|
||||||
// 3秒経っても(今回作成した)通知が既読にならなかったら「未読の通知がありますよ」イベントを発行する
|
|
||||||
setTimeout(async () => {
|
|
||||||
const fresh = await Notification.findOne({ _id: notification._id }, { is_read: true });
|
|
||||||
if (!fresh.is_read) {
|
|
||||||
event(notifiee, 'unread_notification', await serialize(notification));
|
|
||||||
}
|
|
||||||
}, 3000);
|
|
||||||
});
|
|
@ -1,52 +0,0 @@
|
|||||||
const push = require('web-push');
|
|
||||||
import * as mongo from 'mongodb';
|
|
||||||
import Subscription from '../models/sw-subscription';
|
|
||||||
import config from '../../conf';
|
|
||||||
|
|
||||||
if (config.sw) {
|
|
||||||
// アプリケーションの連絡先と、サーバーサイドの鍵ペアの情報を登録
|
|
||||||
push.setVapidDetails(
|
|
||||||
config.maintainer.url,
|
|
||||||
config.sw.public_key,
|
|
||||||
config.sw.private_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function(userId: mongo.ObjectID | string, type, body?) {
|
|
||||||
if (!config.sw) return;
|
|
||||||
|
|
||||||
if (typeof userId === 'string') {
|
|
||||||
userId = new mongo.ObjectID(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch
|
|
||||||
const subscriptions = await Subscription.find({
|
|
||||||
user_id: userId
|
|
||||||
});
|
|
||||||
|
|
||||||
subscriptions.forEach(subscription => {
|
|
||||||
const pushSubscription = {
|
|
||||||
endpoint: subscription.endpoint,
|
|
||||||
keys: {
|
|
||||||
auth: subscription.auth,
|
|
||||||
p256dh: subscription.publickey
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
push.sendNotification(pushSubscription, JSON.stringify({
|
|
||||||
type, body
|
|
||||||
})).catch(err => {
|
|
||||||
//console.log(err.statusCode);
|
|
||||||
//console.log(err.headers);
|
|
||||||
//console.log(err.body);
|
|
||||||
|
|
||||||
if (err.statusCode == 410) {
|
|
||||||
Subscription.remove({
|
|
||||||
user_id: userId,
|
|
||||||
endpoint: subscription.endpoint,
|
|
||||||
auth: subscription.auth,
|
|
||||||
publickey: subscription.publickey
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
import * as mongo from 'mongodb';
|
|
||||||
import Message from '../models/messaging-message';
|
|
||||||
import { IMessagingMessage as IMessage } from '../models/messaging-message';
|
|
||||||
import publishUserStream from '../event';
|
|
||||||
import { publishMessagingStream } from '../event';
|
|
||||||
import { publishMessagingIndexStream } from '../event';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mark as read message(s)
|
|
||||||
*/
|
|
||||||
export default (
|
|
||||||
user: string | mongo.ObjectID,
|
|
||||||
otherparty: string | mongo.ObjectID,
|
|
||||||
message: string | string[] | IMessage | IMessage[] | mongo.ObjectID | mongo.ObjectID[]
|
|
||||||
) => new Promise<any>(async (resolve, reject) => {
|
|
||||||
|
|
||||||
const userId = mongo.ObjectID.prototype.isPrototypeOf(user)
|
|
||||||
? user
|
|
||||||
: new mongo.ObjectID(user);
|
|
||||||
|
|
||||||
const otherpartyId = mongo.ObjectID.prototype.isPrototypeOf(otherparty)
|
|
||||||
? otherparty
|
|
||||||
: new mongo.ObjectID(otherparty);
|
|
||||||
|
|
||||||
const ids: mongo.ObjectID[] = Array.isArray(message)
|
|
||||||
? mongo.ObjectID.prototype.isPrototypeOf(message[0])
|
|
||||||
? (message as mongo.ObjectID[])
|
|
||||||
: typeof message[0] === 'string'
|
|
||||||
? (message as string[]).map(m => new mongo.ObjectID(m))
|
|
||||||
: (message as IMessage[]).map(m => m._id)
|
|
||||||
: mongo.ObjectID.prototype.isPrototypeOf(message)
|
|
||||||
? [(message as mongo.ObjectID)]
|
|
||||||
: typeof message === 'string'
|
|
||||||
? [new mongo.ObjectID(message)]
|
|
||||||
: [(message as IMessage)._id];
|
|
||||||
|
|
||||||
// Update documents
|
|
||||||
await Message.update({
|
|
||||||
_id: { $in: ids },
|
|
||||||
user_id: otherpartyId,
|
|
||||||
recipient_id: userId,
|
|
||||||
is_read: false
|
|
||||||
}, {
|
|
||||||
$set: {
|
|
||||||
is_read: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
multi: true
|
|
||||||
});
|
|
||||||
|
|
||||||
// Publish event
|
|
||||||
publishMessagingStream(otherpartyId, userId, 'read', ids.map(id => id.toString()));
|
|
||||||
publishMessagingIndexStream(userId, 'read', ids.map(id => id.toString()));
|
|
||||||
|
|
||||||
// Calc count of my unread messages
|
|
||||||
const count = await Message
|
|
||||||
.count({
|
|
||||||
recipient_id: userId,
|
|
||||||
is_read: false
|
|
||||||
});
|
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
// 全ての(いままで未読だった)自分宛てのメッセージを(これで)読みましたよというイベントを発行
|
|
||||||
publishUserStream(userId, 'read_all_messaging_messages');
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,52 +0,0 @@
|
|||||||
import * as mongo from 'mongodb';
|
|
||||||
import { default as Notification, INotification } from '../models/notification';
|
|
||||||
import publishUserStream from '../event';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mark as read notification(s)
|
|
||||||
*/
|
|
||||||
export default (
|
|
||||||
user: string | mongo.ObjectID,
|
|
||||||
message: string | string[] | INotification | INotification[] | mongo.ObjectID | mongo.ObjectID[]
|
|
||||||
) => new Promise<any>(async (resolve, reject) => {
|
|
||||||
|
|
||||||
const userId = mongo.ObjectID.prototype.isPrototypeOf(user)
|
|
||||||
? user
|
|
||||||
: new mongo.ObjectID(user);
|
|
||||||
|
|
||||||
const ids: mongo.ObjectID[] = Array.isArray(message)
|
|
||||||
? mongo.ObjectID.prototype.isPrototypeOf(message[0])
|
|
||||||
? (message as mongo.ObjectID[])
|
|
||||||
: typeof message[0] === 'string'
|
|
||||||
? (message as string[]).map(m => new mongo.ObjectID(m))
|
|
||||||
: (message as INotification[]).map(m => m._id)
|
|
||||||
: mongo.ObjectID.prototype.isPrototypeOf(message)
|
|
||||||
? [(message as mongo.ObjectID)]
|
|
||||||
: typeof message === 'string'
|
|
||||||
? [new mongo.ObjectID(message)]
|
|
||||||
: [(message as INotification)._id];
|
|
||||||
|
|
||||||
// Update documents
|
|
||||||
await Notification.update({
|
|
||||||
_id: { $in: ids },
|
|
||||||
is_read: false
|
|
||||||
}, {
|
|
||||||
$set: {
|
|
||||||
is_read: true
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
multi: true
|
|
||||||
});
|
|
||||||
|
|
||||||
// Calc count of my unread notifications
|
|
||||||
const count = await Notification
|
|
||||||
.count({
|
|
||||||
notifiee_id: userId,
|
|
||||||
is_read: false
|
|
||||||
});
|
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
// 全ての(いままで未読だった)通知を(これで)読みましたよというイベントを発行
|
|
||||||
publishUserStream(userId, 'read_all_notifications');
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,19 +0,0 @@
|
|||||||
import config from '../../conf';
|
|
||||||
|
|
||||||
export default function(res, user, redirect: boolean) {
|
|
||||||
const expires = 1000 * 60 * 60 * 24 * 365; // One Year
|
|
||||||
res.cookie('i', user.token, {
|
|
||||||
path: '/',
|
|
||||||
domain: `.${config.host}`,
|
|
||||||
secure: config.url.substr(0, 5) === 'https',
|
|
||||||
httpOnly: false,
|
|
||||||
expires: new Date(Date.now() + expires),
|
|
||||||
maxAge: expires
|
|
||||||
});
|
|
||||||
|
|
||||||
if (redirect) {
|
|
||||||
res.redirect(config.url);
|
|
||||||
} else {
|
|
||||||
res.sendStatus(204);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* Mention
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = text => {
|
|
||||||
const match = text.match(/^@[a-zA-Z0-9\-]+/);
|
|
||||||
if (!match) return null;
|
|
||||||
const mention = match[0];
|
|
||||||
return {
|
|
||||||
type: 'mention',
|
|
||||||
content: mention,
|
|
||||||
username: mention.substr(1)
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,71 +0,0 @@
|
|||||||
/**
|
|
||||||
* Misskey Text Analyzer
|
|
||||||
*/
|
|
||||||
|
|
||||||
const elements = [
|
|
||||||
require('./elements/bold'),
|
|
||||||
require('./elements/url'),
|
|
||||||
require('./elements/link'),
|
|
||||||
require('./elements/mention'),
|
|
||||||
require('./elements/hashtag'),
|
|
||||||
require('./elements/code'),
|
|
||||||
require('./elements/inline-code'),
|
|
||||||
require('./elements/emoji')
|
|
||||||
];
|
|
||||||
|
|
||||||
export default (source: string) => {
|
|
||||||
|
|
||||||
if (source == '') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tokens = [];
|
|
||||||
|
|
||||||
function push(token) {
|
|
||||||
if (token != null) {
|
|
||||||
tokens.push(token);
|
|
||||||
source = source.substr(token.content.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let i = 0;
|
|
||||||
|
|
||||||
// パース
|
|
||||||
while (source != '') {
|
|
||||||
const parsed = elements.some(el => {
|
|
||||||
let tokens = el(source, i);
|
|
||||||
if (tokens) {
|
|
||||||
if (!Array.isArray(tokens)) {
|
|
||||||
tokens = [tokens];
|
|
||||||
}
|
|
||||||
tokens.forEach(push);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!parsed) {
|
|
||||||
push({
|
|
||||||
type: 'text',
|
|
||||||
content: source[0]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// テキストを纏める
|
|
||||||
tokens[0] = [tokens[0]];
|
|
||||||
return tokens.reduce((a, b) => {
|
|
||||||
if (a[a.length - 1].type == 'text' && b.type == 'text') {
|
|
||||||
const tail = a.pop();
|
|
||||||
return a.concat({
|
|
||||||
type: 'text',
|
|
||||||
content: tail.content + b.content
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return a.concat(b);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,26 +0,0 @@
|
|||||||
import * as mongodb from 'mongodb';
|
|
||||||
import Watching from '../models/post-watching';
|
|
||||||
|
|
||||||
export default async (me: mongodb.ObjectID, post: object) => {
|
|
||||||
// 自分の投稿はwatchできない
|
|
||||||
if (me.equals((post as any).user_id)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if watching now
|
|
||||||
const exist = await Watching.findOne({
|
|
||||||
post_id: (post as any)._id,
|
|
||||||
user_id: me,
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist !== null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await Watching.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
post_id: (post as any)._id,
|
|
||||||
user_id: me
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,533 +0,0 @@
|
|||||||
const ms = require('ms');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* エンドポイントを表します。
|
|
||||||
*/
|
|
||||||
export type Endpoint = {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* エンドポイント名
|
|
||||||
*/
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* このエンドポイントにリクエストするのにユーザー情報が必須か否か
|
|
||||||
* 省略した場合は false として解釈されます。
|
|
||||||
*/
|
|
||||||
withCredential?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* エンドポイントのリミテーションに関するやつ
|
|
||||||
* 省略した場合はリミテーションは無いものとして解釈されます。
|
|
||||||
* また、withCredential が false の場合はリミテーションを行うことはできません。
|
|
||||||
*/
|
|
||||||
limit?: {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 複数のエンドポイントでリミットを共有したい場合に指定するキー
|
|
||||||
*/
|
|
||||||
key?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* リミットを適用する期間(ms)
|
|
||||||
* このプロパティを設定する場合、max プロパティも設定する必要があります。
|
|
||||||
*/
|
|
||||||
duration?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* durationで指定した期間内にいくつまでリクエストできるのか
|
|
||||||
* このプロパティを設定する場合、duration プロパティも設定する必要があります。
|
|
||||||
*/
|
|
||||||
max?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最低でもどれくらいの間隔を開けてリクエストしなければならないか(ms)
|
|
||||||
*/
|
|
||||||
minInterval?: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ファイルの添付を必要とするか否か
|
|
||||||
* 省略した場合は false として解釈されます。
|
|
||||||
*/
|
|
||||||
withFile?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* サードパーティアプリからはリクエストすることができないか否か
|
|
||||||
* 省略した場合は false として解釈されます。
|
|
||||||
*/
|
|
||||||
secure?: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* エンドポイントの種類
|
|
||||||
* パーミッションの実現に利用されます。
|
|
||||||
*/
|
|
||||||
kind?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const endpoints: Endpoint[] = [
|
|
||||||
{
|
|
||||||
name: 'meta'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'stats'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'username/available'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'my/apps',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'app/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1day'),
|
|
||||||
max: 3
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'app/show'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'app/name_id/available'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'auth/session/generate'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'auth/session/show'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'auth/session/userkey'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'auth/accept',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'auth/deny',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/posts',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users/activity',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users/post',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users/followers'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users/following'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/users/reaction'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/posts/repost'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/posts/reply'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/posts/reaction'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'aggregation/posts/reactions'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'sw/register',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'i',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/2fa/register',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/2fa/unregister',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/2fa/done',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/update',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1day'),
|
|
||||||
max: 50
|
|
||||||
},
|
|
||||||
kind: 'account-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/update_home',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'account-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/change_password',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/regenerate_token',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/pin',
|
|
||||||
kind: 'account-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/appdata/get',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/appdata/set',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/signin_history',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'account-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'i/authorized_apps',
|
|
||||||
withCredential: true,
|
|
||||||
secure: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'i/notifications',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'notification-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'notifications/get_unread_count',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'notification-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'notifications/delete',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'notification-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'notifications/delete_all',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'notification-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'notifications/mark_as_read_all',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'notification-write'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'drive',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/stream',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
withFile: true,
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/upload_from_url',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 10
|
|
||||||
},
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/show',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/find',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/delete',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/files/update',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/folders',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/folders/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 50
|
|
||||||
},
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/folders/show',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/folders/find',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'drive/folders/update',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'drive-write'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'users'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/show'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/search'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/search_by_username'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/posts'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/following'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/followers'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/recommendation',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'account-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'users/get_frequently_replied_users'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'following/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'following-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'following/delete',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'following-write'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'posts'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/show'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/replies'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/context'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 120,
|
|
||||||
minInterval: ms('1second')
|
|
||||||
},
|
|
||||||
kind: 'post-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/reposts'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/search'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/timeline',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('10minutes'),
|
|
||||||
max: 100
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/mentions',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('10minutes'),
|
|
||||||
max: 100
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/trend',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/categorize',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/reactions',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/reactions/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'reaction-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/reactions/delete',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'reaction-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/favorites/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'favorite-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/favorites/delete',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'favorite-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/polls/vote',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 100
|
|
||||||
},
|
|
||||||
kind: 'vote-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'posts/polls/recommendation',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'messaging/history',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'messaging-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'messaging/unread',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'messaging-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'messaging/messages',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'messaging-read'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'messaging/messages/create',
|
|
||||||
withCredential: true,
|
|
||||||
kind: 'messaging-write'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels/create',
|
|
||||||
withCredential: true,
|
|
||||||
limit: {
|
|
||||||
duration: ms('1hour'),
|
|
||||||
max: 3,
|
|
||||||
minInterval: ms('10seconds')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels/show'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels/posts'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels/watch',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels/unwatch',
|
|
||||||
withCredential: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'channels'
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default endpoints;
|
|
@ -1,90 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Post from '../../models/post';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate posts
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = params => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
const datas = await Post
|
|
||||||
.aggregate([
|
|
||||||
{ $project: {
|
|
||||||
repost_id: '$repost_id',
|
|
||||||
reply_id: '$reply_id',
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$repost_id', null] },
|
|
||||||
then: 'repost',
|
|
||||||
else: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$reply_id', null] },
|
|
||||||
then: 'reply',
|
|
||||||
else: 'post'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
{ $group: { _id: {
|
|
||||||
date: '$date',
|
|
||||||
type: '$type'
|
|
||||||
}, count: { $sum: 1 } } },
|
|
||||||
{ $group: {
|
|
||||||
_id: '$_id.date',
|
|
||||||
data: { $addToSet: {
|
|
||||||
type: '$_id.type',
|
|
||||||
count: '$count'
|
|
||||||
}}
|
|
||||||
} }
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
|
|
||||||
data.posts = (data.data.filter(x => x.type == 'post')[0] || { count: 0 }).count;
|
|
||||||
data.reposts = (data.data.filter(x => x.type == 'repost')[0] || { count: 0 }).count;
|
|
||||||
data.replies = (data.data.filter(x => x.type == 'reply')[0] || { count: 0 }).count;
|
|
||||||
|
|
||||||
delete data.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
posts: 0,
|
|
||||||
reposts: 0,
|
|
||||||
replies: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,76 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
import Reaction from '../../../models/post-reaction';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate reaction of a post
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'post_id' parameter
|
|
||||||
const [postId, postIdErr] = $(params.post_id).id().$;
|
|
||||||
if (postIdErr) return rej('invalid post_id param');
|
|
||||||
|
|
||||||
// Lookup post
|
|
||||||
const post = await Post.findOne({
|
|
||||||
_id: postId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (post === null) {
|
|
||||||
return rej('post not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Reaction
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { post_id: post._id } },
|
|
||||||
{ $project: {
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
{ $group: {
|
|
||||||
_id: '$date',
|
|
||||||
count: { $sum: 1 }
|
|
||||||
}}
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,69 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
import Reaction from '../../../models/post-reaction';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate reactions of a post
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'post_id' parameter
|
|
||||||
const [postId, postIdErr] = $(params.post_id).id().$;
|
|
||||||
if (postIdErr) return rej('invalid post_id param');
|
|
||||||
|
|
||||||
// Lookup post
|
|
||||||
const post = await Post.findOne({
|
|
||||||
_id: postId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (post === null) {
|
|
||||||
return rej('post not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const startTime = new Date(new Date().setMonth(new Date().getMonth() - 1));
|
|
||||||
|
|
||||||
const reactions = await Reaction
|
|
||||||
.find({
|
|
||||||
post_id: post._id,
|
|
||||||
$or: [
|
|
||||||
{ deleted_at: { $exists: false } },
|
|
||||||
{ deleted_at: { $gt: startTime } }
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
_id: false,
|
|
||||||
post_id: false
|
|
||||||
}, {
|
|
||||||
sort: { created_at: -1 }
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
let day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
day = new Date(day.setMilliseconds(999));
|
|
||||||
day = new Date(day.setSeconds(59));
|
|
||||||
day = new Date(day.setMinutes(59));
|
|
||||||
day = new Date(day.setHours(23));
|
|
||||||
// day = day.getTime();
|
|
||||||
|
|
||||||
const count = reactions.filter(r =>
|
|
||||||
r.created_at < day && (r.deleted_at == null || r.deleted_at > day)
|
|
||||||
).length;
|
|
||||||
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: count
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate reply of a post
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'post_id' parameter
|
|
||||||
const [postId, postIdErr] = $(params.post_id).id().$;
|
|
||||||
if (postIdErr) return rej('invalid post_id param');
|
|
||||||
|
|
||||||
// Lookup post
|
|
||||||
const post = await Post.findOne({
|
|
||||||
_id: postId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (post === null) {
|
|
||||||
return rej('post not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Post
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { reply: post._id } },
|
|
||||||
{ $project: {
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
{ $group: {
|
|
||||||
_id: '$date',
|
|
||||||
count: { $sum: 1 }
|
|
||||||
}}
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,75 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate repost of a post
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'post_id' parameter
|
|
||||||
const [postId, postIdErr] = $(params.post_id).id().$;
|
|
||||||
if (postIdErr) return rej('invalid post_id param');
|
|
||||||
|
|
||||||
// Lookup post
|
|
||||||
const post = await Post.findOne({
|
|
||||||
_id: postId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (post === null) {
|
|
||||||
return rej('post not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Post
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { repost_id: post._id } },
|
|
||||||
{ $project: {
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
{ $group: {
|
|
||||||
_id: '$date',
|
|
||||||
count: { $sum: 1 }
|
|
||||||
}}
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,58 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../models/user';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate users
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = params => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
const users = await User
|
|
||||||
.find({}, {
|
|
||||||
_id: false,
|
|
||||||
created_at: true,
|
|
||||||
deleted_at: true
|
|
||||||
}, {
|
|
||||||
sort: { created_at: -1 }
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
let dayStart = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
dayStart = new Date(dayStart.setMilliseconds(0));
|
|
||||||
dayStart = new Date(dayStart.setSeconds(0));
|
|
||||||
dayStart = new Date(dayStart.setMinutes(0));
|
|
||||||
dayStart = new Date(dayStart.setHours(0));
|
|
||||||
|
|
||||||
let dayEnd = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
dayEnd = new Date(dayEnd.setMilliseconds(999));
|
|
||||||
dayEnd = new Date(dayEnd.setSeconds(59));
|
|
||||||
dayEnd = new Date(dayEnd.setMinutes(59));
|
|
||||||
dayEnd = new Date(dayEnd.setHours(23));
|
|
||||||
// day = day.getTime();
|
|
||||||
|
|
||||||
const total = users.filter(u =>
|
|
||||||
u.created_at < dayEnd && (u.deleted_at == null || u.deleted_at > dayEnd)
|
|
||||||
).length;
|
|
||||||
|
|
||||||
const created = users.filter(u =>
|
|
||||||
u.created_at < dayEnd && u.created_at > dayStart
|
|
||||||
).length;
|
|
||||||
|
|
||||||
graph.push({
|
|
||||||
total: total,
|
|
||||||
created: created
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,116 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
|
|
||||||
// TODO: likeやfollowも集計
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate activity of a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 365, limitErr] = $(params.limit).optional.number().range(1, 365).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Lookup user
|
|
||||||
const user = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Post
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { user_id: user._id } },
|
|
||||||
{ $project: {
|
|
||||||
repost_id: '$repost_id',
|
|
||||||
reply_id: '$reply_id',
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$repost_id', null] },
|
|
||||||
then: 'repost',
|
|
||||||
else: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$reply_id', null] },
|
|
||||||
then: 'reply',
|
|
||||||
else: 'post'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
{ $group: { _id: {
|
|
||||||
date: '$date',
|
|
||||||
type: '$type'
|
|
||||||
}, count: { $sum: 1 } } },
|
|
||||||
{ $group: {
|
|
||||||
_id: '$_id.date',
|
|
||||||
data: { $addToSet: {
|
|
||||||
type: '$_id.type',
|
|
||||||
count: '$count'
|
|
||||||
}}
|
|
||||||
} }
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
|
|
||||||
data.posts = (data.data.filter(x => x.type == 'post')[0] || { count: 0 }).count;
|
|
||||||
data.reposts = (data.data.filter(x => x.type == 'repost')[0] || { count: 0 }).count;
|
|
||||||
data.replies = (data.data.filter(x => x.type == 'reply')[0] || { count: 0 }).count;
|
|
||||||
|
|
||||||
delete data.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < limit; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
posts: 0,
|
|
||||||
reposts: 0,
|
|
||||||
replies: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,74 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
import Following from '../../../models/following';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate followers of a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Lookup user
|
|
||||||
const user = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const startTime = new Date(new Date().setMonth(new Date().getMonth() - 1));
|
|
||||||
|
|
||||||
const following = await Following
|
|
||||||
.find({
|
|
||||||
followee_id: user._id,
|
|
||||||
$or: [
|
|
||||||
{ deleted_at: { $exists: false } },
|
|
||||||
{ deleted_at: { $gt: startTime } }
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
_id: false,
|
|
||||||
follower_id: false,
|
|
||||||
followee_id: false
|
|
||||||
}, {
|
|
||||||
sort: { created_at: -1 }
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
let day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
day = new Date(day.setMilliseconds(999));
|
|
||||||
day = new Date(day.setSeconds(59));
|
|
||||||
day = new Date(day.setMinutes(59));
|
|
||||||
day = new Date(day.setHours(23));
|
|
||||||
// day = day.getTime();
|
|
||||||
|
|
||||||
const count = following.filter(f =>
|
|
||||||
f.created_at < day && (f.deleted_at == null || f.deleted_at > day)
|
|
||||||
).length;
|
|
||||||
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: count
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
import Following from '../../../models/following';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate following of a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Lookup user
|
|
||||||
const user = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const startTime = new Date(new Date().setMonth(new Date().getMonth() - 1));
|
|
||||||
|
|
||||||
const following = await Following
|
|
||||||
.find({
|
|
||||||
follower_id: user._id,
|
|
||||||
$or: [
|
|
||||||
{ deleted_at: { $exists: false } },
|
|
||||||
{ deleted_at: { $gt: startTime } }
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
_id: false,
|
|
||||||
follower_id: false,
|
|
||||||
followee_id: false
|
|
||||||
}, {
|
|
||||||
sort: { created_at: -1 }
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
let day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
day = new Date(day.setMilliseconds(999));
|
|
||||||
day = new Date(day.setSeconds(59));
|
|
||||||
day = new Date(day.setMinutes(59));
|
|
||||||
day = new Date(day.setHours(23));
|
|
||||||
|
|
||||||
const count = following.filter(f =>
|
|
||||||
f.created_at < day && (f.deleted_at == null || f.deleted_at > day)
|
|
||||||
).length;
|
|
||||||
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: count
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,110 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
import Post from '../../../models/post';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate post of a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Lookup user
|
|
||||||
const user = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Post
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { user_id: user._id } },
|
|
||||||
{ $project: {
|
|
||||||
repost_id: '$repost_id',
|
|
||||||
reply_id: '$reply_id',
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$repost_id', null] },
|
|
||||||
then: 'repost',
|
|
||||||
else: {
|
|
||||||
$cond: {
|
|
||||||
if: { $ne: ['$reply_id', null] },
|
|
||||||
then: 'reply',
|
|
||||||
else: 'post'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
},
|
|
||||||
{ $group: { _id: {
|
|
||||||
date: '$date',
|
|
||||||
type: '$type'
|
|
||||||
}, count: { $sum: 1 } } },
|
|
||||||
{ $group: {
|
|
||||||
_id: '$_id.date',
|
|
||||||
data: { $addToSet: {
|
|
||||||
type: '$_id.type',
|
|
||||||
count: '$count'
|
|
||||||
}}
|
|
||||||
} }
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
|
|
||||||
data.posts = (data.data.filter(x => x.type == 'post')[0] || { count: 0 }).count;
|
|
||||||
data.reposts = (data.data.filter(x => x.type == 'repost')[0] || { count: 0 }).count;
|
|
||||||
data.replies = (data.data.filter(x => x.type == 'reply')[0] || { count: 0 }).count;
|
|
||||||
|
|
||||||
delete data.data;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
posts: 0,
|
|
||||||
reposts: 0,
|
|
||||||
replies: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,80 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
import Reaction from '../../../models/post-reaction';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Aggregate reaction of a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Lookup user
|
|
||||||
const user = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
_id: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (user === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
const datas = await Reaction
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { user_id: user._id } },
|
|
||||||
{ $project: {
|
|
||||||
created_at: { $add: ['$created_at', 9 * 60 * 60 * 1000] } // Convert into JST
|
|
||||||
}},
|
|
||||||
{ $project: {
|
|
||||||
date: {
|
|
||||||
year: { $year: '$created_at' },
|
|
||||||
month: { $month: '$created_at' },
|
|
||||||
day: { $dayOfMonth: '$created_at' }
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
{ $group: {
|
|
||||||
_id: '$date',
|
|
||||||
count: { $sum: 1 }
|
|
||||||
}}
|
|
||||||
]);
|
|
||||||
|
|
||||||
datas.forEach(data => {
|
|
||||||
data.date = data._id;
|
|
||||||
delete data._id;
|
|
||||||
});
|
|
||||||
|
|
||||||
const graph = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < 30; i++) {
|
|
||||||
const day = new Date(new Date().setDate(new Date().getDate() - i));
|
|
||||||
|
|
||||||
const data = datas.filter(d =>
|
|
||||||
d.date.year == day.getFullYear() && d.date.month == day.getMonth() + 1 && d.date.day == day.getDate()
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
graph.push(data);
|
|
||||||
} else {
|
|
||||||
graph.push({
|
|
||||||
date: {
|
|
||||||
year: day.getFullYear(),
|
|
||||||
month: day.getMonth() + 1, // In JavaScript, month is zero-based.
|
|
||||||
day: day.getDate()
|
|
||||||
},
|
|
||||||
count: 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
res(graph);
|
|
||||||
});
|
|
@ -1,110 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import rndstr from 'rndstr';
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../models/app';
|
|
||||||
import { isValidNameId } from '../../models/app';
|
|
||||||
import serialize from '../../serializers/app';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /app/create:
|
|
||||||
* post:
|
|
||||||
* summary: Create an application
|
|
||||||
* parameters:
|
|
||||||
* - $ref: "#/parameters/AccessToken"
|
|
||||||
* -
|
|
||||||
* name: name_id
|
|
||||||
* description: Application unique name
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
* -
|
|
||||||
* name: name
|
|
||||||
* description: Application name
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
* -
|
|
||||||
* name: description
|
|
||||||
* description: Application description
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
* -
|
|
||||||
* name: permission
|
|
||||||
* description: Permissions that application has
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: array
|
|
||||||
* items:
|
|
||||||
* type: string
|
|
||||||
* collectionFormat: csv
|
|
||||||
* -
|
|
||||||
* name: callback_url
|
|
||||||
* description: URL called back after authentication
|
|
||||||
* in: formData
|
|
||||||
* required: false
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: Created application's information
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Application"
|
|
||||||
*
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an app
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'name_id' parameter
|
|
||||||
const [nameId, nameIdErr] = $(params.name_id).string().pipe(isValidNameId).$;
|
|
||||||
if (nameIdErr) return rej('invalid name_id param');
|
|
||||||
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name, nameErr] = $(params.name).string().$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
|
|
||||||
// Get 'description' parameter
|
|
||||||
const [description, descriptionErr] = $(params.description).string().$;
|
|
||||||
if (descriptionErr) return rej('invalid description param');
|
|
||||||
|
|
||||||
// Get 'permission' parameter
|
|
||||||
const [permission, permissionErr] = $(params.permission).array('string').unique().$;
|
|
||||||
if (permissionErr) return rej('invalid permission param');
|
|
||||||
|
|
||||||
// Get 'callback_url' parameter
|
|
||||||
// TODO: Check it is valid url
|
|
||||||
const [callbackUrl = null, callbackUrlErr] = $(params.callback_url).optional.nullable.string().$;
|
|
||||||
if (callbackUrlErr) return rej('invalid callback_url param');
|
|
||||||
|
|
||||||
// Generate secret
|
|
||||||
const secret = rndstr('a-zA-Z0-9', 32);
|
|
||||||
|
|
||||||
// Create account
|
|
||||||
const app = await App.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
user_id: user._id,
|
|
||||||
name: name,
|
|
||||||
name_id: nameId,
|
|
||||||
name_id_lower: nameId.toLowerCase(),
|
|
||||||
description: description,
|
|
||||||
permission: permission,
|
|
||||||
callback_url: callbackUrl,
|
|
||||||
secret: secret
|
|
||||||
});
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(await serialize(app));
|
|
||||||
});
|
|
@ -1,60 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../../models/app';
|
|
||||||
import { isValidNameId } from '../../../models/app';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /app/name_id/available:
|
|
||||||
* post:
|
|
||||||
* summary: Check available name_id on creation an application
|
|
||||||
* parameters:
|
|
||||||
* -
|
|
||||||
* name: name_id
|
|
||||||
* description: Application unique name
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: Success
|
|
||||||
* schema:
|
|
||||||
* type: object
|
|
||||||
* properties:
|
|
||||||
* available:
|
|
||||||
* description: Whether name_id is available
|
|
||||||
* type: boolean
|
|
||||||
*
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check available name_id of app
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'name_id' parameter
|
|
||||||
const [nameId, nameIdErr] = $(params.name_id).string().pipe(isValidNameId).$;
|
|
||||||
if (nameIdErr) return rej('invalid name_id param');
|
|
||||||
|
|
||||||
// Get exist
|
|
||||||
const exist = await App
|
|
||||||
.count({
|
|
||||||
name_id_lower: nameId.toLowerCase()
|
|
||||||
}, {
|
|
||||||
limit: 1
|
|
||||||
});
|
|
||||||
|
|
||||||
// Reply
|
|
||||||
res({
|
|
||||||
available: exist === 0
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../models/app';
|
|
||||||
import serialize from '../../serializers/app';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /app/show:
|
|
||||||
* post:
|
|
||||||
* summary: Show an application's information
|
|
||||||
* description: Require app_id or name_id
|
|
||||||
* parameters:
|
|
||||||
* -
|
|
||||||
* name: app_id
|
|
||||||
* description: Application ID
|
|
||||||
* in: formData
|
|
||||||
* type: string
|
|
||||||
* -
|
|
||||||
* name: name_id
|
|
||||||
* description: Application unique name
|
|
||||||
* in: formData
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: Success
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Application"
|
|
||||||
*
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show an app
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @param {any} _
|
|
||||||
* @param {any} isSecure
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user, _, isSecure) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'app_id' parameter
|
|
||||||
const [appId, appIdErr] = $(params.app_id).optional.id().$;
|
|
||||||
if (appIdErr) return rej('invalid app_id param');
|
|
||||||
|
|
||||||
// Get 'name_id' parameter
|
|
||||||
const [nameId, nameIdErr] = $(params.name_id).optional.string().$;
|
|
||||||
if (nameIdErr) return rej('invalid name_id param');
|
|
||||||
|
|
||||||
if (appId === undefined && nameId === undefined) {
|
|
||||||
return rej('app_id or name_id is required');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lookup app
|
|
||||||
const app = appId !== undefined
|
|
||||||
? await App.findOne({ _id: appId })
|
|
||||||
: await App.findOne({ name_id_lower: nameId.toLowerCase() });
|
|
||||||
|
|
||||||
if (app === null) {
|
|
||||||
return rej('app not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send response
|
|
||||||
res(await serialize(app, user, {
|
|
||||||
includeSecret: isSecure && app.user_id.equals(user._id)
|
|
||||||
}));
|
|
||||||
});
|
|
@ -1,93 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import rndstr from 'rndstr';
|
|
||||||
const crypto = require('crypto');
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../models/app';
|
|
||||||
import AuthSess from '../../models/auth-session';
|
|
||||||
import AccessToken from '../../models/access-token';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /auth/accept:
|
|
||||||
* post:
|
|
||||||
* summary: Accept a session
|
|
||||||
* parameters:
|
|
||||||
* - $ref: "#/parameters/NativeToken"
|
|
||||||
* -
|
|
||||||
* name: token
|
|
||||||
* description: Session Token
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
* responses:
|
|
||||||
* 204:
|
|
||||||
* description: OK
|
|
||||||
*
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Accept
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'token' parameter
|
|
||||||
const [token, tokenErr] = $(params.token).string().$;
|
|
||||||
if (tokenErr) return rej('invalid token param');
|
|
||||||
|
|
||||||
// Fetch token
|
|
||||||
const session = await AuthSess
|
|
||||||
.findOne({ token: token });
|
|
||||||
|
|
||||||
if (session === null) {
|
|
||||||
return rej('session not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate access token
|
|
||||||
const accessToken = rndstr('a-zA-Z0-9', 32);
|
|
||||||
|
|
||||||
// Fetch exist access token
|
|
||||||
const exist = await AccessToken.findOne({
|
|
||||||
app_id: session.app_id,
|
|
||||||
user_id: user._id,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist === null) {
|
|
||||||
// Lookup app
|
|
||||||
const app = await App.findOne({
|
|
||||||
_id: session.app_id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Generate Hash
|
|
||||||
const sha256 = crypto.createHash('sha256');
|
|
||||||
sha256.update(accessToken + app.secret);
|
|
||||||
const hash = sha256.digest('hex');
|
|
||||||
|
|
||||||
// Insert access token doc
|
|
||||||
await AccessToken.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
app_id: session.app_id,
|
|
||||||
user_id: user._id,
|
|
||||||
token: accessToken,
|
|
||||||
hash: hash
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update session
|
|
||||||
await AuthSess.update(session._id, {
|
|
||||||
$set: {
|
|
||||||
user_id: user._id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res();
|
|
||||||
});
|
|
@ -1,76 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import * as uuid from 'uuid';
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../../models/app';
|
|
||||||
import AuthSess from '../../../models/auth-session';
|
|
||||||
import config from '../../../../conf';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /auth/session/generate:
|
|
||||||
* post:
|
|
||||||
* summary: Generate a session
|
|
||||||
* parameters:
|
|
||||||
* -
|
|
||||||
* name: app_secret
|
|
||||||
* description: App Secret
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: OK
|
|
||||||
* schema:
|
|
||||||
* type: object
|
|
||||||
* properties:
|
|
||||||
* token:
|
|
||||||
* type: string
|
|
||||||
* description: Session Token
|
|
||||||
* url:
|
|
||||||
* type: string
|
|
||||||
* description: Authentication form's URL
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a session
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'app_secret' parameter
|
|
||||||
const [appSecret, appSecretErr] = $(params.app_secret).string().$;
|
|
||||||
if (appSecretErr) return rej('invalid app_secret param');
|
|
||||||
|
|
||||||
// Lookup app
|
|
||||||
const app = await App.findOne({
|
|
||||||
secret: appSecret
|
|
||||||
});
|
|
||||||
|
|
||||||
if (app == null) {
|
|
||||||
return rej('app not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate token
|
|
||||||
const token = uuid.v4();
|
|
||||||
|
|
||||||
// Create session token document
|
|
||||||
const doc = await AuthSess.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
app_id: app._id,
|
|
||||||
token: token
|
|
||||||
});
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res({
|
|
||||||
token: doc.token,
|
|
||||||
url: `${config.auth_url}/${doc.token}`
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,71 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import AuthSess from '../../../models/auth-session';
|
|
||||||
import serialize from '../../../serializers/auth-session';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /auth/session/show:
|
|
||||||
* post:
|
|
||||||
* summary: Show a session information
|
|
||||||
* parameters:
|
|
||||||
* -
|
|
||||||
* name: token
|
|
||||||
* description: Session Token
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: OK
|
|
||||||
* schema:
|
|
||||||
* type: object
|
|
||||||
* properties:
|
|
||||||
* created_at:
|
|
||||||
* type: string
|
|
||||||
* format: date-time
|
|
||||||
* description: Date and time of the session creation
|
|
||||||
* app_id:
|
|
||||||
* type: string
|
|
||||||
* description: Application ID
|
|
||||||
* token:
|
|
||||||
* type: string
|
|
||||||
* description: Session Token
|
|
||||||
* user_id:
|
|
||||||
* type: string
|
|
||||||
* description: ID of user who create the session
|
|
||||||
* app:
|
|
||||||
* $ref: "#/definitions/Application"
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a session
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'token' parameter
|
|
||||||
const [token, tokenErr] = $(params.token).string().$;
|
|
||||||
if (tokenErr) return rej('invalid token param');
|
|
||||||
|
|
||||||
// Lookup session
|
|
||||||
const session = await AuthSess.findOne({
|
|
||||||
token: token
|
|
||||||
});
|
|
||||||
|
|
||||||
if (session == null) {
|
|
||||||
return rej('session not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(await serialize(session, user));
|
|
||||||
});
|
|
@ -1,109 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import App from '../../../models/app';
|
|
||||||
import AuthSess from '../../../models/auth-session';
|
|
||||||
import AccessToken from '../../../models/access-token';
|
|
||||||
import serialize from '../../../serializers/user';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @swagger
|
|
||||||
* /auth/session/userkey:
|
|
||||||
* post:
|
|
||||||
* summary: Get an access token(userkey)
|
|
||||||
* parameters:
|
|
||||||
* -
|
|
||||||
* name: app_secret
|
|
||||||
* description: App Secret
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
* -
|
|
||||||
* name: token
|
|
||||||
* description: Session Token
|
|
||||||
* in: formData
|
|
||||||
* required: true
|
|
||||||
* type: string
|
|
||||||
*
|
|
||||||
* responses:
|
|
||||||
* 200:
|
|
||||||
* description: OK
|
|
||||||
* schema:
|
|
||||||
* type: object
|
|
||||||
* properties:
|
|
||||||
* userkey:
|
|
||||||
* type: string
|
|
||||||
* description: Access Token
|
|
||||||
* user:
|
|
||||||
* $ref: "#/definitions/User"
|
|
||||||
* default:
|
|
||||||
* description: Failed
|
|
||||||
* schema:
|
|
||||||
* $ref: "#/definitions/Error"
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a session
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'app_secret' parameter
|
|
||||||
const [appSecret, appSecretErr] = $(params.app_secret).string().$;
|
|
||||||
if (appSecretErr) return rej('invalid app_secret param');
|
|
||||||
|
|
||||||
// Lookup app
|
|
||||||
const app = await App.findOne({
|
|
||||||
secret: appSecret
|
|
||||||
});
|
|
||||||
|
|
||||||
if (app == null) {
|
|
||||||
return rej('app not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'token' parameter
|
|
||||||
const [token, tokenErr] = $(params.token).string().$;
|
|
||||||
if (tokenErr) return rej('invalid token param');
|
|
||||||
|
|
||||||
// Fetch token
|
|
||||||
const session = await AuthSess
|
|
||||||
.findOne({
|
|
||||||
token: token,
|
|
||||||
app_id: app._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (session === null) {
|
|
||||||
return rej('session not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (session.user_id == null) {
|
|
||||||
return rej('this session is not allowed yet');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lookup access token
|
|
||||||
const accessToken = await AccessToken.findOne({
|
|
||||||
app_id: app._id,
|
|
||||||
user_id: session.user_id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Delete session
|
|
||||||
|
|
||||||
/* https://github.com/Automattic/monk/issues/178
|
|
||||||
AuthSess.deleteOne({
|
|
||||||
_id: session._id
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
AuthSess.remove({
|
|
||||||
_id: session._id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res({
|
|
||||||
access_token: accessToken.token,
|
|
||||||
user: await serialize(session.user_id, null, {
|
|
||||||
detail: true
|
|
||||||
})
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,59 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Channel from '../models/channel';
|
|
||||||
import serialize from '../serializers/channel';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all channels
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} me
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, me) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
// Get 'since_id' parameter
|
|
||||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
|
||||||
if (sinceIdErr) return rej('invalid since_id param');
|
|
||||||
|
|
||||||
// Get 'max_id' parameter
|
|
||||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
|
||||||
if (maxIdErr) return rej('invalid max_id param');
|
|
||||||
|
|
||||||
// Check if both of since_id and max_id is specified
|
|
||||||
if (sinceId && maxId) {
|
|
||||||
return rej('cannot set since_id and max_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct query
|
|
||||||
const sort = {
|
|
||||||
_id: -1
|
|
||||||
};
|
|
||||||
const query = {} as any;
|
|
||||||
if (sinceId) {
|
|
||||||
sort._id = 1;
|
|
||||||
query._id = {
|
|
||||||
$gt: sinceId
|
|
||||||
};
|
|
||||||
} else if (maxId) {
|
|
||||||
query._id = {
|
|
||||||
$lt: maxId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const channels = await Channel
|
|
||||||
.find(query, {
|
|
||||||
limit: limit,
|
|
||||||
sort: sort
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(channels.map(async channel =>
|
|
||||||
await serialize(channel, me))));
|
|
||||||
});
|
|
@ -1,39 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Channel from '../../models/channel';
|
|
||||||
import Watching from '../../models/channel-watching';
|
|
||||||
import serialize from '../../serializers/channel';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a channel
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'title' parameter
|
|
||||||
const [title, titleErr] = $(params.title).string().range(1, 100).$;
|
|
||||||
if (titleErr) return rej('invalid title param');
|
|
||||||
|
|
||||||
// Create a channel
|
|
||||||
const channel = await Channel.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
user_id: user._id,
|
|
||||||
title: title,
|
|
||||||
index: 0,
|
|
||||||
watching_count: 1
|
|
||||||
});
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(await serialize(channel));
|
|
||||||
|
|
||||||
// Create Watching
|
|
||||||
await Watching.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
user_id: user._id,
|
|
||||||
channel_id: channel._id
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,79 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import { default as Channel, IChannel } from '../../models/channel';
|
|
||||||
import Post from '../../models/post';
|
|
||||||
import serialize from '../../serializers/post';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a posts of a channel
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 1000, limitErr] = $(params.limit).optional.number().range(1, 1000).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
// Get 'since_id' parameter
|
|
||||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
|
||||||
if (sinceIdErr) return rej('invalid since_id param');
|
|
||||||
|
|
||||||
// Get 'max_id' parameter
|
|
||||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
|
||||||
if (maxIdErr) return rej('invalid max_id param');
|
|
||||||
|
|
||||||
// Check if both of since_id and max_id is specified
|
|
||||||
if (sinceId && maxId) {
|
|
||||||
return rej('cannot set since_id and max_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'channel_id' parameter
|
|
||||||
const [channelId, channelIdErr] = $(params.channel_id).id().$;
|
|
||||||
if (channelIdErr) return rej('invalid channel_id param');
|
|
||||||
|
|
||||||
// Fetch channel
|
|
||||||
const channel: IChannel = await Channel.findOne({
|
|
||||||
_id: channelId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (channel === null) {
|
|
||||||
return rej('channel not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
//#region Construct query
|
|
||||||
const sort = {
|
|
||||||
_id: -1
|
|
||||||
};
|
|
||||||
|
|
||||||
const query = {
|
|
||||||
channel_id: channel._id
|
|
||||||
} as any;
|
|
||||||
|
|
||||||
if (sinceId) {
|
|
||||||
sort._id = 1;
|
|
||||||
query._id = {
|
|
||||||
$gt: sinceId
|
|
||||||
};
|
|
||||||
} else if (maxId) {
|
|
||||||
query._id = {
|
|
||||||
$lt: maxId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
//#endregion Construct query
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const posts = await Post
|
|
||||||
.find(query, {
|
|
||||||
limit: limit,
|
|
||||||
sort: sort
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(posts.map(async (post) =>
|
|
||||||
await serialize(post, user)
|
|
||||||
)));
|
|
||||||
});
|
|
@ -1,31 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import { default as Channel, IChannel } from '../../models/channel';
|
|
||||||
import serialize from '../../serializers/channel';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a channel
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'channel_id' parameter
|
|
||||||
const [channelId, channelIdErr] = $(params.channel_id).id().$;
|
|
||||||
if (channelIdErr) return rej('invalid channel_id param');
|
|
||||||
|
|
||||||
// Fetch channel
|
|
||||||
const channel: IChannel = await Channel.findOne({
|
|
||||||
_id: channelId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (channel === null) {
|
|
||||||
return rej('channel not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await serialize(channel, user));
|
|
||||||
});
|
|
@ -1,60 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Channel from '../../models/channel';
|
|
||||||
import Watching from '../../models/channel-watching';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unwatch a channel
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'channel_id' parameter
|
|
||||||
const [channelId, channelIdErr] = $(params.channel_id).id().$;
|
|
||||||
if (channelIdErr) return rej('invalid channel_id param');
|
|
||||||
|
|
||||||
//#region Fetch channel
|
|
||||||
const channel = await Channel.findOne({
|
|
||||||
_id: channelId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (channel === null) {
|
|
||||||
return rej('channel not found');
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
//#region Check whether not watching
|
|
||||||
const exist = await Watching.findOne({
|
|
||||||
user_id: user._id,
|
|
||||||
channel_id: channel._id,
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist === null) {
|
|
||||||
return rej('already not watching');
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
// Delete watching
|
|
||||||
await Watching.update({
|
|
||||||
_id: exist._id
|
|
||||||
}, {
|
|
||||||
$set: {
|
|
||||||
deleted_at: new Date()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send response
|
|
||||||
res();
|
|
||||||
|
|
||||||
// Decrement watching count
|
|
||||||
Channel.update(channel._id, {
|
|
||||||
$inc: {
|
|
||||||
watching_count: -1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,58 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import Channel from '../../models/channel';
|
|
||||||
import Watching from '../../models/channel-watching';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Watch a channel
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'channel_id' parameter
|
|
||||||
const [channelId, channelIdErr] = $(params.channel_id).id().$;
|
|
||||||
if (channelIdErr) return rej('invalid channel_id param');
|
|
||||||
|
|
||||||
//#region Fetch channel
|
|
||||||
const channel = await Channel.findOne({
|
|
||||||
_id: channelId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (channel === null) {
|
|
||||||
return rej('channel not found');
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
//#region Check whether already watching
|
|
||||||
const exist = await Watching.findOne({
|
|
||||||
user_id: user._id,
|
|
||||||
channel_id: channel._id,
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist !== null) {
|
|
||||||
return rej('already watching');
|
|
||||||
}
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
// Create Watching
|
|
||||||
await Watching.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
user_id: user._id,
|
|
||||||
channel_id: channel._id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send response
|
|
||||||
res();
|
|
||||||
|
|
||||||
// Increment watching count
|
|
||||||
Channel.update(channel._id, {
|
|
||||||
$inc: {
|
|
||||||
watching_count: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import DriveFile from '../models/drive-file';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get drive information
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Calculate drive usage
|
|
||||||
const usage = ((await DriveFile
|
|
||||||
.aggregate([
|
|
||||||
{ $match: { 'metadata.user_id': user._id } },
|
|
||||||
{
|
|
||||||
$project: {
|
|
||||||
length: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
$group: {
|
|
||||||
_id: null,
|
|
||||||
usage: { $sum: '$length' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]))[0] || {
|
|
||||||
usage: 0
|
|
||||||
}).usage;
|
|
||||||
|
|
||||||
res({
|
|
||||||
capacity: user.drive_capacity,
|
|
||||||
usage: usage
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,74 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFile from '../../models/drive-file';
|
|
||||||
import serialize from '../../serializers/drive-file';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get drive files
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @param {any} app
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params, user, app) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
|
||||||
if (limitErr) throw 'invalid limit param';
|
|
||||||
|
|
||||||
// Get 'since_id' parameter
|
|
||||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
|
||||||
if (sinceIdErr) throw 'invalid since_id param';
|
|
||||||
|
|
||||||
// Get 'max_id' parameter
|
|
||||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
|
||||||
if (maxIdErr) throw 'invalid max_id param';
|
|
||||||
|
|
||||||
// Check if both of since_id and max_id is specified
|
|
||||||
if (sinceId && maxId) {
|
|
||||||
throw 'cannot set since_id and max_id';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) throw 'invalid folder_id param';
|
|
||||||
|
|
||||||
// Get 'type' parameter
|
|
||||||
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).$;
|
|
||||||
if (typeErr) throw 'invalid type param';
|
|
||||||
|
|
||||||
// Construct query
|
|
||||||
const sort = {
|
|
||||||
_id: -1
|
|
||||||
};
|
|
||||||
const query = {
|
|
||||||
'metadata.user_id': user._id,
|
|
||||||
'metadata.folder_id': folderId
|
|
||||||
} as any;
|
|
||||||
if (sinceId) {
|
|
||||||
sort._id = 1;
|
|
||||||
query._id = {
|
|
||||||
$gt: sinceId
|
|
||||||
};
|
|
||||||
} else if (maxId) {
|
|
||||||
query._id = {
|
|
||||||
$lt: maxId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (type) {
|
|
||||||
query.contentType = new RegExp(`^${type.replace(/\*/g, '.+?')}$`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const files = await DriveFile
|
|
||||||
.find(query, {
|
|
||||||
limit: limit,
|
|
||||||
sort: sort
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
const _files = await Promise.all(files.map(file => serialize(file)));
|
|
||||||
return _files;
|
|
||||||
};
|
|
@ -1,46 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import { validateFileName } from '../../../models/drive-file';
|
|
||||||
import serialize from '../../../serializers/drive-file';
|
|
||||||
import create from '../../../common/add-file-to-drive';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a file
|
|
||||||
*
|
|
||||||
* @param {any} file
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (file, params, user): Promise<any> => {
|
|
||||||
if (file == null) {
|
|
||||||
throw 'file is required';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'name' parameter
|
|
||||||
let name = file.originalname;
|
|
||||||
if (name !== undefined && name !== null) {
|
|
||||||
name = name.trim();
|
|
||||||
if (name.length === 0) {
|
|
||||||
name = null;
|
|
||||||
} else if (name === 'blob') {
|
|
||||||
name = null;
|
|
||||||
} else if (!validateFileName(name)) {
|
|
||||||
throw 'invalid name';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
name = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) throw 'invalid folder_id param';
|
|
||||||
|
|
||||||
// Create file
|
|
||||||
const driveFile = await create(user, file.path, name, null, folderId);
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
return serialize(driveFile);
|
|
||||||
};
|
|
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFile from '../../../models/drive-file';
|
|
||||||
import serialize from '../../../serializers/drive-file';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find a file(s)
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name, nameErr] = $(params.name).string().$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) return rej('invalid folder_id param');
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const files = await DriveFile
|
|
||||||
.find({
|
|
||||||
filename: name,
|
|
||||||
'metadata.user_id': user._id,
|
|
||||||
'metadata.folder_id': folderId
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(files.map(async file =>
|
|
||||||
await serialize(file))));
|
|
||||||
});
|
|
@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFile from '../../../models/drive-file';
|
|
||||||
import serialize from '../../../serializers/drive-file';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a file
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params, user) => {
|
|
||||||
// Get 'file_id' parameter
|
|
||||||
const [fileId, fileIdErr] = $(params.file_id).id().$;
|
|
||||||
if (fileIdErr) throw 'invalid file_id param';
|
|
||||||
|
|
||||||
// Fetch file
|
|
||||||
const file = await DriveFile
|
|
||||||
.findOne({
|
|
||||||
_id: fileId,
|
|
||||||
'metadata.user_id': user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (file === null) {
|
|
||||||
throw 'file-not-found';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
const _file = await serialize(file, {
|
|
||||||
detail: true
|
|
||||||
});
|
|
||||||
|
|
||||||
return _file;
|
|
||||||
};
|
|
@ -1,77 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../../models/drive-folder';
|
|
||||||
import DriveFile from '../../../models/drive-file';
|
|
||||||
import { validateFileName } from '../../../models/drive-file';
|
|
||||||
import serialize from '../../../serializers/drive-file';
|
|
||||||
import { publishDriveStream } from '../../../event';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update a file
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'file_id' parameter
|
|
||||||
const [fileId, fileIdErr] = $(params.file_id).id().$;
|
|
||||||
if (fileIdErr) return rej('invalid file_id param');
|
|
||||||
|
|
||||||
// Fetch file
|
|
||||||
const file = await DriveFile
|
|
||||||
.findOne({
|
|
||||||
_id: fileId,
|
|
||||||
'metadata.user_id': user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (file === null) {
|
|
||||||
return rej('file-not-found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name, nameErr] = $(params.name).optional.string().pipe(validateFileName).$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
if (name) file.filename = name;
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) return rej('invalid folder_id param');
|
|
||||||
|
|
||||||
if (folderId !== undefined) {
|
|
||||||
if (folderId === null) {
|
|
||||||
file.metadata.folder_id = null;
|
|
||||||
} else {
|
|
||||||
// Fetch folder
|
|
||||||
const folder = await DriveFolder
|
|
||||||
.findOne({
|
|
||||||
_id: folderId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (folder === null) {
|
|
||||||
return rej('folder-not-found');
|
|
||||||
}
|
|
||||||
|
|
||||||
file.metadata.folder_id = folder._id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await DriveFile.update(file._id, {
|
|
||||||
$set: {
|
|
||||||
filename: file.filename,
|
|
||||||
'metadata.folder_id': file.metadata.folder_id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
const fileObj = await serialize(file);
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(fileObj);
|
|
||||||
|
|
||||||
// Publish file_updated event
|
|
||||||
publishDriveStream(user._id, 'file_updated', fileObj);
|
|
||||||
});
|
|
@ -1,67 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import * as URL from 'url';
|
|
||||||
import $ from 'cafy';
|
|
||||||
import { validateFileName } from '../../../models/drive-file';
|
|
||||||
import serialize from '../../../serializers/drive-file';
|
|
||||||
import create from '../../../common/add-file-to-drive';
|
|
||||||
import * as debug from 'debug';
|
|
||||||
import * as tmp from 'tmp';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as request from 'request';
|
|
||||||
|
|
||||||
const log = debug('misskey:endpoint:upload_from_url');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a file from a URL
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = async (params, user): Promise<any> => {
|
|
||||||
// Get 'url' parameter
|
|
||||||
// TODO: Validate this url
|
|
||||||
const [url, urlErr] = $(params.url).string().$;
|
|
||||||
if (urlErr) throw 'invalid url param';
|
|
||||||
|
|
||||||
let name = URL.parse(url).pathname.split('/').pop();
|
|
||||||
if (!validateFileName(name)) {
|
|
||||||
name = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) throw 'invalid folder_id param';
|
|
||||||
|
|
||||||
// Create temp file
|
|
||||||
const path = await new Promise((res: (string) => void, rej) => {
|
|
||||||
tmp.file((e, path) => {
|
|
||||||
if (e) return rej(e);
|
|
||||||
res(path);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// write content at URL to temp file
|
|
||||||
await new Promise((res, rej) => {
|
|
||||||
const writable = fs.createWriteStream(path);
|
|
||||||
request(url)
|
|
||||||
.on('error', rej)
|
|
||||||
.on('end', () => {
|
|
||||||
writable.close();
|
|
||||||
res(path);
|
|
||||||
})
|
|
||||||
.pipe(writable)
|
|
||||||
.on('error', rej);
|
|
||||||
});
|
|
||||||
|
|
||||||
const driveFile = await create(user, path, name, null, folderId);
|
|
||||||
|
|
||||||
// clean-up
|
|
||||||
fs.unlink(path, (e) => {
|
|
||||||
if (e) log(e.stack);
|
|
||||||
});
|
|
||||||
|
|
||||||
return serialize(driveFile);
|
|
||||||
};
|
|
@ -1,67 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../models/drive-folder';
|
|
||||||
import serialize from '../../serializers/drive-folder';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get drive folders
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @param {any} app
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user, app) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
// Get 'since_id' parameter
|
|
||||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
|
||||||
if (sinceIdErr) return rej('invalid since_id param');
|
|
||||||
|
|
||||||
// Get 'max_id' parameter
|
|
||||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
|
||||||
if (maxIdErr) return rej('invalid max_id param');
|
|
||||||
|
|
||||||
// Check if both of since_id and max_id is specified
|
|
||||||
if (sinceId && maxId) {
|
|
||||||
return rej('cannot set since_id and max_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId = null, folderIdErr] = $(params.folder_id).optional.nullable.id().$;
|
|
||||||
if (folderIdErr) return rej('invalid folder_id param');
|
|
||||||
|
|
||||||
// Construct query
|
|
||||||
const sort = {
|
|
||||||
_id: -1
|
|
||||||
};
|
|
||||||
const query = {
|
|
||||||
user_id: user._id,
|
|
||||||
parent_id: folderId
|
|
||||||
} as any;
|
|
||||||
if (sinceId) {
|
|
||||||
sort._id = 1;
|
|
||||||
query._id = {
|
|
||||||
$gt: sinceId
|
|
||||||
};
|
|
||||||
} else if (maxId) {
|
|
||||||
query._id = {
|
|
||||||
$lt: maxId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const folders = await DriveFolder
|
|
||||||
.find(query, {
|
|
||||||
limit: limit,
|
|
||||||
sort: sort
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(folders.map(async folder =>
|
|
||||||
await serialize(folder))));
|
|
||||||
});
|
|
@ -1,57 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../../models/drive-folder';
|
|
||||||
import { isValidFolderName } from '../../../models/drive-folder';
|
|
||||||
import serialize from '../../../serializers/drive-folder';
|
|
||||||
import { publishDriveStream } from '../../../event';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create drive folder
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name = '無題のフォルダー', nameErr] = $(params.name).optional.string().pipe(isValidFolderName).$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
|
|
||||||
// Get 'parent_id' parameter
|
|
||||||
const [parentId = null, parentIdErr] = $(params.parent_id).optional.nullable.id().$;
|
|
||||||
if (parentIdErr) return rej('invalid parent_id param');
|
|
||||||
|
|
||||||
// If the parent folder is specified
|
|
||||||
let parent = null;
|
|
||||||
if (parentId) {
|
|
||||||
// Fetch parent folder
|
|
||||||
parent = await DriveFolder
|
|
||||||
.findOne({
|
|
||||||
_id: parentId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (parent === null) {
|
|
||||||
return rej('parent-not-found');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create folder
|
|
||||||
const folder = await DriveFolder.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
name: name,
|
|
||||||
parent_id: parent !== null ? parent._id : null,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
const folderObj = await serialize(folder);
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(folderObj);
|
|
||||||
|
|
||||||
// Publish folder_created event
|
|
||||||
publishDriveStream(user._id, 'folder_created', folderObj);
|
|
||||||
});
|
|
@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../../models/drive-folder';
|
|
||||||
import serialize from '../../../serializers/drive-folder';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find a folder(s)
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name, nameErr] = $(params.name).string().$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
|
|
||||||
// Get 'parent_id' parameter
|
|
||||||
const [parentId = null, parentIdErr] = $(params.parent_id).optional.nullable.id().$;
|
|
||||||
if (parentIdErr) return rej('invalid parent_id param');
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const folders = await DriveFolder
|
|
||||||
.find({
|
|
||||||
name: name,
|
|
||||||
user_id: user._id,
|
|
||||||
parent_id: parentId
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(folders.map(folder => serialize(folder))));
|
|
||||||
});
|
|
@ -1,35 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../../models/drive-folder';
|
|
||||||
import serialize from '../../../serializers/drive-folder';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a folder
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId, folderIdErr] = $(params.folder_id).id().$;
|
|
||||||
if (folderIdErr) return rej('invalid folder_id param');
|
|
||||||
|
|
||||||
// Get folder
|
|
||||||
const folder = await DriveFolder
|
|
||||||
.findOne({
|
|
||||||
_id: folderId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (folder === null) {
|
|
||||||
return rej('folder-not-found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await serialize(folder, {
|
|
||||||
detail: true
|
|
||||||
}));
|
|
||||||
});
|
|
@ -1,101 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFolder from '../../../models/drive-folder';
|
|
||||||
import { isValidFolderName } from '../../../models/drive-folder';
|
|
||||||
import serialize from '../../../serializers/drive-folder';
|
|
||||||
import { publishDriveStream } from '../../../event';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update a folder
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'folder_id' parameter
|
|
||||||
const [folderId, folderIdErr] = $(params.folder_id).id().$;
|
|
||||||
if (folderIdErr) return rej('invalid folder_id param');
|
|
||||||
|
|
||||||
// Fetch folder
|
|
||||||
const folder = await DriveFolder
|
|
||||||
.findOne({
|
|
||||||
_id: folderId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (folder === null) {
|
|
||||||
return rej('folder-not-found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'name' parameter
|
|
||||||
const [name, nameErr] = $(params.name).optional.string().pipe(isValidFolderName).$;
|
|
||||||
if (nameErr) return rej('invalid name param');
|
|
||||||
if (name) folder.name = name;
|
|
||||||
|
|
||||||
// Get 'parent_id' parameter
|
|
||||||
const [parentId, parentIdErr] = $(params.parent_id).optional.nullable.id().$;
|
|
||||||
if (parentIdErr) return rej('invalid parent_id param');
|
|
||||||
if (parentId !== undefined) {
|
|
||||||
if (parentId === null) {
|
|
||||||
folder.parent_id = null;
|
|
||||||
} else {
|
|
||||||
// Get parent folder
|
|
||||||
const parent = await DriveFolder
|
|
||||||
.findOne({
|
|
||||||
_id: parentId,
|
|
||||||
user_id: user._id
|
|
||||||
});
|
|
||||||
|
|
||||||
if (parent === null) {
|
|
||||||
return rej('parent-folder-not-found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the circular reference will occur
|
|
||||||
async function checkCircle(folderId) {
|
|
||||||
// Fetch folder
|
|
||||||
const folder2 = await DriveFolder.findOne({
|
|
||||||
_id: folderId
|
|
||||||
}, {
|
|
||||||
_id: true,
|
|
||||||
parent_id: true
|
|
||||||
});
|
|
||||||
|
|
||||||
if (folder2._id.equals(folder._id)) {
|
|
||||||
return true;
|
|
||||||
} else if (folder2.parent_id) {
|
|
||||||
return await checkCircle(folder2.parent_id);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parent.parent_id !== null) {
|
|
||||||
if (await checkCircle(parent.parent_id)) {
|
|
||||||
return rej('detected-circular-definition');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
folder.parent_id = parent._id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update
|
|
||||||
DriveFolder.update(folder._id, {
|
|
||||||
$set: {
|
|
||||||
name: folder.name,
|
|
||||||
parent_id: folder.parent_id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
const folderObj = await serialize(folder);
|
|
||||||
|
|
||||||
// Response
|
|
||||||
res(folderObj);
|
|
||||||
|
|
||||||
// Publish folder_updated event
|
|
||||||
publishDriveStream(user._id, 'folder_updated', folderObj);
|
|
||||||
});
|
|
@ -1,68 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import DriveFile from '../../models/drive-file';
|
|
||||||
import serialize from '../../serializers/drive-file';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get drive stream
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'limit' parameter
|
|
||||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
|
||||||
if (limitErr) return rej('invalid limit param');
|
|
||||||
|
|
||||||
// Get 'since_id' parameter
|
|
||||||
const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$;
|
|
||||||
if (sinceIdErr) return rej('invalid since_id param');
|
|
||||||
|
|
||||||
// Get 'max_id' parameter
|
|
||||||
const [maxId, maxIdErr] = $(params.max_id).optional.id().$;
|
|
||||||
if (maxIdErr) return rej('invalid max_id param');
|
|
||||||
|
|
||||||
// Check if both of since_id and max_id is specified
|
|
||||||
if (sinceId && maxId) {
|
|
||||||
return rej('cannot set since_id and max_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get 'type' parameter
|
|
||||||
const [type, typeErr] = $(params.type).optional.string().match(/^[a-zA-Z\/\-\*]+$/).$;
|
|
||||||
if (typeErr) return rej('invalid type param');
|
|
||||||
|
|
||||||
// Construct query
|
|
||||||
const sort = {
|
|
||||||
_id: -1
|
|
||||||
};
|
|
||||||
const query = {
|
|
||||||
'metadata.user_id': user._id
|
|
||||||
} as any;
|
|
||||||
if (sinceId) {
|
|
||||||
sort._id = 1;
|
|
||||||
query._id = {
|
|
||||||
$gt: sinceId
|
|
||||||
};
|
|
||||||
} else if (maxId) {
|
|
||||||
query._id = {
|
|
||||||
$lt: maxId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (type) {
|
|
||||||
query.contentType = new RegExp(`^${type.replace(/\*/g, '.+?')}$`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue query
|
|
||||||
const files = await DriveFile
|
|
||||||
.find(query, {
|
|
||||||
limit: limit,
|
|
||||||
sort: sort
|
|
||||||
});
|
|
||||||
|
|
||||||
// Serialize
|
|
||||||
res(await Promise.all(files.map(async file =>
|
|
||||||
await serialize(file))));
|
|
||||||
});
|
|
@ -1,85 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../models/user';
|
|
||||||
import Following from '../../models/following';
|
|
||||||
import notify from '../../common/notify';
|
|
||||||
import event from '../../event';
|
|
||||||
import serializeUser from '../../serializers/user';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Follow a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
const follower = user;
|
|
||||||
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// 自分自身
|
|
||||||
if (user._id.equals(userId)) {
|
|
||||||
return rej('followee is yourself');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get followee
|
|
||||||
const followee = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
data: false,
|
|
||||||
profile: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (followee === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if already following
|
|
||||||
const exist = await Following.findOne({
|
|
||||||
follower_id: follower._id,
|
|
||||||
followee_id: followee._id,
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist !== null) {
|
|
||||||
return rej('already following');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create following
|
|
||||||
await Following.insert({
|
|
||||||
created_at: new Date(),
|
|
||||||
follower_id: follower._id,
|
|
||||||
followee_id: followee._id
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send response
|
|
||||||
res();
|
|
||||||
|
|
||||||
// Increment following count
|
|
||||||
User.update(follower._id, {
|
|
||||||
$inc: {
|
|
||||||
following_count: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Increment followers count
|
|
||||||
User.update({ _id: followee._id }, {
|
|
||||||
$inc: {
|
|
||||||
followers_count: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Publish follow event
|
|
||||||
event(follower._id, 'follow', await serializeUser(followee, follower));
|
|
||||||
event(followee._id, 'followed', await serializeUser(follower, followee));
|
|
||||||
|
|
||||||
// Notify
|
|
||||||
notify(followee._id, follower._id, 'follow');
|
|
||||||
});
|
|
@ -1,82 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import User from '../../models/user';
|
|
||||||
import Following from '../../models/following';
|
|
||||||
import event from '../../event';
|
|
||||||
import serializeUser from '../../serializers/user';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unfollow a user
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
|
||||||
const follower = user;
|
|
||||||
|
|
||||||
// Get 'user_id' parameter
|
|
||||||
const [userId, userIdErr] = $(params.user_id).id().$;
|
|
||||||
if (userIdErr) return rej('invalid user_id param');
|
|
||||||
|
|
||||||
// Check if the followee is yourself
|
|
||||||
if (user._id.equals(userId)) {
|
|
||||||
return rej('followee is yourself');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get followee
|
|
||||||
const followee = await User.findOne({
|
|
||||||
_id: userId
|
|
||||||
}, {
|
|
||||||
fields: {
|
|
||||||
data: false,
|
|
||||||
profile: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (followee === null) {
|
|
||||||
return rej('user not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check not following
|
|
||||||
const exist = await Following.findOne({
|
|
||||||
follower_id: follower._id,
|
|
||||||
followee_id: followee._id,
|
|
||||||
deleted_at: { $exists: false }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (exist === null) {
|
|
||||||
return rej('already not following');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete following
|
|
||||||
await Following.update({
|
|
||||||
_id: exist._id
|
|
||||||
}, {
|
|
||||||
$set: {
|
|
||||||
deleted_at: new Date()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send response
|
|
||||||
res();
|
|
||||||
|
|
||||||
// Decrement following count
|
|
||||||
User.update({ _id: follower._id }, {
|
|
||||||
$inc: {
|
|
||||||
following_count: -1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Decrement followers count
|
|
||||||
User.update({ _id: followee._id }, {
|
|
||||||
$inc: {
|
|
||||||
followers_count: -1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Publish follow event
|
|
||||||
event(follower._id, 'unfollow', await serializeUser(followee, follower));
|
|
||||||
});
|
|
@ -1,29 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import User from '../models/user';
|
|
||||||
import serialize from '../serializers/user';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show myself
|
|
||||||
*
|
|
||||||
* @param {any} params
|
|
||||||
* @param {any} user
|
|
||||||
* @param {any} app
|
|
||||||
* @param {Boolean} isSecure
|
|
||||||
* @return {Promise<any>}
|
|
||||||
*/
|
|
||||||
module.exports = (params, user, _, isSecure) => new Promise(async (res, rej) => {
|
|
||||||
// Serialize
|
|
||||||
res(await serialize(user, user, {
|
|
||||||
detail: true,
|
|
||||||
includeSecrets: isSecure
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Update lastUsedAt
|
|
||||||
User.update({ _id: user._id }, {
|
|
||||||
$set: {
|
|
||||||
last_used_at: new Date()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,37 +0,0 @@
|
|||||||
/**
|
|
||||||
* Module dependencies
|
|
||||||
*/
|
|
||||||
import $ from 'cafy';
|
|
||||||
import * as speakeasy from 'speakeasy';
|
|
||||||
import User from '../../../models/user';
|
|
||||||
|
|
||||||
module.exports = async (params, user) => new Promise(async (res, rej) => {
|
|
||||||
// Get 'token' parameter
|
|
||||||
const [token, tokenErr] = $(params.token).string().$;
|
|
||||||
if (tokenErr) return rej('invalid token param');
|
|
||||||
|
|
||||||
const _token = token.replace(/\s/g, '');
|
|
||||||
|
|
||||||
if (user.two_factor_temp_secret == null) {
|
|
||||||
return rej('二段階認証の設定が開始されていません');
|
|
||||||
}
|
|
||||||
|
|
||||||
const verified = (speakeasy as any).totp.verify({
|
|
||||||
secret: user.two_factor_temp_secret,
|
|
||||||
encoding: 'base32',
|
|
||||||
token: _token
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!verified) {
|
|
||||||
return rej('not verified');
|
|
||||||
}
|
|
||||||
|
|
||||||
await User.update(user._id, {
|
|
||||||
$set: {
|
|
||||||
two_factor_secret: user.two_factor_temp_secret,
|
|
||||||
two_factor_enabled: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
res();
|
|
||||||
});
|
|