Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitmehta committed Jul 31, 2020
1 parent ab7462f commit 01c1c9f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
5 changes: 1 addition & 4 deletions Kudu.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,14 @@ 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.dll"),
Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu"),
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.dll
string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu
string SitePackagesPath { get; } // e.g. /data/SitePackages
bool IsOnLinuxConsumption { get; } // e.g. True on Linux Consumption. False on App Service.
}
Expand Down
4 changes: 2 additions & 2 deletions Kudu.Services.Web/Kudu.Services.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<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 -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=false -p:PublishTrimmed=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true -o $(PublishDir)/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'" />
<Exec Command="dotnet publish ../Kudu.Console -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=false -p:PublishTrimmed=true -p:PublishReadyToRun=true -p:PublishReadyToRunShowWarnings=true -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" />
Expand Down
14 changes: 0 additions & 14 deletions Kudu.Services.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,6 @@ 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 01c1c9f

Please sign in to comment.