mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Upgrade to ASP.NET Core RC2 release.
This commit is contained in:
@ -4,16 +4,17 @@
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>e8548ad6-7fb0-439a-8eb5-549a10336d2d</ProjectGuid>
|
||||
<RootNamespace>Bit.Api</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<DevelopmentServerPort>4000</DevelopmentServerPort>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Api.Models;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core.Services;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Bit.Core.Domains;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core;
|
||||
@ -78,7 +78,7 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
// NOTE: It is assumed that the eventual repository call will make sure the updated
|
||||
// ciphers belong to user making this call. Therefore, no check is done here.
|
||||
var ciphers = CipherRequestModel.ToDynamicCiphers(model.Ciphers, User.GetUserId());
|
||||
var ciphers = CipherRequestModel.ToDynamicCiphers(model.Ciphers, _userManager.GetUserId(User));
|
||||
|
||||
var result = await _userService.ChangeEmailAsync(
|
||||
_currentContext.User,
|
||||
@ -107,7 +107,7 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
// NOTE: It is assumed that the eventual repository call will make sure the updated
|
||||
// ciphers belong to user making this call. Therefore, no check is done here.
|
||||
var ciphers = CipherRequestModel.ToDynamicCiphers(model.Ciphers, User.GetUserId());
|
||||
var ciphers = CipherRequestModel.ToDynamicCiphers(model.Ciphers, _userManager.GetUserId(User));
|
||||
|
||||
var result = await _userService.ChangePasswordAsync(
|
||||
_currentContext.User,
|
||||
@ -206,8 +206,8 @@ namespace Bit.Api.Controllers
|
||||
public async Task PostImport([FromBody]ImportRequestModel model)
|
||||
{
|
||||
await _cipherService.ImportCiphersAsync(
|
||||
model.Folders.Select(f => f.ToFolder(User.GetUserId())).ToList(),
|
||||
model.Sites.Select(s => s.ToSite(User.GetUserId())).ToList(),
|
||||
model.Folders.Select(f => f.ToFolder(_userManager.GetUserId(User))).ToList(),
|
||||
model.Sites.Select(s => s.ToSite(_userManager.GetUserId(User))).ToList(),
|
||||
model.SiteRelationships);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Identity;
|
||||
using Bit.Api.Models;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core;
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Repositories;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Bit.Api.Models;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core.Domains;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
@ -17,17 +17,20 @@ namespace Bit.Api.Controllers
|
||||
public class FoldersController : Controller
|
||||
{
|
||||
private readonly IFolderRepository _folderRepository;
|
||||
private readonly UserManager<User> _userManager;
|
||||
|
||||
public FoldersController(
|
||||
IFolderRepository folderRepository)
|
||||
IFolderRepository folderRepository,
|
||||
UserManager<User> userManager)
|
||||
{
|
||||
_folderRepository = folderRepository;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public async Task<FolderResponseModel> Get(string id)
|
||||
{
|
||||
var folder = await _folderRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var folder = await _folderRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(folder == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
@ -39,7 +42,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpGet("")]
|
||||
public async Task<ListResponseModel<FolderResponseModel>> Get()
|
||||
{
|
||||
ICollection<Folder> folders = await _folderRepository.GetManyByUserIdAsync(User.GetUserId());
|
||||
ICollection<Folder> folders = await _folderRepository.GetManyByUserIdAsync(_userManager.GetUserId(User));
|
||||
var responses = folders.Select(f => new FolderResponseModel(f));
|
||||
return new ListResponseModel<FolderResponseModel>(responses);
|
||||
}
|
||||
@ -47,7 +50,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpPost("")]
|
||||
public async Task<FolderResponseModel> Post([FromBody]FolderRequestModel model)
|
||||
{
|
||||
var folder = model.ToFolder(User.GetUserId());
|
||||
var folder = model.ToFolder(_userManager.GetUserId(User));
|
||||
await _folderRepository.CreateAsync(folder);
|
||||
return new FolderResponseModel(folder);
|
||||
}
|
||||
@ -55,7 +58,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpPut("{id}")]
|
||||
public async Task<FolderResponseModel> Put(string id, [FromBody]FolderRequestModel model)
|
||||
{
|
||||
var folder = await _folderRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var folder = await _folderRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(folder == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
@ -68,7 +71,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpDelete("{id}")]
|
||||
public async Task Delete(string id)
|
||||
{
|
||||
var folder = await _folderRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var folder = await _folderRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(folder == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
|
@ -2,13 +2,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Bit.Core.Repositories;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Bit.Api.Models;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core.Domains;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Bit.Api.Controllers
|
||||
{
|
||||
@ -18,19 +18,22 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
private readonly ISiteRepository _siteRepository;
|
||||
private readonly IFolderRepository _folderRepository;
|
||||
private readonly UserManager<User> _userManager;
|
||||
|
||||
public SitesController(
|
||||
ISiteRepository siteRepository,
|
||||
IFolderRepository folderRepository)
|
||||
IFolderRepository folderRepository,
|
||||
UserManager<User> userManager)
|
||||
{
|
||||
_siteRepository = siteRepository;
|
||||
_folderRepository = folderRepository;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public async Task<SiteResponseModel> Get(string id, string[] expand = null)
|
||||
{
|
||||
var site = await _siteRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var site = await _siteRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(site == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
@ -44,7 +47,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpGet("")]
|
||||
public async Task<ListResponseModel<SiteResponseModel>> Get(string[] expand = null)
|
||||
{
|
||||
ICollection<Site> sites = await _siteRepository.GetManyByUserIdAsync(User.GetUserId());
|
||||
ICollection<Site> sites = await _siteRepository.GetManyByUserIdAsync(_userManager.GetUserId(User));
|
||||
var responses = sites.Select(s => new SiteResponseModel(s)).ToList();
|
||||
await ExpandManyAsync(sites, responses, expand, null);
|
||||
return new ListResponseModel<SiteResponseModel>(responses);
|
||||
@ -53,7 +56,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpPost("")]
|
||||
public async Task<SiteResponseModel> Post([FromBody]SiteRequestModel model, string[] expand = null)
|
||||
{
|
||||
var site = model.ToSite(User.GetUserId());
|
||||
var site = model.ToSite(_userManager.GetUserId(User));
|
||||
await _siteRepository.CreateAsync(site);
|
||||
|
||||
var response = new SiteResponseModel(site);
|
||||
@ -64,7 +67,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpPut("{id}")]
|
||||
public async Task<SiteResponseModel> Put(string id, [FromBody]SiteRequestModel model, string[] expand = null)
|
||||
{
|
||||
var site = await _siteRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var site = await _siteRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(site == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
@ -80,7 +83,7 @@ namespace Bit.Api.Controllers
|
||||
[HttpDelete("{id}")]
|
||||
public async Task Delete(string id)
|
||||
{
|
||||
var site = await _siteRepository.GetByIdAsync(id, User.GetUserId());
|
||||
var site = await _siteRepository.GetByIdAsync(id, _userManager.GetUserId(User));
|
||||
if(site == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
@ -118,7 +121,7 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
if(folders == null)
|
||||
{
|
||||
folders = await _folderRepository.GetManyByUserIdAsync(User.GetUserId());
|
||||
folders = await _folderRepository.GetManyByUserIdAsync(_userManager.GetUserId(User));
|
||||
}
|
||||
|
||||
if(folders != null && folders.Count() > 0)
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Mvc.ModelBinding;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
|
||||
namespace Bit.Api.Models.Response
|
||||
{
|
||||
|
20
src/Api/Program.cs
Normal file
20
src/Api/Program.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Bit.Api
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
host.Run();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +1,27 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:4000",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"Hosting:Environment": "Development"
|
||||
}
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:4000",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"web": {
|
||||
"commandName": "web",
|
||||
"environmentVariables": {
|
||||
"Hosting:Environment": "Development"
|
||||
}
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Web": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
using System;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authentication.JwtBearer;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Bit.Api.Utilities;
|
||||
using Bit.Core;
|
||||
using Bit.Core.Domains;
|
||||
@ -16,7 +17,8 @@ using Bit.Core.Identity;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
using Repos = Bit.Core.Repositories.SqlServer;
|
||||
using Loggr.Extensions.Logging;
|
||||
using System.Text;
|
||||
//using Loggr.Extensions.Logging;
|
||||
|
||||
namespace Bit.Api
|
||||
{
|
||||
@ -25,6 +27,7 @@ namespace Bit.Api
|
||||
public Startup(IHostingEnvironment env)
|
||||
{
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("settings.json")
|
||||
.AddJsonFile($"settings.{env.EnvironmentName}.json", optional: true);
|
||||
|
||||
@ -42,14 +45,14 @@ namespace Bit.Api
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<GlobalSettings>(Configuration.GetSection("globalSettings"));
|
||||
var provider = services.BuildServiceProvider();
|
||||
|
||||
// Options
|
||||
services.AddOptions();
|
||||
|
||||
// Settings
|
||||
var provider = services.BuildServiceProvider();
|
||||
var globalSettings = provider.GetRequiredService<IOptions<GlobalSettings>>().Value;
|
||||
var globalSettings = new GlobalSettings();
|
||||
ConfigurationBinder.Bind(Configuration.GetSection("GlobalSettings"), globalSettings);
|
||||
services.AddSingleton(s => globalSettings);
|
||||
|
||||
// Repositories
|
||||
@ -75,7 +78,7 @@ namespace Bit.Api
|
||||
RequireDigit = false,
|
||||
RequireLowercase = false,
|
||||
RequiredLength = 8,
|
||||
RequireNonLetterOrDigit = false,
|
||||
RequireNonAlphanumeric = false,
|
||||
RequireUppercase = false
|
||||
};
|
||||
options.ClaimsIdentity = new ClaimsIdentityOptions
|
||||
@ -90,9 +93,8 @@ namespace Bit.Api
|
||||
jwtBearerOptions.Issuer = "bitwarden";
|
||||
jwtBearerOptions.TokenLifetime = TimeSpan.FromDays(10 * 365);
|
||||
jwtBearerOptions.TwoFactorTokenLifetime = TimeSpan.FromMinutes(10);
|
||||
// TODO: Symmetric key
|
||||
// waiting on https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/250
|
||||
jwtBearerOptions.SigningCredentials = null;
|
||||
var keyBytes = Encoding.ASCII.GetBytes(globalSettings.JwtSigningKey);
|
||||
jwtBearerOptions.SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(keyBytes), SecurityAlgorithms.HmacSha256);
|
||||
})
|
||||
.AddUserStore<UserStore>()
|
||||
.AddRoleStore<RoleStore>()
|
||||
@ -138,21 +140,17 @@ namespace Bit.Api
|
||||
ILoggerFactory loggerFactory,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
loggerFactory.MinimumLevel = LogLevel.Information;
|
||||
loggerFactory.AddConsole();
|
||||
loggerFactory.AddDebug();
|
||||
|
||||
if(!env.IsDevelopment())
|
||||
{
|
||||
loggerFactory.AddLoggr(
|
||||
LogLevel.Error,
|
||||
globalSettings.Loggr.LogKey,
|
||||
globalSettings.Loggr.ApiKey);
|
||||
//loggerFactory.AddLoggr(
|
||||
// LogLevel.Error,
|
||||
// globalSettings.Loggr.LogKey,
|
||||
// globalSettings.Loggr.ApiKey);
|
||||
}
|
||||
|
||||
// Add the platform handler to the request pipeline.
|
||||
app.UseIISPlatformHandler();
|
||||
|
||||
// Add static files to the request pipeline.
|
||||
app.UseStaticFiles();
|
||||
|
||||
@ -165,8 +163,5 @@ namespace Bit.Api
|
||||
// Add MVC to the request pipeline.
|
||||
app.UseMvc();
|
||||
}
|
||||
|
||||
// Entry point for the application.
|
||||
public static void Main(string[] args) => WebApplication.Run<Startup>(args);
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@
|
||||
using System.IdentityModel.Tokens;
|
||||
using Bit.Api.Models.Response;
|
||||
using Bit.Core.Exceptions;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@ -48,14 +48,14 @@ namespace Bit.Api.Utilities
|
||||
}
|
||||
else
|
||||
{
|
||||
var logger = context.HttpContext.ApplicationServices.GetRequiredService<ILogger<ExceptionHandlerFilterAttribute>>();
|
||||
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<ExceptionHandlerFilterAttribute>>();
|
||||
logger.LogError(exception.Message, exception);
|
||||
|
||||
errorModel.Message = "An unhandled server error has occured.";
|
||||
context.HttpContext.Response.StatusCode = 500;
|
||||
}
|
||||
|
||||
var env = context.HttpContext.ApplicationServices.GetRequiredService<IHostingEnvironment>();
|
||||
var env = context.HttpContext.RequestServices.GetRequiredService<IHostingEnvironment>();
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
errorModel.ExceptionMessage = exception.Message;
|
||||
|
@ -1,5 +1,5 @@
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Bit.Api.Models.Response;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -1,42 +1,59 @@
|
||||
{
|
||||
"userSecretsId": "aspnet5-bitwarden-Api",
|
||||
"version": "0.0.1-*",
|
||||
"compilationOptions": {
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"Core": {
|
||||
"version": "0.0.1",
|
||||
"target": "project"
|
||||
},
|
||||
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
|
||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Cors": "6.0.0-rc1-final",
|
||||
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
|
||||
"Loggr.Extensions.Logging": "1.0.1-rc1-final"
|
||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
|
||||
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
|
||||
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
|
||||
"Microsoft.AspNetCore.Cors": "1.0.0-rc2-final",
|
||||
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
|
||||
"Microsoft.Extensions.Configuration.Binder": "1.0.0-rc2-final"
|
||||
},
|
||||
|
||||
"commands": {
|
||||
"web": "Microsoft.AspNet.Server.Kestrel"
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
|
||||
"version": "1.0.0-preview1-final",
|
||||
"imports": "portable-net45+win8+dnxcore50"
|
||||
}
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"dnx451": { }
|
||||
"net46": { }
|
||||
},
|
||||
|
||||
"exclude": [
|
||||
"wwwroot",
|
||||
"node_modules"
|
||||
],
|
||||
"publishExclude": [
|
||||
"**.user",
|
||||
"**.vspscc"
|
||||
]
|
||||
"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%" ]
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
"globalSettings": {
|
||||
"siteName": "bitwarden",
|
||||
"baseVaultUri": "http://localhost:4001",
|
||||
"jwtSigningKey": "THIS IS A SECRET. IT KEEPS YOUR TOKEN SAFE. :)",
|
||||
"documentDB": {
|
||||
"uri": "SECRET",
|
||||
"key": "SECRET",
|
||||
|
9
src/Api/web.config
Normal file
9
src/Api/web.config
Normal file
@ -0,0 +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>
|
||||
</configuration>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
|
||||
</handlers>
|
||||
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600" />
|
||||
</system.webServer>
|
||||
</configuration>
|
Reference in New Issue
Block a user