* Limit preloading goals
* Enforce max limit for goals per site
* typo
* credo
* Remove logger call
* Integrate #5916
* Add a test
* Add test
* Unignore opts
* add module name to service_error when check times out
Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.
* Remove duplicate timeout logic
The current production logs show two types of verification timeouts:
* service_error: "Unhandled Browserless response status: 408" (vast
majority of cases)
* service_error: :timeout (only a few cases)
The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.
* make service_error into a map with code and extra
* interpret temporary service errors
...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.
* separate sentry messages (verification)
* make Verification.ChecksTest more DRY
* organize tests into describe blocks
* test verification telemetry and logging
* fix codespell
* get rid of legacy verification
* rename Checks.InstallationV2 -> Checks.VerifyInstallation
* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation
* rename installationv2 (live) files as well
* delete old change-domain routes
Also rename current liveview modules and routes, removing the v2 suffix
* rename domain_change_v2 files, removing v2 suffix
* remove legacy JS verifier code
Also fix dockerignore and elixir.yml referencing a wrong priv path
* rename verification_v2_test -> verification_test
* remove v2 prefix from logs and sentry messages
* clean up duplicate external_sites_controller_test.exs tests
* remove flag
* fix typespec
* pass timeout as query param to Browserless too
* Fixup external sites controller test module (#5826)
* fix test description
---------
Co-authored-by: Artur Pata <artur.pata@gmail.com>
* WIP
* Add tailwind migration script
* Change deprecated classes via migration script
* Manual fixes
* Restore color configuration with CSS variables
* Convert the rest of the config
* Fix dropdown ring opacity
* Remove migration script
* Fix stylelint errors
* NPM run format
* Fix shadow and rounded variant usage
* Add custom CSS to components layer
* Fix dark: and hover: conflict in settings_tab
* Fix funnel form background opacity
* Fix final bg-opacity
* Bring back cursor-pointer for buttons by default
* npm run format
* Remove `SSO_ENABLED` env flag and replace it with `ee?` checks where needed
* Fix name of a test module to avoid clash
* Remove unnecessary `ee?()` check from condition in `extra/` code
* Add logic to find Plausible script tag
* Clarify where cookies fixtures come from
* Add case for snippet not found
* Fix issue with installation type not propagating to diagnostics
* Better struct definition
* Refactor verification tests to be more comprehensive
* Fix compile error related to Test.Support.DNS
* Fix DNS imports for CE
* Refactor when tracker is in HTML is detected
* Implement a very crude HTTP relay to persistor service
* Temporarily disable local session and event persistence
* Temporarily disable Promex in dev
* Setup dedicated Finch pool for persistor
* Temporarily adjust load script parameters
* Fiddle with pool opts
* Only log errors
* Bump rate
* Put persistor configuration in runtime config
* Move persistor client code to a separate module
* Move event and session persistence behind a switchable adapter
* Add scaffolding of relaying persistor
* Instrument relayed persistence
* Adjust persistor API to accept full ingest event
* Fix persistor URL in config defaults
* Switch local dev env of embedded_with_relay backend
* Revert "Temporarily disable Promex in dev"
This reverts commit d9c9e9075d130cc5177a2a7559b98a2026077327.
* Lower default `PERSISTOR_COUNT`
* Refactor payload encoding and decoding slightly
* Test and slightly improve persistor logic
* Add fast failing dns check to verification
* Convert Detection to a checks pipeline
* Convert detection to checks pipeline
* Unify browserless checks, set retry policy, timeouts
* Fix spelling
* Update change domain v2
* Fix issue with handling errors with detection
* Include timeoutMs in detector function args
* Allow saving npm installation type (#5639)
* small code style/comment improvements
---------
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
* First pass: store login preference
* Only set login preference if SSO is used
* Change mock DNS to use port 5354 and `domain_id` for parameter
* Make login forms use flash message for error passing
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Allow caching tracker script on CE
Open questions with this approach:
- `ingestion_url`: Using `PlausibleWeb.Endpoint.url()` requires that endpoint has started, but we
want to pre-warm the cache _before_ the endpoint starts. To work around this, a different approach
is used to get the right url.
- caching: Other caches currently cache database models, this caches a string. Will this cause issues?
* Slightly better workaround
* Lazier timers
* wip
* Fix up typespcs
* Extract domain status enum to module macros
* Cancel verification jobs when integration is removed
* Revisit verification interface
* Supply local DNS server for domain ownership testing
* Rename a test
* 👾
* Use identifier when submitting domain verification
* Disallow re-verification of already verified domains
* Extend core APIs for better insight into SSO state during setup
* Adjust `toggle_switch` compoenent to accept global attributes
* Improve textarea variant of input component
* Make first very crude pass on SSO setup UI
* Display "Single Sign-On" settings option only when enabled
* Extract SP identity ID function to SAMLConfig as a public one
* Move SAML controller logic behind an adapter
* Don't apply CSRF protection to SAML consume endpoint
* Make copy adjustments
* Change SSO sidebar icon
* Fix `fake_domain_verify` handling before integration is set up
* Tweak configuration markup
* Sanitize PEM input
* Tweak SSO settings sections + prevent domain deletion if applicable
* Minor tweaks to SSO settings tiles
* Bootstrap basic test suite
* Ensure SSO settings are guarded by env var
* Make sure to retry fake domain validation on integration-less cycle
* Trim idp entity id input
* Dedup assertions
* Fix domain identifier interpolation
* Tidy up integration fetching
* Expand tests for SSOManagement LV with fixes
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Add SSO user as a team member on provisioning
* Implement fake SSO actions and basic login form
* Handle team member limit error and adjust login redirect in `UserAuth`
* Always switch to related SSO team on SSO user login
* Ensure `timeout_at` is set when creating new standard user session
* Add env var flag for gating SSO
* Hide SSO login link when SSO disabled
* Hide SSO routes when SSO disabled
* Implement nonce-based allowance for js in SSO content security policy
* Test controller actions
* Add more tests for UserAuth
* Add sync tests for `GateSSO` plug and env var flag in disabled state
* Add test for SSO owner logging in via standard login
As part of https://github.com/plausible/analytics/pull/5435, I could not
get scheduled jobs working locally. After removing `plugins: false`
(defaults to empty list) it works, got an idea from reading unrelated
bug reports.
* Purge bunny cdn cache when tracker script config is updated
* Only allow one purge task scheduled per site
Tested by adding logging and toggling a checkbox a few times. Only one job got executed.
* Typo
* add a new (feature flagged) upgrade page offering v5 plans
* include starter tier plans in available_plans_for + use dev prices in test
* upgrade page remodelling with starter tier
* mobile optimizations
* optimize for darkmode
* add embedded dashboards as a growth benefit
* do not hide header on LegacyChoosePlan
* consistent v5 plan feature order
* slight grandfathering notice adjustment
* display monthly price too on yearly plans
* default to v5 plans unlesss legacy? is true
* refactor: suggest volume not plan for emails
* align back link with page title
* render grandfathering notice for growth v4 too
* Bring back previous dev config
* Dedicated MIX_ENV for load testing + change k6 script
* Remove unused env var
* Remove test flag
* Add .env.load
* Fixup
* streamline dev subscriptions
* spawn -> Task
* fix button alignment
* do not define routes in test env
* remove explicit mentions of dev env when deciding whether to sandbox paddle
* decide checkout behaviour at compile time
* Timex -> Date
* hum
* make it work for enterprise plans too
* allow convenient subscription status change
* fix ci warnings
* remove redundant commented out code
* fix crash + review suggestion
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* site.legacy_time_on_page_cutoff migration
* Update migration logic
* Cronjob for setting legacy_time_on_page_cutoff
* Test site creation default legacy_time_on_page_cutoff
* Use site.legacy_time_on_page_cutoff
Leaving the query param logic for now for testing purposes
* tweak cron
* Work around defaults in tests
* Fixes
* Make cutoff date in job configurable - useful for backfilling
* Add tests for `Teams.get_or_create/1` and `Teams.get_by_owner/1`
* Start populating `current_team` in assigns fetching value from session
* Clean up team passing in invitation services
* Make site transfer service handle multi-team scenario
* Handle multi-team and permission transfer errors on controller level
* Handle multi-teams in site creation on service and controller level
* Drop validation limiting full membership to a single team
* Make user deletion account for public team ownership
* Adjust feature availability checks for Stats API key
* Use current_team when determining limits on site transfer invitation
* Adjust trial upgrade email submission to account for multiple owners
* Remove unnecessary `Teams.load_for_site/1`
* Spike renaming `owner` and `ownership` relationships to plural versions
* Make HelpScout integration handle owner of multiple teams gracefully
* Add FIXME note
* Resolve paddle callback issue by always provisioning a new team when none passed
* Set `current_team` as `my_team` only when user is an owner
* Implement basics of Teams CRM
* Extend Teams CRM
* Further adjust User and Site CRM and refine Team CRM
* Convert Enterprise Plan CRM to refer to team directly and not via user
* Remove unused virtual fields from User schema
* Add note to HelpScout integration
* Allow listing multiple owners under Site Settings / People
* Remove unused User schema relations
* Fix current team fetch in auth plug and context
* Implement basic team switcher
* Ensure (site) editor role is properly handled in site actions auth
* Don't set `site_limit_exceeded` error marker on `permission_denied` error
* Link from HS integration to Team CRM instead of User CRM when available
* Ensure consistent ordering of preloaded owners
* Add `with_subscription` preload for optimisitation
* Add ability to search sites by team identifier
* Add ability to pick team when transferring ownership directly
* Fix failing HelpScout tests
* Scope by team when listing sites in dashboard and via API (optional)
* Add ability to search by team identifier in plans CRM lookup widget
* Add subscription plan, status and grace period to team status info
* Expose teams list in user CRM edit form and fix team details CRM view
* Fix Team Switcher styling
* Reorganise header nav menu
* Avoid additional queries when authenticating user
* Hide the pay/site transfer message on lock screen when teams FF is on
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Implement very rudimentary support for cache partitioning for sessions
* Convenience for starting partitioned caches
* Test basic partitioning expectations
* Include put_many in test
* Use div/2
* Remove unused alias
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Add `<.dropdown_item>`
* Make the ellipsis menu functional again
* Upgrade deps so that storybook can be added
* Add storybook and dropdown story
* Remove lingering warnings/errors
* Add color mode to storybook
* Use new liveview used_input? function
* Alpine improvements
* Add select input to storybook
* Bring back `render_form` for CRM
* Configure eslint so it can see deps
* Remove LiveViewTest patch
* Fix test for phoenix liveview 1.0
* Build assets in prod
* Fix tests
* Attempt to fix lint error
* Add explicit text color to input
* mix format
* Format after merge master
* Add moduledocs
* Only run storybook in production
* Update storybook dependency
* Mix format
In production we use `storage_policy = 'tiered'` by default but this is
not reflected in any migrations.
This change fixes that by introducing a new environment variable and
plumbing to be used in new (and old) migrations
Tested via setting env, doing `mix ecto.drop; mix ecto.create; mix ecto.migrate` and
checking resulting table schemas.
* Increase max_parser_depth setting
This is currently causing issues in production with exports w/ comparisons, but
would blow up in other cases with sufficient data.
The reason this is now blowing up is that we create a large AND/OR condition
for breakdown comparisons. ecto-ch nests each conditional in its separate parentheses
causing us to reach the default 1000 max_parser_depth limit
We can improve this in a couple of ways:
- Not add unneccessary parentheses in ecto-ch
- Adding a new operator to make the AND/OR nesting require less conditionals, using
arrays and tuples instead
* Don't query comparisons for exports
csv exports don't actually output any comparison data, so querying for
it just causes issues.