fix The string is missing the terminator
This commit is contained in:
1 file changed
+37
-2
@@ -616,7 +616,7 @@ jobs:
|
|||||||
throw "RUSTDESK_KEY secret is empty"
|
throw "RUSTDESK_KEY secret is empty"
|
||||||
}
|
}
|
||||||
|
|
||||||
@'
|
$pythonCode = @'
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -630,6 +630,12 @@ jobs:
|
|||||||
server = os.environ["ID_SERVER"].strip()
|
server = os.environ["ID_SERVER"].strip()
|
||||||
key = os.environ["PUB_KEY"].strip()
|
key = os.environ["PUB_KEY"].strip()
|
||||||
|
|
||||||
|
if not server:
|
||||||
|
raise SystemExit("RUSTDESK_ID_SERVER is empty")
|
||||||
|
|
||||||
|
if not key:
|
||||||
|
raise SystemExit("RUSTDESK_KEY is empty")
|
||||||
|
|
||||||
text = path.read_text(encoding="utf-8")
|
text = path.read_text(encoding="utf-8")
|
||||||
|
|
||||||
text, server_count = re.subn(
|
text, server_count = re.subn(
|
||||||
@@ -663,7 +669,36 @@ jobs:
|
|||||||
)
|
)
|
||||||
|
|
||||||
path.write_text(text, encoding="utf-8")
|
path.write_text(text, encoding="utf-8")
|
||||||
PY
|
|
||||||
|
print(f"ID server configured: {server}")
|
||||||
|
print("Server public key configured successfully")
|
||||||
|
print("Relay configuration untouched")
|
||||||
|
'@
|
||||||
|
|
||||||
|
$pythonCode | python -
|
||||||
|
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "RustDesk configuration patch failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Checking patched RustDesk configuration..."
|
||||||
|
|
||||||
|
$config = Get-Content `
|
||||||
|
"rustdesk\libs\hbb_common\src\config.rs" `
|
||||||
|
-Raw
|
||||||
|
|
||||||
|
if ($config -notmatch "RENDEZVOUS_SERVERS") {
|
||||||
|
throw "RENDEZVOUS_SERVERS not found after patch"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($config -notmatch "RS_PUB_KEY") {
|
||||||
|
throw "RS_PUB_KEY not found after patch"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Custom ID server: OK"
|
||||||
|
Write-Host "Custom public key: OK"
|
||||||
|
Write-Host "Relay untouched: OK"
|
||||||
|
|
||||||
- name: Install RustDesk vcpkg dependencies
|
- name: Install RustDesk vcpkg dependencies
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|||||||
Reference in new issue
Block a user