1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

added application insights to api

This commit is contained in:
Kyle Spearrin 2016-10-27 00:09:55 -04:00
parent 2bc7799f3c
commit eb6c0a5068
8 changed files with 135 additions and 125 deletions

View File

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Bit.Api")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitwarden")]
[assembly: AssemblyCompany("8bit Solutions LLC")]
[assembly: AssemblyProduct("bitwarden")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]

View File

@ -1,27 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4000",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"Web": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:4000",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"Web": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}

View File

@ -38,6 +38,7 @@ namespace Bit.Api
if(env.IsDevelopment())
{
builder.AddUserSecrets();
builder.AddApplicationInsightsSettings(developerMode: true);
}
builder.AddEnvironmentVariables();
@ -49,6 +50,8 @@ namespace Bit.Api
public void ConfigureServices(IServiceCollection services)
{
services.AddApplicationInsightsTelemetry(Configuration);
var provider = services.BuildServiceProvider();
// Options
@ -164,6 +167,9 @@ namespace Bit.Api
globalSettings.Loggr.ApiKey);
}
app.UseApplicationInsightsRequestTelemetry();
app.UseApplicationInsightsExceptionTelemetry();
// Add static files to the request pipeline.
app.UseStaticFiles();

View File

@ -1,59 +1,60 @@
{
"userSecretsId": "aspnet5-bitwarden-Api",
"version": "1.0.2",
"userSecretsId": "aspnet5-bitwarden-Api",
"version": "1.0.2",
"dependencies": {
"Core": {
"target": "project"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.AspNetCore.Cors": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Binder": "1.0.0",
"Loggr.Extensions.Logging": "1.0.0"
"dependencies": {
"Core": {
"target": "project"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.AspNetCore.Cors": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Binder": "1.0.0",
"Loggr.Extensions.Logging": "1.0.0",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"net461": { }
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": false,
"gcConcurrent": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"settings.json",
"settings.Production.json",
"settings.Staging.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"net461": {}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": false,
"gcConcurrent": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"settings.json",
"settings.Production.json",
"settings.Staging.json",
"web.config"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

View File

@ -1,25 +1,28 @@
{
"globalSettings": {
"siteName": "bitwarden",
"baseVaultUri": "http://localhost:4001",
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
"sqlServer": {
"connectionString": "SECRET"
},
"mail": {
"apiKey": "SECRET",
"replyToEmail": "do-not-reply@bitwarden.com"
},
"loggr": {
"logKey": "SECRET",
"apiKey": "SECRET"
},
"push": {
"apnsCertificateThumbprint": "SECRET",
"apnsCertificatePassword": "SECRET",
"gcmSenderId": "SECRET",
"gcmApiKey": "SECRET",
"gcmAppPackageName": "com.x8bit.bitwarden"
}
"ApplicationInsights": {
"InstrumentationKey": "5e6c8e7c-8a6d-4d4b-866e-4b80e5b9203e"
},
"globalSettings": {
"siteName": "bitwarden",
"baseVaultUri": "http://localhost:4001",
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
"sqlServer": {
"connectionString": "SECRET"
},
"mail": {
"apiKey": "SECRET",
"replyToEmail": "do-not-reply@bitwarden.com"
},
"loggr": {
"logKey": "SECRET",
"apiKey": "SECRET"
},
"push": {
"apnsCertificateThumbprint": "SECRET",
"apnsCertificatePassword": "SECRET",
"gcmSenderId": "SECRET",
"gcmApiKey": "SECRET",
"gcmAppPackageName": "com.x8bit.bitwarden"
}
}
}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>

View File

@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Bit.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("bitwarden")]
[assembly: AssemblyCompany("8bit Solutions LLC")]
[assembly: AssemblyProduct("bitwarden")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]

View File

@ -1,22 +1,22 @@
{
"dependencies": {
"Microsoft.AspNetCore.Identity": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0",
"OtpSharp": "1.3.0.4",
"Microsoft.AspNetCore.Mvc.Abstractions": "1.0.0",
"Dapper": "1.42.0",
"DataTableProxy": "1.2.0",
"Sendgrid": "6.3.4",
"StackExchange.Redis": "1.0.488",
"PushSharp": "4.0.10"
},
"dependencies": {
"Microsoft.AspNetCore.Identity": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0",
"OtpSharp": "1.3.0.4",
"Microsoft.AspNetCore.Mvc.Abstractions": "1.0.0",
"Dapper": "1.42.0",
"DataTableProxy": "1.2.0",
"Sendgrid": "6.3.4",
"StackExchange.Redis": "1.0.488",
"PushSharp": "4.0.10"
},
"frameworks": {
"net461": {
"frameworkAssemblies": {
"System.ComponentModel.DataAnnotations": "4.0.0.0",
"System.Data": "4.0.0.0"
}
}
"frameworks": {
"net461": {
"frameworkAssemblies": {
"System.ComponentModel.DataAnnotations": "4.0.0.0",
"System.Data": "4.0.0.0"
}
}
}
}