From 3f8ebac466ece8e9598432f3f574ec44e420c03b Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 23 Nov 2017 05:43:00 +0900 Subject: なんかもうめっちゃ変えた MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #940 --- src/api/common/push-sw.ts | 6 +++- src/api/private/signup.ts | 2 +- src/config.ts | 31 ++++++++++-------- src/web/app/ch/tags/channel.tag | 13 +++----- src/web/app/ch/tags/header.tag | 6 ++-- src/web/app/common/mios.ts | 37 ++++++++++++++++++---- src/web/app/common/scripts/api.ts | 4 +-- src/web/app/common/scripts/check-for-update.ts | 6 ++-- src/web/app/common/scripts/config.ts | 27 ---------------- src/web/app/common/scripts/signout.ts | 4 +-- src/web/app/common/scripts/streaming/stream.ts | 5 +-- src/web/app/common/scripts/text-compiler.ts | 5 +-- src/web/app/common/tags/error.tag | 4 +-- src/web/app/common/tags/introduction.tag | 2 +- src/web/app/common/tags/nav-links.tag | 2 +- src/web/app/common/tags/signup.tag | 26 +++++++-------- src/web/app/common/tags/twitter-setting.tag | 12 +++---- src/web/app/common/tags/uploader.tag | 2 +- src/web/app/desktop/scripts/fuck-ad-block.ts | 2 +- src/web/app/desktop/scripts/update-avatar.ts | 5 +-- src/web/app/desktop/scripts/update-banner.ts | 5 +-- src/web/app/desktop/tags/analog-clock.tag | 2 +- src/web/app/desktop/tags/drive/browser-window.tag | 6 ++-- .../app/desktop/tags/home-widgets/broadcast.tag | 4 +-- src/web/app/desktop/tags/home-widgets/channel.tag | 2 +- src/web/app/desktop/tags/home-widgets/version.tag | 4 +-- src/web/app/desktop/tags/messaging/room-window.tag | 4 +-- src/web/app/desktop/tags/pages/entrance.tag | 2 +- src/web/app/desktop/tags/timeline.tag | 2 +- src/web/app/desktop/tags/ui.tag | 4 +-- src/web/app/init.ts | 20 +++++------- src/web/app/mobile/tags/page/settings.tag | 4 +-- src/web/app/mobile/tags/timeline.tag | 2 +- src/web/app/mobile/tags/ui.tag | 4 +-- src/web/app/stats/tags/index.tag | 2 +- src/web/app/status/tags/index.tag | 2 +- src/web/server.ts | 26 +-------------- 37 files changed, 129 insertions(+), 167 deletions(-) delete mode 100644 src/web/app/common/scripts/config.ts (limited to 'src') diff --git a/src/api/common/push-sw.ts b/src/api/common/push-sw.ts index 782a4a6a6c..2993c760ee 100644 --- a/src/api/common/push-sw.ts +++ b/src/api/common/push-sw.ts @@ -4,7 +4,11 @@ import Subscription from '../models/sw-subscription'; import config from '../../conf'; if (config.sw) { - push.setGCMAPIKey(config.sw.gcm_api_key); + // アプリケーションの連絡先と、サーバーサイドの鍵ペアの情報を登録 + push.setVapidDetails( + config.maintainer.url, + config.sw.public_key, + config.sw.private_key); } export default async function(userId: mongo.ObjectID | string, type, body?) { diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index e24734f80c..466c6a489f 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -9,7 +9,7 @@ import generateUserToken from '../common/generate-native-user-token'; import config from '../../conf'; recaptcha.init({ - secret_key: config.recaptcha.secretKey + secret_key: config.recaptcha.secret_key }); const home = { diff --git a/src/config.ts b/src/config.ts index e8322d8333..7237b666f2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,6 @@ */ import * as fs from 'fs'; -import * as URL from 'url'; import * as yaml from 'js-yaml'; import isUrl = require('is-url'); @@ -23,7 +22,19 @@ export const path = process.env.NODE_ENV == 'test' * ユーザーが設定する必要のある情報 */ type Source = { - maintainer: string; + /** + * メンテナ情報 + */ + maintainer: { + /** + * メンテナの名前 + */ + name: string; + /** + * メンテナの連絡先(URLかmailto形式のURL) + */ + url: string; + }; url: string; secondary_url: string; port: number; @@ -52,8 +63,8 @@ type Source = { pass: string; }; recaptcha: { - siteKey: string; - secretKey: string; + site_key: string; + secret_key: string; }; accesslog?: string; accesses?: { @@ -80,8 +91,8 @@ type Source = { * Service Worker */ sw?: { - gcm_sender_id: string; - gcm_api_key: string; + public_key: string; + private_key: string; }; }; @@ -114,14 +125,6 @@ export default function load() { if (!isUrl(config.url)) urlError(config.url); if (!isUrl(config.secondary_url)) urlError(config.secondary_url); - const url = URL.parse(config.url); - const head = url.host.split('.')[0]; - - if (head != 'misskey' && head != 'localhost') { - console.error(`プライマリドメインは、必ず「misskey」ドメインで始まっていなければなりません(現在の設定では「${head}」で始まっています)。例えば「https://misskey.xyz」「http://misskey.my.app.example.com」などが正しいプライマリURLです。`); - process.exit(); - } - config.url = normalizeUrl(config.url); config.secondary_url = normalizeUrl(config.secondary_url); diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag index 8300bd5715..716d61cde4 100644 --- a/src/web/app/ch/tags/channel.tag +++ b/src/web/app/ch/tags/channel.tag @@ -26,11 +26,11 @@
-

参加するにはログインまたは新規登録してください

+

参加するにはログインまたは新規登録してください


- Misskey ver { version } (葵 aoi) + Misskey ver { _VERSION_ } (葵 aoi)
diff --git a/src/web/app/desktop/tags/messaging/room-window.tag b/src/web/app/desktop/tags/messaging/room-window.tag index dca0172be3..1c6ff7c4bc 100644 --- a/src/web/app/desktop/tags/messaging/room-window.tag +++ b/src/web/app/desktop/tags/messaging/room-window.tag @@ -19,11 +19,9 @@ diff --git a/src/web/app/mobile/tags/timeline.tag b/src/web/app/mobile/tags/timeline.tag index 1d6ce23598..074422a20e 100644 --- a/src/web/app/mobile/tags/timeline.tag +++ b/src/web/app/mobile/tags/timeline.tag @@ -164,7 +164,7 @@
-

{ p.channel.title }:

+

{ p.channel.title }:

diff --git a/src/web/app/mobile/tags/ui.tag b/src/web/app/mobile/tags/ui.tag index 0c969d3902..bad6bf73fe 100644 --- a/src/web/app/mobile/tags/ui.tag +++ b/src/web/app/mobile/tags/ui.tag @@ -239,7 +239,7 @@
  • %i18n:mobile.tags.mk-ui-nav.messaging%
  • -

    %i18n:mobile.tags.mk-ui-nav.about%

    +

    %i18n:mobile.tags.mk-ui-nav.about%