﻿<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
    <section name="couchbaseReserve" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>
  <!--PROD CONNECTION STRING
  <connectionStrings>
    <add name="db"
      connectionString="Server=prod-apollo-aurora-cluster.cluster-cjzbf0a3lwld.us-east-1.rds.amazonaws.com;Database=dbSony_dbo;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;default command timeout=2000;Connection Timeout=2000;"
      providerName="MySql.Data.MySqlClient"/>
    <add name="dbReadOnly"
      connectionString="Server=prod-apollo-aurora-cluster.cluster-ro-cjzbf0a3lwld.us-east-1.rds.amazonaws.com;Database=dbSony_dbo;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;default command timeout=2000;Connection Timeout=2000;"
      providerName="MySql.Data.MySqlClient"/>
    <add name="dbErrorLogging" connectionString="Server=prod-apollo-aurora-cluster.cluster-cjzbf0a3lwld.us-east-1.rds.amazonaws.com;Database=elmah;Uid=sony;Pwd=***REMOVED***;CharSet=utf8;UseCompression=true;" providerName="MySql.Data.MySqlClient"/>
  </connectionStrings>
-->
  <!-- DEV CONNECTION STRINGS -->
  <connectionStrings>
    <add name="db" connectionString="Default Command Timeout=600;Server=dev-apollo-aurora-cep.cluster-custom-cic9zqsxd2y6.us-east-1.rds.amazonaws.com;Database=dbSony_dbo;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;" providerName="MySql.Data.MySqlClient" />
    <add name="dbReadOnly" connectionString="Default Command Timeout=60;Server=dev-apollo-aurora-cep.cluster-custom-cic9zqsxd2y6.us-east-1.rds.amazonaws.com;Database=dbSony_dbo;Uid=sony;Pwd=***REMOVED***;CharSet=utf8mb4;Convert Zero Datetime=True;UseCompression=true;" providerName="MySql.Data.MySqlClient" />
    <add name="dbErrorLogging" connectionString="Server=dev-apollo-aurora-cep.cluster-custom-cic9zqsxd2y6.us-east-1.rds.amazonaws.com;Database=elmah;Uid=sony;Pwd=***REMOVED***;CharSet=utf8;" providerName="MySql.Data.MySqlClient" />
  </connectionStrings>
  <appSettings>
    <!-- PROD spotify settings 
    <add key="SpotifyWebApiClientId" value="***REMOVED***" />
    <add key="SpotifyWebApiClientSecret" value="***REMOVED***" />
    -->
  </appSettings>
  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.6.2" />
      </system.Web>
  -->
  <system.web>
    <httpRuntime maxRequestLength="2147483647" relaxedUrlToFileSystemMapping="true" enableVersionHeader="false" targetFramework="4.6.2" />
    <machineKey validationKey="FF8958200A16983208F6A2A1289E55014539B5BBB79D5AA3A0D91640E1056F5032A8F087AF8A1D4097D3253847CEC2B1F28CEB9DAE8D81B9C4ED2572ABA2B8EE" decryptionKey="B062B4E461A4E60BF067D86BAFBE010A549D6DD3B42854DA2BE5C8DE29190B21" />
    <compilation targetFramework="4.7.1" debug="true" />
    <pages controlRenderingCompatibilityVersion="4.0" />
    <customErrors mode="Off" />
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
    </httpModules>
    <httpHandlers>
      <add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
    </httpHandlers>
  </system.web>
  <couchbase>
    <servers bucket="default" bucketPassword="">
      <add uri="http://ec2-52-3-224-211.compute-1.amazonaws.com:8091/pools/default" />
      <add uri="http://ec2-3-81-216-123.compute-1.amazonaws.com:8091/pools/default" />
    </servers>
    <keyTransformer type="Enyim.Caching.Memcached.TigerHashKeyTransformer, Enyim.Caching" />
  </couchbase>
  <couchbaseReserve>
    <servers bucket="default" bucketPassword="">
      <add uri="http://ip-10-10-13-119.ec2.internal:8091/pools/default" />
      <add uri="http://ip-10-10-14-248.ec2.internal:8091/pools/default" />
    </servers>
    <keyTransformer type="Enyim.Caching.Memcached.TigerHashKeyTransformer, Enyim.Caching" />
  </couchbaseReserve>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <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="MoreLinq" publicKeyToken="384d532d7e88985d" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.4.18916.0" newVersion="1.4.18916.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="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="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="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>
    </assemblyBinding>
  </runtime>
  <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>
  <system.webServer>
    <modules>
      <add name="CloakHttpHeadersModule" type="Sony.Filtr.Utility.CloakHttpHeadersModule, Sony.Filtr.Utility, Version=1.0.0.0, Culture=neutral" />
      <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" />
    </modules>
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
        <add name="X-FiltrServer" value="Web01" />
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Credentials" value="true" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, FiltrAuthentication" />
        <add name="Access-Control-Allow-Methods" value="GET, HEAD, POST, PUT, DELETE, OPTIONS" />
      </customHeaders>
    </httpProtocol>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="4294967295" />
      </requestFiltering>
    </security>
    <validation validateIntegratedModeConfiguration="false" />
    <httpErrors existingResponse="PassThrough" />
    <handlers>
      <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
    </handlers>
    <rewrite>
      <rules>
        <rule name="HTTPS Redirect" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTP_X_FORWARDED_PROTO}" pattern="https" negate="true" />
            <add input="{HTTP_HOST}" pattern="adminapi.filtr.com" negate="false" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
  <elmah>
    <errorLog type="Elmah.MySqlErrorLog, Elmah" connectionStringName="dbErrorLogging" />
    <!--
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on remote access and securing ELMAH.
    -->
    <security allowRemoteAccess="false" />
  </elmah>
  <system.net>
    <!--<defaultProxy>
      <proxy proxyaddress="http://127.0.0.1:8888" bypassonlocal="False" />
    </defaultProxy>-->
  </system.net>
  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd">
    <variable name="brief" value="${longdate} - ${message}" />
    <variable name="verbose" value="${longdate} | ${machinename} | ${processid} | ${processname} | ${level} | ${logger} | ${message}" />
    <targets>
      <target name="logfile" d4p1:type="File" fileName="C:\Temp\logs\AdminApi\${logger}-${shortdate}.txt" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance" />
    </targets>
    <rules>
      <logger name="*" minlevel="Debug" writeTo="logfile" />
    </rules>
  </nlog>
  <location path="elmah.axd" inheritInChildApplications="false">
    <system.web>
      <httpHandlers>
        <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
      </httpHandlers>
      <!-- 
        See http://code.google.com/p/elmah/wiki/SecuringErrorLogPages for 
        more information on using ASP.NET authorization securing ELMAH.

      <authorization>
        <allow roles="admin" />
        <deny users="*" />  
      </authorization>
      -->
    </system.web>
    <system.webServer>
      <handlers>
        <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
      </handlers>
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: B99505F0-98C6-46B4-A54D-37139C04B57A-->