mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
more preprocessing for self host
This commit is contained in:
@@ -6,9 +6,11 @@
|
|||||||
'ui.bootstrap.showErrors',
|
'ui.bootstrap.showErrors',
|
||||||
'toastr',
|
'toastr',
|
||||||
'angulartics',
|
'angulartics',
|
||||||
|
// @if !selfHosted
|
||||||
'angulartics.google.analytics',
|
'angulartics.google.analytics',
|
||||||
'angular-stripe',
|
'angular-stripe',
|
||||||
'credit-cards',
|
'credit-cards',
|
||||||
|
// @endif
|
||||||
'angular-promise-polyfill',
|
'angular-promise-polyfill',
|
||||||
|
|
||||||
'bit.directives',
|
'bit.directives',
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ angular
|
|||||||
.module('bit')
|
.module('bit')
|
||||||
|
|
||||||
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider, jwtOptionsProvider,
|
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider, jwtOptionsProvider,
|
||||||
$uibTooltipProvider, toastrConfig, $locationProvider, $qProvider, stripeProvider, appSettings) {
|
$uibTooltipProvider, toastrConfig, $locationProvider, $qProvider, appSettings
|
||||||
|
// @if !selfHosted
|
||||||
|
, stripeProvider
|
||||||
|
// @endif
|
||||||
|
) {
|
||||||
angular.extend(appSettings, window.bitwardenAppSettings);
|
angular.extend(appSettings, window.bitwardenAppSettings);
|
||||||
|
|
||||||
$qProvider.errorOnUnhandledRejections(false);
|
$qProvider.errorOnUnhandledRejections(false);
|
||||||
@@ -37,7 +41,9 @@ angular
|
|||||||
return refreshPromise;
|
return refreshPromise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @if !selfHosted
|
||||||
stripeProvider.setPublishableKey(appSettings.stripeKey);
|
stripeProvider.setPublishableKey(appSettings.stripeKey);
|
||||||
|
// @endif
|
||||||
|
|
||||||
angular.extend(toastrConfig, {
|
angular.extend(toastrConfig, {
|
||||||
closeButton: true,
|
closeButton: true,
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.organization')
|
.module('bit.organization')
|
||||||
|
|
||||||
.controller('organizationBillingChangePaymentController', function ($scope, $state, $uibModalInstance, apiService, stripe,
|
.controller('organizationBillingChangePaymentController', function ($scope, $state, $uibModalInstance, apiService,
|
||||||
$analytics, toastr, existingPaymentMethod) {
|
$analytics, toastr, existingPaymentMethod
|
||||||
|
// @if !selfHosted
|
||||||
|
, stripe
|
||||||
|
// @endif
|
||||||
|
) {
|
||||||
$analytics.eventTrack('organizationBillingChangePaymentController', { category: 'Modal' });
|
$analytics.eventTrack('organizationBillingChangePaymentController', { category: 'Modal' });
|
||||||
$scope.existingPaymentMethod = existingPaymentMethod;
|
$scope.existingPaymentMethod = existingPaymentMethod;
|
||||||
$scope.paymentMethod = 'card';
|
$scope.paymentMethod = 'card';
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.organization')
|
.module('bit.organization')
|
||||||
|
|
||||||
.controller('settingsBillingChangePaymentController', function ($scope, $state, $uibModalInstance, apiService, stripe,
|
.controller('settingsBillingChangePaymentController', function ($scope, $state, $uibModalInstance, apiService,
|
||||||
$analytics, toastr, existingPaymentMethod, appSettings, $timeout) {
|
$analytics, toastr, existingPaymentMethod, appSettings, $timeout
|
||||||
|
// @if !selfHosted
|
||||||
|
, stripe
|
||||||
|
// @endif
|
||||||
|
) {
|
||||||
$analytics.eventTrack('settingsBillingChangePaymentController', { category: 'Modal' });
|
$analytics.eventTrack('settingsBillingChangePaymentController', { category: 'Modal' });
|
||||||
$scope.existingPaymentMethod = existingPaymentMethod;
|
$scope.existingPaymentMethod = existingPaymentMethod;
|
||||||
$scope.paymentMethod = 'card';
|
$scope.paymentMethod = 'card';
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
.module('bit.settings')
|
.module('bit.settings')
|
||||||
|
|
||||||
.controller('settingsCreateOrganizationController', function ($scope, $state, apiService, cryptoService,
|
.controller('settingsCreateOrganizationController', function ($scope, $state, apiService, cryptoService,
|
||||||
toastr, $analytics, authService, stripe, constants, appSettings, validationService) {
|
toastr, $analytics, authService, constants, appSettings, validationService
|
||||||
|
// @if !selfHosted
|
||||||
|
, stripe
|
||||||
|
// @endif
|
||||||
|
) {
|
||||||
$scope.plans = constants.plans;
|
$scope.plans = constants.plans;
|
||||||
$scope.storageGb = constants.storageGb;
|
$scope.storageGb = constants.storageGb;
|
||||||
$scope.paymentMethod = 'card';
|
$scope.paymentMethod = 'card';
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.settings')
|
.module('bit.settings')
|
||||||
|
|
||||||
.controller('settingsPremiumController', function ($scope, $state, apiService, toastr, $analytics, authService, stripe,
|
.controller('settingsPremiumController', function ($scope, $state, apiService, toastr, $analytics, authService,
|
||||||
constants, $timeout, appSettings, validationService) {
|
constants, $timeout, appSettings, validationService
|
||||||
|
// @if !selfHosted
|
||||||
|
, stripe
|
||||||
|
// @endif
|
||||||
|
) {
|
||||||
authService.getUserProfile().then(function (profile) {
|
authService.getUserProfile().then(function (profile) {
|
||||||
if (profile.premium) {
|
if (profile.premium) {
|
||||||
return $state.go('backend.user.settingsBilling');
|
return $state.go('backend.user.settingsBilling');
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<html ng-app="bit" ng-csp>
|
<html ng-app="bit" ng-csp>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
<!-- @if !selfHosted -->
|
||||||
<meta http-equiv="Content-Security-Policy" content="
|
<meta http-equiv="Content-Security-Policy" content="
|
||||||
default-src
|
default-src
|
||||||
'self';
|
'self';
|
||||||
@@ -48,20 +49,48 @@
|
|||||||
https://*.duosecurity.com;
|
https://*.duosecurity.com;
|
||||||
connect-src
|
connect-src
|
||||||
*;">
|
*;">
|
||||||
|
<!-- @endif -->
|
||||||
|
<!-- @if selfHosted !>
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="
|
||||||
|
default-src
|
||||||
|
'self';
|
||||||
|
style-src
|
||||||
|
'self'
|
||||||
|
'unsafe-inline'
|
||||||
|
https://fonts.googleapis.com;
|
||||||
|
img-src
|
||||||
|
'self'
|
||||||
|
data:
|
||||||
|
https://haveibeenpwned.com
|
||||||
|
https://chart.googleapis.com;
|
||||||
|
font-src
|
||||||
|
'self'
|
||||||
|
https://fonts.gstatic.com;
|
||||||
|
child-src
|
||||||
|
'self'
|
||||||
|
https://*.duosecurity.com;
|
||||||
|
frame-src
|
||||||
|
'self'
|
||||||
|
https://*.duosecurity.com;
|
||||||
|
connect-src
|
||||||
|
*;">
|
||||||
|
<!-- @endif -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
|
|
||||||
<title page-title>bitwarden.com Password Manager</title>
|
<title page-title>bitwarden.com Password Manager</title>
|
||||||
|
|
||||||
<!-- @if !selfHosted !>
|
<!-- @if !selfHosted -->
|
||||||
<script src="https://js.stripe.com/v2/"></script>
|
<script src="https://js.stripe.com/v2/"></script>
|
||||||
<script src="https://js.braintreegateway.com/web/dropin/1.4.0/js/dropin.min.js"></script>
|
<script src="https://js.braintreegateway.com/web/dropin/1.4.0/js/dropin.min.js"></script>
|
||||||
<!-- @endif -->
|
<!-- @endif -->
|
||||||
<!-- @if true !>
|
<!-- @if !selfHosted !>
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||||
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
|
||||||
|
<!-- @endif -->
|
||||||
|
<!-- @if true !>
|
||||||
<meta name="x-stylesheet-test" content="" class="fa invisible" />
|
<meta name="x-stylesheet-test" content="" class="fa invisible" />
|
||||||
<script src="js/fallback-styles.min.js?v=<!-- @echo cacheTag !>"></script>
|
<script src="js/fallback-styles.min.js?v=<!-- @echo cacheTag !>"></script>
|
||||||
|
|
||||||
@@ -79,13 +108,15 @@
|
|||||||
'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}">
|
'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}">
|
||||||
<div ui-view></div>
|
<div ui-view></div>
|
||||||
|
|
||||||
<!-- @if true !>
|
<!-- @if !selfHosted !>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"
|
||||||
integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" crossorigin="anonymous"></script>
|
integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" crossorigin="anonymous"></script>
|
||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
|
||||||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js"
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js"
|
||||||
integrity="sha384-AH/e+s4V4kUifvnNED2x1XZqArO5qTFU4YKRzUXbz4IgPG1H0Xmz6fP1XUmO4vT/" crossorigin="anonymous"></script>
|
integrity="sha384-AH/e+s4V4kUifvnNED2x1XZqArO5qTFU4YKRzUXbz4IgPG1H0Xmz6fP1XUmO4vT/" crossorigin="anonymous"></script>
|
||||||
|
<!-- @endif -->
|
||||||
|
<!-- @if true !>
|
||||||
<script src="js/fallback-scripts.min.js?v=<!-- @echo cacheTag !>"></script>
|
<script src="js/fallback-scripts.min.js?v=<!-- @echo cacheTag !>"></script>
|
||||||
<script src="js/settings.js?v=<!-- @echo cacheTag !>"></script>
|
<script src="js/settings.js?v=<!-- @echo cacheTag !>"></script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user