Initial commit
This commit is contained in:
27
client/windows-helpers/README.md
Normal file
27
client/windows-helpers/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Windows Client Tooling Setup
|
||||
|
||||
This folder holds helpers you run on the Windows host that will be pulled by the Proxmox orchestrator.
|
||||
|
||||
## 1. Prerequisites on Windows
|
||||
- Run PowerShell with Administrative privileges.
|
||||
- Ensure OpenSSH.Client is available (Windows ships with it by default on modern builds).
|
||||
- Copy a portable `rsync.exe` (and its DLLs) to `windows-helpers/assets/rsync.zip` so the setup script can expand it into `C:\BackupClient\bin`.
|
||||
|
||||
## 2. Run the helper
|
||||
1. Open PowerShell in this folder.
|
||||
2. Execute `.uild\setup_openssh_rsync.ps1` (adjust path if you copy the scripts elsewhere) with optional parameters:
|
||||
```powershell
|
||||
.\setup_openssh_rsync.ps1 -InstallDir C:\BackupClient -RsyncZipPath .\assets\rsync.zip
|
||||
```
|
||||
3. The script:
|
||||
- installs/starts the OpenSSH Server feature, sets `sshd` to auto-start and opens port 22.
|
||||
- creates `C:\BackupClient` and copies the `rsync` binary into `C:\BackupClient\bin`.
|
||||
|
||||
## 3. Post-setup checks
|
||||
- `sshd` should be running (`Get-Service sshd`).
|
||||
- The firewall rule `BackupClient SSH` allows inbound TCP 22 on private/domain networks.
|
||||
- From the Proxmox server, `ssh backupuser@<windows_ip>` succeeds and the `rsync.exe` inside `C:\BackupClient\bin` can be invoked.
|
||||
|
||||
## 4. Notes
|
||||
- Keep the `rsync.exe` bundle in the installer so the orchestrator can invoke `rsync --server` over SSH.
|
||||
- Store any helper scripts and configuration files near the packaged client so the scheduler toggle and future automation can find them.
|
||||
45
client/windows-helpers/setup_openssh_rsync.ps1
Normal file
45
client/windows-helpers/setup_openssh_rsync.ps1
Normal file
@@ -0,0 +1,45 @@
|
||||
param(
|
||||
[string]$InstallDir = "C:\BackupClient",
|
||||
[string]$RsyncZipPath = "$PSScriptRoot\\assets\\rsync.zip"
|
||||
)
|
||||
|
||||
function Ensure-Directory {
|
||||
param([string]$Path)
|
||||
if (-not (Test-Path $Path)) {
|
||||
New-Item -ItemType Directory -Path $Path -Force | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
function Install-OpenSshServer {
|
||||
$capability = Get-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
|
||||
if ($capability.State -ne "Installed") {
|
||||
Write-Host "Installing OpenSSH.Server..."
|
||||
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | Out-Null
|
||||
}
|
||||
Set-Service sshd -StartupType Automatic
|
||||
Start-Service sshd
|
||||
}
|
||||
|
||||
function Configure-Firewall {
|
||||
$rule = Get-NetFirewallRule -DisplayName "BackupClient SSH" -ErrorAction SilentlyContinue
|
||||
if (-not $rule) {
|
||||
New-NetFirewallRule -DisplayName "BackupClient SSH" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 22 -Profile Private,Domain
|
||||
}
|
||||
}
|
||||
|
||||
function Deploy-Rsync {
|
||||
$binDir = Join-Path $InstallDir "bin"
|
||||
Ensure-Directory $binDir
|
||||
if (Test-Path $RsyncZipPath) {
|
||||
Expand-Archive -Path $RsyncZipPath -DestinationPath $binDir -Force
|
||||
} else {
|
||||
Write-Warning "Rsync zip not found at $RsyncZipPath, expecting rsync.exe already present in $binDir"
|
||||
}
|
||||
}
|
||||
|
||||
Ensure-Directory $InstallDir
|
||||
Install-OpenSshServer
|
||||
Configure-Firewall
|
||||
Deploy-Rsync
|
||||
|
||||
Write-Host "OpenSSH + rsync helper ready in $InstallDir"
|
||||
Reference in New Issue
Block a user