Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
4a9a61f108 | |||
b72d15b56c | |||
8c68992594 | |||
c052028fc3 | |||
c46fbcf345 | |||
06b66f0209 | |||
2de48110bb | |||
87d4452d19 | |||
328fc64ca9 | |||
a6f8327aa2 | |||
d5ab6b41c9 | |||
ffdd0b7de7 | |||
1808eb6eee | |||
438563b505 | |||
92dfcdad57 | |||
c178cfabfa | |||
260e4c955d | |||
0c46f5ce70 | |||
6d67cd07a0 | |||
fb8af53751 | |||
37999f4af7 | |||
3b6ab327c1 |
@ -102,7 +102,7 @@ jobs:
|
||||
- run:
|
||||
name: Build
|
||||
command: |
|
||||
docker build . | tee docker.log
|
||||
docker build -t misskey/misskey .
|
||||
- when:
|
||||
condition: <<parameters.with_deploy>>
|
||||
steps:
|
||||
@ -111,8 +111,6 @@ jobs:
|
||||
command: |
|
||||
if [ "$DOCKERHUB_USERNAME$DOCKERHUB_PASSWORD" ]
|
||||
then
|
||||
tail -n 1 docker.log | read __Successfully __built tag
|
||||
docker tag $tag misskey/misskey
|
||||
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
|
||||
docker push misskey/misskey
|
||||
else
|
||||
|
@ -1,6 +1,3 @@
|
||||
maintainer:
|
||||
name: syuilo
|
||||
url: 'https://syuilo.com'
|
||||
url: 'http://misskey.local'
|
||||
port: 80
|
||||
mongodb:
|
||||
|
@ -1,6 +1,3 @@
|
||||
maintainer:
|
||||
name: syuilo
|
||||
url: 'https://syuilo.com'
|
||||
url: 'http://misskey.local'
|
||||
port: 80
|
||||
mongodb:
|
||||
|
@ -1,10 +1,3 @@
|
||||
maintainer:
|
||||
name: example-maitainer-name # Your name
|
||||
url: http://example.com/ # Your contact (http or mailto)
|
||||
repository_url: https://github.com/syuilo/misskey # Repository URL
|
||||
feedback_url: https://github.com/syuilo/misskey/issues # Feedback URL (e.g. github issue)
|
||||
|
||||
|
||||
# Final accessible URL seen by a user.
|
||||
url: https://example.tld/
|
||||
|
||||
@ -115,11 +108,6 @@ autoAdmin: true
|
||||
# port: 9200
|
||||
# pass: null
|
||||
|
||||
# reCAPTCHA
|
||||
#recaptcha:
|
||||
# site_key: example-site-key
|
||||
# secret_key: example-secret-key
|
||||
|
||||
# ServiceWorker
|
||||
#sw:
|
||||
# # Public key of VAPID
|
||||
@ -140,11 +128,6 @@ autoAdmin: true
|
||||
# client_id: example-github-client-id
|
||||
# client_secret: example-github-client-secret
|
||||
|
||||
# Ghost
|
||||
# Ghost account is an account used for the purpose of delegating
|
||||
# followers when putting users in the list.
|
||||
#ghost: user-id-of-your-ghost-account
|
||||
|
||||
# Clustering
|
||||
#clusterLimit: 1
|
||||
|
||||
|
@ -47,11 +47,6 @@ 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.
|
||||
|
||||
*(optional)* 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
|
||||
----------------------------------------------------------------
|
||||
If you want to enable ServiceWorker, you need to generate VAPID keys:
|
||||
|
@ -53,11 +53,6 @@ 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の依存パッケージをインストール
|
||||
|
||||
*(オプション)* reCAPTCHAトークン
|
||||
----------------------------------------------------------------
|
||||
reCAPTCHAを有効にする場合、reCAPTCHAトークンを取得する必要があります。
|
||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを取得してください。
|
||||
|
||||
*(オプション)* VAPIDキーペアの生成
|
||||
----------------------------------------------------------------
|
||||
ServiceWorkerを有効にする場合、VAPIDキーペアを生成する必要があります:
|
||||
|
@ -947,6 +947,7 @@ common/views/components/api-settings.vue:
|
||||
title: 'APIコンソール'
|
||||
endpoint: 'エンドポイント'
|
||||
parameter: 'パラメータ'
|
||||
credential-info: "「i」パラメータは自動で付与されます。"
|
||||
send: '送信'
|
||||
sending: '応答待ち'
|
||||
response: '結果'
|
||||
@ -1078,12 +1079,25 @@ admin/views/instance.vue:
|
||||
instance-name: "インスタンス名"
|
||||
instance-description: "インスタンスの紹介"
|
||||
banner-url: "バナー画像URL"
|
||||
maintainer-config: "管理者情報"
|
||||
maintainer-name: "管理者名"
|
||||
maintainer-email: "管理者の連絡先"
|
||||
drive-config: "ドライブの設定"
|
||||
cache-remote-files: "リモートのファイルをキャッシュする"
|
||||
cache-remote-files-desc: "この設定を無効にすると、リモートファイルをキャッシュせず直リンクするようになります。そのためサーバーのストレージを節約できますが、プライバシー設定で直リンクを無効にしているユーザーにはファイルが見えなくなったり、サムネイルが生成されないので通信量が増加します。通常はこの設定をオンにしておくことをおすすめします。"
|
||||
local-drive-capacity-mb: "ローカルユーザーひとりあたりのドライブ容量"
|
||||
remote-drive-capacity-mb: "リモートユーザーひとりあたりのドライブ容量"
|
||||
mb: "メガバイト単位"
|
||||
recaptcha-config: "reCAPTCHAの設定"
|
||||
recaptcha-info: "reCAPTCHAを有効にする場合、reCAPTCHAトークンを取得する必要があります。https://www.google.com/recaptcha/intro/ にアクセスしてトークンを取得してください。"
|
||||
enable-recaptcha: "reCAPTCHAを有効にする"
|
||||
recaptcha-site-key: "reCAPTCHA site key"
|
||||
recaptcha-secret-key: "reCAPTCHA secret key"
|
||||
proxy-account-config: "プロキシアカウントの設定"
|
||||
proxy-account-info: "プロキシアカウントは、特定の条件下でユーザーのリモートフォローを代行するアカウントです。例えば、ユーザーがリモートユーザーをリストに入れたとき、リストに入れられたユーザーを誰もフォローしていないとアクティビティがサーバーに配達されないため、代わりにプロキシアカウントがフォローするようにします。"
|
||||
proxy-account-username: "プロキシアカウントのユーザー名"
|
||||
proxy-account-username-desc: "プロキシとして使用するアカウントのユーザー名を指定してください。"
|
||||
proxy-account-warn: "アカウントは自動で作られないため、そのユーザー名のアカウントを予め作成しておく必要があります。"
|
||||
max-note-text-length: "投稿の最大文字数"
|
||||
disable-registration: "ユーザー登録の受付を停止する"
|
||||
disable-local-timeline: "ローカルタイムラインを無効にする"
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "10.41.0",
|
||||
"clientVersion": "1.0.11594",
|
||||
"version": "10.43.1",
|
||||
"clientVersion": "1.0.11616",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
|
@ -6,11 +6,11 @@
|
||||
<ui-horizon-group inputs>
|
||||
<ui-input v-model="name">
|
||||
<span>%i18n:@add-emoji.name%</span>
|
||||
<span slot="text">%i18n:@add-emoji.name-desc%</span>
|
||||
<span slot="desc">%i18n:@add-emoji.name-desc%</span>
|
||||
</ui-input>
|
||||
<ui-input v-model="aliases">
|
||||
<span>%i18n:@add-emoji.aliases%</span>
|
||||
<span slot="text">%i18n:@add-emoji.aliases-desc%</span>
|
||||
<span slot="desc">%i18n:@add-emoji.aliases-desc%</span>
|
||||
</ui-input>
|
||||
</ui-horizon-group>
|
||||
<ui-input v-model="url">
|
||||
|
@ -7,14 +7,38 @@
|
||||
<ui-textarea v-model="description">%i18n:@instance-description%</ui-textarea>
|
||||
<ui-input v-model="bannerUrl"><i slot="icon"><fa icon="link"/></i>%i18n:@banner-url%</ui-input>
|
||||
</section>
|
||||
<section class="fit-bottom">
|
||||
<header><fa icon="headset"/> %i18n:@maintainer-config%</header>
|
||||
<ui-input v-model="maintainerName">%i18n:@maintainer-name%</ui-input>
|
||||
<ui-input v-model="maintainerEmail" type="email"><i slot="icon"><fa :icon="['far', 'envelope']"/></i>%i18n:@maintainer-email%</ui-input>
|
||||
</section>
|
||||
<section class="fit-top fit-bottom">
|
||||
<ui-input v-model="maxNoteTextLength">%i18n:@max-note-text-length%</ui-input>
|
||||
</section>
|
||||
<section class="fit-bottom">
|
||||
<header><fa icon="cloud"/> %i18n:@drive-config%</header>
|
||||
<ui-switch v-model="cacheRemoteFiles">%i18n:@cache-remote-files%<span slot="desc">%i18n:@cache-remote-files-desc%</span></ui-switch>
|
||||
<ui-input v-model="localDriveCapacityMb">%i18n:@local-drive-capacity-mb%<span slot="text">%i18n:@mb%</span><span slot="suffix">MB</span></ui-input>
|
||||
<ui-input v-model="remoteDriveCapacityMb" :disabled="!cacheRemoteFiles">%i18n:@remote-drive-capacity-mb%<span slot="text">%i18n:@mb%</span><span slot="suffix">MB</span></ui-input>
|
||||
<ui-input v-model="localDriveCapacityMb">%i18n:@local-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
|
||||
<ui-input v-model="remoteDriveCapacityMb" :disabled="!cacheRemoteFiles">%i18n:@remote-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
|
||||
</section>
|
||||
<section class="fit-bottom">
|
||||
<header><fa icon="shield-alt"/> %i18n:@recaptcha-config%</header>
|
||||
<ui-switch v-model="enableRecaptcha">%i18n:@enable-recaptcha%</ui-switch>
|
||||
<ui-info>%i18n:@recaptcha-info%</ui-info>
|
||||
<ui-input v-model="recaptchaSiteKey" :disabled="!enableRecaptcha"><i slot="icon"><fa icon="key"/></i>%i18n:@recaptcha-site-key%</ui-input>
|
||||
<ui-input v-model="recaptchaSecretKey" :disabled="!enableRecaptcha"><i slot="icon"><fa icon="key"/></i>%i18n:@recaptcha-secret-key%</ui-input>
|
||||
</section>
|
||||
<section>
|
||||
<header><fa icon="ghost"/> %i18n:@proxy-account-config%</header>
|
||||
<ui-info>%i18n:@proxy-account-info%</ui-info>
|
||||
<ui-input v-model="proxyAccount"><i slot="prefix">@</i>%i18n:@proxy-account-username%<span slot="desc">%i18n:@proxy-account-username-desc%</span></ui-input>
|
||||
<ui-info warn>%i18n:@proxy-account-warn%</ui-info>
|
||||
</section>
|
||||
<section>
|
||||
<ui-switch v-model="disableRegistration">%i18n:@disable-registration%</ui-switch>
|
||||
</section>
|
||||
<section>
|
||||
<ui-switch v-model="disableLocalTimeline">%i18n:@disable-local-timeline%</ui-switch>
|
||||
</section>
|
||||
<section>
|
||||
<ui-button @click="updateMeta">%i18n:@save%</ui-button>
|
||||
@ -22,20 +46,12 @@
|
||||
</ui-card>
|
||||
|
||||
<ui-card>
|
||||
<div slot="title">%i18n:@disable-registration%</div>
|
||||
<div slot="title">%i18n:@invite%</div>
|
||||
<section>
|
||||
<input type="checkbox" v-model="disableRegistration" @change="updateMeta">
|
||||
<button class="ui" @click="invite">%i18n:@invite%</button>
|
||||
<ui-button @click="invite">%i18n:@invite%</ui-button>
|
||||
<p v-if="inviteCode">Code: <code>{{ inviteCode }}</code></p>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card>
|
||||
<div slot="title">%i18n:@disable-local-timeline%</div>
|
||||
<section>
|
||||
<input type="checkbox" v-model="disableLocalTimeline" @change="updateMeta">
|
||||
</section>
|
||||
</ui-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -45,6 +61,8 @@ import Vue from "vue";
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
maintainerName: null,
|
||||
maintainerEmail: null,
|
||||
disableRegistration: false,
|
||||
disableLocalTimeline: false,
|
||||
bannerUrl: null,
|
||||
@ -54,12 +72,18 @@ export default Vue.extend({
|
||||
localDriveCapacityMb: null,
|
||||
remoteDriveCapacityMb: null,
|
||||
maxNoteTextLength: null,
|
||||
enableRecaptcha: false,
|
||||
recaptchaSiteKey: null,
|
||||
recaptchaSecretKey: null,
|
||||
proxyAccount: null,
|
||||
inviteCode: null,
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
(this as any).os.getMeta().then(meta => {
|
||||
this.maintainerName = meta.maintainer.name;
|
||||
this.maintainerEmail = meta.maintainer.email;
|
||||
this.bannerUrl = meta.bannerUrl;
|
||||
this.name = meta.name;
|
||||
this.description = meta.description;
|
||||
@ -67,6 +91,10 @@ export default Vue.extend({
|
||||
this.localDriveCapacityMb = meta.driveCapacityPerLocalUserMb;
|
||||
this.remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb;
|
||||
this.maxNoteTextLength = meta.maxNoteTextLength;
|
||||
this.enableRecaptcha = meta.enableRecaptcha;
|
||||
this.recaptchaSiteKey = meta.recaptchaSiteKey;
|
||||
this.recaptchaSecretKey = meta.recaptchaSecretKey;
|
||||
this.proxyAccount = meta.proxyAccount;
|
||||
});
|
||||
},
|
||||
|
||||
@ -84,6 +112,8 @@ export default Vue.extend({
|
||||
|
||||
updateMeta() {
|
||||
(this as any).api('admin/update-meta', {
|
||||
maintainerName: this.maintainerName,
|
||||
maintainerEmail: this.maintainerEmail,
|
||||
disableRegistration: this.disableRegistration,
|
||||
disableLocalTimeline: this.disableLocalTimeline,
|
||||
bannerUrl: this.bannerUrl,
|
||||
@ -92,7 +122,11 @@ export default Vue.extend({
|
||||
cacheRemoteFiles: this.cacheRemoteFiles,
|
||||
localDriveCapacityMb: parseInt(this.localDriveCapacityMb, 10),
|
||||
remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10),
|
||||
maxNoteTextLength: parseInt(this.maxNoteTextLength, 10)
|
||||
maxNoteTextLength: parseInt(this.maxNoteTextLength, 10),
|
||||
enableRecaptcha: this.enableRecaptcha,
|
||||
recaptchaSiteKey: this.recaptchaSiteKey,
|
||||
recaptchaSecretKey: this.recaptchaSecretKey,
|
||||
proxyAccount: this.proxyAccount,
|
||||
}).then(() => {
|
||||
this.$swal({
|
||||
type: 'success',
|
||||
|
@ -19,6 +19,7 @@
|
||||
</ui-input>
|
||||
<ui-textarea v-model="body">
|
||||
<span>%i18n:@console.parameter% (JSON or JSON5)</span>
|
||||
<span slot="desc">%i18n:@console.credential-info%</span>
|
||||
</ui-textarea>
|
||||
<ui-button @click="send" :disabled="sending">
|
||||
<template v-if="sending">%i18n:@console.sending%</template>
|
||||
|
@ -41,11 +41,17 @@ const lib = Object.entries(emojilib.lib).filter((x: any) => {
|
||||
return x[1].category != 'flags';
|
||||
});
|
||||
|
||||
const char2file = (char: string) => {
|
||||
let codes = [...char].map(x => x.codePointAt(0).toString(16));
|
||||
if (!codes.includes('200d')) codes = codes.filter(x => x != 'fe0f');
|
||||
return codes.join('-');
|
||||
};
|
||||
|
||||
const emjdb: EmojiDef[] = lib.map((x: any) => ({
|
||||
emoji: x[1].char,
|
||||
name: x[0],
|
||||
aliasOf: null,
|
||||
url: `https://twemoji.maxcdn.com/2/svg/${x[1].char.codePointAt(0).toString(16)}.svg`
|
||||
url: `https://twemoji.maxcdn.com/2/svg/${char2file(x[1].char)}.svg`
|
||||
}));
|
||||
|
||||
lib.forEach((x: any) => {
|
||||
@ -55,7 +61,7 @@ lib.forEach((x: any) => {
|
||||
emoji: x[1].char,
|
||||
name: k,
|
||||
aliasOf: x[0],
|
||||
url: `https://twemoji.maxcdn.com/2/svg/${x[1].char.codePointAt(0).toString(16)}.svg`
|
||||
url: `https://twemoji.maxcdn.com/2/svg/${char2file(x[1].char)}.svg`
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -60,7 +60,10 @@ export default Vue.extend({
|
||||
}
|
||||
|
||||
if (this.char) {
|
||||
this.url = `https://twemoji.maxcdn.com/2/svg/${this.char.codePointAt(0).toString(16)}.svg`;
|
||||
let codes = [...this.char].map(x => x.codePointAt(0).toString(16));
|
||||
if (!codes.includes('200d')) codes = codes.filter(x => x != 'fe0f');
|
||||
|
||||
this.url = `https://twemoji.maxcdn.com/2/svg/${codes.join('-')}.svg`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -40,7 +40,6 @@ import twitterSetting from './twitter-setting.vue';
|
||||
import githubSetting from './github-setting.vue';
|
||||
import fileTypeIcon from './file-type-icon.vue';
|
||||
import emoji from './emoji.vue';
|
||||
import Reversi from './games/reversi/reversi.vue';
|
||||
import welcomeTimeline from './welcome-timeline.vue';
|
||||
import uiInput from './ui/input.vue';
|
||||
import uiButton from './ui/button.vue';
|
||||
@ -95,7 +94,6 @@ Vue.component('mk-twitter-setting', twitterSetting);
|
||||
Vue.component('mk-github-setting', githubSetting);
|
||||
Vue.component('mk-file-type-icon', fileTypeIcon);
|
||||
Vue.component('mk-emoji', emoji);
|
||||
Vue.component('mk-reversi', Reversi);
|
||||
Vue.component('mk-welcome-timeline', welcomeTimeline);
|
||||
Vue.component('ui-input', uiInput);
|
||||
Vue.component('ui-button', uiButton);
|
||||
|
@ -31,13 +31,13 @@
|
||||
<ui-input type="file" @change="onAvatarChange">
|
||||
<span>%i18n:@avatar%</span>
|
||||
<span slot="icon"><fa icon="image"/></span>
|
||||
<span slot="text" v-if="avatarUploading">%i18n:@uploading%<mk-ellipsis/></span>
|
||||
<span slot="desc" v-if="avatarUploading">%i18n:@uploading%<mk-ellipsis/></span>
|
||||
</ui-input>
|
||||
|
||||
<ui-input type="file" @change="onBannerChange">
|
||||
<span>%i18n:@banner%</span>
|
||||
<span slot="icon"><fa icon="image"/></span>
|
||||
<span slot="text" v-if="bannerUploading">%i18n:@uploading%<mk-ellipsis/></span>
|
||||
<span slot="desc" v-if="bannerUploading">%i18n:@uploading%<mk-ellipsis/></span>
|
||||
</ui-input>
|
||||
|
||||
<ui-button @click="save(true)">%i18n:@save%</ui-button>
|
||||
|
@ -4,38 +4,38 @@
|
||||
<ui-input v-if="meta.disableRegistration" v-model="invitationCode" type="text" :autocomplete="Math.random()" spellcheck="false" required styl="fill">
|
||||
<span>%i18n:@invitation-code%</span>
|
||||
<span slot="prefix"><fa icon="id-card-alt"/></span>
|
||||
<p slot="text" v-html="'%i18n:@invitation-info%'.replace('{}', meta.maintainer.url)"></p>
|
||||
<p slot="desc" v-html="'%i18n:@invitation-info%'.replace('{}', 'mailto:' + meta.maintainer.email)"></p>
|
||||
</ui-input>
|
||||
<ui-input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{1,20}$" :autocomplete="Math.random()" spellcheck="false" required @input="onChangeUsername" styl="fill">
|
||||
<span>%i18n:@username%</span>
|
||||
<span slot="prefix">@</span>
|
||||
<span slot="suffix">@{{ host }}</span>
|
||||
<p slot="text" v-if="usernameState == 'wait'" style="color:#999"><fa icon="spinner .pulse" fixed-width/> %i18n:@checking%</p>
|
||||
<p slot="text" v-if="usernameState == 'ok'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@available%</p>
|
||||
<p slot="text" v-if="usernameState == 'unavailable'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@unavailable%</p>
|
||||
<p slot="text" v-if="usernameState == 'error'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@error%</p>
|
||||
<p slot="text" v-if="usernameState == 'invalid-format'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@invalid-format%</p>
|
||||
<p slot="text" v-if="usernameState == 'min-range'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@too-short%</p>
|
||||
<p slot="text" v-if="usernameState == 'max-range'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@too-long%</p>
|
||||
<p slot="desc" v-if="usernameState == 'wait'" style="color:#999"><fa icon="spinner .pulse" fixed-width/> %i18n:@checking%</p>
|
||||
<p slot="desc" v-if="usernameState == 'ok'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@available%</p>
|
||||
<p slot="desc" v-if="usernameState == 'unavailable'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@unavailable%</p>
|
||||
<p slot="desc" v-if="usernameState == 'error'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@error%</p>
|
||||
<p slot="desc" v-if="usernameState == 'invalid-format'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@invalid-format%</p>
|
||||
<p slot="desc" v-if="usernameState == 'min-range'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@too-short%</p>
|
||||
<p slot="desc" v-if="usernameState == 'max-range'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@too-long%</p>
|
||||
</ui-input>
|
||||
<ui-input v-model="password" type="password" :autocomplete="Math.random()" required @input="onChangePassword" :with-password-meter="true" styl="fill">
|
||||
<span>%i18n:@password%</span>
|
||||
<span slot="prefix"><fa icon="lock"/></span>
|
||||
<div slot="text">
|
||||
<p slot="text" v-if="passwordStrength == 'low'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@weak-password%</p>
|
||||
<p slot="text" v-if="passwordStrength == 'medium'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@normal-password%</p>
|
||||
<p slot="text" v-if="passwordStrength == 'high'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@strong-password%</p>
|
||||
<div slot="desc">
|
||||
<p v-if="passwordStrength == 'low'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@weak-password%</p>
|
||||
<p v-if="passwordStrength == 'medium'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@normal-password%</p>
|
||||
<p v-if="passwordStrength == 'high'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@strong-password%</p>
|
||||
</div>
|
||||
</ui-input>
|
||||
<ui-input v-model="retypedPassword" type="password" :autocomplete="Math.random()" required @input="onChangePasswordRetype" styl="fill">
|
||||
<span>%i18n:@password% (%i18n:@retype%)</span>
|
||||
<span slot="prefix"><fa icon="lock"/></span>
|
||||
<div slot="text">
|
||||
<p slot="text" v-if="passwordRetypeState == 'match'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@password-matched%</p>
|
||||
<p slot="text" v-if="passwordRetypeState == 'not-match'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@password-not-matched%</p>
|
||||
<div slot="desc">
|
||||
<p v-if="passwordRetypeState == 'match'" style="color:#3CB7B5"><fa icon="check" fixed-width/> %i18n:@password-matched%</p>
|
||||
<p v-if="passwordRetypeState == 'not-match'" style="color:#FF1161"><fa icon="exclamation-triangle" fixed-width/> %i18n:@password-not-matched%</p>
|
||||
</div>
|
||||
</ui-input>
|
||||
<div v-if="meta.recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="meta.recaptchaSitekey" style="margin: 16px 0;"></div>
|
||||
<div v-if="meta.recaptchaSiteKey != null" class="g-recaptcha" :data-sitekey="meta.recaptchaSiteKey" style="margin: 16px 0;"></div>
|
||||
<ui-button type="submit">%i18n:@create%</ui-button>
|
||||
</template>
|
||||
</form>
|
||||
@ -130,7 +130,7 @@ export default Vue.extend({
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
invitationCode: this.invitationCode,
|
||||
'g-recaptcha-response': this.meta.recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null
|
||||
'g-recaptcha-response': this.meta.recaptchaSiteKey != null ? (window as any).grecaptcha.getResponse() : null
|
||||
}, true).then(() => {
|
||||
(this as any).api('signin', {
|
||||
username: this.username,
|
||||
@ -141,7 +141,7 @@ export default Vue.extend({
|
||||
}).catch(() => {
|
||||
alert('%i18n:@some-error%');
|
||||
|
||||
if (this.meta.recaptchaSitekey != null) {
|
||||
if (this.meta.recaptchaSiteKey != null) {
|
||||
(window as any).grecaptcha.reset();
|
||||
}
|
||||
});
|
||||
|
@ -33,7 +33,7 @@
|
||||
</template>
|
||||
<div class="suffix" ref="suffix"><slot name="suffix"></slot></div>
|
||||
</div>
|
||||
<div class="text"><slot name="text"></slot></div>
|
||||
<div class="desc"><slot name="desc"></slot></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -321,7 +321,7 @@ root(fill)
|
||||
if fill
|
||||
padding-right 12px
|
||||
|
||||
> .text
|
||||
> .desc
|
||||
margin 6px 0
|
||||
font-size 13px
|
||||
|
||||
|
@ -129,5 +129,6 @@ export default Vue.extend({
|
||||
> p
|
||||
margin 0
|
||||
opacity 0.7
|
||||
font-size 90%
|
||||
|
||||
</style>
|
||||
|
@ -13,7 +13,7 @@
|
||||
@blur="focused = false"
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="text"><slot name="text"></slot></div>
|
||||
<div class="desc"><slot name="desc"></slot></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -139,7 +139,7 @@ root(fill)
|
||||
outline none
|
||||
box-shadow none
|
||||
|
||||
> .text
|
||||
> .desc
|
||||
margin 6px 0
|
||||
font-size 13px
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<h1><fa icon="heart"/>%i18n:@title%</h1>
|
||||
<p v-if="meta">
|
||||
{{ '%i18n:@text%'.substr(0, '%i18n:@text%'.indexOf('{')) }}
|
||||
<a :href="meta.maintainer.url">{{ meta.maintainer.name }}</a>
|
||||
<a :href="'mailto:' + meta.maintainer.email">{{ meta.maintainer.name }}</a>
|
||||
{{ '%i18n:@text%'.substr('%i18n:@text%'.indexOf('}') + 1) }}
|
||||
</p>
|
||||
</article>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="info">
|
||||
<p>Maintainer: <b><a :href="meta.maintainer.url" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
<p>Machine: {{ meta.machine }}</p>
|
||||
<p>Node: {{ meta.node }}</p>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<mk-window ref="window" width="500px" height="560px" :popout-url="popout" @closed="destroyDom">
|
||||
<span slot="header" :class="$style.header"><fa icon="gamepad"/>%i18n:@game%</span>
|
||||
<mk-reversi :class="$style.content" @gamed="g => game = g"/>
|
||||
<x-reversi :class="$style.content" @gamed="g => game = g"/>
|
||||
</mk-window>
|
||||
</template>
|
||||
|
||||
@ -10,6 +10,9 @@ import Vue from 'vue';
|
||||
import { url } from '../../../config';
|
||||
|
||||
export default Vue.extend({
|
||||
components: {
|
||||
XReversi: () => import('../../../common/views/components/games/reversi/reversi.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
game: null
|
||||
|
@ -247,7 +247,7 @@
|
||||
<ui-card class="other" v-show="page == 'other'">
|
||||
<div slot="title"><fa icon="info-circle"/> %i18n:@about%</div>
|
||||
<section>
|
||||
<p v-if="meta">%i18n:@operator%: <i><a :href="meta.maintainer.url" target="_blank">{{ meta.maintainer.name }}</a></i></p>
|
||||
<p v-if="meta">%i18n:@operator%: <i><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></i></p>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<component :is="ui ? 'mk-ui' : 'div'">
|
||||
<mk-reversi :game-id="$route.params.game" @nav="nav" :self-nav="false"/>
|
||||
<x-reversi :game-id="$route.params.game" @nav="nav" :self-nav="false"/>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
components: {
|
||||
XReversi: () => import('../../../../common/views/components/games/reversi/reversi.vue')
|
||||
},
|
||||
props: {
|
||||
ui: {
|
||||
default: false
|
||||
|
@ -87,7 +87,7 @@
|
||||
<div>
|
||||
<div v-if="meta" class="body">
|
||||
<p>Version: <b>{{ meta.version }}</b></p>
|
||||
<p>Maintainer: <b><a :href="meta.maintainer.url" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<mk-ui>
|
||||
<span slot="header"><span style="margin-right:4px;"><fa icon="gamepad"/></span>%i18n:@reversi%</span>
|
||||
<mk-reversi :game-id="$route.params.game" @nav="nav" :self-nav="false"/>
|
||||
<x-reversi :game-id="$route.params.game" @nav="nav" :self-nav="false"/>
|
||||
</mk-ui>
|
||||
</template>
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
components: {
|
||||
XReversi: () => import('../../../../common/views/components/games/reversi/reversi.vue')
|
||||
},
|
||||
mounted() {
|
||||
document.title = `${(this as any).os.instanceName} %i18n:@reversi%`;
|
||||
},
|
||||
|
@ -62,7 +62,7 @@
|
||||
</article>
|
||||
<div class="info" v-if="meta">
|
||||
<p>Version: <b>{{ meta.version }}</b></p>
|
||||
<p>Maintainer: <b><a :href="meta.maintainer.url" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
|
||||
</div>
|
||||
<footer>
|
||||
<small>{{ copyright }}</small>
|
||||
|
@ -2,24 +2,9 @@
|
||||
* ユーザーが設定する必要のある情報
|
||||
*/
|
||||
export type Source = {
|
||||
/**
|
||||
* メンテナ情報
|
||||
*/
|
||||
maintainer: {
|
||||
/**
|
||||
* メンテナの名前
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* メンテナの連絡先(URLかmailto形式のURL)
|
||||
*/
|
||||
url: string;
|
||||
email?: string;
|
||||
repository_url?: string;
|
||||
feedback_url?: string;
|
||||
};
|
||||
repository_url?: string;
|
||||
feedback_url?: string;
|
||||
languages?: string[];
|
||||
welcome_bg_url?: string;
|
||||
url: string;
|
||||
port: number;
|
||||
https?: { [x: string]: string };
|
||||
@ -41,11 +26,6 @@ export type Source = {
|
||||
port: number;
|
||||
pass: string;
|
||||
};
|
||||
recaptcha?: {
|
||||
site_key: string;
|
||||
secret_key: string;
|
||||
};
|
||||
|
||||
drive?: {
|
||||
storage: string;
|
||||
bucket?: string;
|
||||
@ -56,11 +36,6 @@ export type Source = {
|
||||
|
||||
autoAdmin?: boolean;
|
||||
|
||||
/**
|
||||
* ゴーストアカウントのID
|
||||
*/
|
||||
ghost?: string;
|
||||
|
||||
proxy?: string;
|
||||
|
||||
summalyProxy?: string;
|
||||
@ -78,17 +53,6 @@ export type Source = {
|
||||
hook_secret: string;
|
||||
username: string;
|
||||
};
|
||||
reversi_ai?: {
|
||||
id: string;
|
||||
i: string;
|
||||
};
|
||||
line_bot?: {
|
||||
channel_secret: string;
|
||||
channel_access_token: string;
|
||||
};
|
||||
analysis?: {
|
||||
mecab_command?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Service Worker
|
||||
|
2
src/mfm/parse/elements/emoji.regex.ts
Normal file
2
src/mfm/parse/elements/emoji.regex.ts
Normal file
File diff suppressed because one or more lines are too long
@ -2,6 +2,8 @@
|
||||
* Emoji
|
||||
*/
|
||||
|
||||
import { emojiRegex } from "./emoji.regex";
|
||||
|
||||
export type TextElementEmoji = {
|
||||
type: 'emoji';
|
||||
content: string;
|
||||
@ -9,8 +11,6 @@ export type TextElementEmoji = {
|
||||
name?: string;
|
||||
};
|
||||
|
||||
const emojiRegex = /^[\u{1f300}-\u{1f5ff}\u{1f900}-\u{1f9ff}\u{1f600}-\u{1f64f}\u{1f680}-\u{1f6ff}\u{2600}-\u{26ff}\u{2700}-\u{27bf}\u{1f1e6}-\u{1f1ff}\u{1f191}-\u{1f251}\u{1f004}\u{1f0cf}\u{1f170}-\u{1f171}\u{1f17e}-\u{1f17f}\u{1f18e}\u{3030}\u{2b50}\u{2b55}\u{2934}-\u{2935}\u{2b05}-\u{2b07}\u{2b1b}-\u{2b1c}\u{3297}\u{3299}\u{303d}\u{00a9}\u{00ae}\u{2122}\u{23f3}\u{24c2}\u{23e9}-\u{23ef}\u{25b6}\u{23f8}-\u{23fa}]/ug;
|
||||
|
||||
export default function(text: string) {
|
||||
const name = text.match(/^:([a-zA-Z0-9+_-]+):/);
|
||||
if (name) {
|
||||
|
@ -54,7 +54,7 @@ export default class Replacer {
|
||||
if (this.lang === 'ja-JP') console.warn(`key '${key}' is not string in '${path}'`);
|
||||
return key; // Fallback
|
||||
} else {
|
||||
return text;
|
||||
return text.replace(/\n/g, ' ');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
import db from '../db/mongodb';
|
||||
import config from '../config';
|
||||
import User from './user';
|
||||
import { transform } from '../misc/cafy-id';
|
||||
|
||||
const Meta = db.get<IMeta>('meta');
|
||||
export default Meta;
|
||||
@ -61,17 +63,71 @@ if ((config as any).preventCacheRemoteFiles) {
|
||||
}
|
||||
});
|
||||
}
|
||||
if ((config as any).recaptcha) {
|
||||
Meta.findOne({}).then(m => {
|
||||
if (m != null && m.enableRecaptcha == null) {
|
||||
Meta.update({}, {
|
||||
$set: {
|
||||
enableRecaptcha: (config as any).recaptcha != null,
|
||||
recaptchaSiteKey: (config as any).recaptcha.site_key,
|
||||
recaptchaSecretKey: (config as any).recaptcha.secret_key,
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if ((config as any).ghost) {
|
||||
Meta.findOne({}).then(async m => {
|
||||
if (m != null && m.proxyAccount == null) {
|
||||
const account = await User.findOne({ _id: transform((config as any).ghost) });
|
||||
Meta.update({}, {
|
||||
$set: {
|
||||
proxyAccount: account.username
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if ((config as any).maintainer) {
|
||||
Meta.findOne({}).then(m => {
|
||||
if (m != null && m.maintainer == null) {
|
||||
Meta.update({}, {
|
||||
$set: {
|
||||
maintainer: (config as any).maintainer
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export type IMeta = {
|
||||
name?: string;
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* メンテナ情報
|
||||
*/
|
||||
maintainer: {
|
||||
/**
|
||||
* メンテナの名前
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* メンテナの連絡先
|
||||
*/
|
||||
email?: string;
|
||||
};
|
||||
|
||||
broadcasts?: any[];
|
||||
|
||||
stats?: {
|
||||
notesCount: number;
|
||||
originalNotesCount: number;
|
||||
usersCount: number;
|
||||
originalUsersCount: number;
|
||||
};
|
||||
|
||||
disableRegistration?: boolean;
|
||||
disableLocalTimeline?: boolean;
|
||||
hidedTags?: string[];
|
||||
@ -79,6 +135,12 @@ export type IMeta = {
|
||||
|
||||
cacheRemoteFiles?: boolean;
|
||||
|
||||
proxyAccount?: string;
|
||||
|
||||
enableRecaptcha?: boolean;
|
||||
recaptchaSiteKey?: string;
|
||||
recaptchaSecretKey?: string;
|
||||
|
||||
/**
|
||||
* Drive capacity of a local user (MB)
|
||||
*/
|
||||
|
@ -10,6 +10,7 @@ import Mute from './mute';
|
||||
import { getFriendIds } from '../server/api/common/get-friends';
|
||||
import config from '../config';
|
||||
import FollowRequest from './follow-request';
|
||||
import fetchMeta from '../misc/fetch-meta';
|
||||
|
||||
const User = db.get<IUser>('users');
|
||||
|
||||
@ -376,6 +377,7 @@ function img(url) {
|
||||
}
|
||||
*/
|
||||
|
||||
export function getGhost(): Promise<ILocalUser> {
|
||||
return User.findOne({ _id: new mongo.ObjectId(config.ghost) });
|
||||
export async function fetchProxyAccount(): Promise<ILocalUser> {
|
||||
const meta = await fetchMeta();
|
||||
return await User.findOne({ username: meta.proxyAccount, host: null }) as ILocalUser;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import config from './config';
|
||||
if (config.sw) {
|
||||
// アプリケーションの連絡先と、サーバーサイドの鍵ペアの情報を登録
|
||||
push.setVapidDetails(
|
||||
config.maintainer.url,
|
||||
config.url,
|
||||
config.sw.public_key,
|
||||
config.sw.private_key);
|
||||
}
|
||||
|
@ -88,6 +88,48 @@ export const meta = {
|
||||
desc: {
|
||||
'ja-JP': 'リモートのファイルをキャッシュするか否か'
|
||||
}
|
||||
},
|
||||
|
||||
enableRecaptcha: {
|
||||
validator: $.bool.optional,
|
||||
desc: {
|
||||
'ja-JP': 'reCAPTCHAを使用するか否か'
|
||||
}
|
||||
},
|
||||
|
||||
recaptchaSiteKey: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'reCAPTCHA site key'
|
||||
}
|
||||
},
|
||||
|
||||
recaptchaSecretKey: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'reCAPTCHA secret key'
|
||||
}
|
||||
},
|
||||
|
||||
proxyAccount: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'プロキシアカウントのユーザー名'
|
||||
}
|
||||
},
|
||||
|
||||
maintainerName: {
|
||||
validator: $.str.optional,
|
||||
desc: {
|
||||
'ja-JP': 'インスタンスの管理者名'
|
||||
}
|
||||
},
|
||||
|
||||
maintainerEmail: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -139,6 +181,30 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
|
||||
set.cacheRemoteFiles = ps.cacheRemoteFiles;
|
||||
}
|
||||
|
||||
if (ps.enableRecaptcha !== undefined) {
|
||||
set.enableRecaptcha = ps.enableRecaptcha;
|
||||
}
|
||||
|
||||
if (ps.recaptchaSiteKey !== undefined) {
|
||||
set.recaptchaSiteKey = ps.recaptchaSiteKey;
|
||||
}
|
||||
|
||||
if (ps.recaptchaSecretKey !== undefined) {
|
||||
set.recaptchaSecretKey = ps.recaptchaSecretKey;
|
||||
}
|
||||
|
||||
if (ps.proxyAccount !== undefined) {
|
||||
set.proxyAccount = ps.proxyAccount;
|
||||
}
|
||||
|
||||
if (ps.maintainerName !== undefined) {
|
||||
set['maintainer.name'] = ps.maintainerName;
|
||||
}
|
||||
|
||||
if (ps.maintainerEmail !== undefined) {
|
||||
set['maintainer.email'] = ps.maintainerEmail;
|
||||
}
|
||||
|
||||
await Meta.update({}, {
|
||||
$set: set
|
||||
}, { upsert: true });
|
||||
|
@ -32,8 +32,9 @@ export const meta = {
|
||||
},
|
||||
|
||||
isSensitive: {
|
||||
validator: $.bool.optional,
|
||||
validator: $.or($.bool, $.str).optional,
|
||||
default: false,
|
||||
transform: (v: any): boolean => v === true || v === 'true',
|
||||
desc: {
|
||||
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
|
||||
'en-US': 'Whether this media is NSFW'
|
||||
@ -41,8 +42,9 @@ export const meta = {
|
||||
},
|
||||
|
||||
force: {
|
||||
validator: $.bool.optional,
|
||||
validator: $.or($.bool, $.str).optional,
|
||||
default: false,
|
||||
transform: (v: any): boolean => v === true || v === 'true',
|
||||
desc: {
|
||||
'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。',
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export const meta = {
|
||||
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
const files = await DriveFile
|
||||
.find({
|
||||
filename: name,
|
||||
filename: ps.name,
|
||||
'metadata.userId': user._id,
|
||||
'metadata.folderId': ps.folderId
|
||||
});
|
||||
|
@ -35,8 +35,8 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||
}
|
||||
});
|
||||
|
||||
res({
|
||||
maintainer: config.maintainer,
|
||||
const response: any = {
|
||||
maintainer: instance.maintainer,
|
||||
|
||||
version: pkg.version,
|
||||
clientVersion: client.version,
|
||||
@ -60,24 +60,33 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||
driveCapacityPerLocalUserMb: instance.localDriveCapacityMb,
|
||||
driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb,
|
||||
cacheRemoteFiles: instance.cacheRemoteFiles,
|
||||
recaptchaSitekey: config.recaptcha ? config.recaptcha.site_key : null,
|
||||
recaptchaSiteKey: instance.enableRecaptcha ? instance.recaptchaSiteKey : null,
|
||||
swPublickey: config.sw ? config.sw.public_key : null,
|
||||
hidedTags: (me && me.isAdmin) ? instance.hidedTags : undefined,
|
||||
bannerUrl: instance.bannerUrl,
|
||||
maxNoteTextLength: instance.maxNoteTextLength,
|
||||
|
||||
emojis: emojis,
|
||||
};
|
||||
|
||||
features: ps.detail ? {
|
||||
if (ps.detail) {
|
||||
response.features = {
|
||||
registration: !instance.disableRegistration,
|
||||
localTimeLine: !instance.disableLocalTimeline,
|
||||
elasticsearch: config.elasticsearch ? true : false,
|
||||
recaptcha: config.recaptcha ? true : false,
|
||||
recaptcha: instance.enableRecaptcha,
|
||||
objectStorage: config.drive && config.drive.storage === 'minio',
|
||||
twitter: config.twitter ? true : false,
|
||||
github: config.github ? true : false,
|
||||
serviceWorker: config.sw ? true : false,
|
||||
userRecommendation: config.user_recommendation ? config.user_recommendation : {}
|
||||
} : undefined
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
if (me && me.isAdmin) {
|
||||
response.hidedTags = instance.hidedTags;
|
||||
response.recaptchaSecretKey = instance.recaptchaSecretKey;
|
||||
response.proxyAccount = instance.proxyAccount;
|
||||
}
|
||||
|
||||
res(response);
|
||||
}));
|
||||
|
44
src/server/api/endpoints/notes/watching/create.ts
Normal file
44
src/server/api/endpoints/notes/watching/create.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
|
||||
import Note from '../../../../../models/note';
|
||||
import define from '../../../define';
|
||||
import watch from '../../../../../services/note/watch';
|
||||
|
||||
export const meta = {
|
||||
stability: 'stable',
|
||||
|
||||
desc: {
|
||||
'ja-JP': '指定した投稿をウォッチします。',
|
||||
'en-US': 'Watch a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-write',
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
validator: $.type(ID),
|
||||
transform: transform,
|
||||
desc: {
|
||||
'ja-JP': '対象の投稿のID',
|
||||
'en-US': 'Target note ID.'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
// Get note
|
||||
const note = await Note.findOne({
|
||||
_id: ps.noteId
|
||||
});
|
||||
|
||||
if (note === null) {
|
||||
return rej('note not found');
|
||||
}
|
||||
|
||||
await watch(user._id, note);
|
||||
|
||||
// Send response
|
||||
res();
|
||||
}));
|
44
src/server/api/endpoints/notes/watching/delete.ts
Normal file
44
src/server/api/endpoints/notes/watching/delete.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
|
||||
import Note from '../../../../../models/note';
|
||||
import define from '../../../define';
|
||||
import unwatch from '../../../../../services/note/unwatch';
|
||||
|
||||
export const meta = {
|
||||
stability: 'stable',
|
||||
|
||||
desc: {
|
||||
'ja-JP': '指定した投稿のウォッチを解除します。',
|
||||
'en-US': 'Unwatch a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-write',
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
validator: $.type(ID),
|
||||
transform: transform,
|
||||
desc: {
|
||||
'ja-JP': '対象の投稿のID',
|
||||
'en-US': 'Target note ID.'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
||||
// Get note
|
||||
const note = await Note.findOne({
|
||||
_id: ps.noteId
|
||||
});
|
||||
|
||||
if (note === null) {
|
||||
return rej('note not found');
|
||||
}
|
||||
|
||||
await unwatch(user._id, note);
|
||||
|
||||
// Send response
|
||||
res();
|
||||
}));
|
@ -1,6 +1,6 @@
|
||||
import $ from 'cafy'; import ID, { transform } from '../../../../../misc/cafy-id';
|
||||
import UserList from '../../../../../models/user-list';
|
||||
import User, { pack as packUser, isRemoteUser, getGhost } from '../../../../../models/user';
|
||||
import User, { pack as packUser, isRemoteUser, fetchProxyAccount } from '../../../../../models/user';
|
||||
import { publishUserListStream } from '../../../../../stream';
|
||||
import ap from '../../../../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../../../../remote/activitypub/renderer/follow';
|
||||
@ -71,8 +71,8 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
||||
|
||||
// このインスタンス内にこのリモートユーザーをフォローしているユーザーがいなくても投稿を受け取るためにダミーのユーザーがフォローしたということにする
|
||||
if (isRemoteUser(user)) {
|
||||
const ghost = await getGhost();
|
||||
const content = ap(renderFollow(ghost, user));
|
||||
deliver(ghost, content, user.inbox);
|
||||
const proxy = await fetchProxyAccount();
|
||||
const content = ap(renderFollow(proxy, user));
|
||||
deliver(proxy, content, user.inbox);
|
||||
}
|
||||
}));
|
||||
|
@ -48,7 +48,7 @@ router.get('/v1/instance', async ctx => { // TODO: This is a temporary implement
|
||||
uri: config.hostname,
|
||||
title: meta.name || 'Misskey',
|
||||
description: meta.description || '',
|
||||
email: config.maintainer.email || config.maintainer.url.startsWith('mailto:') ? config.maintainer.url.slice(7) : '',
|
||||
email: meta.maintainer.email,
|
||||
version: `0.0.0:compatible:misskey:${pkg.version}`, // TODO: How to tell about that this is an api for compatibility?
|
||||
thumbnail: meta.bannerUrl,
|
||||
/*
|
||||
|
@ -1,7 +1,6 @@
|
||||
import * as Koa from 'koa';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import { generate as generateKeypair } from '../../../crypto_key';
|
||||
const recaptcha = require('recaptcha-promise');
|
||||
import User, { IUser, validateUsername, validatePassword, pack } from '../../../models/user';
|
||||
import generateUserToken from '../common/generate-native-user-token';
|
||||
import config from '../../../config';
|
||||
@ -10,18 +9,20 @@ import RegistrationTicket from '../../../models/registration-tickets';
|
||||
import usersChart from '../../../chart/users';
|
||||
import fetchMeta from '../../../misc/fetch-meta';
|
||||
|
||||
if (config.recaptcha) {
|
||||
recaptcha.init({
|
||||
secret_key: config.recaptcha.secret_key
|
||||
});
|
||||
}
|
||||
|
||||
export default async (ctx: Koa.Context) => {
|
||||
const body = ctx.request.body as any;
|
||||
|
||||
const instance = await fetchMeta();
|
||||
|
||||
const recaptcha = require('recaptcha-promise');
|
||||
|
||||
// Verify recaptcha
|
||||
// ただしテスト時はこの機構は障害となるため無効にする
|
||||
if (process.env.NODE_ENV !== 'test' && config.recaptcha != null) {
|
||||
if (process.env.NODE_ENV !== 'test' && instance.enableRecaptcha) {
|
||||
recaptcha.init({
|
||||
secret_key: instance.recaptchaSecretKey
|
||||
});
|
||||
|
||||
const success = await recaptcha(body['g-recaptcha-response']);
|
||||
|
||||
if (!success) {
|
||||
@ -34,8 +35,6 @@ export default async (ctx: Koa.Context) => {
|
||||
const password = body['password'];
|
||||
const invitationCode = body['invitationCode'];
|
||||
|
||||
const instance = await fetchMeta();
|
||||
|
||||
if (instance && instance.disableRegistration) {
|
||||
if (invitationCode == null || typeof invitationCode != 'string') {
|
||||
ctx.status = 400;
|
||||
|
9
src/services/note/unwatch.ts
Normal file
9
src/services/note/unwatch.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import * as mongodb from 'mongodb';
|
||||
import Watching from '../../models/note-watching';
|
||||
|
||||
export default async (me: mongodb.ObjectID, note: object) => {
|
||||
await Watching.remove({
|
||||
noteId: (note as any)._id,
|
||||
userId: me
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user