Rewrite CutOS console host header
This commit is contained in:
+7
-1
@@ -153,8 +153,12 @@ function downloadFile(url, dest) {
|
||||
}
|
||||
|
||||
function writeFrpcConfig(clawId, frpConfig, sshSecretKey, dashboardEnabled = true) {
|
||||
const { auth_token, dashboard_local_port = 18789 } = frpConfig;
|
||||
const { auth_token, dashboard_local_port = 18789, dashboard_host_header } = frpConfig;
|
||||
const ttyRemotePort = 10000 + Number(clawId);
|
||||
const dashboardHostHeader = String(dashboard_host_header || '').trim();
|
||||
const dashboardHostHeaderLine = dashboardHostHeader
|
||||
? `hostHeaderRewrite = "${dashboardHostHeader.replace(/"/g, '\\"')}"`
|
||||
: '';
|
||||
const stcpBlock = sshSecretKey ? `
|
||||
[[proxies]]
|
||||
name = "ssh-${clawId}-secret"
|
||||
@@ -175,6 +179,7 @@ name = "dashboard-${clawId}"
|
||||
type = "http"
|
||||
localPort = ${dashboard_local_port}
|
||||
subdomain = "${clawId}"
|
||||
${dashboardHostHeaderLine}
|
||||
` : '';
|
||||
const toml = `# 由 clawd 自动生成,请勿手动修改
|
||||
serverAddr = "frp.claw.cutos.ai"
|
||||
@@ -236,5 +241,6 @@ module.exports = {
|
||||
getDashboardInfo,
|
||||
resolveOpenclawConfigFile,
|
||||
startTtyd,
|
||||
writeFrpcConfig,
|
||||
FrpcManager,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user