This commit is contained in:
syuilo
2018-11-23 08:13:17 +09:00
parent 7e803ff9a9
commit 0d272b1fb0
7 changed files with 27 additions and 8 deletions

View File

@ -139,6 +139,13 @@ export const meta = {
}
},
summalyProxy: {
validator: $.str.optional.nullable,
desc: {
'ja-JP': 'summalyプロキシURL'
}
},
enableTwitterIntegration: {
validator: $.bool.optional,
desc: {
@ -300,6 +307,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
set.langs = ps.langs;
}
if (ps.summalyProxy !== undefined) {
set.summalyProxy = ps.summalyProxy;
}
if (ps.enableTwitterIntegration !== undefined) {
set.enableTwitterIntegration = ps.enableTwitterIntegration;
}

View File

@ -107,6 +107,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
response.githubClientSecret = instance.githubClientSecret;
response.discordClientId = instance.discordClientId;
response.discordClientSecret = instance.discordClientSecret;
response.summalyProxy = instance.summalyProxy;
}
res(response);

View File

@ -2,11 +2,14 @@ import * as Koa from 'koa';
import * as request from 'request-promise-native';
import summaly from 'summaly';
import config from '../../config';
import fetchMeta from '../../misc/fetch-meta';
module.exports = async (ctx: Koa.Context) => {
const meta = await fetchMeta();
try {
const summary = config.summalyProxy ? await request.get({
url: config.summalyProxy,
const summary = meta.summalyProxy ? await request.get({
url: meta.summalyProxy,
proxy: config.proxy,
qs: {
url: ctx.query.url