Skip to content

Commit

Permalink
add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwiterrion committed Nov 16, 2023
1 parent ce597c5 commit d69d73b
Show file tree
Hide file tree
Showing 15 changed files with 154 additions and 6 deletions.
62 changes: 62 additions & 0 deletions docs/documentation/app/builder/environment-variables/_page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import Badges from '../../../components/Badges'

# Environment variables

Wasmo Builder is fully configurable and the only way to configure it is to use the environment variables.

## Storage <Badges values={['STOS3', 'DOCKER_S3', 'LOCAL']} raw />

Wasmo Builder can be run on three differents ways:

- `STORAGE=S3`: Use a remote S3 to store generated Wasm binaries. Can use the Builder UI for editing plugins.

- `STORAGE=DOCKER_S3`: Use a Docker remote S3 to store generated Wasm binaries. Can use the Builder UI for editing plugins.

Both `S3` and `DOCKER_S3` configuration must used the related variables :
```
# required
STORAGE=<S3|DOCKER_S3>
S3_ENDPOINT=<value should start with scheme>
S3_BUCKET=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=<DEFAULT 'us-east-1'>
# optional
S3_FORCE_PATH_STYLE=<DEFAULT false>
```

- `STORAGE=LOCAL`: Use the filesystem to store generated Wasm binaries. The Builder UI is not available with this storage type. You should use this
storage if you want to quickly start an instance and only use the Wasmo CLI. The `local` storage
involves setting an interval to the cleanup job. The job removes binaries with outdated dates.

```
# required
STORAGE=LOCAL
# optional
LOCAL_WASM_JOB_CLEANING=<DEFAULT 60 * 60 * 1000> # 1 hour
```

## Pairing with Otoroshi



## Using the CLI

Wasmo Builder can be called by its own UI or by a Wasmo CLI. To secure calls, Wasmo CLI must send some headers.
These values must be equal between Wasmo Builder and Wasmo CLI and will be used by Wasmo CLI when calling the builder.

``` Query
POST /build HTTP/1.1
...
<CLI_AUTHORIZATION_HEADER>: <CLI_AUTHORIZATION>
```

```
# required
CLI_AUTHORIZATION=
# optional
CLI_AUTHORIZATION_HEADER=<DEFAULT 'Authorization'>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Builder - Environment variables',
}

export default Page;
23 changes: 23 additions & 0 deletions docs/documentation/app/builder/environment-variables/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client"

import Layout from '@/components/Layout';
import Page from './_page.mdx';

export default function Home() {

return <Layout
metadata={{
href: '/builder/environment-variables'
}}
previous={{
href: "/builder/your-first-plugin",
title: "Your first plugin"
}}
next={{
href: "/builder/plugin-structure",
title: "Plugin Structure"
}}>
<Page />
</Layout>

}
7 changes: 7 additions & 0 deletions docs/documentation/app/builder/getting-started/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Builder - Getting started',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/builder/overview/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Builder - Overview',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/builder/plugin-structure/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Builder - Plugin Structure',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/builder/ui/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Builder - UI',
}

export default Page;
2 changes: 1 addition & 1 deletion docs/documentation/app/builder/your-first-plugin/layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Wasmo - Your first plugin',
title: 'Builder - Your first plugin',
}

export default Page;
4 changes: 2 additions & 2 deletions docs/documentation/app/builder/your-first-plugin/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default function Home() {
title: "Builder - Overview"
}}
next={{
href: "/builder/plugin-structure",
title: "Plugin Structure"
href: "/builder/environment-variables",
title: "Environment variables"
}}>
<Page />
</Layout>
Expand Down
7 changes: 7 additions & 0 deletions docs/documentation/app/cli/configuration-file/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'CLI - Configuration file',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/cli/core-commands/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'CLI - Core commands',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/cli/getting-started/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'CLI - Getting started',
}

export default Page;
7 changes: 7 additions & 0 deletions docs/documentation/app/integrations/otoroshi/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Page from './page';

export const metadata = {
title: 'Integrations - Otoroshi',
}

export default Page;
4 changes: 2 additions & 2 deletions docs/documentation/components/Badges.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Badges({ values }) {
export default function Badges({ values, raw }) {
return <div className="inline-flex ms-6 flex items-center mt-2" style={{ gap: '.5rem' }}>
{values.map(value => <span key={value} className="whitespace-nowrap rounded-full bg-purple-100 px-2.5 py-0.5 text-sm text-purple-700">
{`<${value}>`}
{!raw ? `<${value}>` : value}
</span>)}
</div>
}
2 changes: 1 addition & 1 deletion docs/documentation/components/Sidebar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"
const LINKS = {
Builder: ["Overview", "Getting started", "Your first plugin", "Plugin Structure", 'UI'],
Builder: ["Overview", "Getting started", "Your first plugin", "Environment Variables", "Plugin Structure", 'UI'],
CLI: ["Getting started", "Core commands", "Configuration file"],
Integrations: ["Otoroshi"],
}
Expand Down

0 comments on commit d69d73b

Please sign in to comment.