<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <section name="cacheManager" type="CacheManager.Core.Configuration.CacheManagerSection, CacheManager.Core" />
        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
        <sectionGroup name="common">
            <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
        </sectionGroup>
    </configSections>
    <common>
        <logging>
            <factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog32">
                <arg key="configType" value="INLINE" />
            </factoryAdapter>
        </logging>
    </common>
    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true" autoReload="true">
        <targets>
            <target name="debugger" xsi:type="Debugger" layout="${logger}::${message}" />
        </targets>
        <rules>
            <logger name="*" writeTo="debugger" />
        </rules>
    </nlog>
    <cacheManager xmlns="http://tempuri.org/CacheManagerCfg.xsd">
        <managers>
            <cache name="storefrontCache" updateMode="Up" enableStatistics="false" enablePerformanceCounters="false">
                <handle ref="runtimeMemory" name="inMemoryCacheHandle" expirationMode="Absolute" timeout="10m" />
            </cache>
        </managers>
        <cacheHandles>
            <handleDef id="runtimeMemory" type="CacheManager.SystemRuntimeCaching.MemoryCacheHandle`1, CacheManager.SystemRuntimeCaching" />
        </cacheHandles>
    </cacheManager>
    <system.runtime.caching>
        <memoryCache>
            <namedCaches>
                <add name="default" cacheMemoryLimitMegabytes="0" pollingInterval="00:02:00" />
            </namedCaches>
        </memoryCache>
    </system.runtime.caching>
    <system.net>
        <connectionManagement>
            <add address="*" maxconnection="96" />
        </connectionManagement>
    </system.net>
    <connectionStrings>
        <add name="VirtoCommerceBaseUrl" connectionString="http://localhost" />
        <add name="VirtoCommerce" connectionString="Data Source=(local);Initial Catalog=VirtoCommerce2;Persist Security Info=True;User ID=virto;Password=virto;MultipleActiveResultSets=True;Connect Timeout=420" providerName="System.Data.SqlClient" />
        <add name="AssetsConnectionString" connectionString="provider=LocalStorage;rootPath=~/Areas/Admin/Assets;publicUrl=http://localhost/Areas/Admin/Assets" />
        <add name="SearchConnectionString" connectionString="provider=Lucene;server=~/Areas/Admin/App_Data/Lucene;scope=default" />
    </connectionStrings>
    <appSettings>
        <add key="vs:EnableBrowserLink" value="false" />
        <add key="webpages:Version" value="3.0.0.0" />
        <add key="webpages:Enabled" value="false" />
        <add key="ClientValidationEnabled" value="true" />
        <add key="UnobtrusiveJavaScriptEnabled" value="true" />

        <add key="DefaultStore" value="Electronics" />
        <add key="vc-public-pages" value="~/App_data/Pages" />
        <add key="vc-public-themes" value="~/App_data/Themes" />
        <add key="vc-public-ApiAppId" value="27e0d789f12641049bd0e939185b4fd2" />
        <add key="vc-public-ApiSecretKey" value="34f0a3c12c9dbb59b63b5fece955b7b2b9a3b20f84370cba1524dd5c53503a2e2cb733536ecf7ea1e77319a47084a3a2c9d94d36069a432ecc73b72aeba6ea78" />

        <add key="OAuth2.Google.ClientId" value="SECRET" />
        <add key="OAuth2.Google.Secret" value="SECRET" />
        <add key="OAuth2.Facebook.AppId" value="SECRET" />
        <add key="OAuth2.Facebook.Secret" value="SECRET" />

        <add key="owin:AppStartup" value="VirtoCommerce.Storefront.Startup" />
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
        <add key="PreserveLoginUrl" value="true" />
        <add key="VirtoCommerce:SampleDataUrl" value="http://virtocommerce.blob.core.windows.net/sample-data" />
        <add key="VirtoCommerce:Storefront.AppData.Path" value="App_Data\" />
        <add key="VirtoCommerce:Authentication:Cookies.Enabled" value="true" />
        <add key="VirtoCommerce:Authentication:Cookies.ValidateInterval" value="1:00:00:00" />
        <add key="VirtoCommerce:Authentication:BearerTokens.Enabled" value="true" />
        <add key="VirtoCommerce:Authentication:BearerTokens.AccessTokenExpireTimeSpan" value="1:00:00" />
        <add key="VirtoCommerce:Authentication:Hmac.Enabled" value="true" />
        <add key="VirtoCommerce:Authentication:Hmac.SignatureValidityPeriod" value="00:20:00" />
        <add key="VirtoCommerce:Authentication:ApiKeys.Enabled" value="true" />
        <add key="VirtoCommerce:Authentication:ApiKeys.HttpHeaderName" value="api_key" />
        <add key="VirtoCommerce:Authentication:ApiKeys.QueryStringParameterName" value="api_key" />
        <add key="cybs.keysDirectory" value="keysPath" />
        <add key="cybs.sendToProduction" value="false" />
    </appSettings>
    <system.web>
        <compilation targetFramework="4.5.1" />
        <!-- 50MB in kilobytes, default is 4096 or 4MB-->
        <httpRuntime targetFramework="4.5.1" maxRequestLength="51200" />
        <customErrors mode="Off" />
        <pages>
            <namespaces>
                <add namespace="System.Web.Helpers" />
                <add namespace="System.Web.Mvc" />
                <add namespace="System.Web.Mvc.Ajax" />
                <add namespace="System.Web.Mvc.Html" />
                <add namespace="System.Web.Optimization" />
                <add namespace="System.Web.Routing" />
                <add namespace="System.Web.WebPages" />
            </namespaces>
        </pages>
        <caching>
            <outputCache defaultProvider="CacheManagerOutputCacheProvider" enableOutputCache="true">
                <providers>
                    <add name="CacheManagerOutputCacheProvider" type="CacheManager.Web.CacheManagerOutputCacheProvider, CacheManager.Web" cacheName="storefrontCache" />
                </providers>
            </outputCache>
            <outputCacheSettings>
                <outputCacheProfiles>
                    <add name="AssetsCachingProfile" enabled="true" location="ServerAndClient" duration="216000" varyByParam="*" />
                    <add name="ProductCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" />
                    <add name="CatalogSearchCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" />
                    <add name="HomeCachingProfile" enabled="true" location="Server" duration="216000" varyByParam="*" />
                    <add name="CommonCachingProfile" enabled="true" location="ServerAndClient" duration="9916000" varyByParam="*" />
                    <add name="StaticContentCachingProfile" enabled="true" location="ServerAndClient" duration="9916000" varyByParam="*" />
                </outputCacheProfiles>
            </outputCacheSettings>
        </caching>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <!--  Web API Put Request generates an Http 405 Method Not Allowed error -->
            <remove name="WebDAVModule" />
            <remove name="FormsAuthentication" />
            <remove name="UrlRoutingModule-4.0" />
            <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
        </modules>
        <handlers>
            <remove name="WebDAV" />
            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
            <remove name="OPTIONSVerbHandler" />
            <remove name="TRACEVerbHandler" />
            <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
        <staticContent>
            <remove fileExtension=".woff" />
            <remove fileExtension=".woff2" />
            <!-- In case IIS already has this mime type -->
            <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
            <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
        </staticContent>
        <security>
            <requestFiltering allowDoubleEscaping="true">
                <!-- 50MB in bytes, default is 30000000 or approx. 28.6102 Mb-->
                <requestLimits maxAllowedContentLength="52428800" />
            </requestFiltering>
        </security>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-2.3.1.0" newVersion="2.3.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.6.0.0" newVersion="5.6.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
        <providers>
            <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
    </entityFramework>
</configuration>
