Diagram/Kroki: Difference between revisions
Jump to navigation
Jump to search
Created page with "==References== {|class='wikitable mw-collapsible' style='width:100%;margin:3px 0' !scope='col' style='text-align:left' colspan='3'| References |- |valign='top' style='width:33%'| * Diagram » Kroki » Mermaid * Helm » Kroki |valign='top' style='width:34%'| |valign='top' style='width:33%'| |}" |
|||
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{|class='wikitable' style='width:100%;margin:-11px 0 6px 0' | |||
|valign='top'| | |||
<syntaxhighlight style='margin:3px 0' lang='bash'> | |||
cat <<'EXE' | sudo bash | |||
KROKI_ARCH="$(echo "$(uname -s)_$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')" | |||
KROKI_HOME="/opt/cli/$(echo "restic-$(uname -s)-$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')" | |||
KROKI_VERSION=$(curl -s https://api.github.com/repos/yuzutech/kroki-cli/releases/latest | grep -Po '"tag_name": "v\K[^"]*') | |||
curl -fsSLo kroki.tar.gz https://github.com/yuzutech/kroki-cli/releases/download/v${KROKI_VERSION}/kroki-cli_${KROKI_VERSION}_${KROKI_ARCH}.tar.gz | |||
tar xf kroki.tar.gz kroki && install kroki /usr/local/bin | |||
rm -rf kroki.tar.gz kroki | |||
EXE | |||
kroki version | |||
which kroki | |||
</syntaxhighlight> | |||
|} | |||
==Kroki » Config== | |||
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Kroki » Config | |||
|- | |||
|valign='top' colspan='2'| | |||
<syntaxhighlight style='margin:3px 0' lang='yaml'> | |||
cat <<'YML' | tee ${HOME}/kroki.yml >/dev/null | |||
--- | |||
endpoint: https://kroki.shahed.biz.ops | |||
timeout: 30s | |||
YML | |||
</syntaxhighlight> | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight style='margin:3px 0' lang='yaml'> | |||
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode /dev/stdin | |||
--- | |||
config: | |||
theme: forest | |||
--- | |||
graph TD | |||
A[Client] --> B[Ingress] | |||
B --> C[Kroki] | |||
C --> D[Mermaid Renderer] | |||
MMD | |||
)" | |||
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight style='margin:3px 0' lang='yaml'> | |||
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode - | |||
--- | |||
config: | |||
theme: neutral | |||
--- | |||
graph TD | |||
A[Client] --> B[Ingress] | |||
B --> C[Kroki] | |||
C --> D[Mermaid Renderer] | |||
MMD | |||
)" | |||
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
</syntaxhighlight> | |||
|} | |||
==Kroki » Cloud== | |||
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Kroki » Cloud | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight style='margin:3px 0' lang='yaml'> | |||
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode /dev/stdin | |||
--- | |||
config: | |||
theme: dark | |||
--- | |||
flowchart TB | |||
Internet((Internet)) | |||
Cloudflare[Cloudflare Edge<br/>Argo Tunnel] | |||
subgraph AWS["AWS Region"] | |||
subgraph VPC["VPC (Private Network 10.0.0.0/16)"] | |||
IGW[Internet Gateway] | |||
subgraph Subnet["Private Subnet 10.0.1.0/24"] | |||
EC2A[EC2 Instance 1<br/>cloudflared] | |||
EC2B[EC2 Instance 2<br/>cloudflared] | |||
EC2C[EC2 Instance 3<br/>cloudflared] | |||
end | |||
SG[Security Group<br/>Inbound: 80,443<br/>No SSH] | |||
end | |||
end | |||
Internet -->|HTTP/HTTPS 80,443| Cloudflare | |||
Cloudflare -->|Zero Trust| EC2A | |||
Cloudflare -->|Zero Trust| EC2B | |||
Cloudflare -->|Zero Trust| EC2C | |||
IGW -->|80/443 Only| Subnet | |||
EC2A -.->|Outbound TLS| Cloudflare | |||
EC2B -.->|Outbound TLS| Cloudflare | |||
EC2C -.->|Outbound TLS| Cloudflare | |||
SG --- EC2A | |||
SG --- EC2B | |||
SG --- EC2C | |||
PG --- EC2A | |||
PG --- EC2B | |||
PG --- EC2C | |||
MMD | |||
)" | |||
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 & | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
|} | |||
==References== | ==References== | ||
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0' | {|class='wikitable mw-collapsible' style='width:100%;margin:3px 0' | ||
| Line 6: | Line 130: | ||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
* [[Diagram/Kroki/Mermaid|Diagram » Kroki » Mermaid]] | * [[Diagram/Kroki/Mermaid|Diagram » Kroki » Mermaid]] | ||
* [https://www.mermaidchart.com/play Mermaid » Chart » Play] | |||
* [https://mermaid.live/edit Mermaid » Chart » Edit] | |||
* [[Helm/Kroki|Helm » Kroki]] | * [[Helm/Kroki|Helm » Kroki]] | ||
* [[Diagram]] | |||
|valign='top' style='width:34%'| | |valign='top' style='width:34%'| | ||
* [https://github.com/CptLausebaer/mediawiki-kroki-extension/releases MediaWiki » Extension » Kroki » Releases] | |||
* [https://www.mediawiki.org/wiki/Extension:Kroki MediaWiki » Extension » Kroki] | |||
* [[Special:Version|MediaWiki » Version]] | |||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
|} | |} | ||
Revision as of 14:35, 7 January 2026
cat <<'EXE' | sudo bash
KROKI_ARCH="$(echo "$(uname -s)_$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')"
KROKI_HOME="/opt/cli/$(echo "restic-$(uname -s)-$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')"
KROKI_VERSION=$(curl -s https://api.github.com/repos/yuzutech/kroki-cli/releases/latest | grep -Po '"tag_name": "v\K[^"]*')
curl -fsSLo kroki.tar.gz https://github.com/yuzutech/kroki-cli/releases/download/v${KROKI_VERSION}/kroki-cli_${KROKI_VERSION}_${KROKI_ARCH}.tar.gz
tar xf kroki.tar.gz kroki && install kroki /usr/local/bin
rm -rf kroki.tar.gz kroki
EXE
kroki version
which kroki
|
Kroki » Config
|
Kroki » Config | |
|---|---|
cat <<'YML' | tee ${HOME}/kroki.yml >/dev/null
---
endpoint: https://kroki.shahed.biz.ops
timeout: 30s
YML
| |
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode /dev/stdin
---
config:
theme: forest
---
graph TD
A[Client] --> B[Ingress]
B --> C[Kroki]
C --> D[Mermaid Renderer]
MMD
)"
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
|
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode -
---
config:
theme: neutral
---
graph TD
A[Client] --> B[Ingress]
B --> C[Kroki]
C --> D[Mermaid Renderer]
MMD
)"
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
|
Kroki » Cloud
|
Kroki » Cloud | |
|---|---|
BASE64_SCHEME="$(cat <<-'MMD' | kroki encode /dev/stdin
---
config:
theme: dark
---
flowchart TB
Internet((Internet))
Cloudflare[Cloudflare Edge<br/>Argo Tunnel]
subgraph AWS["AWS Region"]
subgraph VPC["VPC (Private Network 10.0.0.0/16)"]
IGW[Internet Gateway]
subgraph Subnet["Private Subnet 10.0.1.0/24"]
EC2A[EC2 Instance 1<br/>cloudflared]
EC2B[EC2 Instance 2<br/>cloudflared]
EC2C[EC2 Instance 3<br/>cloudflared]
end
SG[Security Group<br/>Inbound: 80,443<br/>No SSH]
end
end
Internet -->|HTTP/HTTPS 80,443| Cloudflare
Cloudflare -->|Zero Trust| EC2A
Cloudflare -->|Zero Trust| EC2B
Cloudflare -->|Zero Trust| EC2C
IGW -->|80/443 Only| Subnet
EC2A -.->|Outbound TLS| Cloudflare
EC2B -.->|Outbound TLS| Cloudflare
EC2C -.->|Outbound TLS| Cloudflare
SG --- EC2A
SG --- EC2B
SG --- EC2C
PG --- EC2A
PG --- EC2B
PG --- EC2C
MMD
)"
setsid open https://kroki.shahed.biz.ops/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
setsid open https://kroki.io/mermaid/svg/${BASE64_SCHEME} >/dev/null 2>&1 &
|
|
References
|
References | ||
|---|---|---|