Adopt OCSentinel script layout and add Gitea workflow
Some checks failed
OfficeCom Sentinel Client / build-client (push) Has been cancelled

This commit is contained in:
OfficeCom Codex
2026-07-17 00:50:26 +02:00
parent 7cdc0395c4
commit 85e394f647
23 changed files with 1124 additions and 920 deletions

View File

@@ -1,25 +1,15 @@
param(
[Parameter(Mandatory)]
[string]$SecretValue,
[string]$OutputPath = "C:\ProgramData\OCSentinel\secrets\ocsentinel-upload-secret.dat"
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$RemainingArgs
)
$ErrorActionPreference = "Stop"
Add-Type -AssemblyName System.Security
$outputFullPath = [System.IO.Path]::GetFullPath($OutputPath)
$outputDirectory = Split-Path -Parent $outputFullPath
if (-not [string]::IsNullOrWhiteSpace($outputDirectory)) {
New-Item -ItemType Directory -Force -Path $outputDirectory | Out-Null
$newScript = Join-Path $PSScriptRoot "protect-ocsentinel-secret.ps1"
if (-not (Test-Path $newScript)) {
throw "Replacement script not found: $newScript"
}
$secretBytes = [System.Text.Encoding]::UTF8.GetBytes($SecretValue)
$protectedBytes = [System.Security.Cryptography.ProtectedData]::Protect(
$secretBytes,
$null,
[System.Security.Cryptography.DataProtectionScope]::LocalMachine
)
[System.IO.File]::WriteAllBytes($outputFullPath, $protectedBytes)
Write-Host "Protected secret written to $outputFullPath"
Write-Host "Compatibility wrapper: protect-attacktracer-secret.ps1 -> protect-ocsentinel-secret.ps1"
& powershell.exe -ExecutionPolicy Bypass -File $newScript @RemainingArgs
exit $LASTEXITCODE