@takodotid/circuit 0.43.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -37
- package/package.json +21 -58
- package/src/checks/across.ts +402 -0
- package/src/checks/built-in.ts +256 -0
- package/src/checks/device.ts +436 -0
- package/src/checks/index.ts +53 -0
- package/src/cli/advisories.ts +108 -0
- package/src/cli/app.ts +71 -0
- package/src/cli/editor-types.generated.ts +30 -0
- package/src/cli/editor-types.ts +69 -0
- package/src/cli/format.ts +124 -0
- package/src/cli/git-hooks.ts +79 -0
- package/src/cli/index.ts +350 -1170
- package/src/cli/migrate.ts +554 -0
- package/src/cli/project-commands.ts +656 -0
- package/src/cli/releases.ts +374 -0
- package/src/cli/remember.ts +339 -0
- package/src/cli/rename.ts +27 -33
- package/src/cli/secrets-password.ts +60 -0
- package/src/cli/secrets.ts +258 -0
- package/src/cli/setup.ts +300 -0
- package/src/cli/signing.ts +23 -0
- package/src/cli/text-editor.ts +268 -0
- package/src/cli/ui.ts +298 -0
- package/src/cli/version.ts +2 -0
- package/src/cli/versions.ts +158 -0
- package/src/config/address.ts +102 -0
- package/src/config/circuit.d.ts +30 -0
- package/src/config/common.ts +65 -0
- package/src/config/communities.ts +479 -0
- package/src/config/define.ts +684 -0
- package/src/config/device.ts +164 -0
- package/src/config/firewall.ts +150 -0
- package/src/config/index.ts +22 -0
- package/src/{schema → config}/interfaces.ts +121 -85
- package/src/config/keys.ts +434 -0
- package/src/config/management.ts +61 -0
- package/src/config/merge.ts +335 -0
- package/src/config/models.ts +70 -0
- package/src/config/monitoring.ts +64 -0
- package/src/config/network.ts +180 -0
- package/src/config/presets.ts +149 -0
- package/src/config/routing.ts +401 -0
- package/src/config/services.ts +51 -0
- package/src/config/switching.ts +84 -0
- package/src/config/system.ts +103 -0
- package/src/{schema → config}/time-zones.ts +1 -1
- package/src/core/address.ts +1 -1
- package/src/core/cabling.ts +8 -43
- package/src/core/graph.ts +40 -0
- package/src/{integrations → core}/registries.ts +5 -3
- package/src/core/secrets-file.ts +539 -0
- package/src/core/secrets.ts +83 -64
- package/src/core/topology.ts +103 -146
- package/src/core/utils.ts +12 -1
- package/src/model.ts +83 -0
- package/src/platforms/derive.ts +64 -37
- package/src/platforms/finding.ts +9 -0
- package/src/platforms/fortios/firewall.ts +76 -64
- package/src/platforms/fortios/index.ts +189 -125
- package/src/platforms/fortios/names.ts +51 -18
- package/src/platforms/fortios/render.ts +69 -62
- package/src/platforms/fortios/routing.ts +89 -58
- package/src/platforms/fortios/vdoms.ts +47 -16
- package/src/platforms/junos/TRAPS.md +2 -2
- package/src/platforms/junos/bgp.ts +63 -42
- package/src/platforms/junos/index.ts +122 -89
- package/src/platforms/junos/render.ts +139 -104
- package/src/platforms/platform.ts +10 -8
- package/src/platforms/raisecom-ros/TRAPS.md +1 -1
- package/src/platforms/raisecom-ros/index.ts +89 -70
- package/src/platforms/raisecom-ros/render.ts +49 -45
- package/src/platforms/routeros/TRAPS.md +3 -3
- package/src/platforms/routeros/index.ts +121 -60
- package/src/platforms/routeros/render.ts +214 -195
- package/src/platforms/vrp/TRAPS.md +1 -1
- package/src/platforms/vrp/index.ts +74 -50
- package/src/platforms/vrp/render.ts +67 -56
- package/src/project/project.ts +725 -0
- package/src/studio/app/env.d.ts +9 -0
- package/src/studio/app/index.html +18 -0
- package/src/studio/app/src/App.vue +95 -0
- package/src/studio/app/src/components/AddressesView.vue +38 -0
- package/src/studio/app/src/components/CablesView.vue +29 -0
- package/src/studio/app/src/components/CompareView.vue +160 -0
- package/src/studio/app/src/components/DataTable.vue +49 -0
- package/src/studio/app/src/components/DeviceView.vue +237 -0
- package/src/studio/app/src/components/DevicesView.vue +32 -0
- package/src/studio/app/src/components/Faceplate.vue +75 -0
- package/src/studio/app/src/components/GraphView.vue +282 -0
- package/src/studio/app/src/components/LineDiff.vue +24 -0
- package/src/studio/app/src/components/ProblemsView.vue +42 -0
- package/src/studio/app/src/components/SearchView.vue +72 -0
- package/src/studio/app/src/components/SecretsView.vue +112 -0
- package/src/studio/app/src/components/SessionsView.vue +35 -0
- package/src/studio/app/src/components/Settings.vue +95 -0
- package/src/studio/app/src/components/ToolsView.vue +118 -0
- package/src/studio/app/src/components/VlansView.vue +50 -0
- package/src/studio/app/src/lib/csv.ts +19 -0
- package/src/studio/{public/diff.js → app/src/lib/diff.ts} +40 -35
- package/src/studio/app/src/lib/format.ts +38 -0
- package/src/studio/app/src/lib/net.ts +68 -0
- package/src/studio/app/src/lib/secrets-crypto.ts +35 -0
- package/src/studio/app/src/lib/store.ts +71 -0
- package/src/studio/app/src/lib/tools.ts +217 -0
- package/src/studio/app/src/main.ts +9 -0
- package/src/studio/{public → app/src}/style.css +14 -4
- package/src/studio/app/tsconfig.json +17 -0
- package/src/studio/app/vite.config.ts +16 -0
- package/src/studio/assets.generated.ts +3 -0
- package/src/studio/data.ts +96 -188
- package/src/studio/git.ts +27 -43
- package/src/studio/server.ts +196 -107
- package/src/studio/types.ts +141 -0
- package/src/transport/console.ts +3 -3
- package/src/transport/ssh.ts +1 -1
- package/dist/chunks/index-3b343xva.js +0 -177
- package/dist/chunks/index-6wb41q67.js +0 -62
- package/dist/chunks/index-n7w3tg5y.js +0 -149
- package/dist/chunks/index-yzw86rc8.js +0 -921
- package/dist/chunks/new-w3zys5y4.js +0 -172
- package/dist/chunks/server-cxr9ynxc.js +0 -259
- package/dist/cli/index.js +0 -12922
- package/dist/helpers/index.js +0 -881
- package/dist/index.js +0 -28
- package/dist/types/core/address-space.d.ts +0 -62
- package/dist/types/core/address.d.ts +0 -44
- package/dist/types/core/cabling.d.ts +0 -41
- package/dist/types/core/cross-checks.d.ts +0 -28
- package/dist/types/core/define.d.ts +0 -79
- package/dist/types/core/project-files.d.ts +0 -12
- package/dist/types/core/schema-docs.d.ts +0 -25
- package/dist/types/core/secrets.d.ts +0 -62
- package/dist/types/core/topology.d.ts +0 -96
- package/dist/types/core/utils.d.ts +0 -10
- package/dist/types/core/validator.d.ts +0 -23
- package/dist/types/helpers/bgp.d.ts +0 -195
- package/dist/types/helpers/cables.d.ts +0 -69
- package/dist/types/helpers/checks.d.ts +0 -36
- package/dist/types/helpers/exchange.d.ts +0 -55
- package/dist/types/helpers/filters.d.ts +0 -51
- package/dist/types/helpers/index.d.ts +0 -14
- package/dist/types/helpers/route-server.d.ts +0 -52
- package/dist/types/helpers/upstreams.d.ts +0 -192
- package/dist/types/index.d.ts +0 -10
- package/dist/types/integrations/librenms.d.ts +0 -60
- package/dist/types/integrations/netbox.d.ts +0 -89
- package/dist/types/integrations/peeringdb.d.ts +0 -24
- package/dist/types/integrations/prometheus.d.ts +0 -24
- package/dist/types/integrations/registries.d.ts +0 -8
- package/dist/types/platforms/bgp-wait.d.ts +0 -24
- package/dist/types/platforms/catalog.d.ts +0 -109
- package/dist/types/platforms/derive.d.ts +0 -17
- package/dist/types/platforms/fortios/firewall.d.ts +0 -47
- package/dist/types/platforms/fortios/index.d.ts +0 -140
- package/dist/types/platforms/fortios/models.d.ts +0 -14
- package/dist/types/platforms/fortios/names.d.ts +0 -52
- package/dist/types/platforms/fortios/plan.d.ts +0 -114
- package/dist/types/platforms/fortios/render.d.ts +0 -77
- package/dist/types/platforms/fortios/routing.d.ts +0 -56
- package/dist/types/platforms/fortios/tree.d.ts +0 -37
- package/dist/types/platforms/fortios/vdoms.d.ts +0 -50
- package/dist/types/platforms/index.d.ts +0 -13
- package/dist/types/platforms/junos/bgp.d.ts +0 -44
- package/dist/types/platforms/junos/index.d.ts +0 -114
- package/dist/types/platforms/junos/models.d.ts +0 -14
- package/dist/types/platforms/junos/render.d.ts +0 -154
- package/dist/types/platforms/line-diff.d.ts +0 -67
- package/dist/types/platforms/platform.d.ts +0 -135
- package/dist/types/platforms/raisecom-ros/index.d.ts +0 -71
- package/dist/types/platforms/raisecom-ros/models.d.ts +0 -14
- package/dist/types/platforms/raisecom-ros/render.d.ts +0 -41
- package/dist/types/platforms/routeros/export.d.ts +0 -59
- package/dist/types/platforms/routeros/index.d.ts +0 -116
- package/dist/types/platforms/routeros/models.d.ts +0 -18
- package/dist/types/platforms/routeros/plan.d.ts +0 -58
- package/dist/types/platforms/routeros/render.d.ts +0 -250
- package/dist/types/platforms/vrp/index.d.ts +0 -83
- package/dist/types/platforms/vrp/models.d.ts +0 -12
- package/dist/types/platforms/vrp/render.d.ts +0 -96
- package/dist/types/schema/common.d.ts +0 -30
- package/dist/types/schema/device.d.ts +0 -126
- package/dist/types/schema/firewall.d.ts +0 -131
- package/dist/types/schema/index.d.ts +0 -8
- package/dist/types/schema/interfaces.d.ts +0 -205
- package/dist/types/schema/policy.d.ts +0 -107
- package/dist/types/schema/routing.d.ts +0 -161
- package/dist/types/schema/system.d.ts +0 -198
- package/dist/types/schema/time-zones.d.ts +0 -2
- package/dist/types/transport/console.d.ts +0 -115
- package/dist/types/transport/path-check.d.ts +0 -32
- package/dist/types/transport/ssh.d.ts +0 -27
- package/src/cli/graph-format.ts +0 -91
- package/src/cli/new.ts +0 -234
- package/src/core/address-space.ts +0 -320
- package/src/core/cross-checks.ts +0 -369
- package/src/core/define.ts +0 -124
- package/src/core/project-files.ts +0 -35
- package/src/core/schema-docs.ts +0 -174
- package/src/core/validator.ts +0 -508
- package/src/helpers/bgp.ts +0 -473
- package/src/helpers/cables.ts +0 -74
- package/src/helpers/checks.ts +0 -201
- package/src/helpers/exchange.ts +0 -123
- package/src/helpers/filters.ts +0 -107
- package/src/helpers/index.ts +0 -25
- package/src/helpers/route-server.ts +0 -212
- package/src/helpers/upstreams.ts +0 -369
- package/src/index.ts +0 -13
- package/src/integrations/librenms.ts +0 -291
- package/src/integrations/netbox.ts +0 -620
- package/src/integrations/peeringdb.ts +0 -173
- package/src/integrations/prometheus.ts +0 -90
- package/src/schema/common.ts +0 -41
- package/src/schema/device.ts +0 -145
- package/src/schema/firewall.ts +0 -140
- package/src/schema/index.ts +0 -8
- package/src/schema/policy.ts +0 -115
- package/src/schema/routing.ts +0 -173
- package/src/schema/system.ts +0 -203
- package/src/studio/public/app.js +0 -186
- package/src/studio/public/compare.js +0 -250
- package/src/studio/public/dom.js +0 -138
- package/src/studio/public/evaluate.js +0 -687
- package/src/studio/public/export.js +0 -130
- package/src/studio/public/graph.js +0 -1541
- package/src/studio/public/index.html +0 -83
- package/src/studio/public/net.js +0 -134
- package/src/studio/public/tables.js +0 -1289
- package/src/studio/public/tools.js +0 -610
- package/templates/colocation/checks.ts +0 -53
- package/templates/colocation/circuit.config.ts +0 -9
- package/templates/colocation/edge-01.ts +0 -133
- package/templates/colocation/routing.ts +0 -13
- package/templates/colocation/tenancy.ts +0 -76
- package/templates/colocation/tenants/acme.ts +0 -19
- package/templates/colocation/tenants/index.ts +0 -6
- package/templates/colocation/tor-01.ts +0 -33
- package/templates/edge-router/checks.ts +0 -20
- package/templates/edge-router/circuit.config.ts +0 -8
- package/templates/edge-router/edge-01.ts +0 -110
- package/templates/edge-router/routing.ts +0 -13
- package/templates/project/AGENTS.md +0 -51
- package/templates/project/CLAUDE.md +0 -1
- package/templates/project/README.md +0 -16
- package/templates/project/gitignore +0 -5
- package/templates/project/tsconfig.json +0 -13
- package/templates/single-site/checks.ts +0 -26
- package/templates/single-site/circuit.config.ts +0 -8
- package/templates/single-site/router.ts +0 -86
- package/templates/single-site/site.ts +0 -18
- package/templates/single-site/switch.ts +0 -34
- /package/src/studio/{public → app/public}/favicon.svg +0 -0
- /package/src/studio/{public → app/public}/special-gothic-latin-ext.woff2 +0 -0
- /package/src/studio/{public → app/public}/special-gothic-latin.woff2 +0 -0
- /package/src/studio/{public → app/public}/special-gothic-license.txt +0 -0
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// The router: the internet connection, a gateway and DHCP for each VLAN, and the firewall.
|
|
2
|
-
|
|
3
|
-
import { defineDevice, secret } from "@takodotid/circuit";
|
|
4
|
-
import { MANAGEMENT, ROUTER, TIMEZONE, vlans } from "./site";
|
|
5
|
-
|
|
6
|
-
export default defineDevice({
|
|
7
|
-
name: "router",
|
|
8
|
-
platform: "routeros",
|
|
9
|
-
model: "CCR2216-1G-12XS-2XQ",
|
|
10
|
-
connection: { host: ROUTER, user: "operator" },
|
|
11
|
-
users: { operator: { role: "admin", password: secret("ROUTER_PASSWORD") } },
|
|
12
|
-
|
|
13
|
-
system: {
|
|
14
|
-
timezone: TIMEZONE,
|
|
15
|
-
dns: { servers: ["1.1.1.1", "1.0.0.1"], serve: true },
|
|
16
|
-
ntp: { servers: ["pool.ntp.org"], serve: true },
|
|
17
|
-
},
|
|
18
|
-
management: { allow: [MANAGEMENT], ssh: {} },
|
|
19
|
-
|
|
20
|
-
vlans,
|
|
21
|
-
|
|
22
|
-
ports: {
|
|
23
|
-
"1g-1": { description: "Internet provider", addresses: ["203.0.113.2/30"] },
|
|
24
|
-
"25g-1": {
|
|
25
|
-
description: "Switch",
|
|
26
|
-
speed: "10g",
|
|
27
|
-
trunk_vlans: ["mgmt", "home", "guests"],
|
|
28
|
-
link: { device: "switch", port: "10g-1" },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
// The gateway of each VLAN.
|
|
33
|
-
interfaces: {
|
|
34
|
-
mgmt: { type: "vlan", vlan: "mgmt", addresses: [`${ROUTER}/24`] },
|
|
35
|
-
home: { type: "vlan", vlan: "home", addresses: ["192.168.20.1/24"] },
|
|
36
|
-
guests: { type: "vlan", vlan: "guests", addresses: ["192.168.30.1/24"] },
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
routing: { static: [{ prefix: "0.0.0.0/0", via: "203.0.113.1", description: "Internet provider" }] },
|
|
40
|
-
|
|
41
|
-
dhcp: {
|
|
42
|
-
home: {
|
|
43
|
-
interface: "home",
|
|
44
|
-
network: "192.168.20.0/24",
|
|
45
|
-
gateway: "192.168.20.1",
|
|
46
|
-
dns: ["192.168.20.1"],
|
|
47
|
-
pool: ["192.168.20.100", "192.168.20.200"],
|
|
48
|
-
},
|
|
49
|
-
guests: {
|
|
50
|
-
interface: "guests",
|
|
51
|
-
network: "192.168.30.0/24",
|
|
52
|
-
gateway: "192.168.30.1",
|
|
53
|
-
dns: ["192.168.30.1"],
|
|
54
|
-
pool: ["192.168.30.100", "192.168.30.200"],
|
|
55
|
-
lease_time: 3600,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
firewall: {
|
|
60
|
-
filter: {
|
|
61
|
-
// Traffic to the router itself.
|
|
62
|
-
input: {
|
|
63
|
-
default: "drop",
|
|
64
|
-
rules: [
|
|
65
|
-
{ description: "Replies", match: { state: ["established", "related"] }, action: "accept" },
|
|
66
|
-
{ description: "Ping", match: { protocol: "icmp" }, action: "accept" },
|
|
67
|
-
{ description: "Management", match: { src: MANAGEMENT }, action: "accept" },
|
|
68
|
-
{ description: "DNS from home", match: { in_interface: "home", protocol: "udp", dst_port: 53 }, action: "accept" },
|
|
69
|
-
{ description: "DNS from guests", match: { in_interface: "guests", protocol: "udp", dst_port: 53 }, action: "accept" },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
// Traffic passing through the router: home and guests reach the internet, and nothing else gets through.
|
|
73
|
-
forward: {
|
|
74
|
-
default: "drop",
|
|
75
|
-
rules: [
|
|
76
|
-
{ description: "Replies", match: { state: ["established", "related"] }, action: "accept", offload: true },
|
|
77
|
-
{ description: "Home to the internet", match: { in_interface: "home", out_interface: "1g-1" }, action: "accept" },
|
|
78
|
-
{ description: "Guests to the internet", match: { in_interface: "guests", out_interface: "1g-1" }, action: "accept" },
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
nat: {
|
|
83
|
-
source: [{ description: "Share the public address", match: { out_interface: "1g-1" }, action: "masquerade" }],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Values both devices share. Change them to your own.
|
|
2
|
-
|
|
3
|
-
import type { Prefix, Vlan } from "@takodotid/circuit";
|
|
4
|
-
|
|
5
|
-
/** The management network. Only addresses in it can log in to the devices. */
|
|
6
|
-
export const MANAGEMENT = "192.168.10.0/24" satisfies Prefix;
|
|
7
|
-
|
|
8
|
-
/** The router's address on the management network, the switch's gateway. */
|
|
9
|
-
export const ROUTER = "192.168.10.1";
|
|
10
|
-
|
|
11
|
-
export const TIMEZONE = "Asia/Jakarta";
|
|
12
|
-
|
|
13
|
-
/** Every VLAN on the site. Each device lists the ones it carries. */
|
|
14
|
-
export const vlans = {
|
|
15
|
-
mgmt: { id: 10, description: "Management" },
|
|
16
|
-
home: { id: 20, description: "Home" },
|
|
17
|
-
guests: { id: 30, description: "Guests" },
|
|
18
|
-
} as const satisfies Record<string, Vlan>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// The switch: a port for each device on the site, on the VLAN it belongs to.
|
|
2
|
-
|
|
3
|
-
import { defineDevice, secret } from "@takodotid/circuit";
|
|
4
|
-
import { MANAGEMENT, ROUTER, TIMEZONE, vlans } from "./site";
|
|
5
|
-
|
|
6
|
-
export default defineDevice({
|
|
7
|
-
name: "switch",
|
|
8
|
-
platform: "vrp",
|
|
9
|
-
model: "CE6855-48S6Q-HI",
|
|
10
|
-
connection: { host: "192.168.10.2", user: "operator" },
|
|
11
|
-
users: { operator: { role: "admin", password: secret("SWITCH_PASSWORD") } },
|
|
12
|
-
|
|
13
|
-
system: { timezone: TIMEZONE, ntp: { servers: [ROUTER] } },
|
|
14
|
-
management: { allow: [MANAGEMENT], ssh: {} },
|
|
15
|
-
|
|
16
|
-
lldp: true,
|
|
17
|
-
stp: {},
|
|
18
|
-
|
|
19
|
-
vlans,
|
|
20
|
-
|
|
21
|
-
ports: {
|
|
22
|
-
"10g-1": {
|
|
23
|
-
description: "Router",
|
|
24
|
-
trunk_vlans: ["mgmt", "home", "guests"],
|
|
25
|
-
link: { device: "router", port: "25g-1" },
|
|
26
|
-
},
|
|
27
|
-
"10g-2": { description: "Desk", access_vlan: "home", stp: { edge: true } },
|
|
28
|
-
"10g-3": { description: "Living room", access_vlan: "home", stp: { edge: true } },
|
|
29
|
-
"10g-4": { description: "Guest access point", access_vlan: "guests", stp: { edge: true } },
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
interfaces: { mgmt: { type: "vlan", vlan: "mgmt", addresses: ["192.168.10.2/24"] } },
|
|
33
|
-
routing: { static: [{ prefix: "0.0.0.0/0", via: ROUTER }] },
|
|
34
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|