Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# 1Secure team
/docs/1secure/ @netwrix/1secure-docs
/sidebars/1secure.js @netwrix/1secure-docs
/docs/1securebeta/ @netwrix/1secure-docs
/sidebars/1securebeta.js @netwrix/1secure-docs
/docs/1secureaisecurity/ @netwrix/1secure-docs
/sidebars/1secureaisecurity.js @netwrix/1secure-docs
/static/files/1secure/ @netwrix/1secure-docs
/static/images/1secure/ @netwrix/1secure-docs

Expand Down
11 changes: 11 additions & 0 deletions docs/1secureaisecurity/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Netwrix 1Secure AI Security Documentation"
description: "Pre-release documentation for Netwrix 1Secure AI Security."
sidebar_position: 1
---

# Netwrix 1Secure AI Security Documentation

This section holds pre-release documentation for Netwrix 1Secure AI Security. It isn't listed in the site navigation or search results.

{/* TODO: replace this placeholder with the beta overview */}
11 changes: 0 additions & 11 deletions docs/1securebeta/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"quality:readability": "node scripts/quality/readability.mjs",
"quality:fix": "node scripts/quality/fix-loop.mjs",
"slack:sync": "node scripts/sync-team-slack-map.mjs",
"test:scripts": "bash scripts/test-slugify.sh && bash scripts/test-heading-skip.sh && bash scripts/test-md-extension-autofix.sh && node --test scripts/test-set-blob-metadata.mjs && node scripts/test-set-blob-metadata-integration.mjs && node --test scripts/claude/test-log-summary.mjs && node --test scripts/test-vale-local.mjs && node --test scripts/test-resolve-path-labels.mjs && node --test scripts/test-sync-team-slack-map.mjs && node --test scripts/test-preserve-content.mjs && node --test src/plugins/robotsTxt.test.mjs && node --test src/config/docVariables.test.mjs && node scripts/quality/gen-lint-digest.mjs --check",
"test:scripts": "bash scripts/test-slugify.sh && bash scripts/test-heading-skip.sh && bash scripts/test-md-extension-autofix.sh && node --test scripts/test-set-blob-metadata.mjs && node scripts/test-set-blob-metadata-integration.mjs && node --test scripts/claude/test-log-summary.mjs && node --test scripts/test-vale-local.mjs && node --test scripts/test-resolve-path-labels.mjs && node --test scripts/test-sync-team-slack-map.mjs && node --test scripts/test-preserve-content.mjs && node --test src/plugins/robotsTxt.test.mjs && node --test src/config/docVariables.test.mjs && node --test src/config/products.test.mjs && node scripts/quality/gen-lint-digest.mjs --check",
"prepare": "node scripts/hooks/install.mjs"
},
"dependencies": {
Expand Down
File renamed without changes.
33 changes: 27 additions & 6 deletions src/config/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* - Easier maintenance and fewer places for errors
*/

import { isIndexableSite } from './indexing.js';

/**
* @typedef {Object} ProductVersion
* @property {string} version - Version string (e.g., "12.0", "saas")
Expand All @@ -33,14 +35,15 @@
* @property {string} [icon] - Icon for the product
* @property {string} [navbarGroup] - Products sharing a navbarGroup are shown as one nested submenu with this label inside their category dropdown
* @property {boolean} [hideFromNavbar] - Leave the product out of the navbar dropdowns and the landing page. Its pages stay reachable by URL.
* @property {boolean} [devOnly] - Build the product on docs-dev and locally but not on the production site (docs.netwrix.com). The pages still merge to main with the rest of dev; production just doesn't build them. Remove the flag to release the product.
* @property {boolean} [noIndex] - Keep the product out of search engines and site search: its pages carry a noindex tag and are left out of the sitemap, production robots.txt disallows its routes, and it is not offered in the search product filter. Pair with hideFromNavbar for an unlisted product such as a beta.
*/

/**
* All Netwrix products and their configurations
* @type {Product[]}
*/
export const PRODUCTS = [
const ALL_PRODUCTS = [
{
id: '1secure',
name: '1Secure',
Expand All @@ -58,20 +61,21 @@ export const PRODUCTS = [
],
},
{
id: '1securebeta',
name: '1Secure Beta',
description: 'Pre-release documentation for Netwrix 1Secure',
path: 'docs/1securebeta',
id: '1secureaisecurity',
name: '1Secure AI Security',
description: 'Pre-release documentation for Netwrix 1Secure AI Security',
path: 'docs/1secureaisecurity',
categories: ['Data Security Posture Management (DSPM)'],
icon: '',
hideFromNavbar: true, // Unlisted beta: reachable by URL only
noIndex: true,
devOnly: true, // Not built on production until the beta is released
versions: [
{
version: 'current',
label: 'Current',
isLatest: true,
sidebarFile: './sidebars/1securebeta.js',
sidebarFile: './sidebars/1secureaisecurity.js',
kb: false, // No Knowledge Base for the beta
},
],
Expand Down Expand Up @@ -789,6 +793,23 @@ export const PRODUCTS = [
},
];

/**
* True when this build is for the production site (docs.netwrix.com). The
* client bundle has no APP_EXTERNAL_URL, so there it is false and devOnly
* products stay in the list. That is harmless: they have no routes in production.
*/
function isProductionBuild() {
const url = typeof process !== 'undefined' ? process.env?.APP_EXTERNAL_URL : undefined;
return Boolean(url) && isIndexableSite(url);
}

/**
* Products the site builds. Products flagged devOnly are left out of the
* production build, so they get no plugin, routes, or pages there.
* @type {Product[]}
*/
export const PRODUCTS = ALL_PRODUCTS.filter((product) => !(product.devOnly && isProductionBuild()));

/**
* Product categories with their metadata
*/
Expand Down
30 changes: 30 additions & 0 deletions src/config/products.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';

// products.js reads APP_EXTERNAL_URL when it loads, so each case imports a fresh copy.
async function loadProducts(siteUrl, tag) {
const previous = process.env.APP_EXTERNAL_URL;
if (siteUrl === undefined) delete process.env.APP_EXTERNAL_URL;
else process.env.APP_EXTERNAL_URL = siteUrl;
try {
return (await import(`./products.js?${tag}`)).PRODUCTS;
} finally {
if (previous === undefined) delete process.env.APP_EXTERNAL_URL;
else process.env.APP_EXTERNAL_URL = previous;
}
}

const ids = (products) => products.map((product) => product.id);

test('devOnly products are left out of the production build', async () => {
const products = await loadProducts('https://docs.netwrix.com', 'production');
assert.equal(ids(products).includes('1secureaisecurity'), false);
assert.equal(ids(products).includes('1secure'), true);
});

test('devOnly products are built on docs-dev and locally', async () => {
for (const [url, tag] of [['https://docs-dev.netwrix.com', 'dev'], ['http://localhost:4500', 'local'], [undefined, 'unset']]) {
const products = await loadProducts(url, tag);
assert.equal(ids(products).includes('1secureaisecurity'), true, String(url));
}
});
2 changes: 1 addition & 1 deletion src/plugins/robotsTxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { join } from 'path';
import { isIndexableSite } from '../config/indexing.js';
import { PRODUCTS, generateRouteBasePath } from '../config/products.js';

/** Route prefixes of products flagged noIndex, for example /docs/1securebeta. */
/** Route prefixes of products flagged noIndex, for example /docs/1secureaisecurity. */
export function noIndexRoutes(products = PRODUCTS) {
return products
.filter((product) => product.noIndex)
Expand Down
Loading