Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add changeset for v2025.1.1 #4

Open
wants to merge 23 commits into
base: v2025.1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/web/config/base.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"urls": {},
"stripeKey": "pk_test_KPoCfZXu7mznb9uSCPZ2JpTD",
"braintreeKey": "sandbox_r72q8jq6_9pnxkwm75f87sdc2",
"paypal": {
"businessId": "AD3LAUZSNVPJY",
"buttonAction": "https://www.sandbox.paypal.com/cgi-bin/webscr"
},
"dev": {
"port": 8080,
"allowedHosts": "auto"
Expand Down
3 changes: 0 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
"version": "2025.1.1",
"scripts": {
"build:oss": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" webpack",
"build:bit": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" webpack -c ../../bitwarden_license/bit-web/webpack.config.js",
"build:oss:watch": "webpack serve",
"build:bit:watch": "webpack serve -c ../../bitwarden_license/bit-web/webpack.config.js",
"build:bit:dev": "cross-env ENV=development npm run build:bit",
"build:bit:dev:analyze": "cross-env LOGGING=false webpack -c ../../bitwarden_license/bit-web/webpack.config.js --profile --json > stats.json && npx webpack-bundle-analyzer stats.json build/",
"build:bit:dev:watch": "cross-env ENV=development NODE_OPTIONS=\"--max-old-space-size=8192\" npm run build:bit:watch",
"build:bit:qa": "cross-env NODE_ENV=production ENV=qa npm run build:bit",
"build:bit:euprd": "cross-env NODE_ENV=production ENV=euprd npm run build:bit",
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/app/admin-console/icons/admin-console-logo.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>{{ "generalInformation" | i18n }}</h2>
<input bitInput type="text" formControlName="name" />
</bit-form-field>
<bit-form-field class="tw-w-1/2">
<bit-label>{{ "billingEmail" | i18n }}</bit-label>
<bit-label>{{ "email" | i18n }}</bit-label>
<input bitInput type="email" formControlName="billingEmail" />
</bit-form-field>
<bit-form-field class="tw-w-1/2" *ngIf="isProvider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class OrganizationLayoutComponent implements OnInit {
}

canShowBillingTab(organization: Organization): boolean {
return false; // disable billing tab in Vaultwarden
return canAccessBillingTab(organization);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,7 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
.find((p) => p.organizationId === this.organization.id);
this.orgResetPasswordPolicyEnabled = resetPasswordPolicy?.enabled;

const billingMetadata = await this.billingApiService.getOrganizationBillingMetadata(
this.organization.id,
);

this.orgIsOnSecretsManagerStandalone = billingMetadata.isOnSecretsManagerStandalone;
this.orgIsOnSecretsManagerStandalone = false; // don't get billing metadata

await this.load();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<input bitInput id="orgName" type="text" formControlName="orgName" />
</bit-form-field>
<bit-form-field>
<bit-label>{{ "billingEmail" | i18n }}</bit-label>
<bit-label>{{ "email" | i18n }}</bit-label>
<input bitInput id="billingEmail" formControlName="billingEmail" type="email" />
</bit-form-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class AccountComponent implements OnInit, OnDestroy {
) {}

async ngOnInit() {
this.selfHosted = this.platformUtilsService.isSelfHost();
this.selfHosted = false; // set to false so we can rename organizations

this.route.params
.pipe(
Expand Down Expand Up @@ -179,6 +179,7 @@ export class AccountComponent implements OnInit, OnDestroy {
};

submitCollectionManagement = async () => {
return; // flexible collections are not supported by Vaultwarden
const request = new OrganizationCollectionManagementUpdateRequest();
request.limitCollectionCreation =
this.collectionManagementFormGroup.value.limitCollectionCreation;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
when the body has the layout_frontend class. Having this match the index allows for a duplicative yet seamless
loading state here for process reloading. -->
<div class="tw-p-8 tw-flex">
<img class="new-logo-themed" alt="Bitwarden" />
<img class="new-logo-themed" alt="Vaultwarden" />
<div class="spinner-container tw-justify-center">
<i
class="bwi bwi-spinner bwi-spin bwi-3x tw-text-muted"
Expand Down
4 changes: 4 additions & 0 deletions apps/web/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ export class AppComponent implements OnDestroy, OnInit {
break;
}
case "showToast":
if (typeof message.text === "string" && typeof crypto.subtle === "undefined") {
message.title = "This browser requires HTTPS to use the web vault";
message.text = "Check the Vaultwarden wiki for details on how to enable it";
}
this.toastService._showToast(message);
break;
case "convertAccountToKeyConnector":
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/app/auth/settings/change-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,3 @@ <h1>{{ "changeMasterPassword" | i18n }}</h1>
{{ "changeMasterPassword" | i18n }}
</button>
</form>

<app-webauthn-login-settings></app-webauthn-login-settings>
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ export class TwoFactorSetupAuthenticatorComponent
new window.QRious({
element: document.getElementById("qr"),
value:
"otpauth://totp/Bitwarden:" +
"otpauth://totp/Vaultwarden:" +
Utils.encodeRFC3986URIComponent(email) +
"?secret=" +
encodeURIComponent(this.key) +
"&issuer=Bitwarden",
"&issuer=Vaultwarden",
size: 160,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class OrgBillingHistoryViewComponent implements OnInit, OnDestroy {

this.loading = true;

/* disable billing history
const openInvoicesPromise = this.organizationBillingApiService.getBillingInvoices(
this.organizationId,
"open",
Expand Down Expand Up @@ -87,6 +88,7 @@ export class OrgBillingHistoryViewComponent implements OnInit, OnDestroy {
openInvoices.length <= pageSize ||
paidInvoices.length <= pageSize ||
transactions.length <= pageSize;
*/

this.loading = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</ng-container>
<ng-container *ngIf="createOrganization && selfHosted">
<ng-container *ngIf="createOrganization && false">
<ng-container *ngIf="!(useLicenseUploaderComponent$ | async)">
<p bitTypography="body1">{{ "uploadLicenseFileOrg" | i18n }}</p>
<form [formGroup]="selfHostedForm" [bitSubmit]="submit">
Expand Down Expand Up @@ -40,12 +40,7 @@
(onLicenseFileUploaded)="onLicenseFileUploaded($event)"
/>
</ng-container>
<form
[formGroup]="formGroup"
[bitSubmit]="submit"
*ngIf="!loading && !selfHosted && this.passwordManagerPlans && this.secretsManagerPlans"
class="tw-pt-6"
>
<form [formGroup]="formGroup" [bitSubmit]="submit" *ngIf="!loading" class="tw-pt-6">
<bit-section [ngClass]="{ 'tw-hidden': !createOrganization }">
<app-org-info
(changedBusinessOwned)="changedOwnedBusiness()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,12 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {

if (this.organizationId) {
this.organization = await this.organizationService.get(this.organizationId);
this.billing = await this.organizationApiService.getBilling(this.organizationId);
this.sub = await this.organizationApiService.getSubscription(this.organizationId);
this.taxInformation = await this.organizationApiService.getTaxInfo(this.organizationId);
} else if (!this.selfHosted) {
this.taxInformation = await this.apiService.getTaxInfo();
this.billing = null; // no billing in Vaultwarden
this.sub = null; // no subscriptions in Vaultwarden;
this.taxInformation = null; // no taxes in Vaultwarden;
}

/* no need to ask /api/plans because Vaultwarden only supports the free plan
if (!this.selfHosted) {
const plans = await this.apiService.getPlans();
this.passwordManagerPlans = plans.data.filter((plan) => !!plan.PasswordManager);
Expand Down Expand Up @@ -232,6 +231,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
this.plan = providerDefaultPlan.type;
this.productTier = providerDefaultPlan.productTier;
}
end of asking /api/plans in Vaultwarden */

if (!this.createOrganization) {
this.upgradeFlowPrefillForm();
Expand Down Expand Up @@ -316,6 +316,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}

get selectableProducts() {
return null; // there are no products to select in Vaultwarden
if (this.acceptingSponsorship) {
const familyPlan = this.passwordManagerPlans.find(
(plan) => plan.type === PlanType.FamiliesAnnually,
Expand Down Expand Up @@ -347,6 +348,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}

get selectablePlans() {
return null; // no plans to select in Vaultwarden
const selectedProductTierType = this.formGroup.controls.productTier.value;
const result =
this.passwordManagerPlans?.filter(
Expand Down Expand Up @@ -477,6 +479,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}

get planOffersSecretsManager() {
return false; // no support for secrets manager in Vaultwarden
return this.selectedSecretsManagerPlan != null;
}

Expand All @@ -485,6 +488,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}

changedProduct() {
return; // no choice of products in Vaultwarden
const selectedPlan = this.selectablePlans[0];

this.setPlanType(selectedPlan.type);
Expand Down Expand Up @@ -624,9 +628,8 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
const collectionCt = collection.encryptedString;
const orgKeys = await this.keyService.makeKeyPair(orgKey[1]);

orgId = this.selfHosted
? await this.createSelfHosted(key, collectionCt, orgKeys)
: await this.createCloudHosted(key, collectionCt, orgKeys, orgKey[1]);
// always use createCloudHosted() to disable license file upload
orgId = await this.createCloudHosted(key, collectionCt, orgKeys, orgKey[1]);

this.toastService.showToast({
variant: "success",
Expand Down Expand Up @@ -787,7 +790,9 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
request.billingEmail = this.formGroup.controls.billingEmail.value;
request.initiationPath = "New organization creation in-product";
request.keys = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
request.planType = PlanType.Free; // always select the free plan in Vaultwarden

/* there is no plan to select in Vaultwarden
if (this.selectedPlan.type === PlanType.Free) {
request.planType = PlanType.Free;
} else {
Expand Down Expand Up @@ -819,6 +824,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {

// Secrets Manager
this.buildSecretsManagerRequest(request);
end plan selection and no support for secret manager in Vaultwarden */

if (this.hasProvider) {
const providerRequest = new ProviderOrganizationCreateRequest(
Expand Down Expand Up @@ -898,6 +904,7 @@ export class OrganizationPlansComponent implements OnInit, OnDestroy {
}

private upgradeFlowPrefillForm() {
return; // Vaultwarden only supports free plan
if (this.acceptingSponsorship) {
this.formGroup.controls.productTier.setValue(ProductTierType.Families);
this.changedProduct();
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/core/router.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class RouterService {
.subscribe((event: NavigationEnd) => {
this.currentUrl = event.url;

let title = i18nService.t("bitWebVault");
let title = "Vaultwarden Web";

if (this.currentUrl.includes("/sm/")) {
title = i18nService.t("bitSecretsManager");
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/app/core/web-platform-utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,17 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
}

isDev(): boolean {
return false; // treat Vaultwarden as production ready
return process.env.NODE_ENV === "development";
}

isSelfHost(): boolean {
return true; // treat Vaultwarden as self hosted
return WebPlatformUtilsService.isSelfHost();
}

static isSelfHost(): boolean {
return true; // treat Vaultwarden as self hosted
return process.env.ENV.toString() === "selfhosted";
}

Expand Down
9 changes: 7 additions & 2 deletions apps/web/src/app/layouts/frontend-layout.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<router-outlet></router-outlet>
<div class="container my-5 text-muted text-center">
<environment-selector></environment-selector>
&copy; {{ year }} Bitwarden Inc. <br />
Vaultwarden Web<br />
{{ "versionNumber" | i18n: version }}
<br /><br />
<div class="small">
A modified version of the Bitwarden&reg; Web Vault for Vaultwarden (an unofficial rewrite of the
Bitwarden&reg; server).<br />
Vaultwarden is not associated with the Bitwarden&reg; project nor Bitwarden Inc.
</div>
</div>
7 changes: 6 additions & 1 deletion apps/web/src/app/layouts/header/web-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@
<i class="bwi bwi-fw bwi-user" aria-hidden="true"></i>
{{ "accountSettings" | i18n }}
</a>
<a bitMenuItem href="https://bitwarden.com/help/" target="_blank" rel="noreferrer">
<a
bitMenuItem
href="https://github.com/dani-garcia/vaultwarden"
target="_blank"
rel="noreferrer"
>
<i class="bwi bwi-fw bwi-question-circle" aria-hidden="true"></i>
{{ "getHelp" | i18n }}
</a>
Expand Down
Loading
Loading