Skip to content

Commit c2f0ca6

Browse files
committed
Project build and release
1 parent 9c690e3 commit c2f0ca6

File tree

7 files changed

+341
-24
lines changed

7 files changed

+341
-24
lines changed

Diff for: .github/workflows/release.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: build-and-release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build and create a release
11+
runs-on: ubuntu-22.04
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
ref: ${{ github.ref }}
19+
fetch-depth: 0
20+
fetch-tags: true
21+
22+
- name: Set TAG variables
23+
id: tags_variables
24+
run: |
25+
set -x
26+
27+
TAG_CURRENT=$(git describe --abbrev=0 --tags ${{ github.ref }})
28+
echo "TAG_CURRENT=$TAG_CURRENT" >> "$GITHUB_ENV"
29+
30+
echo "CHANGELOG_MESSAGE<<EOF" >> $GITHUB_ENV
31+
sed -nzE "s/^.*## $TAG_CURRENT([^#]*).*$/\1/p" CHANGELOG.md | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' >> $GITHUB_ENV
32+
echo "EOF" >> $GITHUB_ENV
33+
34+
- name: Build
35+
run: |
36+
./scripts/build_webvaults.sh
37+
38+
- name: Create Release
39+
id: create_release
40+
uses: actions/create-release@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ env.TAG_CURRENT }}
45+
release_name: ${{ env.TAG_CURRENT }}
46+
body: |
47+
${{ env.CHANGELOG_MESSAGE }}
48+
49+
:robot: Built by [release.yml](.github/workflows/release.yml) :robot:
50+
draft: false
51+
prerelease: false
52+
53+
- name: Upload Release Asset
54+
id: upload-release-button
55+
uses: actions/upload-release-asset@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
upload_url: ${{ steps.create_release.outputs.upload_url }}
60+
asset_path: ./oidc_button_web_vault.tar.gz
61+
asset_name: oidc_button_web_vault.tar.gz
62+
asset_content_type: application/gzip
63+
64+
- name: Upload Release Asset
65+
id: upload-release-override
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }}
71+
asset_path: ./oidc_override_web_vault.tar.gz
72+
asset_name: oidc_override_web_vault.tar.gz
73+
asset_content_type: application/gzip

Diff for: CHANGELOG.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Changelog
2+
3+
## v2025.2.2-1
4+
5+
- Released based on `web-v2025.2.2`
6+
7+
## v2025.1.2-4
8+
9+
- Move the dummy `identifier` to the `override` patch.
10+
- During enrollment override the `idendifier` with the one returned by `auto-enroll-status`.
11+
12+
## v2025.1.2-3
13+
14+
- Fix the dummy `identifier` used.
15+
16+
## v2025.1.2-2
17+
18+
- Remove the now unecessary org invite fix.
19+
20+
## v2025.1.2-1
21+
22+
- Released based on `web-v2025.1.2`
23+
24+
## v2025.1.1-1
25+
26+
- Released based on `web-v2025.1.1`
27+
28+
## v2025.1.0-2
29+
30+
- Add css class to 2FA providers
31+
32+
## v2025.1.0-1
33+
34+
- Released based on `web-v2025.1.0`
35+
36+
## v2024.12.1-3
37+
38+
- On login error redirect to the `loggedOut` default page
39+
40+
## v2024.12.1-2
41+
42+
- Add css class to easily hide the password field
43+
44+
## v2024.12.1-1
45+
46+
- Released based on `web-v2024.12.1`
47+
48+
## v2024.10.2-1
49+
50+
- Released based on `web-v2024.10.2`
51+
52+
## v2024.8.3-4
53+
54+
- Fix sso redirection to keep clean url
55+
56+
## v2024.8.3-3
57+
58+
- Fix confirm error message
59+
60+
## v2024.8.3-2
61+
62+
- Remove `Bitwarden Inc.` from footer
63+
64+
## v2024.8.3-1
65+
66+
- Switching `web-vaults` are now built, now rebased on top of https://github.com/bitwarden/clients
67+
- Released based on `web-v2024.8.3`

Diff for: README.md

+47-23
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,59 @@
1-
<p align="center">
2-
<img src="https://raw.githubusercontent.com/bitwarden/brand/main/screenshots/apps-combo-logo.png" alt="Bitwarden" />
3-
</p>
4-
<p align="center">
5-
<a href="https://github.com/bitwarden/clients/actions/workflows/build-browser.yml?query=branch:main" target="_blank"><img src="https://github.com/bitwarden/clients/actions/workflows/build-browser.yml/badge.svg?branch=main" alt="GitHub Workflow browser build on main" /></a>
6-
<a href="https://github.com/bitwarden/clients/actions/workflows/build-cli.yml?query=branch:main" target="_blank"><img src="https://github.com/bitwarden/clients/actions/workflows/build-cli.yml/badge.svg?branch=main" alt="GitHub Workflow CLI build on main" /></a>
7-
<a href="https://github.com/bitwarden/clients/actions/workflows/build-desktop.yml?query=branch:main" target="_blank"><img src="https://github.com/bitwarden/clients/actions/workflows/build-desktop.yml/badge.svg?branch=main" alt="GitHub Workflow desktop build on main" /></a>
8-
<a href="https://github.com/bitwarden/clients/actions/workflows/build-web.yml?query=branch:main" target="_blank"><img src="https://github.com/bitwarden/clients/actions/workflows/build-web.yml/badge.svg?branch=main" alt="GitHub Workflow web build on main" /></a>
9-
<a href="https://gitter.im/bitwarden/Lobby" target="_blank"><img src="https://badges.gitter.im/bitwarden/Lobby.svg" alt="gitter chat" /></a>
10-
</p>
1+
# Web Vault OIDC builds for Vaultwarden
2+
3+
**This project is not associated with the [Bitwarden](https://bitwarden.com/) project nor Bitwarden, Inc.**
114

125
---
136

14-
# Bitwarden Client Applications
7+
<br>
8+
9+
This is a repository to store custom builds of the [Bitwarden web vault](https://github.com/bitwarden/clients/tree/master/apps/web) patched to work with [vaultwarden](https://github.com/dani-garcia/vaultwarden) and patched again to obtain a cleaner flow when using an SSO.
10+
11+
This generate three different versions :
12+
13+
- `button` closest to what is expected to be merge into [bw_web_builds](https://github.com/dani-garcia/bw_web_builds))
14+
- restore the SSO login button ([patch](oidc_button.patch)) (
15+
- allow organization invitation to survive sso account creation ([patch](oidc_invite.patch))
16+
- `override` add additionally :
17+
- set `#sso` as the default redirect url
18+
- remove some unnecessary logic ([patch](oidc_override.patch))
19+
- display SSO errors and redirect to start of the flow ([patch](oidc_sso_errors.patch))
20+
- `experimental` which stop sending the Master password hash to the server ([patch](oidc_experimental.patch))
21+
22+
## Building the web-vault
23+
24+
To build the web-vault you need node and npm installed.
1525

16-
This repository houses all Bitwarden client applications except the [Mobile application](https://github.com/bitwarden/mobile).
26+
### Using node 18 and npm
1727

18-
Please refer to the [Clients section](https://contributing.bitwarden.com/getting-started/clients/) of the [Contributing Documentation](https://contributing.bitwarden.com/) for build instructions, recommended tooling, code style tips, and lots of other great information to get you started.
28+
For a quick and easy local build you can run:
1929

20-
## Related projects:
30+
```bash
31+
./build_webvault.sh
32+
```
2133

22-
- [bitwarden/server](https://github.com/bitwarden/server): The core infrastructure backend (API, database, Docker, etc).
23-
- [bitwarden/ios](https://github.com/bitwarden/ios): Bitwarden mobile app for iOS.
24-
- [bitwarden/android](https://github.com/bitwarden/android): Bitwarden mobile app for Android.
25-
- [bitwarden/directory-connector](https://github.com/bitwarden/directory-connector): A tool for syncing a directory (AD, LDAP, Azure, G Suite, Okta) to an organization.
34+
This will :
2635

27-
# We're Hiring!
36+
- Clone a specific version of the [Bitwarden web vault](https://github.com/bitwarden/clients/tree/master/apps/web)
37+
- Clone a specific version of the [VaultWarden web vault builds](https://github.com/dani-garcia/bw_web_builds)
38+
- Copy ressources from the VaultWarden web vault project
39+
- Apply the VaultWarden web vault patch
40+
- Apply the button [patch](oidc_button.patch)
41+
- Apply the invite [patch](oidc_invite.patch)
42+
- Build the web vault application
43+
- Package it as `oidc_button_web_vault.tar.gz`.
44+
- Apply the override [patch](oidc_override.patch) to improve SSO flow
45+
- Apply the override [patch](oidc_sso_errors.patch) to improve SSO errors handling
46+
- Apply the messages [patch](oidc_messages.patch)
47+
- Build the web vault application
48+
- Package it as `oidc_override_web_vault.tar.gz`.
49+
- Apply the experimental [patch](oidc_experimental.patch) to improve SSO errors handling
50+
- Build the web vault application
51+
- Package it as `oidc_experimental_web_vault.tar.gz`.
2852

29-
Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our [Careers page](https://bitwarden.com/careers/) to see what opportunities are [currently open](https://bitwarden.com/careers/#open-positions) as well as what it's like to work at Bitwarden.
53+
### More information
3054

31-
# Contribute
55+
For more information see: [Install the web-vault](https://github.com/dani-garcia/vaultwarden/wiki/Building-binary#install-the-web-vault)
3256

33-
Code contributions are welcome! Please commit any pull requests against the `main` branch. Learn more about how to contribute by reading the [Contributing Guidelines](https://contributing.bitwarden.com/contributing/). Check out the [Contributing Documentation](https://contributing.bitwarden.com/) for how to get started with your first contribution.
57+
### Pre-build
3458

35-
Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file.
59+
The builds are available in the [releases page](https://github.com/Timshel/oidc_web_builds/releases), and can be replicated with the scripts in this repo.

Diff for: apps/web/webpack.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const devServer =
203203
? {}
204204
: {
205205
server: {
206-
type: "https",
206+
type: envConfig.dev?.protocol ?? "https",
207207
options: {
208208
key: fs.readFileSync("dev-server" + certSuffix + ".pem"),
209209
cert: fs.readFileSync("dev-server" + certSuffix + ".pem"),
@@ -247,6 +247,13 @@ const devServer =
247247
secure: false,
248248
changeOrigin: true,
249249
},
250+
{
251+
context: ["/css"],
252+
target: envConfig.dev?.proxyCss,
253+
pathRewrite: { "^/css": "" },
254+
secure: false,
255+
changeOrigin: true,
256+
},
250257
],
251258
headers: (req) => {
252259
if (!req.originalUrl.includes("connector.html")) {

Diff for: scripts/build_webvaults.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# !/bin/bash
2+
3+
set -x
4+
set -e
5+
6+
NO_SETUP=false
7+
if [[ "$@" == *"--only-build"* ]] ; then
8+
NO_SETUP=true
9+
fi
10+
11+
ONLY_OVERRIDE=false
12+
if [[ "$@" == *"--only-override"* ]] ; then
13+
ONLY_OVERRIDE=true
14+
fi
15+
16+
rm -f oidc_button_web_vault.tar.gz oidc_override_web_vault.tar.gz
17+
18+
# Prepare build
19+
if [ "$NO_SETUP" = false ] ; then
20+
npm ci
21+
npm audit fix || true
22+
fi
23+
24+
### Build button version ###
25+
if [ "$ONLY_OVERRIDE" = false ] ; then
26+
cd apps/web
27+
npm run dist:oss:selfhost
28+
printf '{"version": "oidc_button-%s"}' $TAG_CURRENT > build/vw-version.json
29+
mv build web-vault
30+
tar -czvf ../../"oidc_button_web_vault.tar.gz" web-vault --owner=0 --group=0
31+
rm -rf web-vault
32+
cd ../..
33+
fi
34+
35+
### Build Override version ###
36+
git apply ./scripts/oidc_override.patch
37+
38+
cd apps/web
39+
npm run dist:oss:selfhost
40+
printf '{"version": "oidc_override-%s"}' $TAG_CURRENT > build/vw-version.json
41+
mv build web-vault
42+
tar -czvf ../../"oidc_override_web_vault.tar.gz" web-vault --owner=0 --group=0
43+
rm -rf web-vault
44+
cd ../..

Diff for: scripts/oidc_override.patch

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Subject: [PATCH] SSO login as default, hide sso identifier and use dummy value
2+
3+
---
4+
apps/web/src/app/auth/sso-v1.component.html | 7 -------
5+
apps/web/src/app/auth/sso-v1.component.ts | 2 +-
6+
libs/angular/src/auth/guards/redirect.guard.ts | 2 +-
7+
.../angular/set-password-jit/set-password-jit.component.ts | 2 ++
8+
.../response/organization-auto-enroll-status.response.ts | 2 ++
9+
5 files changed, 6 insertions(+), 9 deletions(-)
10+
11+
diff --git a/apps/web/src/app/auth/sso-v1.component.html b/apps/web/src/app/auth/sso-v1.component.html
12+
index 59abc92e87..0a136f5a4f 100644
13+
--- a/apps/web/src/app/auth/sso-v1.component.html
14+
+++ b/apps/web/src/app/auth/sso-v1.component.html
15+
@@ -5,18 +5,11 @@
16+
</div>
17+
<div *ngIf="!loggingIn">
18+
<p bitTypography="body1">{{ "ssoLogInWithOrgIdentifier" | i18n }}</p>
19+
- <bit-form-field>
20+
- <bit-label>{{ "ssoIdentifier" | i18n }}</bit-label>
21+
- <input bitInput type="text" formControlName="identifier" appAutofocus />
22+
- </bit-form-field>
23+
<hr />
24+
<div class="tw-flex tw-gap-2">
25+
<button type="submit" bitButton bitFormButton buttonType="primary" [block]="true">
26+
{{ "logIn" | i18n }}
27+
</button>
28+
- <a bitButton buttonType="secondary" routerLink="/login" [block]="true">
29+
- {{ "cancel" | i18n }}
30+
- </a>
31+
</div>
32+
</div>
33+
</form>
34+
diff --git a/apps/web/src/app/auth/sso-v1.component.ts b/apps/web/src/app/auth/sso-v1.component.ts
35+
index 8699ecf7b2..f257ea80bb 100644
36+
--- a/apps/web/src/app/auth/sso-v1.component.ts
37+
+++ b/apps/web/src/app/auth/sso-v1.component.ts
38+
@@ -40,7 +40,7 @@ import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legac
39+
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
40+
export class SsoComponentV1 extends BaseSsoComponent implements OnInit {
41+
protected formGroup = new FormGroup({
42+
- identifier: new FormControl(null, [Validators.required]),
43+
+ identifier: new FormControl("OIDCWarden", [Validators.required]),
44+
});
45+
46+
get identifierFormControl() {
47+
diff --git a/libs/angular/src/auth/guards/redirect.guard.ts b/libs/angular/src/auth/guards/redirect.guard.ts
48+
index 7717d325a6..8161adda75 100644
49+
--- a/libs/angular/src/auth/guards/redirect.guard.ts
50+
+++ b/libs/angular/src/auth/guards/redirect.guard.ts
51+
@@ -17,7 +17,7 @@ export interface RedirectRoutes {
52+
53+
export const defaultRoutes: RedirectRoutes = {
54+
loggedIn: "/vault",
55+
- loggedOut: "/login",
56+
+ loggedOut: "/sso",
57+
locked: "/lock",
58+
notDecrypted: "/login-initiated",
59+
};
60+
diff --git a/libs/auth/src/angular/set-password-jit/set-password-jit.component.ts b/libs/auth/src/angular/set-password-jit/set-password-jit.component.ts
61+
index b54529f6a2..eae6146232 100644
62+
--- a/libs/auth/src/angular/set-password-jit/set-password-jit.component.ts
63+
+++ b/libs/auth/src/angular/set-password-jit/set-password-jit.component.ts
64+
@@ -76,7 +76,9 @@ export class SetPasswordJitComponent implements OnInit {
65+
const autoEnrollStatus = await this.organizationApiService.getAutoEnrollStatus(
66+
this.orgSsoIdentifier,
67+
);
68+
+
69+
this.orgId = autoEnrollStatus.id;
70+
+ this.orgSsoIdentifier = autoEnrollStatus.identifier;
71+
this.resetPasswordAutoEnroll = autoEnrollStatus.resetPasswordEnabled;
72+
this.masterPasswordPolicyOptions =
73+
await this.policyApiService.getMasterPasswordPolicyOptsForOrgUser(autoEnrollStatus.id);
74+
diff --git a/libs/common/src/admin-console/models/response/organization-auto-enroll-status.response.ts b/libs/common/src/admin-console/models/response/organization-auto-enroll-status.response.ts
75+
index f2d22fafcd..b27e3f0e25 100644
76+
--- a/libs/common/src/admin-console/models/response/organization-auto-enroll-status.response.ts
77+
+++ b/libs/common/src/admin-console/models/response/organization-auto-enroll-status.response.ts
78+
@@ -2,11 +2,13 @@ import { BaseResponse } from "../../../models/response/base.response";
79+
80+
export class OrganizationAutoEnrollStatusResponse extends BaseResponse {
81+
id: string;
82+
+ identifier: string;
83+
resetPasswordEnabled: boolean;
84+
85+
constructor(response: any) {
86+
super(response);
87+
this.id = this.getResponseProperty("Id");
88+
+ this.identifier = this.getResponseProperty("Identifier");
89+
this.resetPasswordEnabled = this.getResponseProperty("ResetPasswordEnabled");
90+
}
91+
}
92+
--
93+
2.39.5
94+

Diff for: scripts/test_changelog.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# !/bin/bash
2+
3+
LAST_TAG=$(git describe --abbrev=0 --tags HEAD)
4+
5+
echo "Test changelog output for latest tag:"
6+
echo "------------------------------------"
7+
sed -nzE "s/^.*## $LAST_TAG([^#]*).*$/\1/p" CHANGELOG.md | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}'
8+
echo "------------------------------------"

0 commit comments

Comments
 (0)