Resolve #3376
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user