Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
85bf76dd98 | ||
![]() |
bfa326af2c | ||
![]() |
534c47935a | ||
![]() |
31a6f2b421 | ||
![]() |
66c106722c | ||
![]() |
9d0204f2fa | ||
![]() |
fceb0e2158 | ||
![]() |
14e7caaa5d | ||
![]() |
744e009690 | ||
![]() |
713dcd9083 | ||
![]() |
e03ec67b5c | ||
![]() |
7e27e2757f | ||
![]() |
f05c5ff617 | ||
![]() |
1afb26f04a | ||
![]() |
7873905cde | ||
![]() |
41a9100477 | ||
![]() |
b8cc1eb993 | ||
![]() |
adbbfd9dc2 | ||
![]() |
84da99d56c | ||
![]() |
aaf8f09cfd | ||
![]() |
6da464fd1b | ||
![]() |
efaa41ba49 | ||
![]() |
67e8e1d819 | ||
![]() |
532f8f8e4c | ||
![]() |
0109e8e57c | ||
![]() |
6e720b2798 | ||
![]() |
d3f2a97dd4 | ||
![]() |
9f7b04b0ec | ||
![]() |
c4118c78b7 |
@@ -41,10 +41,6 @@ redis:
|
||||
port: 6379
|
||||
pass: example-pass
|
||||
|
||||
recaptcha:
|
||||
site_key: example-site-key
|
||||
secret_key: example-secret-key
|
||||
|
||||
# If enabled:
|
||||
# Server will not cache remote files (Using direct link instead).
|
||||
# You can save your storage.
|
||||
@@ -67,6 +63,11 @@ preventCache: false
|
||||
# port: 9200
|
||||
# pass: null
|
||||
|
||||
# reCAPTCHA
|
||||
# recaptcha:
|
||||
# site_key: example-site-key
|
||||
# secret_key: example-secret-key
|
||||
|
||||
# ServiceWorker
|
||||
# sw:
|
||||
# # Public key of VAPID
|
||||
|
9
.github/ISSUE_TEMPLATE
vendored
9
.github/ISSUE_TEMPLATE
vendored
@@ -1,7 +1,16 @@
|
||||
<!--
|
||||
Thanks for your contribution.
|
||||
|
||||
When you report a bug or suggest a new feature, please include these information.
|
||||
* Your browser
|
||||
* Desktop version or mobile version
|
||||
|
||||
--------
|
||||
|
||||
Misskeyへの貢献ありがとうございます。
|
||||
|
||||
バグの報告や提案などで、可能であれば以下の情報を含めてください。
|
||||
* お使いのブラウザ
|
||||
* デスクトップ版Misskeyかモバイル版Misskeyか
|
||||
|
||||
-->
|
||||
|
12
README.md
12
README.md
@@ -44,9 +44,9 @@ If you want to...
|
||||
|
||||
:heart: Backers & Sponsors
|
||||
----------------------------------------------------------------
|
||||
| ![][nagarus-icon] | ![][dansup-icon] |
|
||||
|:-:|:-:|
|
||||
| [nagarus][nagarus-link] | [dansup][dansup-link] |
|
||||
| <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> |
|
||||
|:-:|:-:|:-:|
|
||||
| [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) |
|
||||
|
||||
:four_leaf_clover: Copyright
|
||||
----------------------------------------------------------------
|
||||
@@ -73,9 +73,3 @@ Misskey is an open-source software licensed under the [GNU AGPLv3](LICENSE).
|
||||
|
||||
[syuilo-link]: https://syuilo.com
|
||||
[syuilo-icon]: https://avatars2.githubusercontent.com/u/4439005?v=3&s=70
|
||||
|
||||
[nagarus-link]: https://www.patreon.com/user/creators?u=11601413
|
||||
[nagarus-icon]: https://c10.patreonusercontent.com/3/eyJ2IjoiMSIsInciOjIwMH0%3D/patreon-media/user/11601413/20cb15f209924302b399b99d3c98b850?token-time=2145916800&token-hash=IO31nK6VZCMWBWU2VAk2c824BX2QZ4DNPKyHHZXS0iw%3D
|
||||
[dansup-link]: https://www.patreon.com/dansup
|
||||
[dansup-icon]: https://c10.patreonusercontent.com/3/eyJ2IjoiMSIsInciOjIwMH0%3D/patreon-media/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb?token-time=2145916800&token-hash=opXAM_pnhUTuN1jCA6p_Nn_YsaqohY465YFjWFqMEEE%3D
|
||||
|
||||
|
@@ -48,9 +48,9 @@ In root :
|
||||
4. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` Checkout to the [latest release](https://github.com/syuilo/misskey/releases/latest)
|
||||
5. `npm install` Install misskey dependencies.
|
||||
|
||||
*5.* reCAPTCHA tokens
|
||||
*(optional)* reCAPTCHA tokens
|
||||
----------------------------------------------------------------
|
||||
Misskey requires reCAPTCHA tokens.
|
||||
If you want to enable reCAPTCHA, you need to generate reCAPTCHA tokens:
|
||||
Please visit https://www.google.com/recaptcha/intro/ and generate keys.
|
||||
|
||||
*(optional)* Generating VAPID keys
|
||||
@@ -63,13 +63,12 @@ npm install web-push -g
|
||||
web-push generate-vapid-keys
|
||||
```
|
||||
|
||||
|
||||
*6.* Make configuration file
|
||||
*5.* Make configuration file
|
||||
----------------------------------------------------------------
|
||||
1. `cp .config/example.yml .config/default.yml` Copy the `.config/example.yml` and rename it to `default.yml`.
|
||||
2. Edit `default.yml`
|
||||
|
||||
*7.* Build Misskey
|
||||
*6.* Build Misskey
|
||||
----------------------------------------------------------------
|
||||
|
||||
Build misskey with the following:
|
||||
@@ -85,7 +84,7 @@ If you're still encountering errors about some modules, use node-gyp:
|
||||
3. `node-gyp build`
|
||||
4. `npm run build`
|
||||
|
||||
*8.* That is it.
|
||||
*7.* That is it.
|
||||
----------------------------------------------------------------
|
||||
Well done! Now, you have an environment that run to Misskey.
|
||||
|
||||
|
@@ -47,10 +47,10 @@ adduser --disabled-password --disabled-login misskey
|
||||
4. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` [最新のリリース](https://github.com/syuilo/misskey/releases/latest)を確認
|
||||
5. `npm install` Misskeyの依存パッケージをインストール
|
||||
|
||||
*5.* reCAPTCHAトークン
|
||||
*(オプション)* reCAPTCHAトークン
|
||||
----------------------------------------------------------------
|
||||
MisskeyはreCAPTCHAトークンを必要とします。
|
||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを生成してください。
|
||||
reCAPTCHAを有効にする場合、reCAPTCHAトークンを取得する必要があります。
|
||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを取得してください。
|
||||
|
||||
*(オプション)* VAPIDキーペアの生成
|
||||
----------------------------------------------------------------
|
||||
@@ -61,12 +61,12 @@ npm install web-push -g
|
||||
web-push generate-vapid-keys
|
||||
```
|
||||
|
||||
*6.* Make configuration file
|
||||
*5.* 設定ファイルを作成する
|
||||
----------------------------------------------------------------
|
||||
1. `cp .config/example.yml .config/default.yml` `.config/example.yml`をコピーし名前を`default.yml`にする。
|
||||
2. `default.yml` を編集する。
|
||||
|
||||
*7.* Misskeyのビルド
|
||||
*6.* Misskeyのビルド
|
||||
----------------------------------------------------------------
|
||||
|
||||
次のコマンドでMisskeyをビルドしてください:
|
||||
@@ -81,8 +81,7 @@ Debianをお使いであれば、`build-essential`パッケージをインスト
|
||||
3. `node-gyp build`
|
||||
4. `npm run build`
|
||||
|
||||
|
||||
*6.* 以上です!
|
||||
*7.* 以上です!
|
||||
----------------------------------------------------------------
|
||||
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
||||
|
||||
|
24
gulpfile.ts
24
gulpfile.ts
@@ -23,7 +23,6 @@ const uglifyes = require('uglify-es');
|
||||
|
||||
const locales = require('./locales');
|
||||
import { fa } from './src/misc/fa';
|
||||
const client = require('./built/client/meta.json');
|
||||
import config from './src/config';
|
||||
|
||||
const uglify = uglifyComposer(uglifyes, console);
|
||||
@@ -46,8 +45,6 @@ gulp.task('build', [
|
||||
'doc'
|
||||
]);
|
||||
|
||||
gulp.task('rebuild', ['clean', 'build']);
|
||||
|
||||
gulp.task('build:ts', () => {
|
||||
const tsProject = ts.createProject('./tsconfig.json');
|
||||
|
||||
@@ -84,12 +81,12 @@ gulp.task('lint', () =>
|
||||
);
|
||||
|
||||
gulp.task('format', () =>
|
||||
gulp.src('./src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: 'verbose',
|
||||
fix: true
|
||||
}))
|
||||
.pipe(tslint.report())
|
||||
gulp.src('./src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: 'verbose',
|
||||
fix: true
|
||||
}))
|
||||
.pipe(tslint.report())
|
||||
);
|
||||
|
||||
gulp.task('mocha', () =>
|
||||
@@ -117,8 +114,9 @@ gulp.task('build:client', [
|
||||
'copy:client'
|
||||
]);
|
||||
|
||||
gulp.task('build:client:script', () =>
|
||||
gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
|
||||
gulp.task('build:client:script', () => {
|
||||
const client = require('./built/client/meta.json');
|
||||
return gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
|
||||
.pipe(replace('VERSION', JSON.stringify(client.version)))
|
||||
.pipe(replace('API', JSON.stringify(config.api_url)))
|
||||
.pipe(replace('ENV', JSON.stringify(env)))
|
||||
@@ -126,8 +124,8 @@ gulp.task('build:client:script', () =>
|
||||
.pipe(isProduction ? uglify({
|
||||
toplevel: true
|
||||
} as any) : gutil.noop())
|
||||
.pipe(gulp.dest('./built/client/assets/')) as any
|
||||
);
|
||||
.pipe(gulp.dest('./built/client/assets/'));
|
||||
});
|
||||
|
||||
gulp.task('build:client:styles', () =>
|
||||
gulp.src('./src/client/app/init.css')
|
||||
|
14
package.json
14
package.json
@@ -1,20 +1,18 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "4.23.1",
|
||||
"clientVersion": "1.0.7371",
|
||||
"version": "4.24.1",
|
||||
"clientVersion": "1.0.7402",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node ./built",
|
||||
"debug": "DEBUG=misskey:* node ./built",
|
||||
"swagger": "node ./swagger.js",
|
||||
"build": "webpack && gulp build",
|
||||
"webpack": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"gulp": "gulp build",
|
||||
"rebuild": "gulp rebuild",
|
||||
"clean": "gulp clean",
|
||||
"cleanall": "gulp cleanall",
|
||||
"lint": "gulp lint",
|
||||
@@ -100,7 +98,7 @@
|
||||
"dompurify": "1.0.5",
|
||||
"elasticsearch": "15.1.1",
|
||||
"element-ui": "2.4.4",
|
||||
"emojilib": "2.2.12",
|
||||
"emojilib": "2.3.0",
|
||||
"escape-regexp": "0.0.1",
|
||||
"eslint": "5.0.1",
|
||||
"eslint-plugin-vue": "4.7.0",
|
||||
@@ -188,7 +186,7 @@
|
||||
"stylus": "0.54.5",
|
||||
"stylus-loader": "3.0.2",
|
||||
"summaly": "2.0.6",
|
||||
"swagger-jsdoc": "1.9.7",
|
||||
"swagger-jsdoc": "1.10.2",
|
||||
"syuilo-password-strength": "0.0.1",
|
||||
"textarea-caret": "3.1.0",
|
||||
"tmp": "0.0.33",
|
||||
@@ -205,7 +203,7 @@
|
||||
"vue-cropperjs": "2.2.1",
|
||||
"vue-js-modal": "1.3.16",
|
||||
"vue-json-tree-view": "2.1.4",
|
||||
"vue-loader": "15.2.5",
|
||||
"vue-loader": "15.2.6",
|
||||
"vue-router": "3.0.1",
|
||||
"vue-template-compiler": "2.5.16",
|
||||
"vuedraggable": "2.16.0",
|
||||
@@ -214,7 +212,7 @@
|
||||
"web-push": "3.3.2",
|
||||
"webfinger.js": "2.6.6",
|
||||
"webpack": "4.16.1",
|
||||
"webpack-cli": "3.0.8",
|
||||
"webpack-cli": "3.1.0",
|
||||
"websocket": "1.0.26",
|
||||
"ws": "5.2.2",
|
||||
"xev": "2.0.1"
|
||||
|
@@ -259,6 +259,7 @@ export default Vue.extend({
|
||||
root(isDark)
|
||||
position fixed
|
||||
z-index 65535
|
||||
max-width 100%
|
||||
margin-top calc(1em + 8px)
|
||||
overflow hidden
|
||||
background isDark ? #313543 : #fff
|
||||
@@ -276,7 +277,8 @@ root(isDark)
|
||||
list-style none
|
||||
|
||||
> li
|
||||
display block
|
||||
display flex
|
||||
align-items center
|
||||
padding 4px 12px
|
||||
white-space nowrap
|
||||
overflow hidden
|
||||
@@ -287,6 +289,10 @@ root(isDark)
|
||||
&, *
|
||||
user-select none
|
||||
|
||||
*
|
||||
overflow hidden
|
||||
text-overflow ellipsis
|
||||
|
||||
&:hover
|
||||
background isDark ? rgba(#fff, 0.1) : rgba(#000, 0.1)
|
||||
|
||||
@@ -305,7 +311,6 @@ root(isDark)
|
||||
> .users > li
|
||||
|
||||
.avatar
|
||||
vertical-align middle
|
||||
min-width 28px
|
||||
min-height 28px
|
||||
max-width 28px
|
||||
@@ -314,19 +319,15 @@ root(isDark)
|
||||
border-radius 100%
|
||||
|
||||
.name
|
||||
vertical-align middle
|
||||
margin 0 8px 0 0
|
||||
color isDark ? rgba(#fff, 0.8) : rgba(#000, 0.8)
|
||||
|
||||
.username
|
||||
vertical-align middle
|
||||
color isDark ? rgba(#fff, 0.3) : rgba(#000, 0.3)
|
||||
|
||||
|
||||
> .hashtags > li
|
||||
|
||||
.name
|
||||
vertical-align middle
|
||||
margin 0 8px 0 0
|
||||
color isDark ? rgba(#fff, 0.8) : rgba(#000, 0.8)
|
||||
|
||||
|
@@ -4,9 +4,9 @@
|
||||
<div class="content">
|
||||
<div class="balloon" :data-no-text="message.text == null">
|
||||
<p class="read" v-if="isMe && message.isRead">%i18n:@is-read%</p>
|
||||
<button class="delete-button" v-if="isMe" title="%i18n:common.delete%">
|
||||
<!-- <button class="delete-button" v-if="isMe" title="%i18n:common.delete%">
|
||||
<img src="/assets/desktop/messaging/delete.png" alt="Delete"/>
|
||||
</button>
|
||||
</button> -->
|
||||
<div class="content" v-if="!message.isDeleted">
|
||||
<misskey-flavored-markdown class="text" v-if="message.text" ref="text" :text="message.text" :i="$store.state.i"/>
|
||||
<div class="file" v-if="message.file">
|
||||
|
@@ -29,11 +29,7 @@
|
||||
<p slot="text" v-if="passwordRetypeState == 'not-match'" style="color:#FF1161">%fa:exclamation-triangle .fw% %i18n:@password-not-matched%</p>
|
||||
</div>
|
||||
</ui-input>
|
||||
<div class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div>
|
||||
<label class="agree-tou" style="display: block; margin: 16px 0;">
|
||||
<input name="agree-tou" type="checkbox" required/>
|
||||
<p><a :href="touUrl" target="_blank">利用規約</a>に同意する</p>
|
||||
</label>
|
||||
<div v-if="recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div>
|
||||
<ui-button type="submit">%i18n:@create%</ui-button>
|
||||
</form>
|
||||
</template>
|
||||
@@ -41,7 +37,7 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
const getPasswordStrength = require('syuilo-password-strength');
|
||||
import { host, url, docsUrl, lang, recaptchaSitekey } from '../../../config';
|
||||
import { host, url, recaptchaSitekey } from '../../../config';
|
||||
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
@@ -51,7 +47,6 @@ export default Vue.extend({
|
||||
password: '',
|
||||
retypedPassword: '',
|
||||
url,
|
||||
touUrl: `${docsUrl}/${lang}/tou`,
|
||||
recaptchaSitekey,
|
||||
usernameState: null,
|
||||
passwordStrength: '',
|
||||
@@ -115,7 +110,7 @@ export default Vue.extend({
|
||||
(this as any).api('signup', {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
'g-recaptcha-response': (window as any).grecaptcha.getResponse()
|
||||
'g-recaptcha-response': recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null
|
||||
}).then(() => {
|
||||
(this as any).api('signin', {
|
||||
username: this.username,
|
||||
@@ -126,15 +121,19 @@ export default Vue.extend({
|
||||
}).catch(() => {
|
||||
alert('%i18n:@some-error%');
|
||||
|
||||
(window as any).grecaptcha.reset();
|
||||
if (recaptchaSitekey != null) {
|
||||
(window as any).grecaptcha.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
|
||||
head.appendChild(script);
|
||||
if (recaptchaSitekey != null) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -144,22 +143,4 @@ export default Vue.extend({
|
||||
|
||||
.mk-signup
|
||||
min-width 302px
|
||||
|
||||
.agree-tou
|
||||
padding 4px
|
||||
border-radius 4px
|
||||
|
||||
&:hover
|
||||
background #f4f4f4
|
||||
|
||||
&:active
|
||||
background #eee
|
||||
|
||||
&, *
|
||||
cursor pointer
|
||||
|
||||
p
|
||||
display inline
|
||||
color #555
|
||||
|
||||
</style>
|
||||
|
@@ -175,6 +175,7 @@ root(isDark)
|
||||
> .val
|
||||
height 4px
|
||||
background $theme-color
|
||||
transition width .3s cubic-bezier(0.23, 1, 0.32, 1)
|
||||
|
||||
&:nth-child(1)
|
||||
> .meter > .val
|
||||
|
@@ -10,7 +10,10 @@
|
||||
<span class="separator" v-if="folder != null">%fa:angle-right%</span>
|
||||
<span class="folder current" v-if="folder != null">{{ folder.name }}</span>
|
||||
</div>
|
||||
<input class="search" type="search" placeholder=" %i18n:@search%"/>
|
||||
<!--
|
||||
TODO: #343
|
||||
<input class="search" type="search" placeholder=" %i18n:@search%"/>
|
||||
-->
|
||||
</nav>
|
||||
<div class="main" :class="{ uploading: uploadings.length > 0, fetching }"
|
||||
ref="main"
|
||||
|
@@ -56,10 +56,10 @@
|
||||
<button @click="menu" ref="menuButton">
|
||||
%fa:ellipsis-h%
|
||||
</button>
|
||||
<button title="%i18n:@detail">
|
||||
<!-- <button title="%i18n:@detail">
|
||||
<template v-if="!isDetailOpened">%fa:caret-down%</template>
|
||||
<template v-if="isDetailOpened">%fa:caret-up%</template>
|
||||
</button>
|
||||
</button> -->
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
|
@@ -6,6 +6,7 @@
|
||||
<div :class="$style.loading" v-if="fetching">
|
||||
<mk-ellipsis-icon/>
|
||||
</div>
|
||||
<p :class="$style.notAvailable" v-if="!fetching && notAvailable">検索機能を利用することができません。</p>
|
||||
<p :class="$style.empty" v-if="!fetching && empty">%fa:search%「{{ q }}」に関する投稿は見つかりませんでした。</p>
|
||||
<mk-notes ref="timeline" :class="$style.notes" :more="existMore ? more : null"/>
|
||||
</mk-ui>
|
||||
@@ -24,7 +25,8 @@ export default Vue.extend({
|
||||
moreFetching: false,
|
||||
existMore: false,
|
||||
offset: 0,
|
||||
empty: false
|
||||
empty: false,
|
||||
notAvailable: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -71,7 +73,11 @@ export default Vue.extend({
|
||||
res(notes);
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
}, rej);
|
||||
}, (e: string) => {
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
if (e === 'searching not available') this.notAvailable = true;
|
||||
});
|
||||
}));
|
||||
},
|
||||
more() {
|
||||
@@ -130,4 +136,18 @@ export default Vue.extend({
|
||||
font-size 3em
|
||||
color #ccc
|
||||
|
||||
|
||||
.notAvailable
|
||||
display block
|
||||
margin 0 auto
|
||||
padding 32px
|
||||
max-width 400px
|
||||
text-align center
|
||||
color #999
|
||||
|
||||
> [data-fa]
|
||||
display block
|
||||
margin-bottom 16px
|
||||
font-size 3em
|
||||
color #ccc
|
||||
</style>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<div class="mkw-notifications">
|
||||
<mk-widget-container :show-header="!props.compact">
|
||||
<template slot="header">%fa:R bell%%i18n:@title%</template>
|
||||
<button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button>
|
||||
<!-- <button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button> -->
|
||||
|
||||
<mk-notifications :class="$style.notifications"/>
|
||||
</mk-widget-container>
|
||||
|
@@ -40,7 +40,7 @@ export type Source = {
|
||||
port: number;
|
||||
pass: string;
|
||||
};
|
||||
recaptcha: {
|
||||
recaptcha?: {
|
||||
site_key: string;
|
||||
secret_key: string;
|
||||
};
|
||||
|
@@ -108,6 +108,7 @@ export interface ILocalUser extends IUserBase {
|
||||
|
||||
export interface IRemoteUser extends IUserBase {
|
||||
inbox: string;
|
||||
sharedInbox?: string;
|
||||
endpoints: string[];
|
||||
uri: string;
|
||||
url?: string;
|
||||
|
@@ -117,6 +117,7 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
|
||||
publicKeyPem: person.publicKey.publicKeyPem
|
||||
},
|
||||
inbox: person.inbox,
|
||||
sharedInbox: person.sharedInbox,
|
||||
endpoints: person.endpoints,
|
||||
uri: person.id,
|
||||
url: person.url,
|
||||
@@ -239,6 +240,8 @@ export async function updatePerson(value: string | IObject, resolver?: Resolver)
|
||||
await User.update({ _id: exist._id }, {
|
||||
$set: {
|
||||
updatedAt: new Date(),
|
||||
inbox: person.inbox,
|
||||
sharedInbox: person.sharedInbox,
|
||||
avatarId: avatar ? avatar._id : null,
|
||||
bannerId: banner ? banner._id : null,
|
||||
avatarUrl: avatar && avatar.metadata.isMetaOnly ? avatar.metadata.url : null,
|
||||
|
@@ -47,6 +47,7 @@ export interface IPerson extends IObject {
|
||||
preferredUsername: string;
|
||||
manuallyApprovesFollowers: boolean;
|
||||
inbox: string;
|
||||
sharedInbox?: string;
|
||||
publicKey: any;
|
||||
followers: any;
|
||||
following: any;
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { performance } from 'perf_hooks';
|
||||
import limitter from './limitter';
|
||||
import { IUser } from '../../models/user';
|
||||
import { IApp } from '../../models/app';
|
||||
@@ -45,7 +46,13 @@ export default (endpoint: string, user: IUser, app: IApp, data: any, file?: any)
|
||||
|
||||
// API invoking
|
||||
try {
|
||||
const a = performance.now();
|
||||
res = await exec(data, user, app);
|
||||
const b = performance.now();
|
||||
|
||||
if (b - a > 500) {
|
||||
console.warn(`SLOW API CALL DETECTED: ${ep.name}`);
|
||||
}
|
||||
} catch (e) {
|
||||
rej(e);
|
||||
return;
|
||||
|
@@ -18,6 +18,8 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 30).get(params.limit);
|
||||
if (limitErr) return rej('invalid limit param');
|
||||
|
||||
if (es == null) return rej('searching not available');
|
||||
|
||||
es.search({
|
||||
index: 'misskey',
|
||||
type: 'note',
|
||||
@@ -53,10 +55,10 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
||||
$in: hits
|
||||
}
|
||||
}, {
|
||||
sort: {
|
||||
_id: -1
|
||||
}
|
||||
});
|
||||
sort: {
|
||||
_id: -1
|
||||
}
|
||||
});
|
||||
|
||||
res(await Promise.all(notes.map(note => pack(note, me))));
|
||||
});
|
||||
|
@@ -7,14 +7,16 @@ import generateUserToken from '../common/generate-native-user-token';
|
||||
import config from '../../../config';
|
||||
import Meta from '../../../models/meta';
|
||||
|
||||
recaptcha.init({
|
||||
secret_key: config.recaptcha.secret_key
|
||||
});
|
||||
if (config.recaptcha) {
|
||||
recaptcha.init({
|
||||
secret_key: config.recaptcha.secret_key
|
||||
});
|
||||
}
|
||||
|
||||
export default async (ctx: Koa.Context) => {
|
||||
// Verify recaptcha
|
||||
// ただしテスト時はこの機構は障害となるため無効にする
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
if (process.env.NODE_ENV !== 'test' && config.recaptcha != null) {
|
||||
const success = await recaptcha(ctx.request.body['g-recaptcha-response']);
|
||||
|
||||
if (!success) {
|
||||
|
@@ -113,7 +113,7 @@ const parsePropDefinition = (key: string, prop: any) => {
|
||||
return prop;
|
||||
};
|
||||
|
||||
const sortParams = (params: Array<{name: string}>) => {
|
||||
const sortParams = (params: Array<{ name: string }>) => {
|
||||
return params;
|
||||
};
|
||||
|
||||
@@ -184,7 +184,7 @@ router.get('/*/api/endpoints/*', async ctx => {
|
||||
paramDefs: ep.meta.params ? extractParamDefRef(Object.entries(ep.meta.params).map(([k, v]) => v)) : null,
|
||||
res: ep.meta.res,
|
||||
resProps: ep.meta.res && ep.meta.res.props ? sortParams(Object.entries(ep.meta.res.props).map(([k, v]) => parsePropDefinition(k, v))) : null,
|
||||
resDefs: null,//extractPropDefRef(Object.entries(ep.res.props).map(([k, v]) => parsePropDefinition(k, v)))
|
||||
resDefs: null, //extractPropDefRef(Object.entries(ep.res.props).map(([k, v]) => parsePropDefinition(k, v)))
|
||||
src: `https://github.com/syuilo/misskey/tree/master/src/server/api/endpoints/${name}.ts`
|
||||
};
|
||||
|
||||
|
@@ -72,7 +72,7 @@ const output = {
|
||||
|
||||
//#region Define consts
|
||||
const consts = {
|
||||
_RECAPTCHA_SITEKEY_: config.recaptcha.site_key,
|
||||
_RECAPTCHA_SITEKEY_: config.recaptcha ? config.recaptcha.site_key : null,
|
||||
_SW_PUBLICKEY_: config.sw ? config.sw.public_key : null,
|
||||
_THEME_COLOR_: constants.themeColor,
|
||||
_COPYRIGHT_: constants.copyright,
|
||||
|
Reference in New Issue
Block a user