Граф коммитов

85 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] d78f65774d
chore(deps): bump node from 22.6-alpine to 20.9-alpine (#5010)
* chore(deps): bump node from 22.6-alpine to 22.7-alpine

Bumps node from 22.6-alpine to 22.7-alpine.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: version alignment

* Downgrade to Node LTS

* downgrade to LTS Node 20.9.0 and NPM 10.1.0

* downgrade to LTS Node 20.9.0 and NPM 10.1.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mansaj <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
2024-09-10 09:40:08 -07:00
mansaj 8c1e2f7125
Merge branch 'main' into dependabot/docker/node-22.6-alpine 2024-08-28 08:56:03 -07:00
Florian Zia 25fe7f74e1
merge: Resolve conflicts with main 2024-08-28 12:45:59 +02:00
mansaj 4ad3b674fc
Merge branch 'main' into dependabot/docker/node-22.6-alpine 2024-08-27 07:46:38 -07:00
Robert Helmer 9f048ce401 link to tech debt ticket for unit test 2024-08-21 22:08:41 +00:00
Robert Helmer afc929c97d add docs for fxa-rp-events deps 2024-08-21 22:08:41 +00:00
Robert Helmer 66fd91d0e0
Merge branch 'main' into dependabot/docker/node-22.6-alpine 2024-08-21 15:06:15 -07:00
Robert Helmer c5512aaa93
add docs and a cli flag for testing adm-zip dependency updates (#4949)
* add docs and a cli flag for testing adm-zip dependency updates

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2024-08-19 06:45:33 -07:00
Robert Helmer a1f12be707 update docs on Docker/Node 2024-08-12 11:49:35 -07:00
Vincent 96e37bb4ca Update docs on react-intersection-observer testing 2024-08-07 16:27:04 +02:00
Robert Helmer 246e0194bd
Update dependency doc with info on testing backend updates (#4919)
* update details for backend dependency testing
* add details to README about load testing using k6
* types/k6 package

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2024-08-06 11:49:55 -07:00
Emmett 7e47500c12
Update release_process.md 2024-07-12 15:04:52 -04:00
Vincent 96bc2874aa Migrate "delete unverified subscribers" cron to TS 2024-07-11 12:58:05 +02:00
Vincent e7261bc8ca Adopt .env.local file
This makes it clearer what variables actually need to be set
locally, and which have been forgotten. It also makes the build
simpler, by removing the need to copy the .env-dist file.

This should be safe to apply, since .env-dist already got loaded by
default, just like .env now is. And it is still the case that
actual environment variables overwrite the ones in the .env file.

For non-Next.js setups (e.g. cron jobs or database migrations), I
switched to dotenv-flow. The regular dotenv explicitly avoids
inheritance [1], because it wants environment variables to be
specific to an environment. That was already not the case with most
of our environment variables, so the switch makes sense for us.

Next steps could be to remove unused variables from .env, and
possibly moving variables with local/stage-specific values to
.env.local.example, though that riskier, since environments might
depend on those being present.

[1]
https://www.npmjs.com/package/dotenv#should-i-have-multiple-env-files
2024-07-09 10:58:25 +02:00
Robert Helmer 589bf8c6d5
MNTOR-3096 - add monitor glean backend (#4544)
* add backend metrics yaml for Glean

---------

Co-authored-by: Sean Rose <1994030+sean-rose@users.noreply.github.com>
2024-06-27 10:37:07 -07:00
Vincent e5ec76fb92
Add documentation on how I test dependency updates
Note that I was only able to add docs for those that I handle. It
would be nice to have docs for the rest as well, but this should at
least be sufficient to cover for me.
2024-05-22 12:12:44 +02:00
Joey Zhou c0a60458ef ci: get rid of circle CI 2024-05-17 10:02:38 -07:00
mansaj 2c9a1a1a83
Update docs/adr/0008-preview-deployment.md
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
2024-05-10 12:32:00 -07:00
Joey Zhou 43933aeaaf chore: typo and wording 2024-05-09 16:26:11 -07:00
Joey Zhou f1d07be8b1 feat: ADR for preview deployment 2024-05-09 16:18:18 -07:00
Robert Helmer 611735557e
add new plan_tier key on all glean events (#4431)
* add plan_tier key to all Glean events

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2024-05-01 09:45:19 -07:00
Robert Helmer 0b7bd43726
Fix description for legacy users in metrics.yaml (#4124) 2024-02-14 07:31:42 -08:00
Vincent b74ac07cf5 Count interactions with guided flow nav buttons 2024-01-12 13:32:54 +01:00
Vincent faeb16be71 Port settings page to proper React 2024-01-04 16:20:26 +01:00
Vincent 9a0a3bb577 Add dev docs on debugging Glean
The repo isn't really the right place to inform end users, and the
doc was outdated anyway, so I just repurposed `analytics.md` for
developer-focused documentation.
2023-12-27 11:28:43 +01:00
Robert Helmer 74abdd2c67
MNTOR-2399 - add new Glean interaction data to metrics YAML (#3700)
* MNTOR-2399 - add new Glean interaction data to metrics YAML

---------

Co-authored-by: Peter deHaan <pdehaan@hey.com>
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2023-11-21 13:10:43 -08:00
Robert Helmer 146a52ae93
ADR: Queue Services Proposal (#2976)
* docs: add proposal for using queues for external services (HIBP, email)
2023-10-18 19:19:46 -07:00
Vincent db52555a1d Add docs on Jira iupdate after stage deploy 2023-10-03 11:50:34 +02:00
Vincent 85eafb36f4 Add docs on how we plan to maintain test coverage 2023-08-04 11:30:54 +02:00
Maxx Crawford 6eedf7de14
ADR: Unit Testing Framework (#3128)
* WIP Draft

* Add decision statement, update ADR#0000

* Update docs/adr/0007-unit-testing-framework.md

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* Update docs/adr/0007-unit-testing-framework.md

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

---------

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2023-07-31 10:15:21 -05:00
Peter deHaan 9c7f291732
Update CODEOWNERS (#3239) 2023-07-20 23:50:42 -07:00
Robert Helmer 867d2aa5d8
MNTOR-924/architecture docs for monitor (#3140)
* docs: C4-style diagram for Monitor
2023-07-15 19:15:58 -07:00
Maxx Crawford 3a75d68684
Fix MNTOR-1795 - Add ADR for L10N workflow updates (#3097)
* Fix MNTOR-1795 - Add ADR for L10N workflow updates

* Add support images

* Add revised doc

* Adjust last updated date

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Update docs/adr/0006-localization-workflow.md

Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>

* Code review revisions

* Fix spelling and punctuation

* Update status/last edited

---------

Co-authored-by: Kaitlyn Andres <kandres@mozilla.com>
Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>
Co-authored-by: Francesco Lodolo <flod@lodolo.net>
2023-07-11 09:52:33 -05:00
Vincent b56993359e
Merge Next.js into `main` (#3116)
* Initialise Next.js app using create-next-app

Command run: npx create-next-app@latest

* Also tell VSCode to format TS and TSX files

* WIP: Sign in with next-auth

* Add Fluent

Unfortunately, since the ReactLocalization object contains
functions, it can't be shared between client and server (because
functions can't be serialized), so in effect every page that uses
localisation has to be a client component.

But at least we can set the correct `lang` attribute on <html> on
the server, so there's that :)

* Copy-paste public breach scan into Next.js

* Halfway migrate public breach list

Did not do: breach icons and getLocale() (for list and date
formatting).

* Enable SSR for localised strings

This allows our pages to be Server Components now.

* Download breach logos in Next.js server

* Tell search engines not to index non-prod envs

* Port existing security headers from Helmet to Next

* Add a 404 page

* Relax CSP in local development

* Set up Next-Auth for server components

It still doesn't work at the moment because the correct redirect
URL hasn't yet been set up on FxA.

* Apply Prettier to Next.js files on commit

* Enable Sass

* feat: Port existing landing page

* fix: Set hibp footer as html

* Wire up Next.js to FxA using iron-session

* feat: Port main layout for authenticated pages

* chore: Get session in layout

* Set up Prettier for VSCode users

* fix: Provide fxa user menu with data

* chore: Format Create Next App template

* Make Next-Auth work with FxA

To test, add the following two variables to your .env:

  NEXTAUTH_URL=http://localhost:6060
  NEXTAUTH_SECRET=<generate using `openssl rand -base64 32`>

You can then add <SignInButton/> to e.g. the landing page to kick
off authentication.

* Port breach-detail page to Next.js

* Add pending translations

* Access session data in React components

* Use Prettier as the formatter in VSCode

* Port Nebula & Protocol tokens into tokens file

* merge: Resolve conflicts

* fix: Move hr into li element

* feat: Handle authenticated users

* chore: Add todo note

* chore: Don’t use default exports for SignInButton and UserMenu

* chore: Move site navigation to client-side component

* Make mozlog work with Next.js

Unfortunately, this required patching the `intel` package. That
said, since that package hasn't been updated in six years, this
should be relatively safe.

The problem is that `intel` was trying to dynamically determine
which modules to load based on which files were present in its
directory. However, since Next.js moves (and presumably bundles)
Node modules into the `.next` folder, it was unable to find the
modules that `mozlog` was expecting to use.

The patch fixes this by simply explicitly importing those four
modules.

* Add back a couple of authentication logs

* add woff files and metropolis css file

* add right font path

* format scss file to include camelcase

* chore: Move components into (nextjs_migration) and remove redundant layout file

* chore: Remove redirect landing page -> dashboard

* chore: Redirect to dashboard upon signin

* add title and body copy variables

* use token variables in landing scss file instead of old variables from variables.css

* feat: Add basic dashboard page elements

* chore: Add circle chart web component

* chore: Add custom select web component

* breaches get and put calls

* cleanup

* get rid of debug logs

* Add sentry to nextJS branch (#3075)

MNTOR-1641 - enable Sentry for NextJS, for front- and back-end code

* chore: Render user breaches

* feat: Port breach resolution api

* fix: Check breach resolution filter by default

* chore: Add redirect /user/dashboard -> /user/breaches

* feat: Add breach page types

* chore: Remove breach resolution API call headers

* fix: Rename changed API response data key

* add template button component

* remove assets

* add button styling

* chore: Trigger auto signIn for pages that require authentication

* chore: Update breach types

* chore: Repurpose HIBP BreachDataTypes

* chore: Don’t capitalize first letter of chart label

* chore: Remove duplicate font size

* chore: Rename BreachResolutionApiBody -> BreachResolutionRequest

* Add a redirect from /security-tips for Next.js

This was already present in the Express-based website.

* Add the app shell for the React-based website

* chore: Re-enable gtag

* use old font code and add status pill component

* remove unnecessary package additions and style status pills

* lint

* test exposurecard data func

* MNTOR-1765 - set title, favicon, and meta tag correctly for nextjs app (#3082)

* Port unsubscribe-monthly page to Next.js

* add toggle to exposurecard accordion

* add icons to exposure type

* Ease transition from `getMessage`

This adds a `getStringLookup` API to ease the transition from old
Fluent functions (which depend on the user's locale being stored in
AsyncLocalStorage). It will behave the same as the old getMessage()
when called as-is, but when passed an instance of ReactLocalization
(which we have access to in Next.js routes), it will retrieve the
localised string from that.

* Add preliminary Subscriber table type definition

* Process new user sign-in

This does a couple of things:
- It updates the code that sends the breach check email on
  first sign-in to pass an instance of ReactLocalization.
- It splits session data and JWT properties to separate data
  provided to use by FxA from data we store in our own database.
- It checks if the user that signs in is already known in our
  database, and if not, it adds them. It does so using mostly the
  same code as in /src/controllers/auth.js's `confirmed` function.

* dockerflow endpoints

* remove introduction.mdx for now, refine button states

* apply some changes

* Move new components out of migration dir

* Delete .bash_profile

* Delete storybook.log

* Delete main.js

* Delete preview.js

* remove use of inter for now

* feat: add email api

* feat: remove email api

* verify email

* update comms options

* light refactoring

* take shared function out to util

* send verification email

* add another property to EmailRow

* add some types

* rename route

* fix review comment

* Fix MNTOR-1634: Stub /settings page (auth)

* Remove commented code, add CSS, match HTML markup from previous iterations

* Remove/comment out logic dependent on session info

* Wire up settings page and new APIs

* Work around radio button unchecking on page load

* Adding a catch all 404

Not ideal but the best solution at the moment

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* version route

* remove log

* Port admin pages to Next.js

The Notification email doesn't work yet, because it's not clear yet
how to trigger the Cloud Function.

* Add Storybook build output folder to gitignore

* Set up Netlify

* Group Storybook ignores together

* add node env

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* fix test

* fix npm test

* fix css lint

* fix lint js

* exclude sentry.*

* Set up the actual linting we'll use

* Prettier-ignore appropriate files, format the rest

* Fix/ignore ESLint and TypeScript errors

* Make tests work with getStringLookup

* Remove now-unused dependencies and build scripts

* Update CI scripts for Next.js

* Add missing Next.js dependencies to the lockfile

These were added when running `next build`.

* Tag Next.js migration TODOs

* Make "add email" dialog work on dashboard

* Load client-side scripts as modules

This is the same the old website did, and avoids e.g. different
`init` functions overriding each other.

* Fix loading of FxA avatar

* Use <BreachLogo> component

* Allow Next.js's inline scripts/styles in prod

For `style-src`, the current website already enables
'unsafe-inline'. For script-src, it looks like we currently cannot
avoid that: https://github.com/vercel/next.js/discussions/51039

* Debug Playwright (#3118)

---------

Co-authored-by: Florian Zia <zia.florian@gmail.com>
Co-authored-by: Kaitlyn <kandres@mozilla.com>
Co-authored-by: Joey Zhou <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
Co-authored-by: maxxcrawford <maxx.crawford@gmail.com>
2023-06-12 13:35:35 -07:00
Robert Helmer 9f8f3fe4a9
MNTOR-1548 docs - add release process matching Relay (#3032) 2023-06-09 10:01:40 -07:00
mansaj f34126e2d7
Decision 2023-05-25 12:10:43 -07:00
Joey Zhou 84c7df181e one more thing for JSON 2023-05-16 12:21:21 -07:00
Joey Zhou 6ec157e8f4 review comment 2023-05-16 12:18:07 -07:00
Joey Zhou afe8df77ba Adding JSON as an option 2023-05-15 16:23:37 -07:00
Joey Zhou 9c4048b242 Merge branch 'MNTOR-24' of https://github.com/mozilla/blurts-server into MNTOR-24 2023-05-15 15:00:41 -07:00
Joey Zhou a413712319 Merge branch 'main' into MNTOR-24 2023-05-15 15:00:27 -07:00
mansaj 166f1da8e0
Apply suggestions from code review
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
2023-05-15 14:46:03 -07:00
Maxx Crawford 7960c4b12c
ADR Proposal: Add React Framework (#3019)
* Add first draft of React ADR

* Add @vinnl comment about virtual DOM and testing

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* Add @vinnl comment about TypeScript

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* Apply suggestions from code review

Add additional suggestion from @vinnl suggestion: Remove react/pro hooks item and reword Fluent pro item

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* Added pro/cons from @toufali and @vinnl

* Moved comment about React / Aria

* Add pro/con about developer experience

* Remove con/virtual dom

* Fix React pro item about developer experience

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>

* Add pro note from @mansaj

* Apply suggestions from code review

Fixes from @pdehaan

Co-authored-by: Peter deHaan <pdehaan@hey.com>

---------

Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
Co-authored-by: Peter deHaan <pdehaan@hey.com>
2023-05-15 14:16:29 -05:00
Joey Zhou f864c38afb format 2023-05-12 11:27:39 -07:00
Joey Zhou f0643ef8bf add more to unlease 2023-05-12 11:20:43 -07:00
Joey Zhou 574122db90 format 2023-05-12 09:28:27 -07:00
Joey Zhou 194c786b0e review comment 2023-05-12 09:27:07 -07:00
Joey Zhou d11625aef1 review comment 2023-05-12 09:25:42 -07:00
Joey Zhou 9683e4fa84 Merge branch 'MNTOR-24' of github.com:mozilla/blurts-server into MNTOR-24
* 'MNTOR-24' of github.com:mozilla/blurts-server:
  more
  update string
  move premium to the second half of the file
  Add note on running Redis locally
  add comment on settings section
  remove extra <hr> tag
  add brand name Premium
  lint
  apply updated settings styling, rearrange order on settings page
  lint
  lint
  add environment var
  MNTOR-1387 - Cancel premium subscription settings option
2023-05-12 09:23:21 -07:00
Joey Zhou b0c00525e4 naming changes 2023-05-12 09:23:16 -07:00