now it works

master
Ingolf Wagner 2021-09-05 15:08:40 +02:00
parent 83c8aaa239
commit d284712b57
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
10 changed files with 143 additions and 11 deletions

View File

@ -42,7 +42,7 @@ end
# #
# tasks for blockdiag files # tasks for blockdiag files
# #
Dir['static/**/*.diag'].each do |diag_file| Dir['src/images/**/*.diag'].each do |diag_file|
name = diag_file[0..-6] name = diag_file[0..-6]
svg_file = "#{name}.svg" svg_file = "#{name}.svg"
@ -64,7 +64,7 @@ end
# #
# tasks for nwdiag files # tasks for nwdiag files
# #
Dir['static/**/*.nwdiag'].each do |diag_file| Dir['src/images/**/*.nwdiag'].each do |diag_file|
name = diag_file[0..-8] name = diag_file[0..-8]
svg_file = "#{name}.svg" svg_file = "#{name}.svg"
@ -86,7 +86,7 @@ end
# #
# tasks for seqdiag files # tasks for seqdiag files
# #
Dir['static/**/*.seqdiag'].each do |diag_file| Dir['src/images/**/*.seqdiag'].each do |diag_file|
name = diag_file[0..-9] name = diag_file[0..-9]
svg_file = "#{name}.svg" svg_file = "#{name}.svg"
@ -108,7 +108,7 @@ end
# #
# tasks for actdiag files # tasks for actdiag files
# #
Dir['static/**/*.actdiag'].each do |diag_file| Dir['src/images/**/*.actdiag'].each do |diag_file|
name = diag_file[0..-9] name = diag_file[0..-9]
svg_file = "#{name}.svg" svg_file = "#{name}.svg"

View File

@ -35,10 +35,10 @@ and micromanage in the computer specific definitions.
## How to import ## How to import
You can use `fetchgit` to import it without downloading it yourself. You can use `fetchgit` to import it without downloading it yourself.
To find the newest `rev` and `sha256` just call
{{% note %}} ```shell
To find the newest `rev` and `sha256` just call `nix-shell -p nix-prefetch-git --run "nix-prefetch-git https://github.com/mrVanDalo/nixos-tinc.git"` nix-shell -p nix-prefetch-git --run "nix-prefetch-git https://github.com/mrVanDalo/nixos-tinc.git"
{{% /note %}} ```
``` ```
{pkgs, ... }: {pkgs, ... }:
@ -107,7 +107,9 @@ it will be the computer that connects all the other computer.
You can have multiple computers which are reachable from the internet You can have multiple computers which are reachable from the internet
but for this example we only have one. but for this example we only have one.
{{<figure src="/nixos/tinc/3computers.svg">}} {{< card >}}
{{<figure src="/nixos/tinc/3computers.svg" width=100% >}}
{{< /card >}}
Here is the `configuration.nix`. Here is the `configuration.nix`.
First we define the whole topology in `default` and First we define the whole topology in `default` and
@ -234,7 +236,9 @@ This is a very common problem in [Kubernetes](https://kubernetes.io/).
It can be resolved by using the `tincSubnet` parameter, It can be resolved by using the `tincSubnet` parameter,
to configure sub-network routing. to configure sub-network routing.
{{<figure src="/nixos/tinc/2subnets.svg">}} {{< card >}}
{{<figure src="/nixos/tinc/2subnets.svg" width=100% >}}
{{< /card >}}
Achieving this is very simple, Achieving this is very simple,
just add the `tincSubnet` parameter in the `hosts` attribute and your done. just add the `tincSubnet` parameter in the `hosts` attribute and your done.

View File

@ -1,7 +1,10 @@
<html> <html lang="en">
<head> <head>
<title> {{ .Title }} </title> <title> {{ .Title }} </title>
{{/* needed for responsive design */}}
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<meta name="author" content="Ingolf Wagner">
<link href="https://fonts.googleapis.com/css?family=Roboto|Abel|Inconsolata|Lato|Zilla+Slab" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto|Abel|Inconsolata|Lato|Zilla+Slab" rel="stylesheet">
<link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/css/main.css">
</head> </head>

BIN
src/images/2subnets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

69
src/images/2subnets.svg Normal file
View File

@ -0,0 +1,69 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg viewBox="0 0 608 588" xmlns="http://www.w3.org/2000/svg" xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs_block">
<filter height="1.504" id="filter_blur" inkspace:collect="always" width="1.1575" x="-0.07875" y="-0.252">
<feGaussianBlur id="feGaussianBlur3780" inkspace:collect="always" stdDeviation="4.2" />
</filter>
</defs>
<title>blockdiag</title>
<desc>
nwdiag {
internet [shape = cloud];
internet -- Gibson [address = "my.awesome.dns.com"]
network private {
address = "10.1.1.0/24";
Gibson [address = "10.1.1.1"];
Hackbardt [address = "10.1.1.2"];
HAL [address = "10.1.1.3"];
}
network "private (subnet)" {
Hackbardt [address = "10.2.2.0/24"];
HAL [address = "10.2.3.0/24"];
}
}
</desc>
<path d="M 171 178 A16,8 0 0 1 187 170 A16,6 0 0 1 227 170 A16,8 0 0 1 243 178 A16,8 0 0 1 243 194 A16,20 0 0 1 219 194 A16,20 0 0 1 195 194 A16,20 0 0 1 171 194 A16,8 0 0 1 171 178" fill="rgb(0,0,0)" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="155" y="306" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="307" y="450" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="459" y="450" />
<path d="M 131 391 L 587 391 A2,4 0 0 1 587 399 L 131 399 A2,4 0 0 1 131 391" fill="rgb(0,0,0)" style="filter:url(#filter_blur)" />
<path d="M 283 535 L 587 535 A2,4 0 0 1 587 543 L 283 543 A2,4 0 0 1 283 535" fill="rgb(0,0,0)" style="filter:url(#filter_blur)" />
<path d="M 128 388 L 584 388 A2,4 0 0 1 584 396 L 128 396 A2,4 0 0 1 128 388" fill="rgb(185,203,228)" stroke="rgb(0,0,0)" />
<path d="M 584 396 A2,4 0 0 1 584 388" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 388 L 584 388" fill="none" stroke="none" />
<path d="M 280 532 L 584 532 A2,4 0 0 1 584 540 L 280 540 A2,4 0 0 1 280 532" fill="rgb(185,203,228)" stroke="rgb(0,0,0)" />
<path d="M 584 540 A2,4 0 0 1 584 532" fill="none" stroke="rgb(0,0,0)" />
<path d="M 280 532 L 584 532" fill="none" stroke="none" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="42" x="99.0" y="391">private</text>
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="66" x="87.0" y="404">10.1.1.0/24</text>
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="108" x="218.0" y="542">"private (subnet)"</text>
<path d="M 204 104 L 204 156" fill="none" stroke="rgb(0,0,0)" />
<path d="M 204 196 L 204 248" fill="none" stroke="rgb(0,0,0)" />
<path d="M 168 172 A16,8 0 0 1 184 164 A16,6 0 0 1 224 164 A16,8 0 0 1 240 172 A16,8 0 0 1 240 188 A16,20 0 0 1 216 188 A16,20 0 0 1 192 188 A16,20 0 0 1 168 188 A16,8 0 0 1 168 172" fill="rgb(255,255,255)" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="204.0" y="182">internet</text>
<path d="M 204 248 L 204 300" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="108" x="270.0" y="280">my.awesome.dns.com</text>
<path d="M 204 340 L 204 388" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="240.0" y="368">10.1.1.1</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="152" y="300" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="36" x="204.0" y="326">Gibson</text>
<path d="M 356 396 L 356 444" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="392.0" y="424">10.1.1.2</text>
<path d="M 356 484 L 356 532" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="66" x="401.0" y="512">10.2.2.0/24</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="304" y="444" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="54" x="356.0" y="470">Hackbardt</text>
<path d="M 508 396 L 508 444" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="544.0" y="424">10.1.1.3</text>
<path d="M 508 484 L 508 532" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="66" x="553.0" y="512">10.2.3.0/24</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="456" y="444" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="18" x="508.0" y="470">HAL</text>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
src/images/3computers.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

55
src/images/3computers.svg Normal file
View File

@ -0,0 +1,55 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg viewBox="0 0 608 588" xmlns="http://www.w3.org/2000/svg" xmlns:inkspace="http://www.inkscape.org/namespaces/inkscape" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs id="defs_block">
<filter height="1.504" id="filter_blur" inkspace:collect="always" width="1.1575" x="-0.07875" y="-0.252">
<feGaussianBlur id="feGaussianBlur3780" inkspace:collect="always" stdDeviation="4.2" />
</filter>
</defs>
<title>blockdiag</title>
<desc>
nwdiag {
internet [shape = cloud];
internet -- Gibson [address = "my.awesome.dns.com"]
network private {
address = "10.1.1.0/24";
Gibson [address = "10.1.1.1"];
Hackbardt [address = "10.1.1.2"];
HAL [address = "10.1.1.3"];
}
}
</desc>
<path d="M 171 178 A16,8 0 0 1 187 170 A16,6 0 0 1 227 170 A16,8 0 0 1 243 178 A16,8 0 0 1 243 194 A16,20 0 0 1 219 194 A16,20 0 0 1 195 194 A16,20 0 0 1 171 194 A16,8 0 0 1 171 178" fill="rgb(0,0,0)" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="155" y="306" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="307" y="450" />
<rect fill="rgb(0,0,0)" height="40" stroke="rgb(0,0,0)" style="filter:url(#filter_blur);opacity:0.7;fill-opacity:1" width="104" x="459" y="450" />
<path d="M 131 391 L 587 391 A2,4 0 0 1 587 399 L 131 399 A2,4 0 0 1 131 391" fill="rgb(0,0,0)" style="filter:url(#filter_blur)" />
<path d="M 128 388 L 584 388 A2,4 0 0 1 584 396 L 128 396 A2,4 0 0 1 128 388" fill="rgb(185,203,228)" stroke="rgb(0,0,0)" />
<path d="M 584 396 A2,4 0 0 1 584 388" fill="none" stroke="rgb(0,0,0)" />
<path d="M 128 388 L 584 388" fill="none" stroke="none" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="42" x="99.0" y="391">private</text>
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="66" x="87.0" y="404">10.1.1.0/24</text>
<path d="M 204 104 L 204 156" fill="none" stroke="rgb(0,0,0)" />
<path d="M 204 196 L 204 248" fill="none" stroke="rgb(0,0,0)" />
<path d="M 168 172 A16,8 0 0 1 184 164 A16,6 0 0 1 224 164 A16,8 0 0 1 240 172 A16,8 0 0 1 240 188 A16,20 0 0 1 216 188 A16,20 0 0 1 192 188 A16,20 0 0 1 168 188 A16,8 0 0 1 168 172" fill="rgb(255,255,255)" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="204.0" y="182">internet</text>
<path d="M 204 248 L 204 300" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="108" x="270.0" y="280">my.awesome.dns.com</text>
<path d="M 204 340 L 204 388" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="240.0" y="368">10.1.1.1</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="152" y="300" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="36" x="204.0" y="326">Gibson</text>
<path d="M 356 396 L 356 444" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="392.0" y="424">10.1.1.2</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="304" y="444" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="54" x="356.0" y="470">Hackbardt</text>
<path d="M 508 396 L 508 444" fill="none" stroke="rgb(0,0,0)" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="48" x="544.0" y="424">10.1.1.3</text>
<rect fill="rgb(255,255,255)" height="40" stroke="rgb(0,0,0)" width="104" x="456" y="444" />
<text fill="rgb(0,0,0)" font-family="sans-serif" font-size="11" font-style="normal" font-weight="normal" text-anchor="middle" textLength="18" x="508.0" y="470">HAL</text>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -94,6 +94,7 @@ table.comparison {
} }
figure { figure {
widows: 98%;
margin-top: 1em; margin-top: 1em;
margin-bottom: 1em; margin-bottom: 1em;
margin-left: 0; margin-left: 0;