Skip to content

Commit 3271316

Browse files
Consolidate all PR changes into single branch (#11)
* Initial plan * fix: apply STACK.md network path corrections and markdown formatting fixes Co-authored-by: danielbodnar <1790726+danielbodnar@users.noreply.github.com> * feat: add TypeScript implementation with systemd generators, services, and tests Co-authored-by: danielbodnar <1790726+danielbodnar@users.noreply.github.com> * fix: address code review feedback - improve type safety and error handling Co-authored-by: danielbodnar <1790726+danielbodnar@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: danielbodnar <1790726+danielbodnar@users.noreply.github.com>
1 parent 1e89d95 commit 3271316

20 files changed

Lines changed: 4497 additions & 11 deletions

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ CMakeUserPresets.json
1717
# and can be added to the global gitignore or merged into this file. For a more nuclear
1818
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
1919
#cmake-build-*
20+
21+
# Node.js dependencies
22+
node_modules/
23+
package-lock.json
24+
25+
# Build outputs
26+
dist/
27+
*.log

.oxlintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"rules": {
4+
"typescript": "error",
5+
"suspicious": "error",
6+
"correctness": "error",
7+
"style": "error",
8+
"pedantic": "warn"
9+
},
10+
"import-plugin": true,
11+
"jsdoc-plugin": true
12+
}

.prettierignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Dependencies
2+
node_modules/
3+
package-lock.json
4+
bun.lock
5+
6+
# Build outputs
7+
dist/
8+
*.log
9+
10+
# Git
11+
.git/
12+
.gitignore
13+
.gitmodules
14+
15+
# Config files that prettier can't parse
16+
.oxlintrc.json
17+
18+
# Binary and non-text files
19+
*.png
20+
*.jpg
21+
*.jpeg
22+
*.gif
23+
*.ico
24+
*.pdf
25+
*.zip
26+
*.tar.gz
27+
28+
# Other configs
29+
LICENSE
30+
*.list

.prettierrc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
semi: true
2+
singleQuote: true
3+
trailingComma: es5
4+
printWidth: 80
5+
tabWidth: 2
6+
proseWrap: preserve
7+
overrides:
8+
- files: '*.ts'
9+
options:
10+
parser: typescript
11+
plugins:
12+
- '@prettier/plugin-oxc'

STACK.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ HelloTimeSec=2
287287
MaxAgeSec=20
288288
```
289289

290-
#### 📄 /usr/lib/systemd/system/10-tenant-bridge.network:
290+
#### 📄 /usr/lib/systemd/network/10-tenant-bridge.network:
291291
```ini
292292
[Match]
293293
Name=br-tenant-%i
@@ -309,7 +309,7 @@ EmitRouter=yes
309309

310310
### 2️⃣ WireGuard VPN Template
311311

312-
#### 📄 /usr/lib/systemd/system/20-wg-tenant.netdev:
312+
#### 📄 /usr/lib/systemd/network/20-wg-tenant.netdev:
313313
```ini
314314
[NetDev]
315315
Name=wg-tenant-%i
@@ -326,7 +326,7 @@ Endpoint=${PEER_ENDPOINT}:51820
326326
PersistentKeepalive=25
327327
```
328328

329-
#### 📄 /usr/lib/systemd/system/20-wg-tenant.network:
329+
#### 📄 /usr/lib/systemd/network/20-wg-tenant.network:
330330
```ini
331331
[Match]
332332
Name=wg-tenant-%i
@@ -341,7 +341,7 @@ Scope=link
341341

342342
### 3️⃣ VXLAN Overlay Template
343343

344-
#### 📄 /usr/lib/systemd/system/30-vxlan-tenant.netdev:
344+
#### 📄 /usr/lib/systemd/network/30-vxlan-tenant.netdev:
345345
```ini
346346
[NetDev]
347347
Name=vxlan-tenant-%i
@@ -354,7 +354,7 @@ DestinationPort=4789
354354
MacLearning=yes
355355
```
356356

357-
#### 📄 /usr/lib/systemd/system/30-vxlan-tenant.network:
357+
#### 📄 /usr/lib/systemd/network/30-vxlan-tenant.network:
358358
```ini
359359
[Match]
360360
Name=vxlan-tenant-%i
@@ -369,7 +369,7 @@ EgressUntagged=1
369369

370370
### 4️⃣ VLAN Segmentation Template
371371

372-
#### 📄 /usr/lib/systemd/system/40-vlan-tenant.netdev:
372+
#### 📄 /usr/lib/systemd/network/40-vlan-tenant.netdev:
373373
```ini
374374
[NetDev]
375375
Name=vlan-tenant-%i
@@ -379,7 +379,7 @@ Kind=vlan
379379
Id=%i
380380
```
381381

382-
#### 📄 /usr/lib/systemd/system/40-vlan-tenant.network:
382+
#### 📄 /usr/lib/systemd/network/40-vlan-tenant.network:
383383
```ini
384384
[Match]
385385
Name=vlan-tenant-%i
@@ -597,17 +597,17 @@ tenant@tenant123.service
597597

598598
Each template ensures compliance with the Linux File System Hierarchy specification:
599599

600-
1. **Root Filesystem Requirements:
600+
1. **Root Filesystem Requirements**:
601601
- `/etc/os-release` or `/usr/lib/os-release` present
602602
- Proper symlink from `/usr/lib/os-release` to `/etc/os-release`
603603
- No files in `/` root directory itself
604604

605-
2. **Extension Image Requirements:
605+
2. **Extension Image Requirements**:
606606
- sysext: Only `/usr/` and `/opt/` directories
607607
- confext: Only `/etc/` directory
608608
- Proper `extension-release` files in correct locations
609609

610-
3. **Verification Structure:
610+
3. **Verification Structure**:
611611
- VOA hierarchy at `/etc/voa/` and `/usr/share/voa/`
612612
- Proper certificate fingerprint naming
613613
- ASCII-armored OpenPGP files
@@ -641,7 +641,7 @@ validate_rootfs() {
641641

642642
## 🎯 Conclusion
643643

644-
This template system provides:
644+
This template system provides the following capabilities:
645645

646646
1. **Standardization**: All tenants use consistent, validated templates
647647
2. **Compliance**: Full adherence to Linux Userspace API specifications

package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "bitbuilder-hypervisor",
3+
"version": "1.0.0",
4+
"description": "Revolutionary git-ops-native, multi-tenant hypervisor platform built on systemd virtualization",
5+
"type": "module",
6+
"main": "dist/index.js",
7+
"exports": {
8+
".": "./dist/index.js",
9+
"./generators/*": "./dist/generators/*.js",
10+
"./services/*": "./dist/services/*.js"
11+
},
12+
"imports": {
13+
"#generators/*": "./src/generators/*.ts",
14+
"#services/*": "./src/services/*.ts",
15+
"#schemas/*": "./src/schemas/*.ts",
16+
"#utils/*": "./src/utils/*.ts",
17+
"#types/*": "./src/types/*.ts"
18+
},
19+
"files": [
20+
"dist",
21+
"templates",
22+
"configs"
23+
],
24+
"scripts": {
25+
"dev": "bun run --watch src/index.ts",
26+
"build": "tsc --noEmit && bun build ./src/index.ts --outdir ./dist --target node --external '#*'",
27+
"build:generators": "bun build ./src/generators/tenant-generator.ts --compile --outfile ./dist/generators/tenant-generator",
28+
"build:services": "bun build ./src/services/tenant-manager.ts --compile --outfile ./dist/services/tenant-manager",
29+
"test": "bun test",
30+
"lint": "oxlint",
31+
"lint:fix": "oxlint --fix",
32+
"format": "prettier --write .",
33+
"quality": "oxlint && prettier --check ."
34+
},
35+
"dependencies": {
36+
"effect": "latest",
37+
"@effect/schema": "latest",
38+
"@effect/platform": "latest",
39+
"@effect/platform-node": "latest"
40+
},
41+
"devDependencies": {
42+
"oxlint": "latest",
43+
"prettier": "latest",
44+
"@prettier/plugin-oxc": "latest",
45+
"typescript": "latest",
46+
"@types/node": "latest"
47+
},
48+
"engines": {
49+
"bun": ">=1.0.0"
50+
},
51+
"keywords": [
52+
"hypervisor",
53+
"systemd",
54+
"virtualization",
55+
"git-ops",
56+
"multi-tenant",
57+
"immutable-infrastructure"
58+
],
59+
"license": "MIT"
60+
}

0 commit comments

Comments
 (0)