refactor!: rename the project from Monitor to MoShiro [CI]
ci/woodpecker/push/main-amd64-build Pipeline was successful

Namespaces, assemblies, solution, binaries, images, systemd units, config paths, environment variables, protocol methods and the Linux user are all renamed. Breaking: existing databases, node identities and installed units must be recreated.
This commit is contained in:
justme committed 2026-10-07 02:03:25 +08:00
1 parent 27ac7fb787
commit 2e146d4da7
309 files changed
+1565 -1572

No files matched your search

+10 -10
View File
@@ -15,14 +15,14 @@ if ($version -ne $projectVersion) {
throw "Tag version $version does not match project version $projectVersion."
}
$tarProject = Join-Path $PSScriptRoot 'Monitor.Tar\Monitor.Tar.csproj'
$tarTool = Join-Path $PSScriptRoot 'Monitor.Tar\bin\Release\net10.0\Monitor.Tar.dll'
$tarProject = Join-Path $PSScriptRoot 'MoShiro.Tar\MoShiro.Tar.csproj'
$tarTool = Join-Path $PSScriptRoot 'MoShiro.Tar\bin\Release\net10.0\MoShiro.Tar.dll'
& dotnet build $tarProject -c Release --nologo
if ($LASTEXITCODE -ne 0) {
throw 'Could not build the cross-platform tar helper.'
}
$giteaBase = if ($env:GITEA_BASE) { $env:GITEA_BASE.TrimEnd('/') } else { 'http://localhost:3100' }
$netrc = Join-Path $env:TEMP ("monitor-gitea-$([guid]::NewGuid().ToString('N')).netrc")
$netrc = Join-Path $env:TEMP ("moshiro-gitea-$([guid]::NewGuid().ToString('N')).netrc")
$giteaHost = ([Uri]$giteaBase).Host
Set-Content -LiteralPath $netrc -Value "machine $giteaHost login justme password $($env:GITEA_TOKEN)" -Encoding ascii -NoNewline
@@ -61,11 +61,11 @@ try {
$stage = Join-Path $root ".release\stage\$($target.Rid)\$role"
$null = New-Item -ItemType Directory -Force -Path $stage
$extension = if ($target.Windows) { '.exe' } else { '' }
Copy-Item -LiteralPath (Join-Path (Join-Path $root ".release\publish\$($target.Rid)\$role") "monitor-$role$extension") -Destination $stage
Copy-Item -LiteralPath (Join-Path (Join-Path $root ".release\publish\$($target.Rid)\$role") "moshiro-$role$extension") -Destination $stage
Copy-Item -LiteralPath (Join-Path $root 'LICENSE') -Destination $stage
Copy-Item -LiteralPath (Join-Path $root "backend\$role\README.md") -Destination $stage
$executables = @("monitor-$role$extension")
$executables = @("moshiro-$role$extension")
if ($role -eq 'agent') {
$enrollName = if ($target.Windows) { 'fleet-enroll.exe' } else { 'fleet-enroll' }
Copy-Item -LiteralPath (Join-Path $enrollDirectory $enrollName) -Destination $stage
@@ -76,12 +76,12 @@ try {
$executables += 'install.sh'
$systemd = Join-Path $stage 'systemd'
$null = New-Item -ItemType Directory -Force -Path $systemd
Copy-Item -LiteralPath (Join-Path $root "packaging/systemd/monitor-$role.service") -Destination $systemd
Copy-Item -LiteralPath (Join-Path $root "packaging/systemd/moshiro-$role.service") -Destination $systemd
if ($role -eq 'probe') {
$openwrt = Join-Path $stage 'openwrt'
$null = New-Item -ItemType Directory -Force -Path $openwrt
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/monitor-probe.init') -Destination $openwrt
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/monitor.keep') -Destination $openwrt
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/moshiro-probe.init') -Destination $openwrt
Copy-Item -LiteralPath (Join-Path $root 'packaging/openwrt/moshiro.keep') -Destination $openwrt
}
}
elseif ($target.Os -eq 'macos') {
@@ -94,7 +94,7 @@ consumer install.
'@ | Set-Content -LiteralPath (Join-Path $stage 'MACOS-SECURITY.txt') -Encoding utf8
}
$archiveName = if ($target.Windows) { "monitor-$role-v$version-windows-$($target.Arch).zip" } else { "monitor-$role-v$version-$($target.Os)-$($target.Arch).tar.gz" }
$archiveName = if ($target.Windows) { "moshiro-$role-v$version-windows-$($target.Arch).zip" } else { "moshiro-$role-v$version-$($target.Os)-$($target.Arch).tar.gz" }
$archive = Join-Path $packageRoot $archiveName
if ($target.Windows) {
Compress-Archive -Path (Join-Path $stage '*') -DestinationPath $archive -CompressionLevel Optimal -Force
@@ -115,7 +115,7 @@ consumer install.
param([string]$File, [string]$Base, [string]$PackageVersion, [string]$Netrc)
$ErrorActionPreference = 'Stop'
$name = [IO.Path]::GetFileName($File)
$url = "$Base/api/packages/justme/generic/monitor-node/$PackageVersion/$name"
$url = "$Base/api/packages/justme/generic/moshiro-node/$PackageVersion/$name"
$status = & curl.exe --silent --show-error --retry 3 --netrc-file $Netrc --upload-file $File --output NUL --write-out '%{http_code}' $url
if ($LASTEXITCODE -ne 0) {
throw "Gitea package upload failed for $name (curl exit $LASTEXITCODE)."