Revert "desktop-local-network-permissions"
This reverts commit 6c7a87994e.
This commit is contained in:
1 file changed
-91
@@ -207,45 +207,6 @@ jobs:
|
|||||||
-Path $WindowPath `
|
-Path $WindowPath `
|
||||||
-Pattern "sso.gandc.ru|will-redirect|allowTrustedOrSsoNavigation"
|
-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
|
- name: Install dependencies
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@@ -728,58 +689,6 @@ jobs:
|
|||||||
-E 'sso\.gandc\.ru|will-redirect|allowTrustedOrSsoNavigation' \
|
-E 'sso\.gandc\.ru|will-redirect|allowTrustedOrSsoNavigation' \
|
||||||
fluxer-src/fluxer_desktop/src/main/Window.ts
|
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
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in new issue
Block a user