Fix links

This commit is contained in:
braginini
2023-05-23 20:09:00 +02:00
parent 8d3ca83eb0
commit f8b79ddcd8
13 changed files with 56 additions and 55 deletions

View File

@@ -22,22 +22,23 @@ const nextConfig = {
experimental: {
scrollRestoration: true,
},
redirects: async () => {
rewrites: async () => {
return [
{
source: '/',
destination: '/docs/introduction',
permanent: true,
},
{
source: '/docs',
destination: '/docs/introduction',
permanent: true,
},
{
source: '/ipa',
source: '/api',
destination: '/ipa/introduction',
permanent: true,
},
{
source: '/api/:path*',
destination: '/ipa/:path*',
}
]
}

View File

@@ -3,12 +3,12 @@ import { Heading } from '@/components/Heading'
const guides = [
{
href: '/ipa/guides/authentication',
href: '/api/guides/authentication',
name: 'Authentication',
description: 'Learn how to authenticate your API requests.',
},
{
href: '/ipa/guides/errors',
href: '/api/guides/errors',
name: 'Errors',
description:
'Read about the different types of errors returned by the API.',

View File

@@ -69,8 +69,8 @@ export const Header = forwardRef(function Header({ className }, ref) {
<nav className="hidden md:block">
<ul role="list" className="flex items-center gap-8">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs/introduction">Docs</TopLevelNavItem>
<TopLevelNavItem href="/ipa/introduction">API</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>
<TopLevelNavItem href="https://join.slack.com/t/netbirdio/shared_invite/zt-vrahf41g-ik1v7fV8du6t0RwxSrJ96A">Support</TopLevelNavItem>

View File

@@ -168,7 +168,7 @@ export function Layout({ children, title, tableOfContents }) {
</main>
<Footer />
</div>
{!router.route.startsWith("/ipa/resources") && <div className="hidden xl:sticky xl:top-[4.5rem] xl:-mr-6 xl:block xl:h-[calc(100vh-4.5rem)] xl:flex-none xl:overflow-y-auto xl:py-16 xl:pr-6">
{!router.route.startsWith("/api/resources") && <div className="hidden xl:sticky xl:top-[4.5rem] xl:-mr-6 xl:block xl:h-[calc(100vh-4.5rem)] xl:flex-none xl:overflow-y-auto xl:py-16 xl:pr-6">
<nav aria-labelledby="on-this-page-title" className="w-80">
{tableOfContents.length > 0 && (
<>

View File

@@ -11,26 +11,26 @@ export const apiNavigation = [
{
title: 'Guides',
links: [
{ title: 'Quickstart', href: '/ipa/guides/quickstart' },
{ title: 'Authentication', href: '/ipa/guides/authentication' },
{ title: 'Errors', href: '/ipa/guides/errors' },
{ title: 'Quickstart', href: '/api/guides/quickstart' },
{ title: 'Authentication', href: '/api/guides/authentication' },
{ title: 'Errors', href: '/api/guides/errors' },
// { title: 'Events', href: '/accounts' },
],
},
{
title: 'Resources',
links: [
{ title: 'Accounts', href: '/ipa/resources/accounts' },
{ title: 'Users', href: '/ipa/resources/users' },
{ title: 'Tokens', href: '/ipa/resources/tokens' },
{ title: 'Peers', href: '/ipa/resources/peers' },
{ title: 'Setup Keys', href: '/ipa/resources/setup-keys' },
{ title: 'Groups', href: '/ipa/resources/groups' },
{ title: 'Rules', href: '/ipa/resources/rules' },
{ title: 'Policies', href: '/ipa/resources/policies' },
{ title: 'Routes', href: '/ipa/resources/routes' },
{ title: 'DNS', href: '/ipa/resources/dns' },
{ title: 'Events', href: '/ipa/resources/events' },
{ title: 'Accounts', href: '/api/resources/accounts' },
{ title: 'Users', href: '/api/resources/users' },
{ title: 'Tokens', href: '/api/resources/tokens' },
{ title: 'Peers', href: '/api/resources/peers' },
{ title: 'Setup Keys', href: '/api/resources/setup-keys' },
{ title: 'Groups', href: '/api/resources/groups' },
{ title: 'Rules', href: '/api/resources/rules' },
{ title: 'Policies', href: '/api/resources/policies' },
{ title: 'Routes', href: '/api/resources/routes' },
{ title: 'DNS', href: '/api/resources/dns' },
{ title: 'Events', href: '/api/resources/events' },
],
},
]
@@ -40,8 +40,8 @@ export function NavigationAPI({tableOfContents, className}) {
<nav className={className}>
<ul role="list">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs/introduction">Docs</TopLevelNavItem>
<TopLevelNavItem href="/ipa/introduction">API</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>
<TopLevelNavItem href="https://join.slack.com/t/netbirdio/shared_invite/zt-vrahf41g-ik1v7fV8du6t0RwxSrJ96A">Support</TopLevelNavItem>
@@ -183,7 +183,7 @@ function NavigationGroup({ group, className, tableOfContents }) {
transition: { duration: 0.15 },
}}
>
{router.route.startsWith("/ipa/resources") && tableOfContents?.map((section) => (
{router.route.startsWith("/api/resources") && tableOfContents?.map((section) => (
<li key={section.id}>
<NavLink
href={`${link.href}#${section.id}`}

View File

@@ -47,8 +47,8 @@ export function NavigationDocs({className}) {
<nav className={className}>
<ul role="list">
<TopLevelNavItem href="https://netbird.io/">Home</TopLevelNavItem>
<TopLevelNavItem href="/docs/introduction">Docs</TopLevelNavItem>
<TopLevelNavItem href="/ipa/introduction">API</TopLevelNavItem>
<TopLevelNavItem href="/docs">Docs</TopLevelNavItem>
<TopLevelNavItem href="/api">API</TopLevelNavItem>
<TopLevelNavItem href="https://netbird.io/blog/">Blog</TopLevelNavItem>
<TopLevelNavItem href="https://github.com/netbirdio/netbird">Github</TopLevelNavItem>
<TopLevelNavItem href="https://join.slack.com/t/netbirdio/shared_invite/zt-vrahf41g-ik1v7fV8du6t0RwxSrJ96A">Support</TopLevelNavItem>

View File

@@ -10,7 +10,7 @@ import { UsersIcon } from '@/components/icons/UsersIcon'
const resources = [
{
href: '/ipa/resources/accounts',
href: '/api/resources/accounts',
name: 'Accounts',
description:
'Learn how to list and update accounts.',
@@ -24,7 +24,7 @@ const resources = [
},
},
{
href: '/ipa/resources/users',
href: '/api/resources/users',
name: 'Users',
description:
'Learn how to create, update, delete, and list users.',
@@ -38,7 +38,7 @@ const resources = [
},
},
{
href: '/ipa/resources/tokens',
href: '/api/resources/tokens',
name: 'Tokens',
description:
'Learn how to create, retrieve, delete, and list tokens.',
@@ -52,7 +52,7 @@ const resources = [
},
},
{
href: '/ipa/resources/peers',
href: '/api/resources/peers',
name: 'Peers',
description:
'Learn how to retrieve, update, delete, and list peers.',
@@ -66,7 +66,7 @@ const resources = [
},
},
{
href: '/ipa/resources/setup-keys',
href: '/api/resources/setup-keys',
name: 'Setup Keys',
description:
'Learn how to create, retrieve, update, and list setup keys.',
@@ -77,7 +77,7 @@ const resources = [
},
},
{
href: '/ipa/resources/groups',
href: '/api/resources/groups',
name: 'Groups',
description:
'Learn how to create, retrieve, update, delete, and list groups.',
@@ -88,7 +88,7 @@ const resources = [
},
},
{
href: '/ipa/resources/rules',
href: '/api/resources/rules',
name: 'Rules',
description:
'Learn how to create, retrieve, update, delete, and list rules.',
@@ -99,7 +99,7 @@ const resources = [
},
},
{
href: '/ipa/resources/policies',
href: '/api/resources/policies',
name: 'Policies',
description:
'Learn how to create, retrieve, update, delete, and list policies.',
@@ -110,7 +110,7 @@ const resources = [
},
},
{
href: '/ipa/resources/routes',
href: '/api/resources/routes',
name: 'Routes',
description:
'Learn about how to create, retrieve, update, delete, and list routes.',
@@ -121,7 +121,7 @@ const resources = [
},
},
{
href: '/ipa/resources/dns',
href: '/api/resources/dns',
name: 'DNS',
description:
'Learn about how to create, retrieve, update, delete, and list nameserver groups and update and retrieve DNS settings.',
@@ -132,7 +132,7 @@ const resources = [
},
},
{
href: '/ipa/resources/events',
href: '/api/resources/events',
name: 'Events',
description:
'Learn about how to list events.',

View File

@@ -3,7 +3,7 @@
## Service Users
Service users are non-interactive accounts that are used to create tokens to access resources and perform actions within your organization's network using NetBird's public API.
Service users are non-interactive accounts that are used to create tokens to access resources and perform actions within your organization's network using [NetBird's public API](/api).
Service users provide additional security by allowing you to limit the scope of access granted to the service user and void losing automated access to critical systems when employees leave the company.
@@ -63,7 +63,7 @@ Be aware that once you close the popup it is impossible to see the plain version
### Using access tokens
Once you have created an access token, you can use it to authenticate API requests to NetBird. See [NetBird API](/ipa/introduction) documentation for detailed usage.
Once you have created an access token, you can use it to authenticate API requests to NetBird. See [NetBird API](/api/introduction) documentation for detailed usage.
For example, if you were using the GitHub API, you might include your personal access token like this:

View File

@@ -26,8 +26,8 @@ Below is the list of global flags:
--admin-url string Admin Panel URL [http|https]://[host]:[port] (default "https://app.netbird.io")
-c, --config string Netbird config file location (default "/etc/netbird/config.json")
--daemon-addr string Daemon service address to serve CLI requests [unix|tcp]://[path|host:port] (default "unix:///var/run/netbird.sock")
--log-file string sets Netbird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log")
-l, --log-level string sets Netbird log level (default "info")
--log-file string sets NetBird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log")
-l, --log-level string sets NetBird log level (default "info")
-m, --management-url string Management Service URL [http|https]://[host]:[port] (default "https://api.wiretrustee.com:443")
-p, --preshared-key string Sets Wireguard PreSharedKey property. If set, then only peers that have the same key can communicate.
-k, --setup-key string Setup key obtained from the Management Service Dashboard (used to register peer)

View File

@@ -379,7 +379,7 @@ Before you start creating and configuring an Azure AD application, ensure that y
### Step 1. Create and configure Azure AD application
In this step, we will create and configure Netbird application in azure AD.
In this step, we will create and configure NetBird application in azure AD.
- Navigate to [Azure Active Directory](https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/Overview)
- Click `App Registrations` in the left menu then click on the `+ New registration` button to create a new application.
- Fill in the form with the following values and click Register
@@ -537,7 +537,7 @@ This guide is a part of the [NetBird Self-hosting Guide](/docs/selfhosted/selfho
</Note>
### Step 1. Create and configure Zitadel application
In this step, we will create and configure Netbird application in zitadel.
In this step, we will create and configure NetBird application in zitadel.
Create new zitadel project
- Navigate to zitadel console

View File

@@ -3,7 +3,7 @@ export const description =
# Authentication
You'll need to authenticate your requests to access any of the endpoints in the NetBird API. In this guide, we'll look at how authentication works. Netbird offers two ways to authenticate your API requests: OAuth2 and personal access tokens (PAT). {{ className: 'lead' }}
You'll need to authenticate your requests to access any of the endpoints in the NetBird API. In this guide, we'll look at how authentication works. NetBird offers two ways to authenticate your API requests: OAuth2 and personal access tokens (PAT). {{ className: 'lead' }}
## OAuth2 with bearer token
@@ -18,7 +18,7 @@ Always keep your token safe and reset it if you suspect it has been compromised.
## Using personal access tokens
When establishing a connection using [PATs](/docs/how-to/access-netbird-public-api), you will need your access token — you can create one in the [Netbird dashboard](https://app.netbird.io/users) under User settings. It is recommended to use [service users](/docs/how-to/access-netbird-public-api) for all organization wide flows calling the API. Here's how to add the token to the request header using cURL:
When establishing a connection using [PATs](/docs/how-to/access-netbird-public-api), you will need your access token — you can create one in the [NetBird dashboard](https://app.netbird.io/users) under User settings. It is recommended to use [service users](/docs/how-to/access-netbird-public-api) for all organization wide flows calling the API. Here's how to add the token to the request header using cURL:
```bash {{ title: 'Example request with personal access token' }}
curl https://api.netbird.io/api/users \

View File

@@ -12,7 +12,7 @@ For this guide, we'll be using cURL to make our first API request. If you don't
## Get an access token
Before making your first API request, you need to create an access token to authenticate requests to the API. You can create an access token in the [Netbird dashboard](https://app.netbird.io) under [Users &raquo; Me](https://app.netbird.io/users).
Before making your first API request, you need to create an access token to authenticate requests to the API. You can create an access token in the [NetBird dashboard](https://app.netbird.io) under [Users &raquo; Me](https://app.netbird.io/users).
After the token was created successfully make sure to store it as we need it for the next step.
## Making your first API request
@@ -31,7 +31,7 @@ curl -X GET https://api.netbird.io/api/peers \
<div className="not-prose">
<Button
href="/peers"
href="/api/resources/peers"
variant="text"
arrow="right"
children="Read the docs for the peers endpoint"
@@ -43,6 +43,6 @@ curl -X GET https://api.netbird.io/api/peers \
Great, you're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the NetBird API:
- [Read how to properly authenticate against the NetBird API](/authentication)
- [Check out the users endpoint](/users)
- [Learn about the different error types](/errors)
- [Read how to properly authenticate against the NetBird API](/api/guides/authentication)
- [Check out the users endpoint](/api/resources/users)
- [Learn about the different error types](/api/guides/errors)

View File

@@ -9,13 +9,13 @@ export const description =
Use the NetBird Public API to manage users, peers, network rules and more from inside your application or scripts to automate the setup of your mesh network. {{ className: 'lead' }}
<div className="not-prose mb-16 mt-6 flex gap-3">
<Button href="/ipa/guides/quickstart" arrow="right" children="Quickstart" />
<Button href="/api/guides/quickstart" arrow="right" children="Quickstart" />
</div>
## Getting started {{ anchor: false }}
To get started, it is recommended to create a [service user](/docs/how-to/use-service-users-with-access-token#service-users), that can later be used to communicate with the NetBird API.
To be able to send requests to our API you need to [authenticate](/ipa/guides/authentication) on each request. This can be done either by Bearer token from your identity provider or by creating a [personal access token](/ipa/guides/authentication#using-personal-access-tokens) in the NetBird dashboard.{{ className: 'lead' }}
To be able to send requests to our API you need to [authenticate](/api/guides/authentication) on each request. This can be done either by Bearer token from your identity provider or by creating a [personal access token](/api/guides/authentication#using-personal-access-tokens) in the NetBird dashboard.{{ className: 'lead' }}
<div className="not-prose">
<Button