From cb848760c686be8db379197fc6518734fb6e5304 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Tue, 12 Jan 2021 20:09:23 -0500 Subject: [PATCH] Docs Website: prepare for move to vercel hosting (#9427) * prepare for move to vercel hosting * add html extension redirect handling * temporarily add back netlify files for hosting transition --- website/.env.production | 1 + website/README.md | 42 +- website/next.config.js | 2 + website/redirects.next.js | 1188 +++++++++++++++++++++++++++++++++++++ website/vercel.json | 7 + 5 files changed, 1219 insertions(+), 21 deletions(-) create mode 100644 website/.env.production create mode 100644 website/redirects.next.js create mode 100644 website/vercel.json diff --git a/website/.env.production b/website/.env.production new file mode 100644 index 0000000000..83825a896c --- /dev/null +++ b/website/.env.production @@ -0,0 +1 @@ +HASHI_ENV=production diff --git a/website/README.md b/website/README.md index c53157b8dc..52198788b7 100644 --- a/website/README.md +++ b/website/README.md @@ -66,9 +66,9 @@ If you pull down new code from github, you should run `npm install` again. Other ## Editing Markdown Content -Documentation content is written in [Markdown](https://www.markdownguide.org/cheat-sheet/) and you'll find all files listed under the `/pages` directory. +Documentation content is written in [Markdown](https://www.markdownguide.org/cheat-sheet/) and you'll find all files listed under the `/content` directory. -To create a new page with Markdown, create a file ending in `.mdx` in the `pages/` directory. The path in the pages directory will be the URL route. For example, `pages/hello/world.mdx` will be served from the `/hello/world` URL. +To create a new page with Markdown, create a file ending in `.mdx` in a `content/`. The path in the content directory will be the URL route. For example, `content/docs/hello.mdx` will be served from the `/docs/hello` URL. This file can be standard Markdown and also supports [YAML frontmatter](https://middlemanapp.com/basics/frontmatter/). YAML frontmatter is optional, there are defaults for all keys. @@ -85,7 +85,7 @@ The significant keys in the YAML frontmatter are: - `title` `(string)` - This is the title of the page that will be set in the HTML title. - `description` `(string)` - This is a description of the page that will be set in the HTML description. -> ⚠️ Since `api` is a reserved directory within NextJS, all `/api/**` pages are listed under the `/pages/api-docs` path. +> ⚠️ If there is a need for a `/api/*` url on this website, the url will be changed to `/api-docs/*`, as the `api` folder is reserved by next.js. ### Creating New Pages @@ -96,7 +96,7 @@ There is currently a small bug with new page creation - if you create a new page There are several custom markdown plugins that are available by default that enhance [standard markdown](https://commonmark.org/) to fit our use cases. This set of plugins introduces a couple instances of custom syntax, and a couple specific pitfalls that are not present by default with markdown, detailed below: - If you see the symbols `~>`, `->`, `=>`, or `!>`, these represent [custom alerts](https://github.com/hashicorp/remark-plugins/tree/master/plugins/paragraph-custom-alerts#paragraph-custom-alerts). These render as colored boxes to draw the user's attention to some type of aside. -- If you see `@include '/some/path.mdx'`, this is a [markdown include](https://github.com/hashicorp/remark-plugins/tree/master/plugins/include-markdown#include-markdown-plugin). It's worth noting as well that all includes resolve from `website/pages/partials` by default, and that changes to partials will not live-reload the website. +- If you see `@include '/some/path.mdx'`, this is a [markdown include](https://github.com/hashicorp/remark-plugins/tree/master/plugins/include-markdown#include-markdown-plugin). It's worth noting as well that all includes resolve from `website/content/partials` by default, and that changes to partials will not live-reload the website. - If you see `# Headline ((#slug))`, this is an example of an [anchor link alias](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-link-aliases). It adds an extra permalink to a headline for compatibility and is removed from the output. - Due to [automatically generated permalinks](https://github.com/hashicorp/remark-plugins/tree/je.anchor-link-adjustments/plugins/anchor-links#anchor-links), any text changes to _headlines_ or _list items that begin with inline code_ can and will break existing permalinks. Be very cautious when changing either of these two text items. @@ -151,7 +151,7 @@ $ curl ... Contined normal markdown content ```` -The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs mst have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four. +The intentionally skipped line is a limitation of the mdx parser which is being actively worked on. All tabs must have a heading, and there is no limit to the number of tabs, though it is recommended to go for a maximum of three or four. #### Enterprise Alert @@ -274,7 +274,7 @@ export default { } ``` -- `category` values will be **directory names** within the `pages/
` directory +- `category` values will be **directory names** within the `content/
` directory - `content` values will be **file names** within their appropriately nested directory A couple more important notes: @@ -378,29 +378,29 @@ You may customize the parameters in any way you'd like. To remove a prerelease f ## Redirects -This website structures URLs based on the filesystem layout. This means that if a file is moved, removed, or a folder is re-organized, links will break. If a path change is necessary, it can be mitigated using redirects. +This website structures URLs based on the filesystem layout. This means that if a file is moved, removed, or a folder is re-organized, links will break. If a path change is necessary, it can be mitigated using redirects. It's important to note that redirects should only be used to cover for external links -- if you are moving a path which internal links point to, the internal links should also be adjusted to point to the correct page, rather than relying on a redirect. -To add a redirect, head over to the `_redirects` file - the format is fairly simple. On the left is the current path, and on the right is the path that should be redirected to. It's important to note that if there are links to a `.html` version of a page, that must also be explicitly redirected. For example: +To add a redirect, head over to the `redirects.js` file - the format is fairly simple - there's a `source` and a `destination` - fill them both in, indicate that it's a permanent redirect or not using the `permanent` key, and that's it. Let's look at an example: ``` -/foo /bar 301! -/foo.html /bar 301! +{ + source: '/foo', + destination: '/bar', + permanent: true +} ``` -This redirect rule will send all incoming links to `/foo` and `/foo.html` to `/bar`. For more details on the redirects file format, [check out the docs on netlify](https://docs.netlify.com/routing/redirects/rewrites-proxies). Note that it is critical that `301!` is added to every one-to-one redirect - if it is left off the redirect may not work. +This redirect rule will send all incoming links to `/foo` to `/bar`. For more details on the redirects file format, [check out the docs on vercel](https://vercel.com/docs/configuration#project/redirects). All redirects will work both locally and in production exactly the same way, so feel free to test and verify your redirects locally. In the past testing redirects has required a preview deployment -- this is no longer the case. Please note however that if you add a redirect while the local server is running, you will need to restart it in order to see the effects of the redirect. -There are a couple important caveats with redirects. First, redirects are applied at the hosting layer, and therefore will not work by default in local dev mode. To test in local dev mode, you can use [`netlify dev`](https://www.netlify.com/products/dev/), or just push a commit and check using the deploy preview. +There is still one caveat though: redirects do not apply to client-side navigation. By default, all links in the navigation and docs sidebar will navigate purely on the client side, which makes navigation through the docs significantly faster, especially for those with low-end devices and/or weak internet connections. In the future, we plan to convert all internal links within docs pages to behave this way as well. This means that if there is a link on this website to a given piece of content that has changed locations in some way, we need to also _directly change existing links to the content_. This way, if a user clicks a link that navigates on the client side, or if they hit the url directly and the page renders from the server side, either one will work perfectly. -Second, redirects do not apply to client-side navigation. By default, all links in the navigation and docs sidebar will navigate purely on the client side, which makes navigation through the docs significantly faster, especially for those with low-end devices and/or weak internet connections. In the future, we plan to convert all internal links within docs pages to behave this way as well. This means that if there is a link on this website to a given piece of content that has changed locations in some way, we need to also _directly change existing links to the content_. This way, if a user clicks a link that navigates on the client side, or if they hit the url directly and the page renders from the server side, either one will work perfectly. +Let's look at an example. Say you have a page called `/docs/foo` which needs to be moved to `/docs/nested/foo`. Additionally, this is a page that has been around for a while and we know there are links into `/docs/foo.html` left over from our previous website structure. First, we move the page, then adjust the docs sidenav, in `data/docs-navigation.js`. Find the category the page is in, and move it into the appropriate subcategory. Next, we add to `_redirects` as such. The `.html` version is covered automatically. -Let's look at an example. Say you have a page called `/docs/foo` which needs to be moved to `/docs/nested/foo`. Additionally, this is a page that has been around for a while and we know there are links into `/docs/foo.html` left over from our previous website structure. First, we move the page, then adjust the docs sidenav, in `data/docs-navigation.js`. Find the category the page is in, and move it into the appropriate subcategory. Next, we add to `_redirects` as such: - -``` -/foo /nested/foo 301! -/foo.html /nested/foo 301! +```js +{ source: '/foo', destination: '/nested/foo', permanent: true } ``` -Finally, we run a global search for internal links to `/foo`, and make sure to adjust them to be `/nested/foo` - this is to ensure that client-side navigation still works correctly. _Adding a redirect alone is not enough_. +Next, we run a global search for internal links to `/foo`, and make sure to adjust them to be `/nested/foo` - this is to ensure that client-side navigation still works correctly. _Adding a redirect alone is not enough_. One more example - let's say that content is being moved to an external website. A common example is guides moving to `learn.hashicorp.com`. In this case, we take all the same steps, except that we need to make a different type of change to the `docs-navigation` file. If previously the structure looked like: @@ -426,7 +426,7 @@ If we no longer want the link to be in the side nav, we can simply remove it. If As the majority of items in the side nav are internal links, the structure makes it as easy as possible to represent these links. This alternate syntax is the most concise manner than an external link can be represented. External links can be used anywhere within the docs sidenav. -It's also worth noting that it is possible to do glob-based redirects, for example matching `/docs/*`, and you may see this pattern in the `_redirects` file. This type of redirect is much higher risk and the behavior is a bit more nuanced, so if you need to add a glob redirect, please reach out to the website maintainers and ask about it first. +It's also worth noting that it is possible to do glob-based redirects, for example matching `/docs/*`, and you may see this pattern in the redirects file. This type of redirect is much higher risk and the behavior is a bit more nuanced, so if you need to add a glob redirect, please reach out to the website maintainers and ask about it first. @@ -448,6 +448,6 @@ We support the following browsers targeting roughly the versions specified. ## Deployment -This website is hosted on Netlify and configured to automatically deploy anytime you push code to the `stable-website` branch. Any time a pull request is submitted that changes files within the `website` folder, a deployment preview will appear in the github checks which can be used to validate the way docs changes will look live. Deployments from `stable-website` will look and behave the same way as deployment previews. +This website is hosted on Vercel and configured to automatically deploy anytime you push code to the `stable-website` branch. Any time a pull request is submitted that changes files within the `website` folder, a deployment preview will appear in the github checks which can be used to validate the way docs changes will look live. Deployments from `stable-website` will look and behave the same way as deployment previews. diff --git a/website/next.config.js b/website/next.config.js index 9b1a853c66..3cfe3fa14d 100644 --- a/website/next.config.js +++ b/website/next.config.js @@ -1,4 +1,5 @@ const withHashicorp = require('@hashicorp/nextjs-scripts') +const redirects = require('./redirects.next') module.exports = withHashicorp({ defaultLayout: true, @@ -11,6 +12,7 @@ module.exports = withHashicorp({ destination: '/api-docs/:path*', }, ], + redirects: () => redirects, // Note: These are meant to be public, it's not a mistake that they are here env: { HASHI_ENV: process.env.HASHI_ENV || 'development', diff --git a/website/redirects.next.js b/website/redirects.next.js new file mode 100644 index 0000000000..3d32322637 --- /dev/null +++ b/website/redirects.next.js @@ -0,0 +1,1188 @@ +// REDIRECTS FILE + +// See the README file in this directory for documentation. Please do not +// modify or delete existing redirects without first verifying internally. +// Next.js redirect documentation: https://nextjs.org/docs/api-reference/next.config.js/redirects + +module.exports = [ + { + source: '/discovery', + destination: '/use-cases/service-discovery-and-health-checking', + permanent: true, + }, + { + source: '/mesh', + destination: '/use-cases/multi-platform-service-mesh', + permanent: true, + }, + { + source: '/segmentation', + destination: '/use-cases/multi-platform-service-mesh', + permanent: true, + }, + { + source: '/docs/agent/acl-rules', + destination: '/docs/security/acl/acl-rules', + permanent: true, + }, + { + source: '/docs/acl/acl-rules', + destination: '/docs/security/acl/acl-rules', + permanent: true, + }, + { + source: '/docs/agent/acl-system', + destination: '/docs/security/acl/acl-system', + permanent: true, + }, + { + source: '/docs/acl/acl-system', + destination: '/docs/security/acl/acl-system', + permanent: true, + }, + { source: '/docs/agent/http', destination: '/api-docs', permanent: true }, + { + source: '/docs/guides/acl-legacy', + destination: '/docs/security/acl/acl-legacy', + permanent: true, + }, + { + source: '/docs/acl/acl-legacy', + destination: '/docs/security/acl/acl-legacy', + permanent: true, + }, + { + source: '/docs/guides/acl-migrate-tokens', + destination: '/docs/security/acl/acl-migrate-tokens', + permanent: true, + }, + { + source: '/docs/acl/acl-migrate-tokens', + destination: '/docs/security/acl/acl-migrate-tokens', + permanent: true, + }, + { + source: '/docs/guides/bootstrapping', + destination: '/docs/install/bootstrapping', + permanent: true, + }, + { + source: '/docs/guides/sentinel', + destination: '/docs/agent/sentinel', + permanent: true, + }, + { + source: '/docs/connect/proxies/sidecar-service', + destination: '/docs/connect/registration/sidecar-service', + permanent: true, + }, + { + source: '/docs/enterprise/connect-multi-datacenter', + destination: '/docs/enterprise', + permanent: true, + }, + { source: '/configuration', destination: '/', permanent: true }, + { + source: '/docs/connect/mesh(_|-)gateway', + destination: '/docs/connect/gateways/mesh-gateway', + permanent: true, + }, + { + source: '/docs/connect/ingress(_|-)gateway', + destination: '/docs/connect/gateways/ingress-gateway', + permanent: true, + }, + { + source: '/docs/connect/terminating(_|-)gateway', + destination: '/docs/connect/gateways/terminating-gateway', + permanent: true, + }, + { + source: '/docs/k8s/connect/overview', + destination: '/docs/k8s/connect', + permanent: true, + }, + { + source: '/docs/agent/cloud-auto-join', + destination: '/docs/install/cloud-auto-join', + permanent: true, + }, + { + source: '/docs/internals/security', + destination: '/docs/security', + permanent: true, + }, + { source: '/docs/acl', destination: '/docs/security/acl', permanent: true }, + { + source: '/docs/acl/auth-methods', + destination: '/docs/security/acl/auth-methods', + permanent: true, + }, + { + source: '/docs/acl/auth-methods/kubernetes', + destination: '/docs/security/acl/auth-methods/kubernetes', + permanent: true, + }, + { + source: '/docs/acl/auth-methods/jwt', + destination: '/docs/security/acl/auth-methods/jwt', + permanent: true, + }, + { + source: '/docs/acl/auth-methods/oidc', + destination: '/docs/security/acl/auth-methods/oidc', + permanent: true, + }, + { + source: '/docs/agent/kv', + destination: '/docs/dynamic-app-config/kv', + permanent: true, + }, + { + source: '/docs/internals/sessions', + destination: '/docs/dynamic-app-config/sessions', + permanent: true, + }, + { + source: '/docs/agent/watches', + destination: '/docs/dynamic-app-config/watches', + permanent: true, + }, + { + source: '/docs/connect/l7-traffic-management', + destination: '/docs/connect/l7-traffic', + permanent: true, + }, + { + source: '/docs/internals/discovery-chain', + destination: '/docs/connect/l7-traffic/discovery-chain', + permanent: true, + }, + { + source: '/docs/k8s/operations/upgrading', + destination: '/docs/k8s/upgrade', + permanent: true, + }, + { + source: '/docs/k8s/operations/uninstalling', + destination: '/docs/k8s/uninstall', + permanent: true, + }, + { + source: '/docs/k8s/operations/tls-on-existing-cluster', + destination: '/docs/k8s/tls-on-existing-cluster', + permanent: true, + }, + { + source: '/docs/agent/services', + destination: '/docs/discovery/services', + permanent: true, + }, + { + source: '/docs/agent/checks', + destination: '/docs/discovery/checks', + permanent: true, + }, + { + source: '/docs/agent/dns', + destination: '/docs/discovery/dns', + permanent: true, + }, + { + source: '/docs/agent/encryption', + destination: '/docs/security/encryption', + permanent: true, + }, + { + source: '/docs/internals/architecture', + destination: '/docs/architecture', + permanent: true, + }, + { + source: '/docs/internals/anti-entropy', + destination: '/docs/architecture/anti-entropy', + permanent: true, + }, + { + source: '/docs/internals/consensus', + destination: '/docs/architecture/consensus', + permanent: true, + }, + { + source: '/docs/internals/gossip', + destination: '/docs/architecture/gossip', + permanent: true, + }, + { + source: '/docs/internals/jepsen', + destination: '/docs/architecture/jepsen', + permanent: true, + }, + { + source: '/docs/internals/coordinates', + destination: '/docs/architecture/coordinates', + permanent: true, + }, + { + source: '/docs/glossary', + destination: '/docs/install/glossary', + permanent: true, + }, + { + source: '/docs/connect/gateways/mesh-gateways', + destination: '/docs/connect/gateways/mesh-gateway', + permanent: true, + }, + { + source: '/docs/faq', + destination: '/docs/troubleshoot/faq', + permanent: true, + }, + { + source: '/docs/common-errors', + destination: '/docs/troubleshoot/common-errors', + permanent: true, + }, + { source: '/intro', destination: '/docs/intro', permanent: true }, + { source: '/intro/vs', destination: '/docs/intro/vs', permanent: true }, + { + source: '/intro/vs/zookeeper', + destination: '/docs/intro/vs/zookeeper', + permanent: true, + }, + { + source: '/intro/vs/chef-puppet', + destination: '/docs/intro/vs/chef-puppet', + permanent: true, + }, + { + source: '/intro/vs/nagios-sensu', + destination: '/docs/intro/vs/nagios-sensu', + permanent: true, + }, + { + source: '/intro/vs/skydns', + destination: '/docs/intro/vs/skydns', + permanent: true, + }, + { + source: '/intro/vs/smartstack', + destination: '/docs/intro/vs/smartstack', + permanent: true, + }, + { + source: '/intro/vs/serf', + destination: '/docs/intro/vs/serf', + permanent: true, + }, + { + source: '/intro/vs/eureka', + destination: '/docs/intro/vs/eureka', + permanent: true, + }, + { + source: '/intro/vs/istio', + destination: '/docs/intro/vs/istio', + permanent: true, + }, + { + source: '/intro/vs/proxies', + destination: '/docs/intro/vs/proxies', + permanent: true, + }, + { + source: '/intro/vs/custom', + destination: '/docs/intro/vs/custom', + permanent: true, + }, + { + source: '/download-tools', + destination: '/docs/download-tools', + permanent: true, + }, + { + source: '/downloads_tools', + destination: '/docs/download-tools', + permanent: true, + }, + { + source: '/download_tools', + destination: '/docs/download-tools', + permanent: true, + }, + { + source: '/downloads_tools', + destination: '/docs/download-tools', + permanent: true, + }, + { + source: '/docs/k8s/ambassador', + destination: '/docs/k8s/connect/ambassador', + permanent: true, + }, + { + source: '/docs/k8s/installation/overview', + destination: '/docs/k8s/installation/install', + permanent: true, + }, + { + source: '/docs/k8s/installation/muti-cluster/overview', + destination: '/docs/k8s/installation/multi-cluster', + permanent: true, + }, + { + source: '/docs/partnerships', + destination: '/docs/integrate/partnerships', + permanent: true, + }, + { + source: '/docs/connect/gateways/wan-federation-via-mesh-gateways', + destination: + '/docs/connect/gateways/mesh-gateway/wan-federation-via-mesh-gateways', + permanent: true, + }, + { + source: '/docs/agent/http/:path*', + destination: '/api/:path*', + permanent: true, + }, + { source: '/docs/agent/http', destination: '/api', permanent: true }, + // CLI Redirects + { source: '/docs/commands', destination: '/commands', permanent: true }, + { + source: '/docs/commands/acl', + destination: '/commands/acl', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method', + destination: '/commands/acl/auth-method', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method/create', + destination: '/commands/acl/auth-method/create', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method/delete', + destination: '/commands/acl/auth-method/delete', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method/list', + destination: '/commands/acl/auth-method/list', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method/read', + destination: '/commands/acl/auth-method/read', + permanent: true, + }, + { + source: '/docs/commands/acl/auth-method/update', + destination: '/commands/acl/auth-method/update', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule', + destination: '/commands/acl/binding-rule', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule/create', + destination: '/commands/acl/binding-rule/create', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule/delete', + destination: '/commands/acl/binding-rule/delete', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule/list', + destination: '/commands/acl/binding-rule/list', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule/read', + destination: '/commands/acl/binding-rule/read', + permanent: true, + }, + { + source: '/docs/commands/acl/binding-rule/update', + destination: '/commands/acl/binding-rule/update', + permanent: true, + }, + { + source: '/docs/commands/acl/bootstrap', + destination: '/commands/acl/bootstrap', + permanent: true, + }, + { + source: '/docs/commands/acl/policy', + destination: '/commands/acl/policy', + permanent: true, + }, + { + source: '/docs/commands/acl/policy/create', + destination: '/commands/acl/policy/create', + permanent: true, + }, + { + source: '/docs/commands/acl/policy/delete', + destination: '/commands/acl/policy/delete', + permanent: true, + }, + { + source: '/docs/commands/acl/policy/list', + destination: '/commands/acl/policy/list', + permanent: true, + }, + { + source: '/docs/commands/acl/policy/read', + destination: '/commands/acl/policy/read', + permanent: true, + }, + { + source: '/docs/commands/acl/policy/update', + destination: '/commands/acl/policy/update', + permanent: true, + }, + { + source: '/docs/commands/acl/set-agent-token', + destination: '/commands/acl/set-agent-token', + permanent: true, + }, + { + source: '/docs/commands/acl/token', + destination: '/commands/acl/token', + permanent: true, + }, + { + source: '/docs/commands/acl/token/clone', + destination: '/commands/acl/token/clone', + permanent: true, + }, + { + source: '/docs/commands/acl/token/create', + destination: '/commands/acl/token/create', + permanent: true, + }, + { + source: '/docs/commands/acl/token/delete', + destination: '/commands/acl/token/delete', + permanent: true, + }, + { + source: '/docs/commands/acl/token/list', + destination: '/commands/acl/token/list', + permanent: true, + }, + { + source: '/docs/commands/acl/token/read', + destination: '/commands/acl/token/read', + permanent: true, + }, + { + source: '/docs/commands/acl/token/update', + destination: '/commands/acl/token/update', + permanent: true, + }, + { + source: '/docs/commands/acl/translate-rules', + destination: '/commands/acl/translate-rules', + permanent: true, + }, + { + source: '/docs/commands/agent', + destination: '/commands/agent', + permanent: true, + }, + { + source: '/docs/commands/catalog', + destination: '/commands/catalog', + permanent: true, + }, + { + source: '/docs/commands/catalog/datacenters', + destination: '/commands/catalog/datacenters', + permanent: true, + }, + { + source: '/docs/commands/catalog/nodes', + destination: '/commands/catalog/nodes', + permanent: true, + }, + { + source: '/docs/commands/catalog/services', + destination: '/commands/catalog/services', + permanent: true, + }, + { + source: '/docs/commands/config', + destination: '/commands/config', + permanent: true, + }, + { + source: '/docs/commands/config/delete', + destination: '/commands/config/delete', + permanent: true, + }, + { + source: '/docs/commands/config/list', + destination: '/commands/config/list', + permanent: true, + }, + { + source: '/docs/commands/config/read', + destination: '/commands/config/read', + permanent: true, + }, + { + source: '/docs/commands/config/write', + destination: '/commands/config/write', + permanent: true, + }, + { + source: '/docs/commands/connect', + destination: '/commands/connect', + permanent: true, + }, + { + source: '/docs/commands/connect/ca', + destination: '/commands/connect/ca', + permanent: true, + }, + { + source: '/docs/commands/connect/proxy', + destination: '/commands/connect/proxy', + permanent: true, + }, + { + source: '/docs/commands/connect/envoy', + destination: '/commands/connect/envoy', + permanent: true, + }, + { + source: '/docs/commands/connect/expose', + destination: '/commands/connect/expose', + permanent: true, + }, + { + source: '/docs/commands/debug', + destination: '/commands/debug', + permanent: true, + }, + { + source: '/docs/commands/event', + destination: '/commands/event', + permanent: true, + }, + { + source: '/docs/commands/exec', + destination: '/commands/exec', + permanent: true, + }, + { + source: '/docs/commands/force-leave', + destination: '/commands/force-leave', + permanent: true, + }, + { + source: '/docs/commands/info', + destination: '/commands/info', + permanent: true, + }, + { + source: '/docs/commands/intention', + destination: '/commands/intention', + permanent: true, + }, + { + source: '/docs/commands/intention/check', + destination: '/commands/intention/check', + permanent: true, + }, + { + source: '/docs/commands/intention/create', + destination: '/commands/intention/create', + permanent: true, + }, + { + source: '/docs/commands/intention/delete', + destination: '/commands/intention/delete', + permanent: true, + }, + { + source: '/docs/commands/intention/get', + destination: '/commands/intention/get', + permanent: true, + }, + { + source: '/docs/commands/intention/match', + destination: '/commands/intention/match', + permanent: true, + }, + { + source: '/docs/commands/join', + destination: '/commands/join', + permanent: true, + }, + { + source: '/docs/commands/keygen', + destination: '/commands/keygen', + permanent: true, + }, + { + source: '/docs/commands/keyring', + destination: '/commands/keyring', + permanent: true, + }, + { source: '/docs/commands/kv', destination: '/commands/kv', permanent: true }, + { + source: '/docs/commands/kv/delete', + destination: '/commands/kv/delete', + permanent: true, + }, + { + source: '/docs/commands/kv/export', + destination: '/commands/kv/export', + permanent: true, + }, + { + source: '/docs/commands/kv/get', + destination: '/commands/kv/get', + permanent: true, + }, + { + source: '/docs/commands/kv/import', + destination: '/commands/kv/import', + permanent: true, + }, + { + source: '/docs/commands/kv/put', + destination: '/commands/kv/put', + permanent: true, + }, + { + source: '/docs/commands/leave', + destination: '/commands/leave', + permanent: true, + }, + { + source: '/docs/commands/license', + destination: '/commands/license', + permanent: true, + }, + { + source: '/docs/commands/lock', + destination: '/commands/lock', + permanent: true, + }, + { + source: '/docs/commands/login', + destination: '/commands/login', + permanent: true, + }, + { + source: '/docs/commands/logout', + destination: '/commands/logout', + permanent: true, + }, + { + source: '/docs/commands/maint', + destination: '/commands/maint', + permanent: true, + }, + { + source: '/docs/commands/members', + destination: '/commands/members', + permanent: true, + }, + { + source: '/docs/commands/monitor', + destination: '/commands/monitor', + permanent: true, + }, + { + source: '/docs/commands/namespace', + destination: '/commands/namespace', + permanent: true, + }, + { + source: '/docs/commands/namespace/create', + destination: '/commands/namespace/create', + permanent: true, + }, + { + source: '/docs/commands/namespace/delete', + destination: '/commands/namespace/delete', + permanent: true, + }, + { + source: '/docs/commands/namespace/list', + destination: '/commands/namespace/list', + permanent: true, + }, + { + source: '/docs/commands/namespace/read', + destination: '/commands/namespace/read', + permanent: true, + }, + { + source: '/docs/commands/namespace/update', + destination: '/commands/namespace/update', + permanent: true, + }, + { + source: '/docs/commands/namespace/write', + destination: '/commands/namespace/write', + permanent: true, + }, + { + source: '/docs/commands/operator', + destination: '/commands/operator', + permanent: true, + }, + { + source: '/docs/commands/operator/area', + destination: '/commands/operator/area', + permanent: true, + }, + { + source: '/docs/commands/operator/autopilot', + destination: '/commands/operator/autopilot', + permanent: true, + }, + { + source: '/docs/commands/operator/raft', + destination: '/commands/operator/raft', + permanent: true, + }, + { + source: '/docs/commands/reload', + destination: '/commands/reload', + permanent: true, + }, + { + source: '/docs/commands/rft', + destination: '/commands/rft', + permanent: true, + }, + { + source: '/docs/commands/rtt', + destination: '/commands/rtt', + permanent: true, + }, + { + source: '/docs/commands/services', + destination: '/commands/services', + permanent: true, + }, + { + source: '/docs/commands/services/register', + destination: '/commands/services/register', + permanent: true, + }, + { + source: '/docs/commands/services/deregister', + destination: '/commands/services/deregister', + permanent: true, + }, + { + source: '/docs/commands/snapshot', + destination: '/commands/snapshot', + permanent: true, + }, + { + source: '/docs/commands/snapshot/agent', + destination: '/commands/snapshot/agent', + permanent: true, + }, + { + source: '/docs/commands/snapshot/inspect', + destination: '/commands/snapshot/inspect', + permanent: true, + }, + { + source: '/docs/commands/snapshot/restore', + destination: '/commands/snapshot/restore', + permanent: true, + }, + { + source: '/docs/commands/snapshot/save', + destination: '/commands/snapshot/save', + permanent: true, + }, + { + source: '/docs/commands/tls', + destination: '/commands/tls', + permanent: true, + }, + { + source: '/docs/commands/tls/ca', + destination: '/commands/tls/ca', + permanent: true, + }, + { + source: '/docs/commands/tls/cert', + destination: '/commands/tls/cert', + permanent: true, + }, + { + source: '/docs/commands/validate', + destination: '/commands/validate', + permanent: true, + }, + { + source: '/docs/commands/version', + destination: '/commands/version', + permanent: true, + }, + { + source: '/docs/commands/watch', + destination: '/commands/watch', + permanent: true, + }, + { + source: '/docs/commands/acl/acl-bootstrap', + destination: '/commands/acl/bootstrap', + permanent: true, + }, + { + source: '/docs/commands/acl/acl-policy', + destination: '/commands/acl/policy', + permanent: true, + }, + { + source: '/docs/commands/acl/acl-set-agent-token', + destination: '/commands/acl/set-agent-token', + permanent: true, + }, + { + source: '/docs/commands/acl/acl-token', + destination: '/commands/acl/token', + permanent: true, + }, + { + source: '/docs/commands/acl/acl-translate-rules', + destination: '/commands/acl/translate-rules', + permanent: true, + }, + // Learn Redirects + { + source: '/docs/guides/acl', + destination: + 'https://learn.hashicorp.com/consul/security-networking/production-acls', + permanent: true, + }, + { + source: '/docs/guides/agent-encryption', + destination: + 'https://learn.hashicorp.com/consul/security-networking/agent-encryption', + permanent: true, + }, + { + source: '/docs/guides/autopilot', + destination: + 'https://learn.hashicorp.com/consul/day-2-operations/autopilot', + permanent: true, + }, + { + source: '/docs/guides/backup', + destination: 'https://learn.hashicorp.com/consul/datacenter-deploy/backup', + permanent: true, + }, + { + source: '/docs/guides/cluster-monitoring-metrics', + destination: + 'https://learn.hashicorp.com/consul/day-2-operations/monitoring', + permanent: true, + }, + { + source: '/docs/guides/creating-certificates', + destination: + 'https://learn.hashicorp.com/consul/security-networking/certificates', + permanent: true, + }, + { + source: '/docs/guides/deployment-guide', + destination: + 'https://learn.hashicorp.com/consul/datacenter-deploy/deployment-guide', + permanent: true, + }, + { + source: '/docs/guides/deployment', + destination: + 'https://learn.hashicorp.com/consul/datacenter-deploy/reference-architecture', + permanent: true, + }, + { + source: '/docs/guides/dns-cache', + destination: + 'https://learn.hashicorp.com/consul/security-networking/dns-caching', + permanent: true, + }, + { + source: '/docs/guides/minikube', + destination: + 'https://learn.hashicorp.com/consul/getting-started-k8s/minikube', + permanent: true, + }, + { + source: '/docs/guides/connect-production', + destination: + 'https://learn.hashicorp.com/consul/developer-segmentation/connect-production', + permanent: true, + }, + { + source: '/docs/guides/connect-envoy', + destination: + 'https://learn.hashicorp.com/consul/developer-segmentation/connect-envoy', + permanent: true, + }, + { + source: '/docs/guides/consul-template', + destination: + 'https://learn.hashicorp.com/consul/developer-configuration/consul-template', + permanent: true, + }, + { + source: '/docs/guides/consul-aws', + destination: + 'https://learn.hashicorp.com/consul/cloud-integrations/consul-aws', + permanent: true, + }, + { + source: '/docs/guides/forwarding', + destination: + 'https://learn.hashicorp.com/consul/security-networking/forwarding', + permanent: true, + }, + { + source: '/docs/guides/external', + destination: + 'https://learn.hashicorp.com/consul/developer-discovery/external', + permanent: true, + }, + { + source: '/docs/guides/advanced-federation', + destination: + 'https://learn.hashicorp.com/consul/day-2-operations/advanced-federation', + permanent: true, + }, + { + source: '/docs/guides/datacenters', + destination: + 'https://learn.hashicorp.com/consul/security-networking/datacenters', + permanent: true, + }, + { + source: '/docs/guides/geo-failover', + destination: + 'https://learn.hashicorp.com/consul/developer-discovery/geo-failover', + permanent: true, + }, + { + source: '/docs/guides/leader-election', + destination: + 'https://learn.hashicorp.com/consul/developer-configuration/elections', + permanent: true, + }, + { + source: '/docs/guides/monitoring-telegraf', + destination: 'https://learn.hashicorp.com/consul/integrations/telegraf', + permanent: true, + }, + { + source: '/docs/guides/network-segments', + destination: + 'https://learn.hashicorp.com/consul/day-2-operations/network-segments', + permanent: true, + }, + { + source: '/docs/guides/semaphore', + destination: + 'https://learn.hashicorp.com/consul/developer-configuration/semaphore', + permanent: true, + }, + { + source: '/docs/guides/windows-guide', + destination: 'https://learn.hashicorp.com/consul/datacenter-deploy/windows', + permanent: true, + }, + { + source: '/docs/guides/consul-containers', + destination: 'https://hub.docker.com/_/consul', + permanent: true, + }, + { + source: '/docs/guides/kubernetes-reference', + destination: + 'https://learn.hashicorp.com/consul/day-1-operations/kubernetes-reference', + permanent: true, + }, + { + source: '/docs/guides/outage', + destination: 'https://learn.hashicorp.com/consul/day-2-operations/outage', + permanent: true, + }, + { + source: '/docs/platform/k8s/minikube', + destination: 'https://learn.hashicorp.com/consul/kubernetes/minikube', + permanent: true, + }, + { + source: '/docs/platform/k8s/aks', + destination: 'https://learn.hashicorp.com/consul/kubernetes/azure-k8s', + permanent: true, + }, + { + source: '/docs/platform/k8s/eks', + destination: 'https://learn.hashicorp.com/consul/kubernetes/aws-k8s', + permanent: true, + }, + { + source: '/docs/platform/k8s/gke', + destination: + 'https://learn.hashicorp.com/consul/kubernetes/google-cloud-k8s', + permanent: true, + }, + { + source: '/intro/getting-started', + destination: + 'https://learn.hashicorp.com/consul?track=getting-started#getting-started', + permanent: true, + }, + { + source: '/intro/getting-started/:path*', + destination: 'https://learn.hashicorp.com/consul/getting-started/:path*', + permanent: true, + }, + // Replatforming redirects + { source: '/guides', destination: '/docs/guides', permanent: true }, + { source: '/api/acl/acl', destination: '/api-docs/acl', permanent: true }, + { + source: '/api-docs/features', + destination: '/api-docs/features/consistency', + permanent: true, + }, + { + source: '/docs/upgrade-specific', + destination: '/docs/upgrading/upgrade-specific', + permanent: true, + }, + { + source: '/docs/compatibility', + destination: '/docs/upgrading/compatibility', + permanent: true, + }, + { + source: '/docs/commands/acl/role/create', + destination: '/commands/acl/role/create', + permanent: true, + }, + { + source: '/docs/commands/acl/role/delete', + destination: '/commands/acl/role/delete', + permanent: true, + }, + { + source: '/docs/commands/acl/role/list', + destination: '/commands/acl/role/list', + permanent: true, + }, + { + source: '/docs/commands/acl/role/read', + destination: '/commands/acl/role/read', + permanent: true, + }, + { + source: '/docs/commands/acl/role/update', + destination: '/commands/acl/role/update', + permanent: true, + }, + { source: '/docs/agent/basics', destination: '/docs/agent', permanent: true }, + { + source: '/docs/agent/config_entries', + destination: '/docs/agent/config-entries', + permanent: true, + }, + { + source: '/docs/acl/acl-auth-methods', + destination: '/docs/acl/auth-methods', + permanent: true, + }, + { + source: '/docs/connect/platform/nomad', + destination: '/docs/connect/nomad', + permanent: true, + }, + { + source: '/docs/platform/k8s/run', + destination: '/docs/k8s/installation/install', + permanent: true, + }, + { + source: '/docs/platform/k8s/consul-enterprise', + destination: + '/docs/k8s/installation/deployment-configurations/consul-enterprise', + permanent: true, + }, + { + source: '/docs/platform/k8s/clients-outside-kubernetes', + destination: + '/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes', + permanent: true, + }, + { + source: '/docs/platform/k8s/servers-outside-kubernetes', + destination: + '/docs/k8s/installation/deployment-configurations/servers-outside-kubernetes', + permanent: true, + }, + { + source: '/docs/platform/k8s/predefined-pvcs', + destination: '/docs/k8s/installation/platforms/self-hosted-kubernetes', + permanent: true, + }, + { + source: '/docs/platform/k8s/operations', + destination: '/docs/k8s/operations', + permanent: true, + }, + { + source: '/docs/platform/k8s/upgrading', + destination: '/docs/k8s/operations/upgrading', + permanent: true, + }, + { + source: '/docs/platform/k8s/tls-on-existing-cluster', + destination: '/docs/k8s/operations/tls-on-existing-cluster', + permanent: true, + }, + { + source: '/docs/platform/k8s/uninstalling', + destination: '/docs/k8s/operations/upgrading', + permanent: true, + }, + { + source: '/docs/platform/k8s/:path*', + destination: '/docs/k8s/:path*', + permanent: true, + }, + { + source: '/docs/nia/installation/configuration', + destination: '/docs/nia/configuration', + permanent: true, + }, + { + source: '/use-cases/network-middleware-automation', + destination: '/use-cases/network-infrastructure-automation', + permanent: true, + }, + // disallow '.html' or '/index.html' in favor of cleaner, simpler paths + { source: '/:path*/index', destination: '/:path*', permanent: true }, + { source: '/:path*.html', destination: '/:path*', permanent: true }, +] diff --git a/website/vercel.json b/website/vercel.json new file mode 100644 index 0000000000..0e6117e609 --- /dev/null +++ b/website/vercel.json @@ -0,0 +1,7 @@ +{ + "version": 2, + "public": true, + "github": { + "silent": true + } +}