プロキシアカウントをユーザー名ではなくIDで保存するように

This commit is contained in:
syuilo
2020-02-05 10:15:09 +09:00
parent ce589fee8c
commit 8818648740
8 changed files with 67 additions and 22 deletions

View File

@ -4,6 +4,7 @@ import { getConnection } from 'typeorm';
import { Meta } from '../../../../models/entities/meta';
import { insertModerationLog } from '../../../../services/insert-moderation-log';
import { DB_MAX_NOTE_TEXT_LENGTH } from '../../../../misc/hard-limits';
import { ID } from '../../../../misc/cafy-id';
export const meta = {
desc: {
@ -165,10 +166,10 @@ export const meta = {
}
},
proxyAccount: {
validator: $.optional.nullable.str,
proxyAccountId: {
validator: $.optional.nullable.type(ID),
desc: {
'ja-JP': 'プロキシアカウントのユーザー名'
'ja-JP': 'プロキシアカウントのID'
}
},
@ -479,8 +480,8 @@ export default define(meta, async (ps, me) => {
set.recaptchaSecretKey = ps.recaptchaSecretKey;
}
if (ps.proxyAccount !== undefined) {
set.proxyAccount = ps.proxyAccount;
if (ps.proxyAccountId !== undefined) {
set.proxyAccountId = ps.proxyAccountId;
}
if (ps.maintainerName !== undefined) {

View File

@ -170,7 +170,7 @@ export default define(meta, async (ps, me) => {
response.hiddenTags = instance.hiddenTags;
response.blockedHosts = instance.blockedHosts;
response.recaptchaSecretKey = instance.recaptchaSecretKey;
response.proxyAccount = instance.proxyAccount;
response.proxyAccountId = instance.proxyAccountId;
response.twitterConsumerKey = instance.twitterConsumerKey;
response.twitterConsumerSecret = instance.twitterConsumerSecret;
response.githubClientId = instance.githubClientId;