Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/SeqCli/Cli/Commands/Forwarder/InstallCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
using System.ServiceProcess;
using System.Threading.Tasks;
using Seq.Forwarder.Cli.Features;
using Seq.Forwarder.Config;
using Seq.Forwarder.ServiceProcess;
using Seq.Forwarder.Util;
using SeqCli;
using SeqCli.Cli;
using SeqCli.Cli.Features;
using SeqCli.Config;
using SeqCli.Config.Forwarder;
using SeqCli.Forwarder.Util;

// ReSharper disable once ClassNeverInstantiated.Global

Expand Down Expand Up @@ -181,12 +183,12 @@ void Install()
throw new ArgumentException("Seq requires a local (or SAN) storage location; network shares are not supported.");

Console.WriteLine($"Updating the configuration in {_storagePath.ConfigFilePath}...");
var config = SeqForwarderConfig.ReadOrInit(_storagePath.ConfigFilePath);
var config = SeqCliConfig.Read();

if (!string.IsNullOrEmpty(_listenUri.ListenUri))
{
config.Api.ListenUri = _listenUri.ListenUri;
SeqForwarderConfig.Write(_storagePath.ConfigFilePath, config);
config.Forwarder.Api.ListenUri = _listenUri.ListenUri;
SeqCliConfig.Write(config);
}

if (_serviceCredentials.IsUsernameSpecified)
Expand All @@ -203,10 +205,10 @@ void Install()
Console.WriteLine($"Granting {ServiceUsername} rights to {_storagePath.StorageRootPath}...");
GiveFullControl(_storagePath.StorageRootPath);

Console.WriteLine($"Granting {ServiceUsername} rights to {config.Diagnostics.InternalLogPath}...");
GiveFullControl(config.Diagnostics.InternalLogPath);
Console.WriteLine($"Granting {ServiceUsername} rights to {config.Forwarder.Diagnostics.InternalLogPath}...");
GiveFullControl(config.Forwarder.Diagnostics.InternalLogPath);

var listenUri = MakeListenUriReservationPattern(config.Api.ListenUri);
var listenUri = MakeListenUriReservationPattern(config.Forwarder.Api.ListenUri);
Console.WriteLine($"Adding URL reservation at {listenUri} for {ServiceUsername}...");
var netshResult = CaptiveProcess.Run("netsh", $"http add urlacl url={listenUri} user=\"{ServiceUsername}\"", Console.WriteLine, Console.WriteLine);
if (netshResult != 0)
Expand Down
4 changes: 3 additions & 1 deletion src/SeqCli/Cli/Commands/Forwarder/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Seq.Forwarder.ServiceProcess;
using SeqCli.Cli.Features;
using SeqCli.Config;
using SeqCli.Config.Forwarder;
Expand Down Expand Up @@ -169,7 +171,7 @@ static int RunService(ServerService service)
{
#if WINDOWS
System.ServiceProcess.ServiceBase.Run([
new ServiceProcess.SeqForwarderWindowsService(service)
new SeqForwarderWindowsService(service)
]);
return 0;
#else
Expand Down
1 change: 1 addition & 0 deletions src/SeqCli/Cli/Commands/Forwarder/UninstallCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Seq.Forwarder.ServiceProcess;
using Seq.Forwarder.Util;
using SeqCli.Cli;
using SeqCli.Forwarder.Util;

namespace Seq.Forwarder.Cli.Commands
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Security.Cryptography;
using System.Text;
using SeqCli.Forwarder.Cryptography;

namespace Seq.Forwarder.Cryptography
{
Expand Down
4 changes: 3 additions & 1 deletion src/SeqCli/Forwarder/Cryptography/StringDataProtector.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SeqCli.Forwarder.Cryptography;
using Seq.Forwarder.Cryptography;

namespace SeqCli.Forwarder.Cryptography;

static class StringDataProtector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.ServiceProcess;
using Seq.Forwarder.Web.Host;
using SeqCli.Forwarder.Web.Host;

namespace Seq.Forwarder.ServiceProcess
{
Expand Down
4 changes: 3 additions & 1 deletion src/SeqCli/Forwarder/Util/ExecutionEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SeqCli.Forwarder.Util;
using Seq.Forwarder.Util;

namespace SeqCli.Forwarder.Util;

static class ExecutionEnvironment
{
Expand Down
1 change: 1 addition & 0 deletions src/SeqCli/Forwarder/Util/ServiceConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.Linq;
using System.ServiceProcess;
using System.Text;
using SeqCli.Forwarder.Util;

namespace Seq.Forwarder.Util
{
Expand Down