mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-06-20 18:10:40 +00:00
feat: use self-hosted install scripts and pass dashboard URL
This commit is contained in:
@@ -141,6 +141,7 @@ const generateCommand = (
|
|||||||
`NZ_SERVER=${install_host}`,
|
`NZ_SERVER=${install_host}`,
|
||||||
`NZ_TLS=${tls || false}`,
|
`NZ_TLS=${tls || false}`,
|
||||||
`NZ_CLIENT_SECRET=${agent_secret}`,
|
`NZ_CLIENT_SECRET=${agent_secret}`,
|
||||||
|
`NZ_DASHBOARD_URL=${window.location.origin}`,
|
||||||
]
|
]
|
||||||
if (uuid) envParts.push(`NZ_UUID=${uuid}`)
|
if (uuid) envParts.push(`NZ_UUID=${uuid}`)
|
||||||
const env = envParts.join(" ")
|
const env = envParts.join(" ")
|
||||||
@@ -156,10 +157,10 @@ const generateCommand = (
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case OSTypes.Linux:
|
case OSTypes.Linux:
|
||||||
case OSTypes.macOS: {
|
case OSTypes.macOS: {
|
||||||
return `curl -L https://raw.githubusercontent.com/nezhahq/scripts/main/agent/install.sh -o agent.sh && chmod +x agent.sh && env ${env} ./agent.sh`
|
return `curl -L ${window.location.origin}/script/agent.sh -o agent.sh && chmod +x agent.sh && env ${env} ./agent.sh`
|
||||||
}
|
}
|
||||||
case OSTypes.Windows: {
|
case OSTypes.Windows: {
|
||||||
return `${env_win} [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/nezhahq/scripts/main/agent/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1`
|
return `${env_win} [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest ${window.location.origin}/script/agent.ps1 -OutFile C:\\install.ps1;powershell.exe C:\\install.ps1`
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
throw new Error(`Unknown OS: ${type}`)
|
throw new Error(`Unknown OS: ${type}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user