Skip to content

Commit 43fbe21

Browse files
LeoMcAarglcaugnerchrisdavidmillsfiji-flo
authored
feat(observatory): launch HTTP Observatory (#10371)
Introduces the HTTP Observatory on MDN. Originally part of the Mozilla Observatory standalone tool, the HTTP Observatory is now available on MDN under the new "Tools" menu. Backend: https://github.com/mdn/mdn-http-observatory (MP-556) --------- Co-authored-by: Andi Pieper <[email protected]> Co-authored-by: Claas Augner <[email protected]> Co-authored-by: Chris Mills <[email protected]> Co-authored-by: Claas Augner <[email protected]> Co-authored-by: Florian Dieminger <[email protected]>
1 parent 0926f1e commit 43fbe21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3805
-32
lines changed

Diff for: .github/workflows/prod-build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ jobs:
243243
# Playground
244244
REACT_APP_PLAYGROUND_BASE_HOST: mdnplay.dev
245245

246+
# Observatory
247+
REACT_APP_OBSERVATORY_API_URL: https://observatory-api.mdn.mozilla.net
248+
246249
# Sentry.
247250
SENTRY_DSN_BUILD: ${{ secrets.SENTRY_DSN_BUILD }}
248251
SENTRY_ENVIRONMENT: prod

Diff for: .github/workflows/stage-build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ jobs:
260260
# Playground
261261
REACT_APP_PLAYGROUND_BASE_HOST: mdnyalp.dev
262262

263+
# Observatory
264+
REACT_APP_OBSERVATORY_API_URL: https://observatory-api.mdn.allizom.net
265+
263266
# Sentry.
264267
SENTRY_DSN_BUILD: ${{ secrets.SENTRY_DSN_BUILD }}
265268
SENTRY_ENVIRONMENT: stage

Diff for: .github/workflows/test-build.yml

+3
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ jobs:
156156

157157
# Playground
158158
REACT_APP_PLAYGROUND_BASE_HOST: play.test.mdn.allizom.net
159+
160+
# Observatory
161+
REACT_APP_OBSERVATORY_API_URL: https://observatory-api.mdn.allizom.net
159162
run: |
160163
161164
# Info about which CONTENT_* environment variables were set and to what.

Diff for: build/spas.ts

+42-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
VALID_LOCALES,
1313
MDN_PLUS_TITLE,
1414
DEFAULT_LOCALE,
15+
OBSERVATORY_TITLE_FULL,
16+
OBSERVATORY_TITLE,
1517
} from "../libs/constants/index.js";
1618
import {
1719
CONTENT_ROOT,
@@ -38,11 +40,17 @@ const FEATURED_ARTICLES = [
3840
];
3941

4042
const LATEST_NEWS: (NewsItem | string)[] = [
43+
"blog/mdn-http-observatory-launch/",
4144
"blog/mdn-curriculum-launch/",
4245
"blog/baseline-evolution-on-mdn/",
4346
"blog/introducing-the-mdn-playground/",
4447
];
4548

49+
const PAGE_DESCRIPTIONS = Object.freeze({
50+
observatory:
51+
"Test your site’s HTTP headers, including CSP and HSTS, to find security problems and get actionable recommendations to make your website more secure. Test other websites to see how you compare.",
52+
});
53+
4654
const contributorSpotlightRoot = CONTRIBUTOR_SPOTLIGHT_ROOT;
4755

4856
async function buildContributorSpotlight(
@@ -145,6 +153,27 @@ export async function buildSPAs(options: {
145153

146154
const SPAs = [
147155
{ prefix: "play", pageTitle: "Playground | MDN" },
156+
{
157+
prefix: "observatory",
158+
pageTitle: `HTTP Header Security Test - ${OBSERVATORY_TITLE_FULL}`,
159+
pageDescription: PAGE_DESCRIPTIONS.observatory,
160+
},
161+
{
162+
prefix: "observatory/analyze",
163+
pageTitle: `Scan results - ${OBSERVATORY_TITLE_FULL}`,
164+
pageDescription: PAGE_DESCRIPTIONS.observatory,
165+
noIndexing: true,
166+
},
167+
{
168+
prefix: "observatory/docs/tests_and_scoring",
169+
pageTitle: `Tests & Scoring - ${OBSERVATORY_TITLE_FULL}`,
170+
pageDescription: PAGE_DESCRIPTIONS.observatory,
171+
},
172+
{
173+
prefix: "observatory/docs/faq",
174+
pageTitle: `FAQ - ${OBSERVATORY_TITLE_FULL}`,
175+
pageDescription: PAGE_DESCRIPTIONS.observatory,
176+
},
148177
{ prefix: "search", pageTitle: "Search", onlyFollow: true },
149178
{ prefix: "plus", pageTitle: MDN_PLUS_TITLE },
150179
{
@@ -182,10 +211,17 @@ export async function buildSPAs(options: {
182211
},
183212
];
184213
const locale = VALID_LOCALES.get(pathLocale) || pathLocale;
185-
for (const { prefix, pageTitle, noIndexing, onlyFollow } of SPAs) {
214+
for (const {
215+
prefix,
216+
pageTitle,
217+
pageDescription,
218+
noIndexing,
219+
onlyFollow,
220+
} of SPAs) {
186221
const url = `/${locale}/${prefix}`;
187222
const context: HydrationData = {
188223
pageTitle,
224+
pageDescription,
189225
locale,
190226
noIndexing,
191227
onlyFollow,
@@ -283,6 +319,11 @@ export async function buildSPAs(options: {
283319
"plus/docs",
284320
"MDN Plus"
285321
);
322+
await buildStaticPages(
323+
fileURLToPath(new URL("../copy/observatory/", import.meta.url)),
324+
"observatory/docs",
325+
OBSERVATORY_TITLE
326+
);
286327

287328
// Build all the home pages in all locales.
288329
// Fetch merged content PRs for the latest contribution section.

Diff for: client/public/assets/observatory/assessment.svg

+4
Loading

Diff for: client/public/assets/observatory/fail-icon.svg

+13
Loading

0 commit comments

Comments
 (0)