diff --git a/.gitignore b/.gitignore index a6f1fac81..d16b12208 100644 --- a/.gitignore +++ b/.gitignore @@ -199,3 +199,4 @@ FakesAssemblies/ # Other project.lock.json *.jfm +mail_dist/ diff --git a/bitwarden-core.sln b/bitwarden-core.sln index 5118e544a..4f452b5c3 100644 --- a/bitwarden-core.sln +++ b/bitwarden-core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D}" EndProject @@ -19,6 +19,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Api", "src\Api\Api.xproj", EndProject Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "Sql", "src\Sql\Sql.sqlproj", "{58554E52-FDEC-4832-AFF9-302B01E08DCA}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Mail", "src\Mail\Mail.xproj", "{B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,6 +41,10 @@ Global {58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU {58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.Build.0 = Release|Any CPU {58554E52-FDEC-4832-AFF9-302B01E08DCA}.Release|Any CPU.Deploy.0 = Release|Any CPU + {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -47,5 +53,6 @@ Global {3973D21B-A692-4B60-9B70-3631C057423A} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} {E8548AD6-7FB0-439A-8EB5-549A10336D2D} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} {58554E52-FDEC-4832-AFF9-302B01E08DCA} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} + {B78A6C74-1A24-48C6-802A-13BE3E4DAFF1} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84D} EndGlobalSection EndGlobal diff --git a/src/Mail/Mail.xproj b/src/Mail/Mail.xproj new file mode 100644 index 000000000..78614f383 --- /dev/null +++ b/src/Mail/Mail.xproj @@ -0,0 +1,23 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + b78a6c74-1a24-48c6-802a-13be3e4daff1 + Bit.Mail + .\obj + .\bin\ + v4.6.1 + + + 2.0 + + + + + + + \ No newline at end of file diff --git a/src/Mail/Program.cs b/src/Mail/Program.cs new file mode 100644 index 000000000..bacde93ac --- /dev/null +++ b/src/Mail/Program.cs @@ -0,0 +1,20 @@ +using System.IO; +using Microsoft.AspNetCore.Hosting; + +namespace Bit.Mail +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/src/Mail/Properties/launchSettings.json b/src/Mail/Properties/launchSettings.json new file mode 100644 index 000000000..cd4dd04fa --- /dev/null +++ b/src/Mail/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:33104/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Mail": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5004", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/src/Mail/Startup.cs b/src/Mail/Startup.cs new file mode 100644 index 000000000..0435a6e9f --- /dev/null +++ b/src/Mail/Startup.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; + +namespace Bit.Mail +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) { } + + public void Configure(IApplicationBuilder app) + { + app.UseFileServer(); + app.UseBrowserLink(); + } + } +} diff --git a/src/Mail/gulpfile.js b/src/Mail/gulpfile.js new file mode 100644 index 000000000..bddd169fe --- /dev/null +++ b/src/Mail/gulpfile.js @@ -0,0 +1,20 @@ +/// + +var gulp = require('gulp'), + rimraf = require('rimraf'), + premailer = require('gulp-premailer'); + +var paths = { + dist: '../../mail_dist/', + wwwroot: './wwwroot/' +}; + +gulp.task('inline', ['clean'], function () { + return gulp.src(paths.wwwroot + 'templates/*.html') + .pipe(premailer()) + .pipe(gulp.dest(paths.dist)); +}); + +gulp.task('clean', function (cb) { + return rimraf(paths.dist, cb); +}); diff --git a/src/Mail/package.json b/src/Mail/package.json new file mode 100644 index 000000000..d761e57e4 --- /dev/null +++ b/src/Mail/package.json @@ -0,0 +1,9 @@ +{ + "name": "bitwarden", + "version": "0.0.1", + "devDependencies": { + "gulp": "3.9.1", + "rimraf": "2.5.4", + "gulp-premailer": "0.4.0" + } +} diff --git a/src/Mail/project.json b/src/Mail/project.json new file mode 100644 index 000000000..a6c25c658 --- /dev/null +++ b/src/Mail/project.json @@ -0,0 +1,48 @@ +{ + "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0", + "type": "platform" + }, + "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", + "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", + "Microsoft.AspNetCore.StaticFiles": "1.0.0", + "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0" + }, + + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" + }, + + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dotnet5.6", + "portable-net45+win8" + ] + } + }, + + "buildOptions": { + "emitEntryPoint": true, + "preserveCompilationContext": true, + "define": [ "DEBUG" ] + }, + + "runtimeOptions": { + "configProperties": { + "System.GC.Server": true + } + }, + + "publishOptions": { + "include": [ + "wwwroot", + "web.config" + ] + }, + + "scripts": { + "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] + } +} diff --git a/src/Mail/web.config b/src/Mail/web.config new file mode 100644 index 000000000..768899947 --- /dev/null +++ b/src/Mail/web.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Mail/wwwroot/index.html b/src/Mail/wwwroot/index.html new file mode 100644 index 000000000..5e88bad57 --- /dev/null +++ b/src/Mail/wwwroot/index.html @@ -0,0 +1,12 @@ + + + + + bitwarden Mail Templates + + +
    +
  1. Welcome
  2. +
+ + diff --git a/src/Mail/wwwroot/styles.css b/src/Mail/wwwroot/styles.css new file mode 100644 index 000000000..df565848b --- /dev/null +++ b/src/Mail/wwwroot/styles.css @@ -0,0 +1,221 @@ +/* ------------------------------------- + GLOBAL + A very basic CSS reset +------------------------------------- */ +body, html, body * { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + box-sizing: border-box; + font-size: 14px; + color: #333; +} + +img { + max-width: 100%; + border: none; +} + +body { + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: none; + width: 100% !important; + height: 100%; + line-height: 22px; +} + +/* Let's make sure all tables have defaults */ +table td { + vertical-align: top; +} + + table td.middle { + vertical-align: middle; + } + +/* ------------------------------------- + BODY & CONTAINER +------------------------------------- */ +body { + background-color: #f6f6f6; +} + +.body-wrap { + background-color: #f6f6f6; + width: 100%; +} + +.container { + display: block !important; + max-width: 600px !important; + margin: 0 auto !important; + /* makes it centered */ + clear: both !important; +} + +.content { + max-width: 600px; + margin: 0 auto; + display: block; + padding: 20px; +} + +/* ------------------------------------- + HEADER, FOOTER, MAIN +------------------------------------- */ +.main { + background-color: #fff; + border: 1px solid #e9e9e9; + border-radius: 3px; +} + +.content-wrap { + padding: 20px; +} + +.content-block { + padding: 0 0 15px; +} + +.header { + width: 100%; + margin-bottom: 20px; +} + +.footer { + width: 100%; + clear: both; + color: #999; + padding-top: 15px; +} + + .footer p, .footer a, .footer td { + color: #999; + font-size: 12px; + } + +/* ------------------------------------- + TYPOGRAPHY +------------------------------------- */ + +.h3 { + font-size: 18px; + line-height: 25px; + margin-bottom: 20px; + margin-top: 20px; +} + +/* ------------------------------------- + LINKS & BUTTONS +------------------------------------- */ +a { + color: #3c8dbc; + text-decoration: underline; +} + +.btn-primary { + text-decoration: none; + color: #FFF; + background-color: #3c8dbc; + border: solid #3c8dbc; + border-width: 10px 20px; + line-height: 2em; + font-weight: bold; + text-align: center; + cursor: pointer; + display: inline-block; + border-radius: 5px; + text-transform: capitalize; +} + +/* ------------------------------------- + OTHER STYLES THAT MIGHT BE USEFUL +------------------------------------- */ +.last { + margin-bottom: 0; + padding-bottom: 0; +} + +.first { + margin-top: 0; + padding-top: 0; +} + +.aligncenter { + text-align: center; +} + +.alignright { + text-align: right; +} + +.alignleft { + text-align: left; +} + +.clear { + clear: both; +} + +/* ------------------------------------- + ALERTS + Change the class depending on warning email, good email or bad email +------------------------------------- */ +.alert { + font-size: 16px; + color: #fff; + font-weight: 500; + padding: 20px; + text-align: center; + border-radius: 3px 3px 0 0; +} + + .alert a { + color: #fff; + text-decoration: none; + font-weight: 500; + font-size: 16px; + } + + .alert.alert-warning { + background-color: #FF9F00; + } + + .alert.alert-bad { + background-color: #D0021B; + } + + .alert.alert-good { + background-color: #68B90F; + } + +/* ------------------------------------- + RESPONSIVE AND MOBILE FRIENDLY STYLES +------------------------------------- */ +@media only screen and (max-width: 640px) { + body { + padding: 0 !important; + } + + .container { + padding: 0 !important; + width: 100% !important; + } + + .content { + padding: 0 !important; + } + + .content-wrap { + padding: 10px !important; + } + + .invoice { + width: 100% !important; + } + + .main { + border-right: none !important; + border-left: none !important; + border-radius: 0 !important; + } +} diff --git a/src/Mail/wwwroot/templates/welcome.html b/src/Mail/wwwroot/templates/welcome.html new file mode 100644 index 000000000..f6f191336 --- /dev/null +++ b/src/Mail/wwwroot/templates/welcome.html @@ -0,0 +1,133 @@ + + + + + + Welcome + + + + + + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Thank you for creating an account with bitwarden. You may now log in with your new account. +
+ Did you know that bitwarden is free to sync with all of your devices? Download bitwarden today on: +
+ Mobile +
+ + + + + +
AndroidiOS
+
+ + + + + +
+ + Get bitwarden on Google Play + + + + Get bitwarden for iOS + +
+
+ Desktop +
+ + + + + + +
ChromeFirefoxOpera
+
+ + + + + + +
+ + Chrome Extension + + + Firefox Extension + + Opera Extension +
+
+ Web +
+ You can also access your vault from any web-enabled device using our web vault at https://vault.bitwarden.com. +
+ If you have any questions or problems you can email us from our website at https://bitwarden.com/contact. +
+ — The bitwarden Team +
+
+ +
+
+ +