Skip to content

Commit 0d84d66

Browse files
committed
Remove URL reservation
1 parent 96f3b32 commit 0d84d66

29 files changed

+15
-968
lines changed

src/ServiceControl.Config/Framework/Modules/InstallerModule.cs

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ internal async Task<ReportCard> Add(ServiceControlInstallableBase details, IProg
6666
try
6767
{
6868
progress.Report(5, 9, "Registering URL ACLs...");
69-
instanceInstaller.RegisterUrlAcl();
7069
progress.Report(6, 9, "Instance setup in progress, this could take several minutes...");
7170
instanceInstaller.SetupInstance();
7271
}
@@ -87,10 +86,6 @@ internal async Task<ReportCard> Add(ServiceControlInstallableBase details, IProg
8786
instanceInstaller.ReportCard.Warnings.Add($"New instance did not startup - please check configuration for {instance.Name}");
8887
}
8988
}
90-
else
91-
{
92-
instanceInstaller.RemoveUrlAcl();
93-
}
9489

9590
instanceInstaller.ReportCard.SetStatus();
9691
return instanceInstaller.ReportCard;
@@ -193,7 +188,7 @@ internal async Task<ReportCard> Update(ServiceControlBaseService instance, bool
193188
internal ReportCard Delete(string instanceName, bool removeDB, bool removeLogs, IProgress<ProgressDetails> progress = null)
194189
{
195190
progress ??= new Progress<ProgressDetails>();
196-
progress.Report(0, 7, "Stopping instance...");
191+
progress.Report(0, 6, "Stopping instance...");
197192
var instance = InstanceFinder.FindServiceControlInstance(instanceName);
198193
instance.ReportCard = new ReportCard();
199194

@@ -208,27 +203,24 @@ internal ReportCard Delete(string instanceName, bool removeDB, bool removeLogs,
208203

209204
instance.BackupAppConfig();
210205

211-
progress.Report(1, 7, "Disabling startup...");
206+
progress.Report(1, 6, "Disabling startup...");
212207
instance.Service.SetStartupMode("Disabled");
213208

214-
progress.Report(2, 7, "Deleting service...");
209+
progress.Report(2, 6, "Deleting service...");
215210
instance.Service.Delete();
216211

217-
progress.Report(3, 7, "Removing URL ACL...");
218-
instance.RemoveUrlAcl();
219-
220-
progress.Report(4, 7, "Deleting install...");
212+
progress.Report(3, 6, "Deleting install...");
221213
instance.RemoveBinFolder();
222214

223215
if (removeLogs)
224216
{
225-
progress.Report(5, 7, "Deleting logs...");
217+
progress.Report(4, 6, "Deleting logs...");
226218
instance.RemoveLogsFolder();
227219
}
228220

229221
if (removeDB)
230222
{
231-
progress.Report(6, 7, "Deleting database...");
223+
progress.Report(5, 6, "Deleting database...");
232224
instance.RemoveDataBaseFolder();
233225
}
234226

@@ -268,8 +260,6 @@ internal async Task<ReportCard> Add(MonitoringNewInstance details, IProgress<Pro
268260

269261
try
270262
{
271-
progress.Report(5, 9, "Registering URL ACLs...");
272-
instanceInstaller.RegisterUrlAcl();
273263
progress.Report(6, 9, "Creating queues...");
274264
instanceInstaller.SetupInstance();
275265
}
@@ -290,10 +280,6 @@ internal async Task<ReportCard> Add(MonitoringNewInstance details, IProgress<Pro
290280
instanceInstaller.ReportCard.Warnings.Add($"New instance did not startup - please check configuration for {instance.Name}");
291281
}
292282
}
293-
else
294-
{
295-
instanceInstaller.RemoveUrlAcl();
296-
}
297283

298284
instanceInstaller.ReportCard.SetStatus();
299285
return instanceInstaller.ReportCard;
@@ -386,7 +372,7 @@ internal async Task<ReportCard> Update(MonitoringInstance instance, bool startSe
386372
internal ReportCard Delete(string instanceName, bool removeLogs, IProgress<ProgressDetails> progress = null)
387373
{
388374
progress ??= new Progress<ProgressDetails>();
389-
progress.Report(0, 7, "Stopping instance...");
375+
progress.Report(0, 5, "Stopping instance...");
390376
var instance = InstanceFinder.FindMonitoringInstance(instanceName);
391377
instance.ReportCard = new ReportCard();
392378

@@ -401,21 +387,18 @@ internal ReportCard Delete(string instanceName, bool removeLogs, IProgress<Progr
401387

402388
instance.BackupAppConfig();
403389

404-
progress.Report(1, 7, "Disabling startup...");
390+
progress.Report(1, 5, "Disabling startup...");
405391
instance.Service.SetStartupMode("Disabled");
406392

407-
progress.Report(2, 7, "Deleting service...");
393+
progress.Report(2, 5, "Deleting service...");
408394
instance.Service.Delete();
409395

410-
progress.Report(3, 7, "Removing URL ACL...");
411-
instance.RemoveUrlAcl();
412-
413-
progress.Report(4, 7, "Deleting install...");
396+
progress.Report(3, 5, "Deleting install...");
414397
instance.RemoveBinFolder();
415398

416399
if (removeLogs)
417400
{
418-
progress.Report(5, 7, "Deleting logs...");
401+
progress.Report(4, 5, "Deleting logs...");
419402
instance.RemoveLogsFolder();
420403
}
421404

src/ServiceControl.Management.PowerShell/Cmdlets/UrlAcls/AddUrlAcl.cs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
11
namespace ServiceControl.Management.PowerShell
22
{
3-
using System;
4-
using System.Collections.Generic;
53
using System.Management.Automation;
6-
using System.Security.Principal;
7-
using ServiceControlInstaller.Engine.UrlAcl;
84

95
[Cmdlet(VerbsCommon.Add, "UrlAcl")]
106
public class AddUrlAcl : PSCmdlet
117
{
128
[ValidateNotNullOrEmpty]
139
[Parameter(Mandatory = true, Position = 0, HelpMessage = "The URL to add to the URLACL list. This should always in a trailing /")]
14-
1510
public string Url { get; set; }
1611

17-
protected override void BeginProcessing()
18-
{
19-
Account.TestIfAdmin();
20-
}
21-
2212
protected override void ProcessRecord()
2313
{
24-
var sidList = new List<SecurityIdentifier>();
25-
26-
foreach (var user in Users)
27-
{
28-
try
29-
{
30-
var account = new NTAccount(user);
31-
var sid = (SecurityIdentifier)account.Translate(typeof(SecurityIdentifier));
32-
sidList.Add(sid);
33-
}
34-
catch (Exception ex)
35-
{
36-
WriteError(new ErrorRecord(ex, "Failed to parse account name", ErrorCategory.InvalidData, user));
37-
return;
38-
}
39-
}
40-
41-
UrlReservation.Create(new UrlReservation(Url, sidList.ToArray()));
14+
WriteWarning("ServiceControl no longer requires URL reservations, so this command no longer functions. Use the 'netsh http add urlacl' command instead.");
4215
}
4316

4417
[ValidateNotNullOrEmpty]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
namespace ServiceControl.Management.PowerShell
22
{
33
using System.Management.Automation;
4-
using ServiceControlInstaller.Engine.UrlAcl;
54

65
[Cmdlet(VerbsCommon.Get, "UrlAcls")]
76
public class GetUrlAcls : PSCmdlet
87
{
98
protected override void ProcessRecord()
109
{
11-
WriteObject(UrlReservation.GetAll(), true);
10+
WriteWarning("ServiceControl no longer requires URL reservations, so this command no longer functions. Use the 'netsh http show urlacl' command instead.");
1211
}
1312
}
1413
}
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
namespace ServiceControl.Management.PowerShell
22
{
33
using System.Management.Automation;
4-
using ServiceControlInstaller.Engine.UrlAcl;
54

65
[Cmdlet(VerbsCommon.Remove, "UrlAcl")]
76
public class RemoveUrlAcl : PSCmdlet
87
{
9-
[ValidateNotNull]
10-
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0, HelpMessage = "Specify the URLACL to remove")]
11-
public UrlReservation[] UrlAcl { get; set; }
12-
13-
protected override void BeginProcessing()
14-
{
15-
Account.TestIfAdmin();
16-
}
17-
188
protected override void ProcessRecord()
199
{
20-
foreach (var entry in UrlAcl)
21-
{
22-
UrlReservation.Delete(entry);
23-
}
10+
WriteWarning("ServiceControl no longer requires URL reservations, so this command no longer functions. Use the 'netsh http delete urlacl' command instead.");
2411
}
2512
}
2613
}

src/ServiceControlInstaller.Engine.UnitTests/UrlAcl/UrlReservationTest.cs

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)