Skip to content

Commit

Permalink
Merge pull request #56 from cybertec-postgresql/13-installps1-enhance…
Browse files Browse the repository at this point in the history
…ments

[+] grant access to PES folder and add firewall inbound rules, closes…
  • Loading branch information
pashagolub authored Dec 16, 2022
2 parents 3351823 + da12905 commit 7c468eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,18 @@ Write-Host "--- Installing vip-manager service ---" -ForegroundColor blue
vip-manager\vip_service.exe install | Out-Default
Write-Host "--- vip-manager service sucessfully installed ---" -ForegroundColor green

$workDir = (Get-Location).tostring()
$python = (Get-Command python.exe).Source

# grant access to PES directory
Write-Host "--- Grant access to working directory ---" -ForegroundColor blue
icacls $workDir /q /c /t /grant $userName:F
Write-Host "--- Access to working directory granted ---" -ForegroundColor green

Write-Host "--- Enabling Etcd, Postgres and patroni (via python) to listen to incomming traffic ---" -ForegroundColor blue
netsh advfirewall firewall add rule name="etcd" dir=in action=allow program="$workDir\etcd\etcd.exe" enable=yes
netsh advfirewall firewall add rule name="postgresql" dir=in action=allow program="$workDir\pgsql\bin\postgres.exe" enable=yes
netsh advfirewall firewall add rule name="python" dir=in action=allow program="$python" enable=yes
Write-Host "--- Firewall rules sucessfully installed ---" -ForegroundColor green

Write-Host "--- Installation sucessfully finished ---" -ForegroundColor green
6 changes: 6 additions & 0 deletions src/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ Write-Host "--- Uninstalling vip-manager service ---" -ForegroundColor blue
vip-manager\vip_service.exe uninstall | Out-Default
Write-Host "--- vip-manager service sucessfully uninstalled ---" -ForegroundColor green

Write-Host "--- Disabling Etcd, Postgres and patroni firewall rules ---" -ForegroundColor blue
netsh advfirewall firewall delete rule name="etcd"
netsh advfirewall firewall delete rule name="postgresql"
netsh advfirewall firewall delete rule name="python"
Write-Host "--- Firewall rules sucessfully deleted ---" -ForegroundColor green

Write-Host "--- Uninstallation sucessfully finished ---" -ForegroundColor green

0 comments on commit 7c468eb

Please sign in to comment.