linux ubuntu
parent
4a094b0326
commit
4dc04fb092
|
@ -122,17 +122,26 @@ const executor = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async linux (exec, params) {
|
async linux (exec, params) {
|
||||||
await exec('sudo sed -i \'/export https=/d\' ~/.bashrc')
|
|
||||||
await exec('sudo sed -i \'/export no_proxy=/d\' ~/.bashrc')
|
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
const { ip, port } = params
|
const { ip, port } = params
|
||||||
const local = 'localhost, 127.0.0.1, ::1'
|
// const local = 'localhost, 127.0.0.0/8, ::1'
|
||||||
|
|
||||||
|
const setProxyCmd = [
|
||||||
|
'gsettings set org.gnome.system.proxy mode manual',
|
||||||
|
`gsettings set org.gnome.system.proxy.https port ${port}`,
|
||||||
|
`gsettings set org.gnome.system.proxy.https host ${ip}`,
|
||||||
|
`gsettings set org.gnome.system.proxy.http port ${port}`,
|
||||||
|
`gsettings set org.gnome.system.proxy.http host ${ip}`
|
||||||
|
// `gsettings set org.gnome.system.proxy ignore-hosts "${local}"`
|
||||||
|
]
|
||||||
|
|
||||||
const setProxyCmd = `sudo echo 'export https_proxy=https://${ip}:${port}' >> ~/.bashrc`
|
|
||||||
await exec(setProxyCmd)
|
await exec(setProxyCmd)
|
||||||
await exec(`sudo echo 'export no_proxy="${local}"' >> ~/.bashrc`)
|
} else {
|
||||||
|
const setProxyCmd = [
|
||||||
|
'gsettings set org.gnome.system.proxy mode none'
|
||||||
|
]
|
||||||
|
await exec(setProxyCmd)
|
||||||
}
|
}
|
||||||
await exec('source ~/.bashrc')
|
|
||||||
},
|
},
|
||||||
async mac (exec, params) {
|
async mac (exec, params) {
|
||||||
// exec = _exec
|
// exec = _exec
|
||||||
|
|
|
@ -51,11 +51,13 @@ utils.createCA = function (CN) {
|
||||||
name: 'basicConstraints',
|
name: 'basicConstraints',
|
||||||
critical: true,
|
critical: true,
|
||||||
cA: true
|
cA: true
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: 'keyUsage',
|
name: 'keyUsage',
|
||||||
critical: true,
|
critical: true,
|
||||||
keyCertSign: true
|
keyCertSign: true
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: 'subjectKeyIdentifier'
|
name: 'subjectKeyIdentifier'
|
||||||
}])
|
}])
|
||||||
|
|
||||||
|
@ -111,19 +113,19 @@ utils.createFakeCertificateByDomain = function (caKey, caCert, domain) {
|
||||||
critical: true,
|
critical: true,
|
||||||
cA: false
|
cA: false
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: 'keyUsage',
|
// name: 'keyUsage',
|
||||||
critical: true,
|
// critical: true,
|
||||||
digitalSignature: true,
|
// digitalSignature: true,
|
||||||
contentCommitment: true,
|
// contentCommitment: true,
|
||||||
keyEncipherment: true,
|
// keyEncipherment: true,
|
||||||
dataEncipherment: true,
|
// dataEncipherment: true,
|
||||||
keyAgreement: true,
|
// keyAgreement: true,
|
||||||
keyCertSign: true,
|
// keyCertSign: true,
|
||||||
cRLSign: true,
|
// cRLSign: true,
|
||||||
encipherOnly: true,
|
// encipherOnly: true,
|
||||||
decipherOnly: true
|
// decipherOnly: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: 'subjectAltName',
|
name: 'subjectAltName',
|
||||||
altNames: [{
|
altNames: [{
|
||||||
|
|
Loading…
Reference in New Issue