Skip to content

Commit d4230c7

Browse files
rr404jdv
andauthored
fixing some broken links (#1071)
* fixing some broken links * adding runtime redirect to catch all edge cases where sometimes the redirect doesn't work well via static files --------- Co-authored-by: jdv <julien@crowdsec.net>
1 parent 63e2d7a commit d4230c7

10 files changed

Lines changed: 44 additions & 16 deletions

File tree

crowdsec-docs/docs/expr/cti_helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_position: 4
77
## CTI Helpers
88

99
CTI Helper allows to query Crowdsec's CTI API to enhance the engine capabilities.
10-
It requires [creating a CTI API Key in the console, as described here](/u/cti_api/getting_started).
10+
It requires [creating a CTI API Key in the console, as described here](/u/console/ip_reputation/intro).
1111

1212
The CTI API Key must be present in the `api.cti` section of the configuration file:
1313

crowdsec-docs/docusaurus.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,20 @@ const redirects = [
207207
{ from: "/u/cti_api/search_queries", to: "/u/console/ip_reputation/search_ui" },
208208
{ from: "/u/cti_api/advanced_search", to: "/u/console/ip_reputation/search_ui_advanced" },
209209
{ from: "/u/cti_api/cve_explorer", to: "/u/console/ip_reputation/intro#live-exploit-tracker" },
210+
// other CTI pages redirect / fixes
211+
{ from: "/next/cti_api/intro", to: "/u/console/ip_reputation/api_keys" },
212+
{ from: "/next/cti_api/getting_started", to: "/u/console/ip_reputation/api_keys" },
210213
];
211214

215+
function redirectsGlobalDataPlugin() {
216+
return {
217+
name: "redirects-global-data",
218+
async contentLoaded({ actions }: { actions: { setGlobalData: (data: unknown) => void } }) {
219+
actions.setGlobalData({ redirects });
220+
},
221+
};
222+
}
223+
212224
const config: Config = {
213225
future: {
214226
v4: {
@@ -378,6 +390,7 @@ const config: Config = {
378390
},
379391
],
380392
["@docusaurus/plugin-client-redirects", { redirects }],
393+
redirectsGlobalDataPlugin,
381394
tailwindPlugin,
382395
],
383396
};

crowdsec-docs/src/components/home-page/features.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const FEATURES_LIST = [
5050
//schema api ?
5151
title: "Open Source",
5252
Svg: require("../../static/img/icon-opensource.svg").default,
53-
link: "/docs/faq#what-licence-is-crowdsec-released-under-",
53+
link: "/u/troubleshooting/security_engine#what-license-is-provided",
5454
description: <>CrowdSec is as open source and free as it can be through an MIT license. No back doors. No shenanigans.</>,
5555
},
5656
//community driven ->

crowdsec-docs/src/pages/cti.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ const gettingStarted: FeatureCardProps[] = [
1818
{
1919
title: "Console Quickstart",
2020
description: "Use the web interface to search and explore CTI data.",
21-
link: "/u/cti_api/getting_started",
21+
link: "/u/console/ip_reputation/intro",
2222
icon: "🖥️",
2323
},
2424
{
2525
title: "API Quickstart",
2626
description: "Integrate CTI data programmatically into your workflows.",
27-
link: "/u/cti_api/api_getting_started",
27+
link: "/u/console/ip_reputation/api_keys",
2828
icon: "🔌",
2929
},
3030
];
@@ -33,7 +33,7 @@ const coreFeatures: FeatureCardProps[] = [
3333
{
3434
title: "IP Reports",
3535
description: "Get full context for any IP, including reputation and activity.",
36-
link: "/u/cti_api/ip_report",
36+
link: "/u/console/ip_reputation/ip_report",
3737
icon: "📋",
3838
},
3939
{
@@ -45,13 +45,13 @@ const coreFeatures: FeatureCardProps[] = [
4545
{
4646
title: "Advanced Search",
4747
description: "Build complex queries to spot patterns at scale.",
48-
link: "/u/cti_api/advanced_search",
48+
link: "/u/console/ip_reputation/search_ui_advanced",
4949
icon: "🎯",
5050
},
5151
{
5252
title: "CVE Explorer",
5353
description: "Explore CVEs and see active exploitation by IP.",
54-
link: "/u/cti_api/cve_explorer",
54+
link: "/u/console/ip_reputation/intro#live-exploit-tracker",
5555
icon: "🛡️",
5656
},
5757
];
@@ -128,7 +128,7 @@ const CTIPage = () => {
128128
description="Query CrowdSec threat intelligence to enrich investigations and automate lookups. Get IP reputation, attack history, and behavior data from a global sensor network."
129129
heroButtons={[
130130
{ label: "Get Started", link: "/u/cti_api/intro" },
131-
{ label: "API Quickstart", link: "/u/cti_api/api_getting_started", variant: "outline" },
131+
{ label: "API Quickstart", link: "/u/console/ip_reputation/api_keys", variant: "outline" },
132132
]}
133133
helpDescription="Get help in Discord or check the FAQ for quick answers."
134134
helpButtons={[

crowdsec-docs/src/theme/NotFound/Content/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
import Link from "@docusaurus/Link";
22
import Translate from "@docusaurus/Translate";
3+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
4+
import useGlobalData from "@docusaurus/useGlobalData";
35
import { Button } from "@site/src/ui/button";
46
import Heading from "@theme/Heading";
57
import type { Props } from "@theme/NotFound/Content";
68
import clsx from "clsx";
7-
import { type ReactNode } from "react";
9+
import { type ReactNode, useEffect } from "react";
810

911
export default function NotFoundContent({ className }: Props): ReactNode {
12+
const { siteConfig } = useDocusaurusContext();
13+
const globalData = useGlobalData();
14+
const pluginData = globalData["redirects-global-data"]?.default as { redirects: { from: string; to: string }[] } | undefined;
15+
16+
useEffect(() => {
17+
if (!pluginData?.redirects) return;
18+
const path = window.location.pathname.replace(siteConfig.baseUrl.replace(/\/$/, ""), "") || "/";
19+
const match = pluginData.redirects.find((r) => r.from === path);
20+
if (match) {
21+
window.location.replace(match.to);
22+
}
23+
}, [pluginData, siteConfig.baseUrl]);
24+
1025
return (
1126
<main className={clsx("container margin-vert--xl", className)}>
1227
<div className="row">

crowdsec-docs/unversioned/cti_api/api_integration/integration_misp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MISP plugin lets you enrich the knowledge of IP attributes using CrowdSec's CTI
1010

1111
### Requirements
1212

13-
- A CrowdSec CTI API key. See [instructions to obtain it](https://docs.crowdsec.net/docs/next/cti_api/getting_started/#getting-an-api-key)
13+
- A CrowdSec CTI API key. See [instructions to obtain it](https://docs.crowdsec.net/docs/u/console/ip_reputation/api_keys/#getting-an-api-key)
1414

1515
### Setting up plugin server
1616

@@ -58,7 +58,7 @@ Configuration parameters are described below:
5858
|------------------------------------------------------|-----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
5959
| `Plugin.Enrichment_crowdsec_enabled` | Yes | Boolean | Enable or disable the crowdsec module |
6060
| `Plugin.Enrichment_crowdsec_restrict` | No | String | Restrict the crowdsec module to the given organisation. |
61-
| `Plugin.Enrichment_crowdsec_api_key` | Yes | String | CrowdSec CTI API key. See [instructions to obtain it](https://docs.crowdsec.net/docs/next/cti_api/getting_started/#getting-an-api-key) |
61+
| `Plugin.Enrichment_crowdsec_api_key` | Yes | String | CrowdSec CTI API key. See [instructions to obtain it](https://docs.crowdsec.net/docs/u/console/ip_reputation/api_keys/#getting-an-api-key) |
6262
| `Plugin.Enrichment_crowdsec_add_reputation_tag` | No | String | Enable/disable the creation of a reputation tag for the IP attribute. You can use `True` or `False` as string value. Default: `True` |
6363
| `Plugin.Enrichment_crowdsec_add_behavior_tag` | No | String | Enable/disable the creation of a behavior tag for the IP attribute. You can use `True` or `False` as string value. Default: `True` |
6464
| `Plugin.Enrichment_crowdsec_add_classification_tag` | No | String | Enable/disable the creation of a classification tag for the IP attribute. You can use `True` or `False` as string value. Default: `True` |

crowdsec-docs/unversioned/cti_api/api_integration/integration_qradar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ You can click on the "Show" button to see the RAW JSON response from the API.
5151

5252
## References
5353

54-
You can find our latest taxonomy about attack details, classifications, scores etc in [our official docs](https://docs.crowdsec.net/docs/next/cti_api/taxonomy)
54+
You can find our latest taxonomy about attack details, classifications, scores etc in [our official docs](/u/cti_api/taxonomy/intro)

crowdsec-docs/unversioned/troubleshooting/usecases.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ Add exclusive context to your alerts and automate incident response with up to 3
388388
<Tabs>
389389
<TabItem value="documentation-resources" label="Documentation & Resources">
390390

391-
- [Explore CrowdSec CTI within the console](/u/cti_api/getting_started)
392-
- [Create a test API key](/u/cti_api/api_getting_started)
391+
- [Explore CrowdSec CTI within the console](/u/console/ip_reputation/intro)
392+
- [Create a test API key](/u/console/ip_reputation/api_keys)
393393
- [IP reputation enrichment glossary](/u/cti_api/taxonomy/cti_object)
394394
- [Evaluate your IPs using our **IPDEX** tool](/u/cti_api/api_integration/integration_ipdex/)
395395
- [Contact Us for 🏅 advanced usage ↗️](https://www.crowdsec.net/business-requests?interest=CTI%20subscription)

crowdsec-docs/versioned_docs/version-v1.6/expr/cti_helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_position: 4
77
## CTI Helpers
88

99
CTI Helper allows to query Crowdsec's CTI API to enhance the engine capabilities.
10-
It requires [creating a CTI API Key in the console, as described here](/u/cti_api/getting_started).
10+
It requires [creating a CTI API Key in the console, as described here](/u/console/ip_reputation/intro).
1111

1212
The CTI API Key must be present in the `api.cti` section of the configuration file:
1313

crowdsec-docs/versioned_docs/version-v1.7/expr/cti_helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_position: 4
77
## CTI Helpers
88

99
CTI Helper allows to query Crowdsec's CTI API to enhance the engine capabilities.
10-
It requires [creating a CTI API Key in the console, as described here](/u/cti_api/getting_started).
10+
It requires [creating a CTI API Key in the console, as described here](/u/console/ip_reputation/intro).
1111

1212
The CTI API Key must be present in the `api.cti` section of the configuration file:
1313

0 commit comments

Comments
 (0)