Add dev/prod environments with TrueNAS Docker production deploy.
Split PostgreSQL into gallery_dev and gallery_prod, add Docker/Gitea deploy tooling, SMB image sync, pgAdmin split script, dev:web on Keenetic :5173, and operator docs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
02d238b043
commit
2edf577faf
34 files changed
+1742
-80
No files matched your search
@@ -0,0 +1,42 @@
|
||||
# Sync production image files from TrueNAS to dev repo.
|
||||
#
|
||||
# Usage:
|
||||
# npm run images:sync-from-prod
|
||||
# .\infra\scripts\sync-images-from-prod.ps1
|
||||
|
||||
param(
|
||||
[string]$Source = "\\192.168.10.122\Gallery\data\images",
|
||||
[string]$Dest = (Join-Path $PSScriptRoot "..\..\data\images"),
|
||||
[switch]$SkipConfirm
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
if (-not (Test-Path $Dest)) {
|
||||
New-Item -ItemType Directory -Path $Dest -Force | Out-Null
|
||||
}
|
||||
$Dest = (Resolve-Path $Dest).Path
|
||||
|
||||
Write-Host "Source: $Source"
|
||||
Write-Host "Dest: $Dest"
|
||||
|
||||
if (-not $SkipConfirm) {
|
||||
$confirm = Read-Host "Copy all files from prod (skip older)? Type yes"
|
||||
if ($confirm -ne "yes") {
|
||||
Write-Host "Aborted."
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
if (-not (Test-Path $Source)) {
|
||||
Write-Error "Source not found: $Source"
|
||||
exit 1
|
||||
}
|
||||
|
||||
robocopy $Source $Dest /E /XO /R:2 /W:3 /NFL /NDL /NJH /NJS
|
||||
$code = $LASTEXITCODE
|
||||
if ($code -ge 8) {
|
||||
Write-Error "robocopy failed with exit code $code"
|
||||
exit $code
|
||||
}
|
||||
|
||||
Write-Host "Image sync complete (robocopy exit $code)."
|
||||
@@ -0,0 +1,49 @@
|
||||
# Sync dev image files to TrueNAS production volume.
|
||||
#
|
||||
# Usage (from repo root):
|
||||
# npm run images:sync-to-prod
|
||||
# Copies data/images/ → \\192.168.10.122\Gallery\data\images
|
||||
# Map the share first if needed: net use \\192.168.10.122\Gallery /user:YOUR_TRUENAS_USER
|
||||
|
||||
param(
|
||||
[string]$Source = (Join-Path $PSScriptRoot "..\..\data\images"),
|
||||
[string]$Dest = "\\192.168.10.122\Gallery\data\images",
|
||||
[switch]$SkipConfirm
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Source = (Resolve-Path $Source -ErrorAction Stop).Path
|
||||
|
||||
Write-Host "Source: $Source"
|
||||
Write-Host "Dest: $Dest"
|
||||
|
||||
if (-not $SkipConfirm) {
|
||||
$confirm = Read-Host "Copy all files (skip older)? Type yes"
|
||||
if ($confirm -ne "yes") {
|
||||
Write-Host "Aborted."
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
$smbRoot = "\\192.168.10.122\Gallery"
|
||||
if ($env:SMB_USER -and $env:SMB_PASSWORD) {
|
||||
Write-Host "Mapping $sbmRoot ..."
|
||||
net use $sbmRoot /user:$env:SMB_USER $env:SMB_PASSWORD 2>&1 | Out-Host
|
||||
}
|
||||
|
||||
try {
|
||||
if (-not (Test-Path $Dest)) {
|
||||
New-Item -ItemType Directory -Path $Dest -Force | Out-Null
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Note: could not pre-create dest (will rely on robocopy): $($_.Exception.Message)"
|
||||
}
|
||||
|
||||
robocopy $Source $Dest /E /XO /R:2 /W:3 /NFL /NDL /NJH /NJS
|
||||
$code = $LASTEXITCODE
|
||||
if ($code -ge 8) {
|
||||
Write-Error "robocopy failed with exit code $code"
|
||||
exit $code
|
||||
}
|
||||
|
||||
Write-Host "Image sync complete (robocopy exit $code)."
|
||||
Reference in new issue
Block a user