Skip to content

Commit

Permalink
docs: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Jun 15, 2020
1 parent 003401c commit 68f616e
Show file tree
Hide file tree
Showing 35 changed files with 337 additions and 254 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/.idea
/build-test
/dist
/dist
/docs/vendor
/docs/Gemfile*
/docs/.bundle
/docs/_site
/docs/.jekyll-cache
4 changes: 2 additions & 2 deletions assets/bindata.go
Git LFS file not shown
2 changes: 1 addition & 1 deletion clients/python/lambda_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from dataclasses import dataclass

from base64 import decodebytes, encodebytes
from typing import Any, List, Optional
from base64 import decodebytes, encodebytes



Expand Down
13 changes: 10 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
theme: jekyll-theme-minimal
remote_theme: pmarsceill/just-the-docs
title: Trusted CGI
url: "https://trusted-cgi.reddec.net"
description: Lightweight self-hosted lambda/applications/cgi/serverless-functions engine
logo: assets/logo.svg
show_downloads: true
logo: /assets/logo.svg
permalink: pretty
show_downloads: true
aux_links:
"reddec":
- "https://reddec.net"
"GitHub":
- "//github.com/reddec/trusted-cgi"
94 changes: 0 additions & 94 deletions docs/_layouts/default.html

This file was deleted.

6 changes: 6 additions & 0 deletions docs/administrating/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: default
title: Administrating
nav_order: 3
has_children: true
---
7 changes: 7 additions & 0 deletions docs/installation.md → docs/administrating/installation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
layout: default
title: Installation
parent: Administrating
nav_order: 1
---
{:toc:}
# Install

TL;DR;
Expand Down
11 changes: 11 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: default
title: API
nav_order: 700
has_children: true
---

API for the platform. Based on [JSON-RPC 2.0](https://www.jsonrpc.org/specification).

Documentation for the API is autogenerated. See `clients` directory in a source root for pre-built
clients.
6 changes: 6 additions & 0 deletions docs/api/lambda_api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
layout: default
title: LambdaAPI
parent: API
---

# LambdaAPI

API for lambdas
Expand Down
6 changes: 6 additions & 0 deletions docs/api/project_api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
layout: default
title: ProjectAPI
parent: API
---

# ProjectAPI

API for global project
Expand Down
6 changes: 6 additions & 0 deletions docs/api/user_api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
layout: default
title: UserAPI
parent: API
---

# UserAPI

User/admin profile API
Expand Down
53 changes: 53 additions & 0 deletions docs/cgi-ctl/download.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
layout: default
title: download
parent: Control util
nav_order: 200
---
## download

From `0.3.1`

Download the lambda content from a remote instance of `trusted-cgi`.

```
Usage:
cgi-ctl [OPTIONS] download [download-OPTIONS]
Help Options:
-h, --help Show this help message
[download command options]
-l, --login= Login name (default: admin) [$LOGIN]
-p, --password= Password (default: admin) [$PASSWORD]
-P, --ask-pass Get password from stdin [$ASK_PASS]
-u, --url= Trusted-CGI endpoint (default: http://127.0.0.1:3434/) [$URL]
-i, --uid= Lambda UID [$UID]
-o, --output= Output data (- means stdout, empty means as UID) [$OUTPUT]
```

**Example 1** (from local dev instance, lambda `e0ed902f-4a9c-4c29-870d-f343f330b6ab`):

```
cgi-ctl download -i e0ed902f-4a9c-4c29-870d-f343f330b6ab
```

will create `e0ed902f-4a9c-4c29-870d-f343f330b6ab.tar.gz` archive.


**Example 2** (from the remote instance, same lambda):

```
cgi-ctl download -i e0ed902f-4a9c-4c29-870d-f343f330b6ab --url https://example.com/ -P
```

will ask password for `admin` user and then download archive

**Example 3** (from the remote instance, same lambda):

```
cgi-ctl download -i e0ed902f-4a9c-4c29-870d-f343f330b6ab --url https://example.com/ -P -o - | tar zxf -
```

will ask password for `admin` user, download archive and unpack to current directory

13 changes: 13 additions & 0 deletions docs/cgi-ctl/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
title: Control util
nav_order: 600
has_children: true
---

`cgi-ctl` command aims to be a tool for helping developers interact with the platform without web UI.

`cgi-ctl` includes into distribution starting from version 0.3.1 and could be obtained independently
via source code or pre-built binary ([see installation](../administrating/installation))

Always use `cgi-ctl --help` for actual help.
27 changes: 27 additions & 0 deletions docs/cgi-ctl/init_bare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: default
title: init bare
parent: Control util
nav_order: 1
---
## init bare

From `0.3.0`

Initialize a basic lambda in a current directory.

```
Usage:
cgi-ctl [OPTIONS] init bare [bare-OPTIONS]
Help Options:
-h, --help Show this help message
[bare command options]
--git Enable Git [$GIT]
-d, --description= Description (default: Bare project) [$DESCRIPTION]
-P, --private Mark as private [$PRIVATE]
-t, --time-limit= Time limit for execution (default: 10s) [$TIME_LIMIT]
-p, --max-payload= Maximum payload (default: 8192) [$MAX_PAYLOAD]
```
39 changes: 39 additions & 0 deletions docs/cgi-ctl/upload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: default
title: upload
parent: Control util
nav_order: 201
---
## upload

From `0.3.1`

Upload the lambda content from the current directory to a remote instance of `trusted-cgi`.

Files defined in `.cgiignore` file will be ignored (uses `tar --exclude-form` syntax).

```
Usage:
cgi-ctl [OPTIONS] upload [upload-OPTIONS]
Help Options:
-h, --help Show this help message
[upload command options]
-l, --login= Login name (default: admin) [$LOGIN]
-p, --password= Password (default: admin) [$PASSWORD]
-P, --ask-pass Get password from stdin [$ASK_PASS]
-u, --url= Trusted-CGI endpoint (default: http://127.0.0.1:3434/) [$URL]
-o, --uid= Lambda UID [$UID]
--input= Directory (default: .) [$INPUT]
```


**Example 1** (lambda `e0ed902f-4a9c-4c29-870d-f343f330b6ab`)

```
cgi-ctl upload -o e0ed902f-4a9c-4c29-870d-f343f330b6ab --url https://example.com/ -P
```


will ask password for `admin` user, make archive and upload to the instance
Loading

0 comments on commit 68f616e

Please sign in to comment.