mirror of https://github.com/certd/certd
perf: ipv6支持
parent
a38ff69cbd
commit
da6ac1626b
|
@ -30,6 +30,7 @@ export class SysPrivateSettings extends BaseSettings {
|
|||
|
||||
httpsProxy? = '';
|
||||
httpProxy? = '';
|
||||
dnsResultOrder? = '';
|
||||
|
||||
removeSecret() {
|
||||
const clone = cloneDeep(this);
|
||||
|
|
|
@ -7,6 +7,7 @@ import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, Sy
|
|||
import * as _ from 'lodash-es';
|
||||
import { BaseService } from '../../../basic/index.js';
|
||||
import { logger, setGlobalProxy } from '@certd/basic';
|
||||
import * as dns from 'node:dns';
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
|
@ -131,6 +132,10 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
|
|||
httpsProxy: bean.httpsProxy,
|
||||
};
|
||||
setGlobalProxy(opts);
|
||||
|
||||
if (bean.dnsResultOrder) {
|
||||
dns.setDefaultResultOrder(bean.dnsResultOrder as any);
|
||||
}
|
||||
}
|
||||
|
||||
async updateByKey(key: string, setting: any) {
|
||||
|
|
|
@ -13,6 +13,7 @@ export type SysPublicSetting = {
|
|||
export type SysPrivateSetting = {
|
||||
httpProxy?: string;
|
||||
httpsProxy?: string;
|
||||
dnsResultOrder?: string;
|
||||
};
|
||||
|
||||
export const SettingKeys = {
|
||||
|
|
|
@ -39,6 +39,15 @@
|
|||
</div>
|
||||
<div class="helper">一般这两个代理填一样的</div>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="双栈网络" :name="['private', 'dnsResultOrder']">
|
||||
<a-select v-model:value="formState.private.dnsResultOrder">
|
||||
<a-select-option value="verbatim">默认</a-select-option>
|
||||
<a-select-option value="ipv4first">IPV4优先</a-select-option>
|
||||
<a-select-option value="ipv6first">IPV6优先</a-select-option>
|
||||
</a-select>
|
||||
<div class="helper">如果选择IPv6优先,需要在docker-compose.yaml中启用ipv6</div>
|
||||
</a-form-item>
|
||||
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
|
||||
<a-button :loading="saveLoading" type="primary" html-type="submit">保存</a-button>
|
||||
</a-form-item>
|
||||
|
|
Loading…
Reference in New Issue