Compare commits
1
Commits
1.0.7
..
6c7a87994e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c7a87994e
|
@@ -207,6 +207,45 @@ jobs:
|
||||
-Path $WindowPath `
|
||||
-Pattern "sso.gandc.ru|will-redirect|allowTrustedOrSsoNavigation"
|
||||
|
||||
$WindowContent = Get-Content $WindowPath -Raw
|
||||
|
||||
if ($WindowContent -match "'local-network-access'") {
|
||||
throw "Local network permissions are already present in Window.ts"
|
||||
}
|
||||
|
||||
$PermissionPattern = "'clipboard-sanitized-write',\r?\n\]\);"
|
||||
|
||||
$PermissionReplacement = @(
|
||||
"'clipboard-sanitized-write',"
|
||||
"`t'local-network-access',"
|
||||
"`t'local-network',"
|
||||
"`t'loopback-network',"
|
||||
"]);"
|
||||
) -join "`n"
|
||||
|
||||
$PatchedWindowContent = [regex]::Replace(
|
||||
$WindowContent,
|
||||
$PermissionPattern,
|
||||
$PermissionReplacement,
|
||||
1
|
||||
)
|
||||
|
||||
if ($PatchedWindowContent -eq $WindowContent) {
|
||||
throw "Unable to patch trustedRendererPermissionTypes"
|
||||
}
|
||||
|
||||
Set-Content `
|
||||
-Path $WindowPath `
|
||||
-Value $PatchedWindowContent `
|
||||
-NoNewline `
|
||||
-Encoding utf8
|
||||
|
||||
Write-Host "Local network permissions patch applied"
|
||||
|
||||
Select-String `
|
||||
-Path $WindowPath `
|
||||
-Pattern "local-network-access|local-network|loopback-network"
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
shell: powershell
|
||||
@@ -689,6 +728,58 @@ jobs:
|
||||
-E 'sso\.gandc\.ru|will-redirect|allowTrustedOrSsoNavigation' \
|
||||
fluxer-src/fluxer_desktop/src/main/Window.ts
|
||||
|
||||
python3 <<'PY'
|
||||
from pathlib import Path
|
||||
|
||||
path = Path(
|
||||
"fluxer-src/fluxer_desktop/src/main/Window.ts"
|
||||
)
|
||||
|
||||
data = path.read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
if "'local-network-access'" in data:
|
||||
raise SystemExit(
|
||||
"Local network permissions are already present in Window.ts"
|
||||
)
|
||||
|
||||
old = (
|
||||
"\t'clipboard-sanitized-write',\n"
|
||||
"]);"
|
||||
)
|
||||
|
||||
new = (
|
||||
"\t'clipboard-sanitized-write',\n"
|
||||
"\t'local-network-access',\n"
|
||||
"\t'local-network',\n"
|
||||
"\t'loopback-network',\n"
|
||||
"]);"
|
||||
)
|
||||
|
||||
if data.count(old) != 1:
|
||||
raise SystemExit(
|
||||
"Unable to locate trustedRendererPermissionTypes"
|
||||
)
|
||||
|
||||
data = data.replace(
|
||||
old,
|
||||
new,
|
||||
1,
|
||||
)
|
||||
|
||||
path.write_text(
|
||||
data,
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
print("Local network permissions patch applied")
|
||||
PY
|
||||
|
||||
grep -n \
|
||||
-E "local-network-access|local-network|loopback-network" \
|
||||
fluxer-src/fluxer_desktop/src/main/Window.ts
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
|
||||
Reference in new issue
Block a user