Aggiunta iniziale di glimpse...

This commit is contained in:
Samuele E. Locatelli
2017-04-14 17:39:51 +02:00
parent 798a2b8cfe
commit 660fa2ad93
33 changed files with 233 additions and 7 deletions
BIN
View File
Binary file not shown.
+16
View File
@@ -195,6 +195,21 @@
<HintPath>..\packages\elmah.corelibrary.1.2.2\lib\Elmah.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Glimpse.AspNet, Version=1.9.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Glimpse.AspNet.1.9.2\lib\net45\Glimpse.AspNet.dll</HintPath>
</Reference>
<Reference Include="Glimpse.AspNetCache, Version=0.9.9.35094, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Glimpse.AspNetCache.0.9.9.35094\lib\net35\Glimpse.AspNetCache.dll</HintPath>
</Reference>
<Reference Include="Glimpse.Core, Version=1.8.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll</HintPath>
</Reference>
<Reference Include="Glimpse.Elmah, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Glimpse.Elmah.1.1.1\lib\net40\Glimpse.Elmah.dll</HintPath>
</Reference>
<Reference Include="Glimpse.WebForms, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Glimpse.WebForms.1.1.1\lib\net45\Glimpse.WebForms.dll</HintPath>
</Reference>
<Reference Include="ImageResizer, Version=3.4.3.103, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageResizer.3.4.3\lib\ImageResizer.dll</HintPath>
<Private>True</Private>
@@ -978,6 +993,7 @@
<Compile Include="FullPage.master.designer.cs">
<DependentUpon>FullPage.master</DependentUpon>
</Compile>
<Compile Include="GlimpseSecurityPolicy.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
+32
View File
@@ -0,0 +1,32 @@
/*
// Uncomment this class to provide custom runtime policy for Glimpse
using Glimpse.AspNet.Extensions;
using Glimpse.Core.Extensibility;
namespace GIM_site
{
public class GlimpseSecurityPolicy:IRuntimePolicy
{
public RuntimePolicy Execute(IRuntimePolicyContext policyContext)
{
// You can perform a check like the one below to control Glimpse's permissions within your application.
// More information about RuntimePolicies can be found at http://getglimpse.com/Help/Custom-Runtime-Policy
// var httpContext = policyContext.GetHttpContext();
// if (!httpContext.User.IsInRole("Administrator"))
// {
// return RuntimePolicy.Off;
// }
return RuntimePolicy.On;
}
public RuntimeEvent ExecuteOn
{
// The RuntimeEvent.ExecuteResource is only needed in case you create a security policy
// Have a look at http://blog.getglimpse.com/2013/12/09/protect-glimpse-axd-with-your-custom-runtime-policy/ for more details
get { return RuntimeEvent.EndRequest | RuntimeEvent.ExecuteResource; }
}
}
}
*/
+13 -7
View File
@@ -16,7 +16,7 @@
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
<section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false" />
</configSections>
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" /></configSections>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
@@ -61,7 +61,7 @@
</compilation>
<httpHandlers>
<add verb="GET,HEAD,POST" path="*.asbx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" /></httpHandlers>
<customErrors mode="Off" />
<!--<customErrors mode="RemoteOnly" defaultRedirect="unauthorized.aspx" />-->
<httpRuntime maxRequestLength="102400" />
@@ -75,12 +75,13 @@
appRequestQueueLimit="100" />
-->
<httpModules>
<!-- Glimpse: This can be commented in to add additional data to the Trace tab when using WebForms
<trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false"/> --><httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</httpModules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" /></httpModules>
</system.web>
<!--<system.web.extensions>
<scripting>
@@ -207,13 +208,13 @@
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="ASBXHandler" verb="GET,HEAD,POST" path="*.asbx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" /></handlers>
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</modules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" /></modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@@ -273,4 +274,9 @@
<add name="SeamCarving" />
</plugins>
</resizer>
</configuration>
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<!--
For more information on how to configure Glimpse, please visit http://getglimpse.com/Help/Configuration
or access {your site}/Glimpse.axd for even more details and a Configuration Tool to support you.
-->
</glimpse></configuration>
Binary file not shown.
+5
View File
@@ -11,6 +11,11 @@
<package id="elmah" version="1.2.2" targetFramework="net45" />
<package id="elmah.corelibrary" version="1.2.2" targetFramework="net45" />
<package id="FontAwesome" version="4.7.0" targetFramework="net45" />
<package id="Glimpse" version="1.8.6" targetFramework="net462" />
<package id="Glimpse.AspNet" version="1.9.2" targetFramework="net462" />
<package id="Glimpse.AspNetCache" version="0.9.9.35094" targetFramework="net462" />
<package id="Glimpse.Elmah" version="1.1.1" targetFramework="net462" />
<package id="Glimpse.WebForms" version="1.1.1" targetFramework="net462" />
<package id="ImageResizer" version="3.4.3" targetFramework="net45" />
<package id="ImageResizer.Plugins.DiskCache" version="3.4.3" targetFramework="net45" />
<package id="ImageResizer.Plugins.SeamCarving" version="3.4.3" targetFramework="net45" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+84
View File
@@ -0,0 +1,84 @@
$dataDir = Join-Path $env:AppData "Glimpse"
$dataFile = Join-Path $dataDir "extensions.cli"
function Get-VersionValue($package, $packages){
$oldPkg = $packages | where { $_.Action -eq "Uninstall" -and $_.Id -eq $package.Id } | sort { $_.Timestamp } -des | select -first 1
$result = ""
if ($oldPkg -ne $nul -and $oldPkg.Version -ne $package.Version){ $result += "{0}.." -f $oldPkg.Version }
return $result += $package.Version
}
# INSTALL
function Register-GlimpseExtension($package, $dte) {
$pkgs = @()
if (Test-Path $dataFile)
{
$pkgs = @(Import-Clixml $dataFile | where { $_.Timestamp -gt (Get-Date).AddMinutes(-8) })
}
$pkgs += @{
"Id" = $package.Id;
"Version" = $package.Version;
"Timestamp" = Get-Date;
"Action" = "Install"
}
if (!(Test-Path $dataDir)){ md $dataDir }
$pkgs | Export-Clixml $dataFile
$queryArgs = @()
foreach ($pkg in @($pkgs | where { $_.Action -eq "Install" } | sort { $_.Timestamp } -des))
{
$version = Get-VersionValue $pkg $pkgs
$queryArgs += "{0}={1}" -f $pkg.Id, $version
}
$queryString = $queryArgs -join "&"
$dte.ItemOperations.Navigate("http://getGlimpse.com/Version/Install/?" + $queryString)
}
Register-TabExpansion 'Register-GlimpseExtension' @{
'package' = {
"$package"
};
'dte' = {
"$DTE"
};
}
Export-ModuleMember Register-GlimpseExtension
# UNINSTALL
function Unregister-GlimpseExtension($package) {
$pkgs = @()
if (Test-Path $dataFile)
{
$pkgs = @(Import-Clixml $dataFile)
}
$pkgs += @{
"Id" = $package.Id;
"Version" = $package.Version;
"Timestamp" = Get-Date;
"Action" = "Uninstall"
}
if (!(Test-Path $dataDir)){ md $dataDir }
$pkgs | Export-Clixml $dataFile
}
Register-TabExpansion 'Unregister-GlimpseExtension' @{
'package' = {
"$package"
};
}
Export-ModuleMember Unregister-GlimpseExtension
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package)
Import-Module (Join-Path $toolsPath glimpse.psm1)
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package
Binary file not shown.
@@ -0,0 +1,32 @@
/*
// Uncomment this class to provide custom runtime policy for Glimpse
using Glimpse.AspNet.Extensions;
using Glimpse.Core.Extensibility;
namespace $rootnamespace$
{
public class GlimpseSecurityPolicy:IRuntimePolicy
{
public RuntimePolicy Execute(IRuntimePolicyContext policyContext)
{
// You can perform a check like the one below to control Glimpse's permissions within your application.
// More information about RuntimePolicies can be found at http://getglimpse.com/Help/Custom-Runtime-Policy
// var httpContext = policyContext.GetHttpContext();
// if (!httpContext.User.IsInRole("Administrator"))
// {
// return RuntimePolicy.Off;
// }
return RuntimePolicy.On;
}
public RuntimeEvent ExecuteOn
{
// The RuntimeEvent.ExecuteResource is only needed in case you create a security policy
// Have a look at http://blog.getglimpse.com/2013/12/09/protect-glimpse-axd-with-your-custom-runtime-policy/ for more details
get { return RuntimeEvent.EndRequest | RuntimeEvent.ExecuteResource; }
}
}
}
*/
@@ -0,0 +1,30 @@
<configuration>
<configSections>
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
</configSections>
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<!--
For more information on how to configure Glimpse, please visit http://getglimpse.com/Help/Configuration
or access {your site}/Glimpse.axd for even more details and a Configuration Tool to support you.
-->
</glimpse>
<system.web>
<!-- Glimpse: This can be commented in to add additional data to the Trace tab when using WebForms
<trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false"/> -->
<httpModules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet"/>
</httpModules>
<httpHandlers>
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet"/>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode"/>
</modules>
<handlers>
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE
+3
View File
@@ -0,0 +1,3 @@
param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package