Merge branch 'master' into process-data
commit
6508efc909
|
@ -0,0 +1,65 @@
|
|||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/node:latest
|
||||
environment:
|
||||
HUGO_VERSION: "0.53"
|
||||
S3DEPLOY_VERSION: "2.3.0"
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- install-v1-{{ checksum ".circleci/config.yml" }}
|
||||
- install-v1-
|
||||
- run:
|
||||
name: Make bin folder
|
||||
command: mkdir -p $HOME/bin
|
||||
- run:
|
||||
name: Install Hugo
|
||||
command: ./deploy/ci-install-hugo.sh
|
||||
- run:
|
||||
name: Install s3deploy
|
||||
command: ./deploy/ci-install-s3deploy.sh
|
||||
- run:
|
||||
name: Install NPM dependencies
|
||||
command: sudo npm i -g postcss-cli autoprefixer
|
||||
- save_cache:
|
||||
key: install-v1-{{ checksum ".circleci/config.yml" }}
|
||||
paths:
|
||||
- /home/circleci/bin
|
||||
- run:
|
||||
name: Hugo Build
|
||||
command: $HOME/bin/hugo -v --destination workspace/public
|
||||
- persist_to_workspace:
|
||||
root: workspace
|
||||
paths:
|
||||
- public
|
||||
|
||||
deploy:
|
||||
docker:
|
||||
- image: circleci/golang:latest
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- install-v1-{{ checksum ".circleci/config.yml" }}
|
||||
- install-v1-
|
||||
- attach_workspace:
|
||||
at: workspace
|
||||
- run:
|
||||
name: Deploy to S3
|
||||
command: $HOME/bin/s3deploy -source=workspace/public/ -bucket=$BUCKET -region=$REGION
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
jobs:
|
||||
- build
|
||||
- deploy:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
|
@ -1,7 +1,6 @@
|
|||
.DS_Store
|
||||
*~
|
||||
public
|
||||
deploy
|
||||
.*.swp
|
||||
node_modules
|
||||
*.log
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
routes:
|
||||
- route: "^.+\\.(js|css|svg|ttf|eot|woff|otf|png|jpg)$"
|
||||
# cache static assets for 20 years
|
||||
headers:
|
||||
Cache-Control: "max-age=630720000, no-transform, public"
|
||||
gzip: true
|
||||
- route: "^.+\\.(html|xml|json|js)$"
|
||||
gzip: true
|
|
@ -3,7 +3,7 @@ This is the repository contains the InfluxDB v2.x documentation that will be
|
|||
accessible at [docs.influxdata.com](https://docs.influxdata.com).
|
||||
|
||||
## Contributing
|
||||
We welcome and encourage community contributions to the InfluxData See our [Contribution guidelines](blob/master/CONTRIBUTING.md) for information
|
||||
We welcome and encourage community contributions to the InfluxData See our [Contribution guidelines](CONTRIBUTING.md) for information
|
||||
about contributing to the InfluxData documentation.
|
||||
|
||||
## Run the docs locally
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
h2,h3,h4,h5,h6 {
|
||||
& + .highlight pre { margin-top: .5rem; }
|
||||
& + .code-tabs-wrapper { margin-top: 0; }
|
||||
}
|
||||
h1 {
|
||||
font-family: $klavika;
|
||||
font-weight: 300;
|
||||
|
@ -67,36 +71,26 @@
|
|||
&:hover {
|
||||
color: $article-link-hover;
|
||||
}
|
||||
code {
|
||||
font-weight: normal;
|
||||
transition: color .2s;
|
||||
position: relative;
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border-style: solid;
|
||||
border-width: 0 .4rem .4rem 0;
|
||||
border-color: transparent rgba($article-code, .35) transparent transparent;
|
||||
transition: border .2s;
|
||||
}
|
||||
&:hover {
|
||||
color: $article-code-hover;
|
||||
&:after {
|
||||
border-color: transparent $article-code-hover transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
strong {
|
||||
color: $article-bold;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
margin-bottom: 2rem;
|
||||
border-radius: ($border-radius * 1.5);
|
||||
box-shadow: 1px 3px 10px $article-shadow;
|
||||
}
|
||||
|
||||
hr {
|
||||
border-width: 1px 0 0;
|
||||
border-color: $article-hr;
|
||||
border-style: solid;
|
||||
margin: 1.85rem 0 1.75rem;
|
||||
}
|
||||
|
||||
//////////////////////////////////// Lists ////////////////////////////////////
|
||||
|
||||
ol, ul {
|
||||
|
@ -107,6 +101,7 @@
|
|||
list-style-type: disc;
|
||||
li:before{
|
||||
content: "" !important;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,6 +131,7 @@
|
|||
|
||||
li {
|
||||
margin: .25rem 0;
|
||||
p:only-child { margin-bottom: 0; }
|
||||
}
|
||||
|
||||
//////////////////////////////////// Code ////////////////////////////////////
|
||||
|
@ -145,15 +141,46 @@
|
|||
font-family: 'Inconsolata', monospace;
|
||||
}
|
||||
|
||||
code {
|
||||
p code {
|
||||
padding: .15rem .45rem .25rem;
|
||||
border-radius: $border-radius;
|
||||
color: $article-code;
|
||||
white-space: nowrap;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
a {
|
||||
code {
|
||||
font-weight: normal;
|
||||
transition: color .2s;
|
||||
position: relative;
|
||||
color: $article-code-link;
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
right: 0;
|
||||
border-style: solid;
|
||||
border-width: 0 .4rem .4rem 0;
|
||||
border-color: transparent rgba($article-code-link, .35) transparent transparent;
|
||||
transition: border .2s;
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
code {
|
||||
color: $article-code-link-hover;
|
||||
&:after {
|
||||
border-color: transparent $article-link-hover transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pre {
|
||||
margin: 2rem 0 3rem;
|
||||
padding: 1.5rem 1.5rem 1.25rem;
|
||||
margin: 2rem 0 2.25rem;
|
||||
padding: 1.75rem 1.75rem 1.25rem;
|
||||
border-radius: $border-radius;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
|
@ -548,7 +575,7 @@
|
|||
h4 { font-size: 1.3rem; }
|
||||
|
||||
pre {
|
||||
padding: 1.2em;
|
||||
padding: 1.2em 1.2em .75rem;
|
||||
}
|
||||
|
||||
blockquote,
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
.error-page {
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
vertical-align: middle;
|
||||
justify-content: space-around;
|
||||
|
||||
.error-content {
|
||||
margin-top: 10vh;
|
||||
max-width: 310px;
|
||||
}
|
||||
|
||||
.error-code {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin: 0 auto;
|
||||
width: 15rem;
|
||||
height: 15rem;
|
||||
max-width: 80vw;
|
||||
max-height: 80vw;
|
||||
border-radius: 50%;
|
||||
box-shadow: 5px 5px 30px $sidebar-search-shadow;
|
||||
|
||||
.error-code-border {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
border: 2px solid rgba($article-link, .5);
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: $klavika;
|
||||
color: $article-link;
|
||||
font-size: 5rem;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: $article-link;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
&:hover {
|
||||
color: $article-link-hover;
|
||||
}
|
||||
}
|
||||
|
||||
.wayfinding {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-content: center;
|
||||
margin: 2rem 0 1.5rem;
|
||||
|
||||
.btn {
|
||||
display: block;
|
||||
flex-grow: 1;
|
||||
margin-right: 4px;
|
||||
padding: .75rem 1rem;
|
||||
border-radius: $border-radius;
|
||||
background: $error-page-btn;
|
||||
text-align: center;
|
||||
color: $error-page-btn-text;
|
||||
&:hover {
|
||||
background: $error-page-btn-hover;
|
||||
color: $error-page-btn-hover-text;
|
||||
}
|
||||
&.back:before {
|
||||
content: "\e90a";
|
||||
font-family: "icomoon";
|
||||
margin-right: .35rem;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
// text-align: center;
|
||||
color: $article-text;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -20,24 +20,25 @@
|
|||
}
|
||||
|
||||
input {
|
||||
background: $article-bg;
|
||||
background: $sidebar-search-bg;
|
||||
border-radius: $border-radius;
|
||||
border: 1px solid $sidebar-search-border;
|
||||
border: 1px solid $sidebar-search-bg;
|
||||
padding: .5em 2.15rem .5rem .5rem;
|
||||
width: 100%;
|
||||
color: $article-text;
|
||||
transition-property: border, box-shadow;
|
||||
transition-duration: .2s;
|
||||
box-shadow: 2px 2px 6px $sidebar-search-shadow;
|
||||
&:focus {
|
||||
outline: none;
|
||||
border: 1px solid $sidebar-search-highlight;
|
||||
box-shadow: 0px 0px 7px rgba($sidebar-search-highlight, .65);
|
||||
border-color: $sidebar-search-highlight;
|
||||
box-shadow: 1px 1px 10px rgba($sidebar-search-highlight, .5);
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
&::placeholder {
|
||||
font-family: 'Roboto';
|
||||
font-weight: 500;
|
||||
color: rgba($article-text, .35);
|
||||
color: rgba($article-text, .45);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,4 +16,5 @@
|
|||
"layouts/layout-sidebar-toggle",
|
||||
"layouts/layout-content-wrapper",
|
||||
"layouts/layout-article",
|
||||
"layouts/syntax-highlighting";
|
||||
"layouts/syntax-highlighting",
|
||||
"layouts/layout-error-page";
|
||||
|
|
|
@ -26,16 +26,18 @@ $theme-switch-light: inline-block !default;
|
|||
$theme-switch-dark: none !default;
|
||||
|
||||
// Sidebar
|
||||
$sidebar-search-border: $g5-pepper !default;
|
||||
$sidebar-search-bg: $g3-castle !default;
|
||||
$sidebar-search-shadow: #0F0F10 !default;
|
||||
$sidebar-search-highlight: $b-pool !default;
|
||||
|
||||
// Article Content
|
||||
$article-bg: $g3-castle !default;
|
||||
$article-heading: $g19-ghost !default;
|
||||
$article-text: $g14-chromium !default;
|
||||
$article-bold: $g19-ghost !default;
|
||||
$article-link: $b-pool !default;
|
||||
$article-bold: $g18-cloud !default;
|
||||
$article-link: #2aa3ff !default;
|
||||
$article-link-hover: $g20-white !default;
|
||||
$article-hr: $g6-smoke !default;
|
||||
$article-shadow: #191a1b !default;
|
||||
$article-note-shadow: #191a1b !default;
|
||||
$article-warn-shadow: #191a1b !default;
|
||||
|
@ -51,7 +53,8 @@ $article-code-accent5: #ff6db0 !default;
|
|||
$article-code-accent6: $b-pool !default;
|
||||
$article-code-accent7: #e90 !default;
|
||||
$article-code-select: $b-pool !default;
|
||||
$article-code-hover: $g20-white !default;
|
||||
$article-code-link: #2aa3ff !default;
|
||||
$article-code-link-hover: $g20-white !default;
|
||||
$article-code-scrollbar: $g7-graphite !default;
|
||||
|
||||
// Article Tables
|
||||
|
@ -122,3 +125,9 @@ $nav-border: $g5-pepper !default;
|
|||
$nav-toggle: $g16-pearl !default;
|
||||
$nav-toggle-hover: $g16-pearl !default;
|
||||
$nav-toggle-bg-hover: $b-ocean !default;
|
||||
|
||||
// Error Page Colors
|
||||
$error-page-btn: $b-ocean !default;
|
||||
$error-page-btn-text: $g20-white !default;
|
||||
$error-page-btn-hover: $g20-white !default;
|
||||
$error-page-btn-hover-text: $b-ocean !default;
|
||||
|
|
|
@ -25,8 +25,9 @@ $theme-switch-light: none;
|
|||
$theme-switch-dark: inline-block;
|
||||
|
||||
// Sidebar
|
||||
$sidebar-search-border: $g15-platinum;
|
||||
$sidebar-search-highlight: $b-pool;
|
||||
$sidebar-search-bg: $g20-white;
|
||||
$sidebar-search-shadow: $g14-chromium;
|
||||
$sidebar-search-highlight: $b-ocean;
|
||||
|
||||
// Article Content
|
||||
$article-bg: $g20-white;
|
||||
|
@ -36,6 +37,7 @@ $article-bold: $g8-storm;
|
|||
$article-link: $b-ocean;
|
||||
$article-link-hover: $gr-viridian;
|
||||
$article-shadow: #c8cdd0;
|
||||
$article-hr: $g15-platinum;
|
||||
$article-note-shadow: #8cb7ab;
|
||||
$article-warn-shadow: #b98a7d;
|
||||
|
||||
|
@ -50,7 +52,8 @@ $article-code-accent5: #e24bbb;
|
|||
$article-code-accent6: $b-ocean;
|
||||
$article-code-accent7: #e90;
|
||||
$article-code-select: $b-pool;
|
||||
$article-code-hover: $b-sapphire;
|
||||
$article-code-link: $b-sapphire;
|
||||
$article-code-link-hover: $gr-emerald;
|
||||
$article-code-scrollbar: $p-potassium;
|
||||
|
||||
// Article Tables
|
||||
|
@ -115,9 +118,15 @@ $article-tab-code-active-text: $p-star;
|
|||
// Left Navigation
|
||||
$nav-category: $b-ocean;
|
||||
$nav-category-hover: $gr-viridian;
|
||||
$nav-item: $g9-mountain;
|
||||
$nav-item-hover: $gr-viridian;
|
||||
$nav-item: $g10-wolf;
|
||||
$nav-item-hover: $b-ocean;
|
||||
$nav-border: $g14-chromium;
|
||||
$nav-toggle: $g9-mountain;
|
||||
$nav-toggle: $g20-white;
|
||||
$nav-toggle-hover: $g20-white;
|
||||
$nav-toggle-bg-hover: $b-ocean;
|
||||
|
||||
// Error Page Colors
|
||||
$error-page-btn: $b-ocean;
|
||||
$error-page-btn-text: $g20-white;
|
||||
$error-page-btn-hover: $b-pool;
|
||||
$error-page-btn-hover-text: $g20-white;
|
||||
|
|
|
@ -16,12 +16,12 @@ This is a paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nu
|
|||
|
||||
This is a paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc rutrum, metus id scelerisque euismod, erat ante suscipit nibh, ac congue enim risus id est. Etiam tristique nisi et tristique auctor. Morbi eu bibendum erat. Sed ullamcorper, dui id lobortis efficitur, mauris odio pharetra neque, vel tempor odio dolor blandit justo.
|
||||
|
||||
{{< code-tabs-wrapper >}}
|
||||
#### Here's a title for this codeblock
|
||||
{{% code-tabs-wrapper %}}
|
||||
{{% code-tabs %}}
|
||||
[Flux](#)
|
||||
[InfluxQL](#)
|
||||
{{% /code-tabs %}}
|
||||
|
||||
{{% code-tab-content %}}
|
||||
```js
|
||||
data = from(bucket: "telegraf/autogen")
|
||||
|
@ -39,7 +39,7 @@ FROM "telegraf"."autogen"."mem"
|
|||
WHERE time > now() - 15m
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
{{% /code-tabs-wrapper %}}
|
||||
|
||||
{{% enterprise %}}
|
||||
### h3 This is a header3
|
||||
|
@ -67,9 +67,16 @@ This is a paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nu
|
|||
|
||||
This is a paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc rutrum, metus id scelerisque euismod, erat ante suscipit nibh, ac congue enim risus id est. Etiam tristique nisi et tristique auctor. Morbi eu bibendum erat. Sed ullamcorper, dui id lobortis efficitur, mauris odio pharetra neque, vel tempor odio dolor blandit justo.This is a paragraph
|
||||
|
||||
---
|
||||
|
||||
There is a horizontal rule above and below this line.
|
||||
|
||||
---
|
||||
|
||||
#### Inline Styles
|
||||
This is an [inline link](#). This is `inline code`.
|
||||
This is an [`inline code link`](#) .
|
||||
This is an [`inline code link`](#).
|
||||
This is an [`inline code link` with text in the link](#).
|
||||
This is **bold**. This is _italic_.
|
||||
|
||||
- Unordered list line-item 1
|
||||
|
@ -134,6 +141,23 @@ avg_cpu
|
|||
|> yield()
|
||||
//
|
||||
```
|
||||
|
||||
###### Here's a codeblock with a title
|
||||
```js
|
||||
// This is a code block
|
||||
cpu = from(bucket:"telegraf/autogen")
|
||||
|> range(start:-30m)
|
||||
|> filter(fn:(r) => r._measurement == "cpu")
|
||||
|
||||
avg_cpu = cpu |> window(every:5m) |> mean()
|
||||
|
||||
avg_cpu
|
||||
|> group(none:true)
|
||||
|> yield()
|
||||
//
|
||||
```
|
||||
|
||||
|
||||
{{% enterprise %}}
|
||||
###### This is a table
|
||||
| Column 1 | Column 2 | Column 3 | Column 4 |
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Deploying the InfluxData Docs
|
||||
|
||||
Use the following command to deploy a CloudFormation stack using the template in this directory.
|
||||
|
||||
```sh
|
||||
aws cloudformation deploy \
|
||||
--template-file docs-website.yml \
|
||||
--stack-name="${STACK_NAME}" \
|
||||
--capabilities CAPABILITY_IAM \
|
||||
--no-execute-changeset \
|
||||
--parameter-overrides \
|
||||
AcmCertificateArn="${ACM_ARN}" \
|
||||
DomainName="${DOMAIN_NAME}"
|
||||
```
|
||||
|
||||
The `--no-execute-changeset` option will display the actions that will be taken. Remove the `--no-execute-changeset` option to actually deploy a change.
|
|
@ -0,0 +1,11 @@
|
|||
HUGO_DOWNLOAD=hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# Install Hugo if not already cached or upgrade an old version.
|
||||
if [ ! -e $HOME/bin/hugo ] || ! [[ `$HOME/bin/hugo version` =~ v${HUGO_VERSION} ]]; then
|
||||
wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_DOWNLOAD}
|
||||
tar xvzf ${HUGO_DOWNLOAD} hugo
|
||||
mv hugo $HOME/bin/hugo
|
||||
fi
|
|
@ -0,0 +1,11 @@
|
|||
S3DEPLOY_DOWNLOAD=s3deploy_${S3DEPLOY_VERSION}_Linux-64bit.tar.gz
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# Install s3deploy if not already cached or upgrade an old version.
|
||||
if [ ! -e $HOME/bin/s3deploy ] || ! [[ `$HOME/bin/s3deploy -V` =~ ${S3DEPLOY_VERSION} ]]; then
|
||||
wget https://github.com/bep/s3deploy/releases/download/v${S3DEPLOY_VERSION}/${S3DEPLOY_DOWNLOAD}
|
||||
tar xvzf ${S3DEPLOY_DOWNLOAD} s3deploy
|
||||
mv s3deploy $HOME/bin/s3deploy
|
||||
fi
|
|
@ -0,0 +1,269 @@
|
|||
###############################################################################
|
||||
### AWS Cloudformation Template
|
||||
### InfluxData Documentation Website Hosting and Deployment
|
||||
###############################################################################
|
||||
AWSTemplateFormatVersion: 2010-09-09
|
||||
Description: >
|
||||
Cloudformation template to stand up the AWS resources for hosting the
|
||||
InfluxData documentation static website created using Hugo. Cloudfront
|
||||
distribution is used to cache requests to an S3 bucket configured as a static
|
||||
website. A Lambda@Edge function rewrites requests with paths ending in
|
||||
index.html and requests to old v1 docs endpoints, which reside in a second
|
||||
bucket. Finally, a lambda is used to generate new versions of the docs using
|
||||
the GitHub source based on event and webhook triggers.
|
||||
|
||||
###############################################################################
|
||||
Parameters:
|
||||
###############################################################################
|
||||
|
||||
AcmCertificateArn:
|
||||
Type: String
|
||||
Description: >
|
||||
The ARN of the SSL certificate to use for the CloudFront
|
||||
distribution.
|
||||
|
||||
DomainName:
|
||||
Type: String
|
||||
Description: The docs website domain name.
|
||||
Default: dev.docs.influxdata.com
|
||||
|
||||
###############################################################################
|
||||
Outputs:
|
||||
###############################################################################
|
||||
|
||||
DocsProdBucketArn:
|
||||
Description: The ARN of the S3 bucket hosting the static content.
|
||||
Value: !GetAtt DocsV2Bucket.Arn
|
||||
|
||||
DocsCircleCIDeployAccessKeyId:
|
||||
Description: The access key ID for CircleCI deployment to S3.
|
||||
Value: !Ref DocsCircleCIDeployAccessKey
|
||||
|
||||
DocsCircleCIDeploySecretAccessKey:
|
||||
Description: The secret access key for CircleCI deployment to S3.
|
||||
Value: !GetAtt DocsCircleCIDeployAccessKey.SecretAccessKey
|
||||
|
||||
###############################################################################
|
||||
Resources:
|
||||
###############################################################################
|
||||
|
||||
DocsCloudFrontDistribution:
|
||||
Type: AWS::CloudFront::Distribution
|
||||
Description: The CDN for both V1 and V2 docs.
|
||||
Properties:
|
||||
DistributionConfig:
|
||||
Aliases:
|
||||
- !Ref DomainName
|
||||
DefaultCacheBehavior:
|
||||
Compress: true
|
||||
ForwardedValues:
|
||||
QueryString: false
|
||||
TargetOriginId: !Ref DocsV2Bucket
|
||||
ViewerProtocolPolicy: redirect-to-https
|
||||
LambdaFunctionAssociations:
|
||||
- EventType: origin-request
|
||||
LambdaFunctionARN: !Ref DocsOriginRequestRewriteLambdaVersion
|
||||
DefaultRootObject: index.html
|
||||
CustomErrorResponses:
|
||||
- ErrorCachingMinTTL: 300
|
||||
ErrorCode: 403
|
||||
ResponseCode: 404
|
||||
ResponsePagePath: /404.html
|
||||
Enabled: true
|
||||
HttpVersion: http2
|
||||
Origins:
|
||||
- DomainName:
|
||||
!Sub "${DocsV2Bucket}.s3.amazonaws.com"
|
||||
Id: !Ref DocsV2Bucket
|
||||
S3OriginConfig:
|
||||
OriginAccessIdentity:
|
||||
!Sub "origin-access-identity/cloudfront/${DocsCloudFrontOriginAccessIdentity}"
|
||||
- DomainName:
|
||||
!Sub "${DocsV1Bucket}.s3.amazonaws.com"
|
||||
Id: !Ref DocsV1Bucket
|
||||
S3OriginConfig:
|
||||
OriginAccessIdentity:
|
||||
!Sub "origin-access-identity/cloudfront/${DocsCloudFrontOriginAccessIdentity}"
|
||||
PriceClass: PriceClass_100
|
||||
ViewerCertificate:
|
||||
AcmCertificateArn: !Ref AcmCertificateArn
|
||||
MinimumProtocolVersion: TLSv1.1_2016
|
||||
SslSupportMethod: sni-only
|
||||
Tags:
|
||||
- Key: Domain
|
||||
Value: !Ref DomainName
|
||||
|
||||
DocsCloudFrontOriginAccessIdentity:
|
||||
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
|
||||
Properties:
|
||||
CloudFrontOriginAccessIdentityConfig:
|
||||
Comment: !Sub 'CloudFront Origin Access Identity for ${DomainName}'
|
||||
|
||||
DocsV2Bucket:
|
||||
Type: AWS::S3::Bucket
|
||||
Properties:
|
||||
BucketEncryption:
|
||||
ServerSideEncryptionConfiguration:
|
||||
-
|
||||
ServerSideEncryptionByDefault:
|
||||
SSEAlgorithm: AES256
|
||||
Tags:
|
||||
- Key: Domain
|
||||
Value: !Ref DomainName
|
||||
|
||||
DocsV2BucketPolicy:
|
||||
Type: AWS::S3::BucketPolicy
|
||||
Properties:
|
||||
Bucket: !Ref DocsV2Bucket
|
||||
PolicyDocument:
|
||||
Statement:
|
||||
-
|
||||
Effect: Allow
|
||||
Action:
|
||||
- s3:GetObject
|
||||
Resource: !Sub "arn:aws:s3:::${DocsV2Bucket}/*"
|
||||
Principal:
|
||||
CanonicalUser: !GetAtt DocsCloudFrontOriginAccessIdentity.S3CanonicalUserId
|
||||
|
||||
DocsV1Bucket:
|
||||
Type: AWS::S3::Bucket
|
||||
Properties:
|
||||
BucketEncryption:
|
||||
ServerSideEncryptionConfiguration:
|
||||
-
|
||||
ServerSideEncryptionByDefault:
|
||||
SSEAlgorithm: AES256
|
||||
Tags:
|
||||
- Key: Domain
|
||||
Value: !Ref DomainName
|
||||
|
||||
DocsV1BucketPolicy:
|
||||
Type: AWS::S3::BucketPolicy
|
||||
Properties:
|
||||
Bucket: !Ref DocsV1Bucket
|
||||
PolicyDocument:
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- s3:GetObject
|
||||
Resource: !Sub "arn:aws:s3:::${DocsV1Bucket}/*"
|
||||
Principal:
|
||||
CanonicalUser: !GetAtt DocsCloudFrontOriginAccessIdentity.S3CanonicalUserId
|
||||
|
||||
DocsOriginRequestRewriteLambda:
|
||||
Type: AWS::Lambda::Function
|
||||
Properties:
|
||||
Description: Lambda function performing request URI rewriting.
|
||||
Code:
|
||||
ZipFile: |
|
||||
const config = {
|
||||
suffix: '.html',
|
||||
appendToDirs: 'index.html',
|
||||
removeTrailingSlash: false,
|
||||
};
|
||||
|
||||
const regexSuffixless = /\/[a-z0-9]+([0-9\.]+)?$/; // e.g. "/some/page" but not "/", "/some/" or "/some.jpg"
|
||||
const regexTrailingSlash = /.+\/$/; // e.g. "/some/" or "/some/page/" but not root "/"
|
||||
|
||||
exports.handler = function handler(event, context, callback) {
|
||||
const { request } = event.Records[0].cf;
|
||||
const { uri } = request;
|
||||
const { suffix, appendToDirs, removeTrailingSlash } = config;
|
||||
|
||||
// Append ".html" to origin request
|
||||
if (suffix && uri.match(regexSuffixless)) {
|
||||
request.uri = uri + suffix;
|
||||
callback(null, request);
|
||||
return;
|
||||
}
|
||||
|
||||
// Append "index.html" to origin request
|
||||
if (appendToDirs && uri.match(regexTrailingSlash)) {
|
||||
request.uri = uri + appendToDirs;
|
||||
callback(null, request);
|
||||
return;
|
||||
}
|
||||
|
||||
// Redirect (301) non-root requests ending in "/" to URI without trailing slash
|
||||
if (removeTrailingSlash && uri.match(/.+\/$/)) {
|
||||
const response = {
|
||||
// body: '',
|
||||
// bodyEncoding: 'text',
|
||||
headers: {
|
||||
'location': [{
|
||||
key: 'Location',
|
||||
value: uri.slice(0, -1)
|
||||
}]
|
||||
},
|
||||
status: '301',
|
||||
statusDescription: 'Moved Permanently'
|
||||
};
|
||||
callback(null, response);
|
||||
return;
|
||||
}
|
||||
|
||||
// If nothing matches, return request unchanged
|
||||
callback(null, request);
|
||||
};
|
||||
Handler: index.handler
|
||||
MemorySize: 128
|
||||
Role: !Sub ${DocsOriginRequestRewriteLambdaRole.Arn}
|
||||
Runtime: nodejs8.10
|
||||
Tags:
|
||||
- Key: Domain
|
||||
Value: !Ref DomainName
|
||||
|
||||
DocsOriginRequestRewriteLambdaVersion:
|
||||
Type: AWS::Lambda::Version
|
||||
Properties:
|
||||
FunctionName: !Ref DocsOriginRequestRewriteLambda
|
||||
Description: !Sub "URL rewriting for ${DomainName}"
|
||||
|
||||
DocsOriginRequestRewriteLambdaRole:
|
||||
Type: AWS::IAM::Role
|
||||
Properties:
|
||||
AssumeRolePolicyDocument:
|
||||
Version: 2012-10-17
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action: sts:AssumeRole
|
||||
Principal:
|
||||
Service:
|
||||
- edgelambda.amazonaws.com
|
||||
- lambda.amazonaws.com
|
||||
ManagedPolicyArns:
|
||||
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
|
||||
|
||||
DocsCircleCIDeployUser:
|
||||
Type: AWS::IAM::User
|
||||
Properties:
|
||||
Policies:
|
||||
- PolicyName: giveaccesstoupdatedocsbuckets
|
||||
PolicyDocument:
|
||||
Version: 2012-10-17
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- s3:ListBucket
|
||||
- s3:GetBucketLocation
|
||||
Resource:
|
||||
- !Sub "arn:aws:s3:::${DocsV2Bucket}"
|
||||
- !Sub "arn:aws:s3:::${DocsV1Bucket}"
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- s3:PutObject
|
||||
- s3:PutObjectAcl
|
||||
- s3:DeleteObject
|
||||
Resource:
|
||||
- !Sub "arn:aws:s3:::${DocsV2Bucket}/*"
|
||||
- !Sub "arn:aws:s3:::${DocsV1Bucket}/*"
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- cloudfront:GetDistribution
|
||||
- cloudfront:CreateInvalidation
|
||||
Resource: !Sub "arn:aws:cloudfront::${AWS::AccountId}:distribution/${DocsCloudFrontDistribution}"
|
||||
|
||||
DocsCircleCIDeployAccessKey:
|
||||
Type: AWS::IAM::AccessKey
|
||||
Properties:
|
||||
UserName: !Ref DocsCircleCIDeployUser
|
|
@ -0,0 +1,34 @@
|
|||
{{ partial "header.html" . }}
|
||||
|
||||
<div class="error-page">
|
||||
<div class="error-content">
|
||||
<div class="error-code">
|
||||
<div class="error-code-border">
|
||||
<h1>404</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wayfinding">
|
||||
<a class="btn back" href="javascript:history.back()">Back</a>
|
||||
<a class="btn version">InfluxDB</a>
|
||||
</div>
|
||||
<p>Whoops! Looks like this page doesn't exist. If a link brought you here, <a href="https://github.com/influxdata/docs-v2/issues/new" target="_blank">let us know</a>. We'd like to fix it.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function getProjectVersion(urlPath) {
|
||||
if (/v[0-9][.][0-9]*/.test(urlPath)) { return urlPath.match(/v[0-9][.][0-9]*/)[0] }
|
||||
else { return undefined }
|
||||
}
|
||||
|
||||
var path = window.location.pathname
|
||||
var projectVersion = getProjectVersion(path)
|
||||
|
||||
if ( projectVersion != undefined ) {
|
||||
$('.btn.version').append(' ' + projectVersion).attr('href', '/' + projectVersion + '/');
|
||||
} else {
|
||||
$('.btn.version').hide()
|
||||
}
|
||||
</script>
|
||||
|
||||
{{ partial "footer.html" . }}
|
|
@ -5,6 +5,7 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="description" content="{{ if .Description }}{{ .Description }}. {{ end }}">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||
<title>{{ if .Params.seotitle }} {{ print .Params.seotitle " | " }} {{ else if .Title }} {{ print .Title " | " }} {{ end }}InfluxData Documentation</title>
|
||||
|
||||
{{ partial "header/stylesheets.html"}}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Loading…
Reference in New Issue