Skip to content

Commit 7c468eb

Browse files
authored
Merge pull request #56 from cybertec-postgresql/13-installps1-enhancements
[+] grant access to PES folder and add firewall inbound rules, closes…
2 parents 3351823 + da12905 commit 7c468eb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/install.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,18 @@ Write-Host "--- Installing vip-manager service ---" -ForegroundColor blue
5050
vip-manager\vip_service.exe install | Out-Default
5151
Write-Host "--- vip-manager service sucessfully installed ---" -ForegroundColor green
5252

53+
$workDir = (Get-Location).tostring()
54+
$python = (Get-Command python.exe).Source
55+
56+
# grant access to PES directory
57+
Write-Host "--- Grant access to working directory ---" -ForegroundColor blue
58+
icacls $workDir /q /c /t /grant $userName:F
59+
Write-Host "--- Access to working directory granted ---" -ForegroundColor green
60+
61+
Write-Host "--- Enabling Etcd, Postgres and patroni (via python) to listen to incomming traffic ---" -ForegroundColor blue
62+
netsh advfirewall firewall add rule name="etcd" dir=in action=allow program="$workDir\etcd\etcd.exe" enable=yes
63+
netsh advfirewall firewall add rule name="postgresql" dir=in action=allow program="$workDir\pgsql\bin\postgres.exe" enable=yes
64+
netsh advfirewall firewall add rule name="python" dir=in action=allow program="$python" enable=yes
65+
Write-Host "--- Firewall rules sucessfully installed ---" -ForegroundColor green
66+
5367
Write-Host "--- Installation sucessfully finished ---" -ForegroundColor green

src/uninstall.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ Write-Host "--- Uninstalling vip-manager service ---" -ForegroundColor blue
1313
vip-manager\vip_service.exe uninstall | Out-Default
1414
Write-Host "--- vip-manager service sucessfully uninstalled ---" -ForegroundColor green
1515

16+
Write-Host "--- Disabling Etcd, Postgres and patroni firewall rules ---" -ForegroundColor blue
17+
netsh advfirewall firewall delete rule name="etcd"
18+
netsh advfirewall firewall delete rule name="postgresql"
19+
netsh advfirewall firewall delete rule name="python"
20+
Write-Host "--- Firewall rules sucessfully deleted ---" -ForegroundColor green
21+
1622
Write-Host "--- Uninstallation sucessfully finished ---" -ForegroundColor green

0 commit comments

Comments
 (0)