Skip to content

Commit

Permalink
Migrate to web-v2024.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Timshel committed Sep 13, 2024
1 parent d0e3cc2 commit 9f40c73
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 48 deletions.
2 changes: 1 addition & 1 deletion docker/DockerSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ xx_image_digest: "sha256:1978e7a58a1777cb0ef0dde76bad60b7914b21da57cfa88047875e4
rust_version: 1.81.0 # Rust version to be used
debian_version: bookworm # Debian release name to be used
alpine_version: "3.20" # Alpine version to be used
oidc_web_release: https://github.com/Timshel/oidc_web_builds/releases/download/v2024.6.2-4
oidc_web_release: https://github.com/Timshel/oidc_web_vault/releases/download/v2024.8.3-3
# For which platforms/architectures will we try to build images
platforms: ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
# Determine the build images per OS/Arch
Expand Down
9 changes: 4 additions & 5 deletions docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ARG TARGETARCH
ARG TARGETVARIANT
ARG TARGETPLATFORM

ARG OIDC_WEB_RELEASE="https://github.com/Timshel/oidc_web_builds/releases/download/v2024.6.2-4"
ARG OIDC_WEB_RELEASE="https://github.com/Timshel/oidc_web_vault/releases/download/v2024.8.3-3"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -41,10 +41,6 @@ ENV DEBIAN_FRONTEND=noninteractive \



# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

# Create CARGO_HOME folder and don't download rust docs
RUN mkdir -pv "${CARGO_HOME}" && \
rustup set profile minimal
Expand Down Expand Up @@ -96,6 +92,9 @@ RUN source /env-cargo && \
ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \
fi

# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

######################## RUNTIME IMAGE ########################
# Create a new stage with a minimal image
Expand Down
9 changes: 4 additions & 5 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARG TARGETARCH
ARG TARGETVARIANT
ARG TARGETPLATFORM

ARG OIDC_WEB_RELEASE="https://github.com/Timshel/oidc_web_builds/releases/download/v2024.6.2-4"
ARG OIDC_WEB_RELEASE="https://github.com/Timshel/oidc_web_vault/releases/download/v2024.8.3-3"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -65,10 +65,6 @@ RUN apt-get update && \
# Run xx-cargo early, since it sometimes seems to break when run at a later stage
echo "export CARGO_TARGET=$(xx-cargo --print-target-triple)" >> /env-cargo

# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

# Create CARGO_HOME folder and don't download rust docs
RUN mkdir -pv "${CARGO_HOME}" && \
rustup set profile minimal
Expand Down Expand Up @@ -137,6 +133,9 @@ RUN source /env-cargo && \
ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \
fi

# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

######################## RUNTIME IMAGE ########################
# Create a new stage with a minimal image
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ RUN apt-get update && \
echo "export CARGO_TARGET=$(xx-cargo --print-target-triple)" >> /env-cargo
{% endif %}

# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

# Create CARGO_HOME folder and don't download rust docs
RUN mkdir -pv "${CARGO_HOME}" && \
rustup set profile minimal
Expand Down Expand Up @@ -169,6 +165,9 @@ RUN source /env-cargo && \
ln -vfsr "/app/target/${CARGO_TARGET}/${CARGO_PROFILE}" /app/target/final ; \
fi

# Get all version of the front-end
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_button_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_button
RUN curl -L "${OIDC_WEB_RELEASE}/oidc_override_web_vault.tar.gz" | tar -xz ; mv web-vault /web-vault_override

######################## RUNTIME IMAGE ########################
# Create a new stage with a minimal image
Expand Down
47 changes: 27 additions & 20 deletions playwright/tests/login.smtp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,31 @@ test('Activaite 2fa', async ({ context, page }) => {

await logUser(test, page, users.user1);

await page.getByRole('button', { name: users.user1.name }).click();
await page.getByRole('menuitem', { name: 'Account settings' }).click();
await page.getByLabel('Security').click();
await page.getByRole('link', { name: 'Two-step login' }).click();
await page.locator('li').filter({ hasText: 'Email Verification codes will' }).getByRole('button').click();
await page.getByLabel('Master password (required)').fill(users.user1.password);
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Send email' }).click();
await test.step('activate', async () => {
await page.getByRole('button', { name: users.user1.name }).click();
await page.getByRole('menuitem', { name: 'Account settings' }).click();
await page.getByRole('link', { name: 'Security' }).click();
await page.getByRole('link', { name: 'Two-step login' }).click();
await page.locator('li').filter({ hasText: 'Email Email Enter a code sent' }).getByRole('button').click();
await page.getByLabel('Master password (required)').fill(users.user1.password);
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Send email' }).click();
});

const codeMail = await emails.next((mail) => mail.subject === "Vaultwarden Login Verification Code");
const page2 = await context.newPage();
await page2.setContent(codeMail.html);
const code = await page2.getByTestId("2fa").innerText();
await page2.close();
const code = await test.step('retrieve code', async () => {
const codeMail = await emails.next((mail) => mail.subject.includes("Login Verification Code"));
const page2 = await context.newPage();
await page2.setContent(codeMail.html);
const code = await page2.getByTestId("2fa").innerText();
await page2.close();
return code;
});

await page.getByLabel('2. Enter the resulting 6').fill(code);
await page.getByRole('button', { name: 'Turn on' }).click();
await page.getByRole('heading', { name: 'Turned on', exact: true });
await test.step('input code', async () => {
await page.getByLabel('2. Enter the resulting 6').fill(code);
await page.getByRole('button', { name: 'Turn on' }).click();
await page.getByRole('heading', { name: 'Turned on', exact: true });
});

emails.close();
});
Expand All @@ -129,13 +136,13 @@ test('2fa', async ({ context, page }) => {
await page.getByLabel('Master password').fill(users.user1.password);
await page.getByRole('button', { name: 'Log in with master password' }).click();

const codeMail = await emails.next((mail) => mail.subject === "Vaultwarden Login Verification Code");
const codeMail = await emails.next((mail) => mail.subject.includes("Login Verification Code"));
const page2 = await context.newPage();
await page2.setContent(codeMail.html);
const code = await page2.getByTestId("2fa").innerText();
await page2.close();

await page.getByLabel('Verification code').fill(code);
await page.getByLabel(/Verification code/).fill(code);
await page.getByRole('button', { name: 'Continue' }).click();

await expect(page).toHaveTitle(/Vaults/);
Expand All @@ -144,9 +151,9 @@ test('2fa', async ({ context, page }) => {
await test.step('disable', async () => {
await page.getByRole('button', { name: 'Test' }).click();
await page.getByRole('menuitem', { name: 'Account settings' }).click();
await page.getByLabel('Security').click();
await page.getByRole('link', { name: 'Security' }).click();
await page.getByRole('link', { name: 'Two-step login' }).click();
await page.locator('li').filter({ hasText: 'Email Turned on Verification' }).getByRole('button').click();
await page.locator('li').filter({ hasText: 'Email Email Turned on Enter a' }).getByRole('button').click();
await page.getByLabel('Master password (required)').click();
await page.getByLabel('Master password (required)').fill(users.user1.password);
await page.getByRole('button', { name: 'Continue' }).click();
Expand Down
10 changes: 5 additions & 5 deletions playwright/tests/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ test('Authenticator 2fa', async ({ context, page }) => {
await test.step('Activate', async () => {
await page.getByRole('button', { name: users.user1.name }).click();
await page.getByRole('menuitem', { name: 'Account settings' }).click();
await page.getByLabel('Security').click();
await page.getByRole('link', { name: 'Security' }).click();
await page.getByRole('link', { name: 'Two-step login' }).click();
await page.locator('li').filter({ hasText: 'Authenticator app Use an' }).getByRole('button').click();
await page.locator('li').filter({ hasText: /Authenticator app/ }).getByRole('button').click();
await page.getByLabel('Master password (required)').fill(users.user1.password);
await page.getByRole('button', { name: 'Continue' }).click();

const secret = await page.getByLabel('Key').innerText();
totp = new OTPAuth.TOTP({ secret, period: 30 });

await page.getByLabel('3. Enter the resulting 6').fill(totp.generate());
await page.getByLabel(/Verification code/).fill(totp.generate());
await page.getByRole('button', { name: 'Turn on' }).click();
await page.getByRole('heading', { name: 'Turned on', exact: true });
await page.getByLabel('Close').click();
Expand All @@ -75,7 +75,7 @@ test('Authenticator 2fa', async ({ context, page }) => {
await page.getByLabel('Master password').fill(users.user1.password);
await page.getByRole('button', { name: 'Log in with master password' }).click();

await page.getByLabel('Verification code').fill(totp.generate({timestamp}));
await page.getByLabel(/Verification code/).fill(totp.generate({timestamp}));
await page.getByRole('button', { name: 'Continue' }).click();

await expect(page).toHaveTitle(/Vaults/);
Expand All @@ -84,7 +84,7 @@ test('Authenticator 2fa', async ({ context, page }) => {
await test.step('disable', async () => {
await page.getByRole('button', { name: 'Test' }).click();
await page.getByRole('menuitem', { name: 'Account settings' }).click();
await page.getByLabel('Security').click();
await page.getByRole('link', { name: 'Security' }).click();
await page.getByRole('link', { name: 'Two-step login' }).click();
await page.locator('li').filter({ hasText: /Authenticator app/ }).getByRole('button').click();
await page.getByLabel('Master password (required)').click();
Expand Down
14 changes: 9 additions & 5 deletions playwright/tests/organization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ test('Invite users', async ({ page }) => {
await page.getByRole('button', { name: 'Invite member' }).click();
await page.getByLabel('Email (required)').fill(users.user2.email);
await page.getByRole('tab', { name: 'Collections' }).click();
await page.locator('label').filter({ hasText: 'Grant access to all current' }).click();
await page.getByLabel('Permission').selectOption('edit');
await page.getByLabel('Select collections').click();
await page.getByLabel('Options list').getByText('Default collection').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId("toast-message")).toHaveText('User(s) invited');
});
Expand All @@ -56,7 +58,9 @@ test('Invite users', async ({ page }) => {
await page.getByRole('button', { name: 'Invite member' }).click();
await page.getByLabel('Email (required)').fill(users.user3.email);
await page.getByRole('tab', { name: 'Collections' }).click();
await page.locator('label').filter({ hasText: 'Grant access to all current' }).click();
await page.getByLabel('Permission').selectOption('edit');
await page.getByLabel('Select collections').click();
await page.getByLabel('Options list').getByText('Default collection').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId("toast-message")).toHaveText('User(s) invited');
});
Expand Down Expand Up @@ -135,9 +139,8 @@ test('invited with existing account', async ({ page }) => {

test('Confirm invited user', async ({ page }) => {
await logUser(test, page, users.user1, user1Mails);
await page.getByLabel('Switch products').click();
await page.getByRole('link', { name: ' Admin Console' }).click();
await page.getByLabel('Members').click();
await page.getByRole('link', { name: 'Admin Console' }).click();
await page.getByRole('link', { name: 'Members' }).click();

await test.step('Accept user2', async () => {
await page.getByRole('row', { name: users.user2.name }).getByLabel('Options').click();
Expand All @@ -153,4 +156,5 @@ test('Confirm invited user', async ({ page }) => {
test('Organization is visible', async ({ page }) => {
await logUser(test, page, users.user2, user2Mails);
await page.getByLabel('vault: Test').click();
await expect(page.getByLabel('Filter: Default collection')).toBeVisible();
});
12 changes: 9 additions & 3 deletions playwright/tests/sso_organization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ test('Invite users', async ({ page }) => {
await page.getByRole('button', { name: 'Invite member' }).click();
await page.getByLabel('Email (required)').fill(users.user2.email);
await page.getByRole('tab', { name: 'Collections' }).click();
await page.locator('label').filter({ hasText: 'Grant access to all current' }).click();
await page.getByLabel('Permission').selectOption('edit');
await page.getByLabel('Select collections').click();
await page.getByLabel('Options list').getByText('Default collection').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId("toast-message")).toHaveText('User(s) invited');
});
Expand All @@ -60,7 +62,9 @@ test('Invite users', async ({ page }) => {
await page.getByRole('button', { name: 'Invite member' }).click();
await page.getByLabel('Email (required)').fill(users.user3.email);
await page.getByRole('tab', { name: 'Collections' }).click();
await page.locator('label').filter({ hasText: 'Grant access to all current' }).click();
await page.getByLabel('Permission').selectOption('edit');
await page.getByLabel('Select collections').click();
await page.getByLabel('Options list').getByText('Default collection').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId("toast-message")).toHaveText('User(s) invited');
});
Expand Down Expand Up @@ -163,7 +167,9 @@ test('Org invite auto accept', async ({ page }, testInfo: TestInfo) => {
await page.getByRole('button', { name: 'Invite member' }).click();
await page.getByLabel('Email (required)').fill(users.user2.email);
await page.getByRole('tab', { name: 'Collections' }).click();
await page.locator('label').filter({ hasText: 'Grant access to all current' }).click();
await page.getByLabel('Permission').selectOption('edit');
await page.getByLabel('Select collections').click();
await page.getByLabel('Options list').getByText('Default collection').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByTestId("toast-message")).toHaveText('User(s) invited');
});
Expand Down

0 comments on commit 9f40c73

Please sign in to comment.