refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)

Solution + 23 src projects + 26 test projects renamed; folders, csproj,
namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated.
ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated.
SQL roles/logins, LDAP domains, CLI command name, and CLI config dir
(~/.scadalink → ~/.scadabridge) also renamed.

Build green; 5 Host.Tests fail awaiting SQL login rename in next commit.
Pre-existing StaleTagMonitor timing flakes unchanged.

Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
Joseph Doherty
2026-05-28 09:37:45 -04:00
parent 6d87ee3c3b
commit 7b0b9c7365
1531 changed files with 11180 additions and 11054 deletions
+20 -20
View File
@@ -1,4 +1,4 @@
# ScadaLink Maintenance Procedures
# ScadaBridge Maintenance Procedures
## SQL Server Maintenance (Central)
@@ -17,7 +17,7 @@
```sql
-- Rebuild fragmented indexes on configuration database
USE ScadaLink;
USE ScadaBridge;
EXEC sp_MSforeachtable 'ALTER INDEX ALL ON ? REBUILD WITH (ONLINE = ON)';
```
@@ -43,8 +43,8 @@ Consider partitioning the AuditLogEntries table by month for efficient purging.
```sql
-- Check database sizes
EXEC sp_helpdb 'ScadaLink';
EXEC sp_helpdb 'ScadaLink_MachineData';
EXEC sp_helpdb 'ScadaBridge';
EXEC sp_helpdb 'ScadaBridge_MachineData';
-- Check table sizes
SELECT
@@ -72,7 +72,7 @@ ORDER BY TotalSpaceMB DESC;
```powershell
# Check SQLite file sizes
Get-ChildItem C:\ScadaLink\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}}
Get-ChildItem C:\ScadaBridge\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}}
```
### S&F Database Growth
@@ -92,14 +92,14 @@ The S&F database has **no max buffer size** by design. During extended outages,
SQLite does not reclaim disk space after deleting rows. Periodically vacuum:
```powershell
# Stop the ScadaLink service first
sc.exe stop ScadaLink-Site
# Stop the ScadaBridge service first
sc.exe stop ScadaBridge-Site
# Vacuum the S&F database
sqlite3 C:\ScadaLink\data\store-and-forward.db "VACUUM;"
sqlite3 C:\ScadaBridge\data\store-and-forward.db "VACUUM;"
# Restart the service
sc.exe start ScadaLink-Site
sc.exe start ScadaBridge-Site
```
**Important:** Only vacuum when the service is stopped. SQLite does not support concurrent vacuum.
@@ -108,16 +108,16 @@ sc.exe start ScadaLink-Site
```powershell
# Hot backup using SQLite backup API (safe while service is running)
sqlite3 C:\ScadaLink\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db"
sqlite3 C:\ScadaLink\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db"
sqlite3 C:\ScadaBridge\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db"
sqlite3 C:\ScadaBridge\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db"
```
## Log Rotation
### Serilog File Sink
ScadaLink uses Serilog's rolling file sink with daily rotation:
- New file created each day: `scadalink-20260316.log`
ScadaBridge uses Serilog's rolling file sink with daily rotation:
- New file created each day: `scadabridge-20260316.log`
- Files are not automatically deleted.
### Log Retention Policy
@@ -126,16 +126,16 @@ Implement a scheduled task to delete old log files:
```powershell
# Delete log files older than 30 days
Get-ChildItem C:\ScadaLink\logs\scadalink-*.log |
Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } |
Remove-Item -Force
```
Schedule this as a Windows Task:
```powershell
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaLink\logs\scadalink-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`""
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`""
$trigger = New-ScheduledTaskTrigger -Daily -At "03:00"
Register-ScheduledTask -TaskName "ScadaLink-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaLink log files older than 30 days"
Register-ScheduledTask -TaskName "ScadaBridge-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaBridge log files older than 30 days"
```
### Log Disk Space
@@ -164,13 +164,13 @@ If event log storage is consuming excessive disk space:
```powershell
# Stop the service
sc.exe stop ScadaLink-Site
sc.exe stop ScadaBridge-Site
# Delete the event log database and let it be recreated
Remove-Item C:\ScadaLink\data\event-log.db
Remove-Item C:\ScadaBridge\data\event-log.db
# Restart the service
sc.exe start ScadaLink-Site
sc.exe start ScadaBridge-Site
```
## Certificate Management
@@ -180,7 +180,7 @@ sc.exe start ScadaLink-Site
If using LDAPS (port 636), the LDAP server's TLS certificate must be trusted:
1. Export the CA certificate from Active Directory.
2. Import into the Windows certificate store on both central nodes.
3. Restart the ScadaLink service.
3. Restart the ScadaBridge service.
### OPC UA Certificates