Skip to content

Commit

Permalink
Revert "More fixes"
Browse files Browse the repository at this point in the history
This reverts commit 01c1c9f.
  • Loading branch information
sanchitmehta committed Jul 31, 2020
1 parent 21afa77 commit 5d43bff
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Kudu.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Contracts/IEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
7 changes: 7 additions & 0 deletions Kudu.Services.Web/Kudu.Services.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<Exec Command="sh $(ProjectDir)/updateNodeModules.sh &quot;$(PublishDir)&quot;" Condition="'$(OS)' != 'Windows_NT' AND '$(Configuration)' == 'Release'" />
<Exec Command="sh $(ProjectDir)/updateNodeModules.sh &quot;$(OutputPath)&quot;" Condition="'$(OS)' != 'Windows_NT' AND '$(Configuration)' == 'Debug'" />
</Target>
<Target Name="BuildKuduConsole" AfterTargets="Build">
<Message Text="%0a%0aBuilding KuduConsole%0a" Importance="high" />
<Exec Command="dotnet build ../Kudu.Console -o $(MSBuildProjectDirectory)/$(PublishDir)..\KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' == 'Windows_NT'" />
<Exec Command="dotnet build ../Kudu.Console -o $(OutputPath)/KuduConsole" Condition="'$(Configuration)' == 'Debug' AND '$(OS)' != 'Windows_NT'" />
<Exec Command="dotnet publish ..\Kudu.Console --configuration Release -o $(PublishDir)\KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' == 'Windows_NT'" />
<Exec Command="dotnet publish ../Kudu.Console --configuration Release -o $(PublishDir)/KuduConsole" Condition="'$(Configuration)' == 'Release' AND '$(OS)' != 'Windows_NT'" />
</Target>
<Target Name="ChangeScriptPermissionsForLinux" AfterTargets="publish">
<Message Text="%0a%0aSetting Permissions for Kudu Script(s)%0a" Importance="high" />
<Exec Command="chmod -R +x $(PublishDir)/KuduConsole" Condition=" '$(OS)' != 'Windows_NT' AND '$(Configuration)' == 'Release'" />
Expand Down
14 changes: 14 additions & 0 deletions Kudu.Services.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@ public void ConfigureServices(IServiceCollection services)

services.AddScoped<ICommandExecutor, CommandExecutor>();

// 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";
Expand Down

0 comments on commit 5d43bff

Please sign in to comment.