﻿<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=152368
  -->
<configuration>
  <configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
    </sectionGroup>
    <section name="uri" type="System.Configuration.UriSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
  </configSections>
  <uri>
    <schemeSettings>
      <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
    </schemeSettings>
  </uri>
  <elmah>
    <security allowRemoteAccess="1" />
    <errorLog type="Elmah.MySqlErrorLog, Elmah" connectionStringName="dbErrorLogging" />
  </elmah>
  <couchbase>
    <servers bucket="default" bucketPassword="">
      <add uri="http://127.0.0.1:8091/pools/default" />
    </servers>
    <keyTransformer type="Enyim.Caching.Memcached.TigerHashKeyTransformer, Enyim.Caching" />
  </couchbase>
  <appSettings>
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="autoFormsAuthentication" value="false" />
    <add key="enableSimpleMembership" value="false" />
    <add key="NewRelic.AppName" value="Filtr" />
  </appSettings>
  <connectionStrings>
    <add name="db" connectionString="Server=sonydb-aurora-cluster.cluster-cmhoisrwzxhm.eu-west-1.rds.amazonaws.com;Database=dbSonyTest;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;" providerName="MySql.Data.MySqlClient" />
    <add name="dbReadOnly" connectionString="Server=sonydb-aurora-cluster.cluster-ro-cmhoisrwzxhm.eu-west-1.rds.amazonaws.com;Database=dbSonyTest;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;" providerName="MySql.Data.MySqlClient" />
    <add name="dbErrorLogging" connectionString="Server=sonydb-aurora.cmhoisrwzxhm.eu-west-1.rds.amazonaws.com;Database=elmah;Uid=sony;Pwd=***REMOVED***;CharSet=utf8;" providerName="MySql.Data.MySqlClient" />
  </connectionStrings>
  <!--
    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5" />
      </system.Web>
  -->
  <system.web>
    <machineKey validationKey="FF8958200A16983208F6A2A1289E55014539B5BBB79D5AA3A0D91640E1056F5032A8F087AF8A1D4097D3253847CEC2B1F28CEB9DAE8D81B9C4ED2572ABA2B8EE" decryptionKey="B062B4E461A4E60BF067D86BAFBE010A549D6DD3B42854DA2BE5C8DE29190B21" />
    <trust level="Full" />
    <customErrors mode="Off" redirectMode="ResponseRewrite" defaultRedirect="error.html" />
    <compilation debug="true" targetFramework="4.7.1" />
    <httpRuntime maxQueryStringLength="2097151" maxRequestLength="10000000" requestPathInvalidCharacters="" relaxedUrlToFileSystemMapping="true" enableVersionHeader="false" />
    <caching>
      <outputCache defaultProvider="DistributedCache">
        <providers>
          <add name="DistributedCache" type="Sony.Filtr.API.WCF.DistributedOutputCacheProvider, Sony.Filtr.API, Version=1.0.0.0, Culture=neutral" />
        </providers>
      </outputCache>
      <outputCacheSettings>
        <outputCacheProfiles>
          <add name="CacheVeryLongTime" duration="103680" varyByParam="*" location="Any" />
          <add name="CacheLongTime" duration="28800" varyByParam="*" location="Any" />
          <add name="CacheShortTime" duration="3600" varyByParam="*" location="Any" />
          <add name="CacheVeryShortTime" duration="600" varyByParam="*" location="Any" />
          <add name="CacheBootstrap" duration="3600" varyByParam="callback" location="Any" />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
    <pages controlRenderingCompatibilityVersion="4.0" />
  </system.web>
  <system.net>
    <defaultProxy>
      <proxy proxyaddress="http://127.0.0.1:8888" bypassonlocal="False" />
    </defaultProxy>
  </system.net>
  <system.serviceModel>
    <services>
      <service name="Sony.Filtr.API.FiltrAPI">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrAPI" />
      </service>
      <service name="Sony.Filtr.API.FiltrAPI2">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrAPI2" />
      </service>
      <service name="Sony.Filtr.API.FiltrAPI21">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrAPI21" />
      </service>
      <service name="Sony.Filtr.API.FiltrApi3">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrApi3" />
      </service>
      <service name="Sony.Filtr.API.FiltrApiWorkout">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrApiWorkout" />
      </service>
      <service name="Sony.Filtr.API.FiltrApiWorkout3">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="Sony.Filtr.API.FiltrApiWorkout3" />
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding writeEncoding="UTF-8" name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />
      </webHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
      <add name="CloakHttpHeadersModule" type="Sony.Filtr.Utility.CloakHttpHeadersModule, Sony.Filtr.Utility, Version=1.0.0.0, Culture=neutral" />
    </modules>
    <handlers>
      <add name="ASPX" verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory" />
      <add name="ProxyAsyncHandler" path="*.ashx" verb="*" type="Sony.Filtr.API.ProxyAsyncHandler" />
      <add name="StaticFile-local" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
      <add name="ServiceModel-4.0" path="*" verb="*.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
      <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
    <staticContent>
      <mimeMap fileExtension=".ejs" mimeType="text/plain" />
    </staticContent>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>
    <rewrite>
      <rules>
        <rule name="Bootstrap Callback" stopProcessing="true">
          <match url="(.+)/bootstrap/([^/]+)" />
          <action type="Rewrite" url="{R:1}/bootstrap?callback={R:2}" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>
    <httpErrors errorMode="Custom" existingResponse="PassThrough">
      <remove statusCode="500" subStatusCode="-1" />
      <error statusCode="500" prefixLanguageFilePath="" path="/error.aspx" responseMode="ExecuteURL" />
    </httpErrors>
    <httpCompression noCompressionForProxies="false" />
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.13.0" newVersion="8.0.13.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.0.93.0" newVersion="1.0.93.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="BookSleeve" publicKeyToken="9056fda458ff61cf" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.3.41.0" newVersion="1.3.41.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="MoreLinq" publicKeyToken="384d532d7e88985d" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.18418.0" newVersion="1.1.18418.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.5022.0" newVersion="2.0.5022.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Reflection.TypeExtensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="NodaTime" publicKeyToken="4226afe0d9b296d1" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.3.0" newVersion="2.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Linq" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <!--
  <location path="elmah.axd">
    <system.web>
      <authorization>
        <allow roles="Administrators"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  -->
  <system.data>
    <DbProviderFactories>
      <clear />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
    </DbProviderFactories>
  </system.data>
  <nlog>
    <variable name="brief" value="${longdate} - ${message}" />
    <variable name="verbose" value="${longdate} | ${machinename} | ${processid} | ${processname} | ${level} | ${logger} | ${message}" />
    <targets>
      <target name="logfile" type="File" fileName="C:\Temp\logs\${logger}-${shortdate}.txt" />
    </targets>
    <rules>
      <logger name="*" minlevel="Debug" writeTo="logfile" />
    </rules>
  </nlog>
</configuration>