This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
forked from PostHog/posthog-foss
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
* upstream/master: (145 commits) Sync and remove all non-FOSS parts feat(surveys): Add UI for enabling/disabling surveys popup (#17602) fix: selecting from cohort people (#17610) refactor(hogql): remove persons related params from insight filters (#17612) chore(deps): Update posthog-js to 1.81.0 (#17604) feat(hogql): add backend side filter to query conversion method (#17542) feat: onboarding invite members, other products, verification steps (#17615) feat: new onboarding navigation (#17582) chore(deps): Update posthog-js to 1.80.0 (#17603) feat(surveys): Add opt in migration (#17600) chore: App metrics no hub no promise manager (#17581) fix: Redis server for replay (#17597) fix: Wait for ingester shutdown before redis shutdown (#17594) feat: Added option for parallel processing of replay ingestion (#17585) feat: Handle potential races in revoking replay partitions (#17578) chore: migrate plugins sortable (#17587) feat: hogql trends (#17519) fix(batch-exports): Do not export site url (#17588) feat: bubble menu for link / text editing (#17550) feat: Record S3 BatchExport errors (#17535) ...
- Loading branch information
Showing
623 changed files
with
14,507 additions
and
5,874 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ | |
!plugin-server/.prettierrc | ||
!share/GeoLite2-City.mmdb | ||
!hogvm/python | ||
!unit.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
# Check if staged files contain any added or modified PNGs - skip when merging | ||
if \ | ||
git rev-parse -q --verify MERGE_HEAD \ | ||
&& git diff --cached --name-status | grep '^[AM]' | grep -q '.png$' | ||
then | ||
# Error if OptiPNG is not installed | ||
if ! command -v optipng >/dev/null; then | ||
echo "PNG files must be optimized before being committed, but OptiPNG is not installed! Fix this with \`brew/apt install optipng\`." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
pnpm lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# To ensure we are able to expose metrics from multiple processes, we need to | ||
# provide a directory for `prometheus_client` to store a shared registry. | ||
export PROMETHEUS_MULTIPROC_DIR=$(mktemp -d) | ||
chmod -R 777 $PROMETHEUS_MULTIPROC_DIR | ||
trap 'rm -rf "$PROMETHEUS_MULTIPROC_DIR"' EXIT | ||
|
||
export PROMETHEUS_METRICS_EXPORT_PORT=8001 | ||
export STATSD_PORT=${STATSD_PORT:-8125} | ||
|
||
exec /usr/local/bin/docker-entrypoint.sh unitd --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
describe('Password Reset', () => { | ||
beforeEach(() => { | ||
cy.get('[data-attr=top-menu-toggle]').click() | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
cy.location('pathname').should('eq', '/login') | ||
}) | ||
|
||
it('Can request password reset', () => { | ||
cy.get('[data-attr=login-email]').type('[email protected]').should('have.value', '[email protected]').blur() | ||
cy.get('[data-attr=forgot-password]', { timeout: 5000 }).should('be.visible') // Wait for login precheck (note blur above) | ||
cy.get('[data-attr="forgot-password"]').click() | ||
cy.location('pathname').should('eq', '/reset') | ||
cy.get('[data-attr="reset-email"]').type('[email protected]') | ||
cy.get('button[type=submit]').click() | ||
cy.get('div').should('contain', 'Request received successfully!') | ||
cy.get('b').should('contain', '[email protected]') | ||
}) | ||
|
||
it('Cannot reset with invalid token', () => { | ||
cy.visit('/reset/user_id/token') | ||
cy.get('div').should('contain', 'The provided link is invalid or has expired. ') | ||
}) | ||
|
||
it('Shows validation error if passwords do not match', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('12345678') | ||
cy.get('.ant-progress-bg').should('be.visible') | ||
cy.get('[data-attr="password-confirm"]').type('1234567A') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.text-danger').should('contain', 'Passwords do not match') | ||
cy.location('pathname').should('eq', '/reset/e2e_test_user/e2e_test_token') // not going anywhere | ||
}) | ||
|
||
it('Shows validation error if password is too short', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('123') | ||
cy.get('[data-attr="password-confirm"]').type('123') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.text-danger').should('be.visible') | ||
cy.get('.text-danger').should('contain', 'must be at least 8 characters') | ||
cy.location('pathname').should('eq', '/reset/e2e_test_user/e2e_test_token') // not going anywhere | ||
}) | ||
|
||
it('Can reset password with valid token', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('NEW123456789') | ||
cy.get('[data-attr="password-confirm"]').type('NEW123456789') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.Toastify__toast--success').should('be.visible') | ||
|
||
// assert the user was redirected; can't test actual redirection to /insights because the test handler doesn't actually log in the user | ||
cy.location('pathname').should('not.contain', '/reset/e2e_test_user/e2e_test_token') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,58 +87,3 @@ describe('Auth', () => { | |
cy.location('pathname').should('eq', urls.projectHomepage()) | ||
}) | ||
}) | ||
|
||
describe('Password Reset', () => { | ||
beforeEach(() => { | ||
cy.get('[data-attr=top-menu-toggle]').click() | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
cy.location('pathname').should('eq', '/login') | ||
}) | ||
|
||
it('Can request password reset', () => { | ||
cy.get('[data-attr=login-email]').type('[email protected]').should('have.value', '[email protected]').blur() | ||
cy.get('[data-attr=forgot-password]', { timeout: 5000 }).should('be.visible') // Wait for login precheck (note blur above) | ||
cy.get('[data-attr="forgot-password"]').click() | ||
cy.location('pathname').should('eq', '/reset') | ||
cy.get('[data-attr="reset-email"]').type('[email protected]') | ||
cy.get('button[type=submit]').click() | ||
cy.get('div').should('contain', 'Request received successfully!') | ||
cy.get('b').should('contain', '[email protected]') | ||
}) | ||
|
||
it('Cannot reset with invalid token', () => { | ||
cy.visit('/reset/user_id/token') | ||
cy.get('div').should('contain', 'The provided link is invalid or has expired. ') | ||
}) | ||
|
||
it('Shows validation error if passwords do not match', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('12345678') | ||
cy.get('.ant-progress-bg').should('be.visible') | ||
cy.get('[data-attr="password-confirm"]').type('1234567A') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.text-danger').should('contain', 'Passwords do not match') | ||
cy.location('pathname').should('eq', '/reset/e2e_test_user/e2e_test_token') // not going anywhere | ||
}) | ||
|
||
it('Shows validation error if password is too short', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('123') | ||
cy.get('[data-attr="password-confirm"]').type('123') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.text-danger').should('be.visible') | ||
cy.get('.text-danger').should('contain', 'must be at least 8 characters') | ||
cy.location('pathname').should('eq', '/reset/e2e_test_user/e2e_test_token') // not going anywhere | ||
}) | ||
|
||
it('Can reset password with valid token', () => { | ||
cy.visit('/reset/e2e_test_user/e2e_test_token') | ||
cy.get('[data-attr="password"]').type('NEW123456789') | ||
cy.get('[data-attr="password-confirm"]').type('NEW123456789') | ||
cy.get('button[type=submit]').click() | ||
cy.get('.Toastify__toast--success').should('be.visible') | ||
|
||
// assert the user was redirected; can't test actual redirection to /insights because the test handler doesn't actually log in the user | ||
cy.location('pathname').should('not.contain', '/reset/e2e_test_user/e2e_test_token') | ||
}) | ||
}) |
Oops, something went wrong.