From 5d43bff24f0e2d3c1739623e5b1cbde570e4014f Mon Sep 17 00:00:00 2001 From: Sanchit Mehta Date: Thu, 30 Jul 2020 19:44:42 -0700 Subject: [PATCH] Revert "More fixes" This reverts commit 01c1c9fead5ff7f14ff029f095c2af0d5621a251. --- Kudu.Console/Program.cs | 5 ++++- Kudu.Contracts/IEnvironment.cs | 2 +- Kudu.Services.Web/Kudu.Services.Web.csproj | 7 +++++++ Kudu.Services.Web/Startup.cs | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Kudu.Console/Program.cs b/Kudu.Console/Program.cs index c220caa1..3684a8b5 100644 --- a/Kudu.Console/Program.cs +++ b/Kudu.Console/Program.cs @@ -279,14 +279,17 @@ private static IEnvironment GetEnvironment(string siteRoot, string requestId) string binPath = System.Environment.GetEnvironmentVariable("SCM_BIN_PATH"); if (string.IsNullOrWhiteSpace(binPath)) { + // CORE TODO Double check. Process.GetCurrentProcess() always gets the dotnet.exe process, + // so changed to Assembly.GetEntryAssembly().Location binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); } + // CORE TODO Handing in a null IHttpContextAccessor (and KuduConsoleFullPath) again return new Kudu.Core.Environment(root, EnvironmentHelper.NormalizeBinPath(binPath), repositoryPath, requestId, - Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu"), + Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu.dll"), null, new FileSystemPathProvider(new NullMeshPersistentFileSystem())); } diff --git a/Kudu.Contracts/IEnvironment.cs b/Kudu.Contracts/IEnvironment.cs index 880e75dd..a10c22f8 100644 --- a/Kudu.Contracts/IEnvironment.cs +++ b/Kudu.Contracts/IEnvironment.cs @@ -29,7 +29,7 @@ public interface IEnvironment string FunctionsPath { get; } // e.g. /site/wwwroot string AppBaseUrlPrefix { get; } // e.g. siteName.azurewebsites.net string RequestId { get; } // e.g. x-arr-log-id or x-ms-request-id header value - string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu + string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu.dll string SitePackagesPath { get; } // e.g. /data/SitePackages bool IsOnLinuxConsumption { get; } // e.g. True on Linux Consumption. False on App Service. } diff --git a/Kudu.Services.Web/Kudu.Services.Web.csproj b/Kudu.Services.Web/Kudu.Services.Web.csproj index e274bd32..55465416 100644 --- a/Kudu.Services.Web/Kudu.Services.Web.csproj +++ b/Kudu.Services.Web/Kudu.Services.Web.csproj @@ -52,6 +52,13 @@ + + + + + + + diff --git a/Kudu.Services.Web/Startup.cs b/Kudu.Services.Web/Startup.cs index 7f4c2cb2..95ab0fee 100644 --- a/Kudu.Services.Web/Startup.cs +++ b/Kudu.Services.Web/Startup.cs @@ -273,6 +273,20 @@ public void ConfigureServices(IServiceCollection services) services.AddScoped(); + // KuduWebUtil.MigrateSite(environment, noContextDeploymentsSettingsManager); + // RemoveOldTracePath(environment); + // RemoveTempFileFromUserDrive(environment); + + // CORE TODO Windows Fix: Temporary fix for https://github.com/npm/npm/issues/5905 + //EnsureNpmGlobalDirectory(); + //EnsureUserProfileDirectory(); + + //// Skip SSL Certificate Validate + //if (Environment.SkipSslValidation) + //{ + // ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; + //} + //// Make sure webpages:Enabled is true. Even though we set it in web.config, it could be overwritten by //// an Azure AppSetting that's supposed to be for the site only but incidently affects Kudu as well. ConfigurationManager.AppSettings["webpages:Enabled"] = "true";