1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

version bump and project cleanup

This commit is contained in:
Kyle Spearrin 2017-07-25 22:34:07 -04:00
parent b7e8852250
commit c3b2be17a9
13 changed files with 76 additions and 321 deletions

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.6
VisualStudioVersion = 15.0.26430.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}"
EndProject
@ -24,11 +24,9 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Sql", "src\Sql\Sql.sqlproj"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mail", "util\Mail\Mail.csproj", "{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Billing", "src\Billing\Billing.csproj", "{02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Billing", "src\Billing\Billing.csproj", "{02BC2982-ED8D-4A6D-A41E-092B3DAEB98A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Identity", "src\Identity\Identity.csproj", "{04148736-3C0B-445E-8B74-2020E7A53502}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnhMigrator", "util\AnhMigrator\AnhMigrator.csproj", "{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identity", "src\Identity\Identity.csproj", "{04148736-3C0B-445E-8B74-2020E7A53502}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -62,10 +60,6 @@ Global
{04148736-3C0B-445E-8B74-2020E7A53502}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04148736-3C0B-445E-8B74-2020E7A53502}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04148736-3C0B-445E-8B74-2020E7A53502}.Release|Any CPU.Build.0 = Release|Any CPU
{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -77,6 +71,5 @@ Global
{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E}
{02BC2982-ED8D-4A6D-A41E-092B3DAEB98A} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
{04148736-3C0B-445E-8B74-2020E7A53502} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}
{05C45D68-DAB9-40E6-9E2E-F81BBD2E0C42} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E}
EndGlobalSection
EndGlobal

View File

@ -1,18 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<VersionPrefix>1.7.0</VersionPrefix>
<VersionPrefix>1.8.0</VersionPrefix>
<TargetFramework>net461</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Api</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Api</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<RootNamespace>Bit.Api</RootNamespace>
<UserSecretsId>bitwarden-Api</UserSecretsId>
</PropertyGroup>

View File

@ -1,23 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Bit.Api")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("8bit Solutions LLC")]
[assembly: AssemblyProduct("bitwarden")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e8548ad6-7fb0-439a-8eb5-549a10336d2d")]

View File

@ -1,17 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<VersionPrefix>1.8.0</VersionPrefix>
<TargetFramework>net461</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Billing</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Billing</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<RootNamespace>Bit.Billing</RootNamespace>
<UserSecretsId>bitwarden-Billing</UserSecretsId>
</PropertyGroup>
@ -28,10 +20,6 @@
<PackageReference Include="System.Net.Http" Version="4.3.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />

View File

@ -1,23 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Bit.Billing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("8bit Solutions LLC")]
[assembly: AssemblyProduct("bitwarden")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("02bc2982-ed8d-4a6d-a41e-092b3daeb98a")]

View File

@ -3,13 +3,6 @@
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<AssemblyName>Core</AssemblyName>
<PackageId>Core</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<RootNamespace>Bit.Core</RootNamespace>
</PropertyGroup>

View File

@ -1,23 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Bit.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("8bit Solutions LLC")]
[assembly: AssemblyProduct("bitwarden")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3973d21b-a692-4b60-9b70-3631c057423a")]

View File

@ -1,20 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<VersionPrefix>1.8.0</VersionPrefix>
<TargetFramework>net461</TargetFramework>
<AssemblyName>Identity</AssemblyName>
<RootNamespace>Bit.Identity</RootNamespace>
<UserSecretsId>bitwarden-Identity</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>
</Project>

View File

@ -1,18 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
<RootNamespace>Bit.AnhMigrator</RootNamespace>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Core\Core.csproj" />
</ItemGroup>
</Project>

View File

@ -1,171 +0,0 @@
using Bit.Core.Models.Table;
using Dapper;
using Microsoft.Azure.NotificationHubs;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using Bit.Core.Enums;
using Newtonsoft.Json;
namespace Bit.AnhMigrator
{
class Program
{
private const string SqlConnectionString = "";
private const string AnhConnectionString = "";
private const string AnhHubName = "";
private static DateTime _startDate = DateTime.UtcNow.AddYears(-10);
private static string _viewId = "";
private static NotificationHubClient _client;
static void Main(string[] args)
{
_client = NotificationHubClient.CreateClientFromConnectionString(
AnhConnectionString,
AnhHubName);
//RegisterAsync(args).Wait();
//ViewAsync(args).Wait();
Console.Read();
}
private static async Task RegisterAsync(string[] args)
{
IDictionary<Guid, List<OrganizationUser>> orgUsersDict;
using(var connection = new SqlConnection(SqlConnectionString))
{
var results = await connection.QueryAsync<OrganizationUser>(
"SELECT * FROM [dbo].[OrganizationUser] WHERE [Status] = 2 AND [UserId] IS NOT NULL",
commandType: CommandType.Text);
orgUsersDict = results
.GroupBy(ou => ou.UserId.Value)
.ToDictionary(ou => ou.Key, ou => ou.ToList());
}
IEnumerable<Device> devices;
using(var connection = new SqlConnection(SqlConnectionString))
{
devices = await connection.QueryAsync<Device>(
"SELECT * FROM [dbo].[Device] WHERE [PushToken] IS NOT NULL AND [RevisionDate] > @StartDate",
new { StartDate = _startDate },
commandType: CommandType.Text);
}
var i = 0;
foreach(var device in devices)
{
i++;
if(string.IsNullOrWhiteSpace(device.PushToken))
{
return;
}
var installation = new Installation
{
InstallationId = device.Id.ToString(),
PushChannel = device.PushToken,
Templates = new Dictionary<string, InstallationTemplate>()
};
installation.Tags = new List<string>
{
$"userId:{device.UserId}"
};
if(!string.IsNullOrWhiteSpace(device.Identifier))
{
installation.Tags.Add("deviceIdentifier:" + device.Identifier);
}
if(orgUsersDict.ContainsKey(device.UserId))
{
foreach(var orgUser in orgUsersDict[device.UserId])
{
installation.Tags.Add("organizationId:" + orgUser.OrganizationId);
}
}
string payloadTemplate = null, messageTemplate = null, badgeMessageTemplate = null;
switch(device.Type)
{
case DeviceType.Android:
payloadTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}}";
messageTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\"}," +
"\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}";
installation.Platform = NotificationPlatform.Gcm;
break;
case DeviceType.iOS:
payloadTemplate = "{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}," +
"\"aps\":{\"alert\":null,\"badge\":null,\"content-available\":1}}";
messageTemplate = "{\"data\":{\"type\":\"#(type)\"}," +
"\"aps\":{\"alert\":\"$(message)\",\"badge\":null,\"content-available\":1}}";
badgeMessageTemplate = "{\"data\":{\"type\":\"#(type)\"}," +
"\"aps\":{\"alert\":\"$(message)\",\"badge\":\"#(badge)\",\"content-available\":1}}";
installation.Platform = NotificationPlatform.Apns;
break;
case DeviceType.AndroidAmazon:
payloadTemplate = "{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}";
messageTemplate = "{\"data\":{\"type\":\"#(type)\",\"message\":\"$(message)\"}}";
installation.Platform = NotificationPlatform.Adm;
break;
default:
break;
}
BuildInstallationTemplate(installation, "payload", payloadTemplate, device.UserId, device.Identifier);
BuildInstallationTemplate(installation, "message", messageTemplate, device.UserId, device.Identifier);
BuildInstallationTemplate(installation, "badgeMessage", badgeMessageTemplate ?? messageTemplate, device.UserId,
device.Identifier);
await _client.CreateOrUpdateInstallationAsync(installation);
Console.WriteLine("Added install #" + i + " (" + installation.InstallationId + ")");
}
}
private static void BuildInstallationTemplate(Installation installation, string templateId, string templateBody,
Guid userId, string deviceIdentifier)
{
if(templateBody == null)
{
return;
}
var fullTemplateId = $"template:{templateId}";
var template = new InstallationTemplate
{
Body = templateBody,
Tags = new List<string>
{
fullTemplateId,
$"{fullTemplateId}_userId:{userId}"
}
};
if(!string.IsNullOrWhiteSpace(deviceIdentifier))
{
template.Tags.Add($"{fullTemplateId}_deviceIdentifier:{deviceIdentifier}");
}
installation.Templates.Add(fullTemplateId, template);
}
private static async Task ViewAsync(string[] args)
{
var install = await _client.GetInstallationAsync(_viewId);
var json = JsonConvert.SerializeObject(install, Formatting.Indented);
Console.WriteLine(json);
}
}
}

View File

@ -2,10 +2,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Mail</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Mail</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
<RootNamespace>Bit.Mail</RootNamespace>

View File

@ -102,6 +102,10 @@ body {
padding: 0 0 10px;
}
.content-block-spaced {
padding: 0 0 25px;
}
.indented {
padding-left: 20px;
}

View File

@ -14,41 +14,87 @@
<table cellpadding="0" cellspacing="0" class="container-table">
<tr>
<td class="content content-banner" align="center">
<a href="#" title="" target="_blank" class="banner">
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=Announcement%20Image&w=600&h=158"
<a href="https://blog.bitwarden.com/premium-features-attachments-2fa-options-totp-priority-support-d4c12e2d9018" title="bitwarden premium membership" target="_blank" class="banner">
<img src="https://bitwarden.com/images/mail/premium.png"
width="600" alt="" />
</a>
<table class="main" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="content-wrap">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="content-block-spaced">
Today we're excited to announce the release of the <a href="https://vault.bitwarden.com/#/?premium=purchase" target="_blank">bitwarden premium membership</a>, which includes access to some great new features:
</a></td>
</tr>
<tr>
<td class="h3 content-block">
A title!
File Attachments
</td>
</tr>
<tr>
<td class="content-block">
Some text about an announcement.
Often times you have sensitive files such as private keys, scanned documents, etc. that need to be securely stored, protected, and sharable. bitwarden premium gives you 1GB of encrypted file storage that allows you to securely store file attachments to any entry in your vault.
</td>
</tr>
<tr>
<td class="content-block indented">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="15">&bull;</td>
<td class="li">Bullet 1</td>
<td class="content-block-spaced">
<a href="#" target="_blank">&rarr; Learn more</a>
</td>
</tr>
<tr>
<td>&bull;</td>
<td class="li">Bullet 2</td>
<td class="h3 content-block">
Additional Two-step Login (2FA) Options
</td>
</tr>
</table>
<tr>
<td class="content-block">
Premium membership unlocks access to additional two-step login options. Use Duo, YubiKey, and/or FIDO U2F to further secure your account.
</td>
</tr>
<tr>
<td class="content-block-spaced">
<a href="#" target="_blank">&rarr; Learn more</a>
</td>
</tr>
<tr>
<td class="h3 content-block">
TOTP Verification Codes
</td>
</tr>
<tr>
<td class="content-block">
bitwarden can replace existing authenticator apps such as Authy and Google Authenticator. Securely store authenticator keys and bitwarden will generate TOTP verification codes for you, even assisting you during login auto-fills.
</td>
</tr>
<tr>
<td class="content-block-spaced">
<a href="#" target="_blank">&rarr; Learn more</a>
</td>
</tr>
<tr>
<td class="h3 content-block">
Priority Customer Support
</td>
</tr>
<tr>
<td class="content-block-spaced">
Receive priority customer support when contacting us with questions or for help. Your inquires will be responded to quicker and prioritized over any others received by free users.
</td>
</tr>
<tr>
<td class="content-block-spaced aligncenter">
<a href="https://blog.bitwarden.com/premium-features-attachments-2fa-options-totp-priority-support-d4c12e2d9018" target="_blank"><img src="https://bitwarden.com/images/mail/share-more-button2.png" title="Read the full announcement on our blog..." alt="Read the full announcement on our blog..." width="266" /></a>
</td>
</tr>
<tr>
<td class="content-block-spaced">
You can purchase a bitwarden premium membership by logging into the <a href="https://vault.bitwarden.com/#/?premium=purchase" target="_blank">web vault</a> and navigating to <strong>Settings</strong> &rarr; <strong>Go Premium</strong>.
</td>
</tr>
<tr>
<td class="content-block last">
Thank you!<br />
Regards,<br />
The bitwarden Team
</td>
</tr>