From 0920f0416defa2027f20dcedfde3cb81c1f8511e Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Wed, 23 Nov 2022 08:50:58 +0200 Subject: [PATCH] Remove secrets from sql scripts --- .../NetworkResurrector.Api.Domain.Data.csproj | 15 ----------- .../Scripts/1.0.0/01.Machine table.sql | 11 -------- .../1.0.1/01.Add pve-master machine.sql | 5 ---- .../Scripts/1.0.2/01.Added RPi machines.sql | 11 -------- .../1.0.2/02.Added new RPi machines.sql | 11 -------- .../1.0.3/01.Power actions configuration.sql | 22 --------------- .../03.Register Acer thin testing machine.sql | 27 ------------------- .../Scripts/1.0.3/04.pve-primbra config.sql | 19 ------------- 8 files changed, 121 deletions(-) delete mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.1/01.Add pve-master machine.sql delete mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/01.Added RPi machines.sql delete mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/02.Added new RPi machines.sql delete mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/03.Register Acer thin testing machine.sql delete mode 100644 src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/04.pve-primbra config.sql diff --git a/src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj b/src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj index ab8f8ca..d61c954 100644 --- a/src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj +++ b/src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj @@ -16,27 +16,12 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - PreserveNewest PreserveNewest - - PreserveNewest - - - PreserveNewest - diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.0/01.Machine table.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.0/01.Machine table.sql index b62c9de..055ca87 100644 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.0/01.Machine table.sql +++ b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.0/01.Machine table.sql @@ -9,15 +9,4 @@ begin IPv4Address varchar(20), [Description] varchar(max) ) -end - -if not exists (select top 1 1 from Machine) -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Personal main development station' union - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Proxmox node' union - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Proxmox node' union - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'VMware ESXi Hypervisor' union - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Main file server' union - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'OpenMediaVault Server' end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.1/01.Add pve-master machine.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.1/01.Add pve-master machine.sql deleted file mode 100644 index 4426a08..0000000 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.1/01.Add pve-master machine.sql +++ /dev/null @@ -1,5 +0,0 @@ -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Proxmox main node' -end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/01.Added RPi machines.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/01.Added RPi machines.sql deleted file mode 100644 index 67f0633..0000000 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/01.Added RPi machines.sql +++ /dev/null @@ -1,11 +0,0 @@ -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Raspberry Pi 3 Model B server' -end - -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Raspberry Pi 2 Model B server' -end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/02.Added new RPi machines.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/02.Added new RPi machines.sql deleted file mode 100644 index a25f79a..0000000 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.2/02.Added new RPi machines.sql +++ /dev/null @@ -1,11 +0,0 @@ -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Raspberry Pi 4 Model B/8GB' -end - -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'Raspberry Pi Zero W' -end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/01.Power actions configuration.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/01.Power actions configuration.sql index fbec6d3..7236f07 100644 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/01.Power actions configuration.sql +++ b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/01.Power actions configuration.sql @@ -62,26 +62,4 @@ begin PowerActionId int constraint FK_PowerActionConfigurationn_PowerAction foreign key references PowerAction(PowerActionId), PerformerId int constraint FK_PowerActionConfiguration_PowerActionPerformer foreign key references PowerActionPerformer(PerformerId) ) -end - -declare @orion_machine_id int, @server_performer_id int, @agent_performer_id int -select @orion_machine_id = MachineId from Machine where MachineName = '***REMOVED***' -select @server_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_SERVER' -select @agent_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_AGENT' - -if not exists (select top 1 1 from MachineAgent) -begin - insert into MachineAgent (MachineId, AgentPort) - select @orion_machine_id, ***REMOVED*** -end - -if not exists (select top 1 1 from PowerActionConfiguration) -begin - insert into PowerActionConfiguration (MachineId, PowerActionId, PerformerId) - select @orion_machine_id, - PowerActionId, - case when PowerActionCode in ('WAKE', 'PING') then @server_performer_id - else @agent_performer_id - end - from PowerAction end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/03.Register Acer thin testing machine.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/03.Register Acer thin testing machine.sql deleted file mode 100644 index 1008998..0000000 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/03.Register Acer thin testing machine.sql +++ /dev/null @@ -1,27 +0,0 @@ -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED*** - Acer thin testing machine' -end - -declare @machine_id int, @server_performer_id int, @agent_performer_id int -select @machine_id = MachineId from Machine where MachineName = '***REMOVED***' -select @server_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_SERVER' -select @agent_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_AGENT' - -if not exists (select top 1 1 from MachineAgent where MachineId = @machine_id) -begin - insert into MachineAgent (MachineId, AgentPort) - select @machine_id, ***REMOVED*** -end - -if not exists (select top 1 1 from PowerActionConfiguration where MachineId = @machine_id) -begin - insert into PowerActionConfiguration (MachineId, PowerActionId, PerformerId) - select @machine_id, - PowerActionId, - case when PowerActionCode in ('WAKE', 'PING') then @server_performer_id - else @agent_performer_id - end - from PowerAction -end \ No newline at end of file diff --git a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/04.pve-primbra config.sql b/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/04.pve-primbra config.sql deleted file mode 100644 index 1e93326..0000000 --- a/src/api/NetworkResurrector.Api.Domain.Data/Scripts/1.0.3/04.pve-primbra config.sql +++ /dev/null @@ -1,19 +0,0 @@ -if not exists (select top 1 1 from Machine where MachineName = '***REMOVED***') -begin - insert into Machine(MachineName, FullMachineName, MACAddress, IPv4Address, [Description]) - select '***REMOVED***', '***REMOVED***', '***REMOVED***', '***REMOVED***', 'The old ***REMOVED*** host and the first public server of the lab' -end - -declare @machine_id int, @server_performer_id int -select @machine_id = MachineId from Machine where MachineName = '***REMOVED***' -select @server_performer_id = PerformerId from PowerActionPerformer where PerformerCode = 'NETWORK_RESURRECTOR_SERVER' - -if not exists (select top 1 1 from PowerActionConfiguration where MachineId = @machine_id) -begin - insert into PowerActionConfiguration (MachineId, PowerActionId, PerformerId) - select @machine_id, - PowerActionId, - @server_performer_id - from PowerAction - where PowerActionCode in ('WAKE', 'PING') -end \ No newline at end of file