yakmesh 1.3.2 β 1.4.0
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 +1 -1
- package/content/store.js +22 -9
- package/deploy-packages/README.md +114 -0
- package/deploy-packages/build-packages.ps1 +205 -0
- package/deploy-packages/yakmesh-full/README.md +122 -0
- package/deploy-packages/yakmesh-full/config/Caddyfile +61 -0
- package/deploy-packages/yakmesh-full/config/php.ini +55 -0
- package/deploy-packages/yakmesh-full/config/yakmesh.config.js +100 -0
- package/deploy-packages/yakmesh-full/start.ps1 +193 -0
- package/deploy-packages/yakmesh-full/stop.ps1 +35 -0
- package/deploy-packages/yakmesh-minimal/README.md +69 -0
- package/deploy-packages/yakmesh-minimal/config/Caddyfile +46 -0
- package/deploy-packages/yakmesh-minimal/config/yakmesh.config.js +79 -0
- package/deploy-packages/yakmesh-minimal/start.ps1 +165 -0
- package/deploy-packages/yakmesh-minimal/stop.ps1 +29 -0
- package/discord.md +13 -63
- package/gossip/protocol.js +13 -2
- package/mesh/annex.js +743 -0
- package/mesh/beacon-broadcast.js +4 -5
- package/mesh/echo-ranging.js +3 -4
- package/mesh/phantom-routing.js +3 -4
- package/mesh/pulse-sync.js +3 -4
- package/mesh/temporal-encoder.js +3 -3
- package/package.json +1 -1
- package/server/index.js +24 -0
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ See [TRADEMARK.md](TRADEMARK.md) for trademark usage policy.
|
|
|
182
182
|
<p>
|
|
183
183
|
<a href="https://discord.gg/E62tAE2wGh">π¬ Discord</a> β’
|
|
184
184
|
<a href="https://t.me/yakmesh">π± Telegram</a> β’
|
|
185
|
-
<a href="https://x.com/
|
|
185
|
+
<a href="https://x.com/yakmesh_dev">π Twitter</a>
|
|
186
186
|
</p>
|
|
187
187
|
<br>
|
|
188
188
|
<sub>Β© 2026 YAKMESHβ’ Project. Sturdy & Secure.</sub>
|
package/content/store.js
CHANGED
|
@@ -446,7 +446,10 @@ export class ContentStore {
|
|
|
446
446
|
|
|
447
447
|
// Gossip to mesh
|
|
448
448
|
if (this.gossip) {
|
|
449
|
+
console.log(`π‘ Gossiping content_announce for ${hash.slice(0, 16)}...`);
|
|
449
450
|
this.gossip.spreadRumor('content', announcement);
|
|
451
|
+
} else {
|
|
452
|
+
console.log(`β οΈ No gossip protocol available for content announce`);
|
|
450
453
|
}
|
|
451
454
|
|
|
452
455
|
// Update status
|
|
@@ -499,12 +502,13 @@ export class ContentStore {
|
|
|
499
502
|
// Peer has new content - request it if we don't have it
|
|
500
503
|
if (!this.has(data.hash)) {
|
|
501
504
|
console.log(`π¦ New content announced: ${data.hash.slice(0, 16)}... from ${origin.slice(0, 16)}...`);
|
|
502
|
-
// Request full content via
|
|
503
|
-
if (this.
|
|
504
|
-
this.
|
|
505
|
+
// Request full content via gossip
|
|
506
|
+
if (this.gossip) {
|
|
507
|
+
this.gossip.spreadRumor('content', {
|
|
505
508
|
type: 'content_request',
|
|
506
509
|
hash: data.hash,
|
|
507
510
|
requestedBy: this.identity?.identity?.nodeId,
|
|
511
|
+
timestamp: Date.now(),
|
|
508
512
|
});
|
|
509
513
|
}
|
|
510
514
|
}
|
|
@@ -514,13 +518,24 @@ export class ContentStore {
|
|
|
514
518
|
// Peer wants content - send if we have it
|
|
515
519
|
if (this.has(data.hash)) {
|
|
516
520
|
const result = this.getWithProof(data.hash);
|
|
517
|
-
if (this.
|
|
518
|
-
|
|
521
|
+
if (this.gossip && result) {
|
|
522
|
+
// Ensure content is properly encoded as base64
|
|
523
|
+
let contentBase64;
|
|
524
|
+
if (Buffer.isBuffer(result.content)) {
|
|
525
|
+
contentBase64 = result.content.toString('base64');
|
|
526
|
+
} else if (typeof result.content === 'string') {
|
|
527
|
+
contentBase64 = Buffer.from(result.content, 'utf8').toString('base64');
|
|
528
|
+
} else {
|
|
529
|
+
contentBase64 = Buffer.from(JSON.stringify(result.content), 'utf8').toString('base64');
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
this.gossip.spreadRumor('content', {
|
|
519
533
|
type: 'content_response',
|
|
520
534
|
hash: data.hash,
|
|
521
|
-
content:
|
|
535
|
+
content: contentBase64,
|
|
522
536
|
meta: result.meta,
|
|
523
537
|
proof: result.proof,
|
|
538
|
+
timestamp: Date.now(),
|
|
524
539
|
});
|
|
525
540
|
}
|
|
526
541
|
}
|
|
@@ -536,9 +551,7 @@ export class ContentStore {
|
|
|
536
551
|
if (computedHash !== data.hash) {
|
|
537
552
|
console.warn(`β οΈ Content hash mismatch from ${origin.slice(0, 16)}...`);
|
|
538
553
|
return;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
// Store it
|
|
554
|
+
} // Store it
|
|
542
555
|
await this.store(content, {
|
|
543
556
|
...data.meta,
|
|
544
557
|
publish: false, // Don't re-gossip
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# YAKMESH Deployment Packages
|
|
2
|
+
|
|
3
|
+
Two deployment variants for different use cases:
|
|
4
|
+
|
|
5
|
+
## π¦ Package Variants
|
|
6
|
+
|
|
7
|
+
### `yakmesh-minimal/` - Minimal Package
|
|
8
|
+
**Best for:** Advanced users, custom setups, cloud deployments
|
|
9
|
+
|
|
10
|
+
Includes:
|
|
11
|
+
- Yakmesh core (mesh network + content API)
|
|
12
|
+
- Caddy web server (auto-downloads on first run)
|
|
13
|
+
- Basic startup scripts
|
|
14
|
+
|
|
15
|
+
**You provide:** PHP runtime, Node.js (if needed), custom configurations
|
|
16
|
+
|
|
17
|
+
Size: ~3 MB (compressed)
|
|
18
|
+
|
|
19
|
+
### `yakmesh-full/` - Self-Contained Package
|
|
20
|
+
**Best for:** Turnkey deployments, air-gapped environments, quick demos
|
|
21
|
+
|
|
22
|
+
Includes everything in minimal, PLUS:
|
|
23
|
+
- PHP 8.3 portable (FastCGI ready)
|
|
24
|
+
- Node.js 20 LTS portable
|
|
25
|
+
- 7-Zip CLI (archive handling)
|
|
26
|
+
- Pre-configured Caddyfile templates
|
|
27
|
+
- Sample htdocs with demo site
|
|
28
|
+
|
|
29
|
+
Size: ~100 MB (compressed)
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### Minimal Package
|
|
34
|
+
```powershell
|
|
35
|
+
cd yakmesh-minimal
|
|
36
|
+
.\start.ps1
|
|
37
|
+
# First run downloads Caddy automatically
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Full Package
|
|
41
|
+
```powershell
|
|
42
|
+
cd yakmesh-full
|
|
43
|
+
.\start.ps1
|
|
44
|
+
# Everything included - no downloads needed
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Directory Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
yakmesh-{variant}/
|
|
51
|
+
βββ bin/ # Executables (Caddy, PHP, Node, 7z)
|
|
52
|
+
β βββ caddy.exe # Web server (auto-downloaded in minimal)
|
|
53
|
+
β βββ php/ # PHP portable (full only)
|
|
54
|
+
β βββ node/ # Node.js portable (full only)
|
|
55
|
+
β βββ 7z/ # 7-Zip CLI (full only)
|
|
56
|
+
βββ config/
|
|
57
|
+
β βββ yakmesh.config.js # Main configuration
|
|
58
|
+
β βββ Caddyfile # Web server config
|
|
59
|
+
β βββ php.ini # PHP config (full only)
|
|
60
|
+
βββ htdocs/ # Web document root
|
|
61
|
+
β βββ index.html # Demo page
|
|
62
|
+
βββ data/ # Persistent data
|
|
63
|
+
β βββ content/ # Content store
|
|
64
|
+
β βββ database/ # SQLite databases
|
|
65
|
+
βββ logs/ # Log files
|
|
66
|
+
βββ start.ps1 # Windows startup
|
|
67
|
+
βββ start.sh # Linux/Mac startup
|
|
68
|
+
βββ stop.ps1 # Windows shutdown
|
|
69
|
+
βββ README.md # Usage instructions
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Configuration
|
|
73
|
+
|
|
74
|
+
### yakmesh.config.js
|
|
75
|
+
```javascript
|
|
76
|
+
export default {
|
|
77
|
+
// Node identity
|
|
78
|
+
name: 'My Yakmesh Node',
|
|
79
|
+
|
|
80
|
+
// Network
|
|
81
|
+
port: 9001, // Mesh port
|
|
82
|
+
httpPort: 3000, // Content API
|
|
83
|
+
webPort: 8080, // Caddy web server
|
|
84
|
+
|
|
85
|
+
// Bootstrap peers (leave empty for standalone)
|
|
86
|
+
bootstrap: [],
|
|
87
|
+
|
|
88
|
+
// PHP settings (full package only)
|
|
89
|
+
php: {
|
|
90
|
+
enabled: true,
|
|
91
|
+
port: 9000,
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
// Content delivery
|
|
95
|
+
content: {
|
|
96
|
+
root: './htdocs',
|
|
97
|
+
cacheMaxAge: 86400,
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Port Reference
|
|
103
|
+
|
|
104
|
+
| Service | Port | Description |
|
|
105
|
+
|---------|------|-------------|
|
|
106
|
+
| Mesh | 9001 | P2P WebSocket connections |
|
|
107
|
+
| Content API | 3000 | Public content delivery |
|
|
108
|
+
| Web Server | 8080 | Caddy (HTTP) |
|
|
109
|
+
| Web Server HTTPS | 8443 | Caddy (HTTPS, if configured) |
|
|
110
|
+
| PHP FastCGI | 9000 | PHP-FPM (full package) |
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT License - see LICENSE file
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
Build YAKMESH deployment packages
|
|
4
|
+
|
|
5
|
+
.DESCRIPTION
|
|
6
|
+
Downloads all required binaries and creates:
|
|
7
|
+
- yakmesh-minimal-win-x64.zip (lightweight, downloads on first run)
|
|
8
|
+
- yakmesh-full-win-x64.zip (self-contained, everything bundled)
|
|
9
|
+
|
|
10
|
+
.PARAMETER Target
|
|
11
|
+
Which package to build: 'minimal', 'full', or 'all' (default)
|
|
12
|
+
#>
|
|
13
|
+
|
|
14
|
+
param(
|
|
15
|
+
[ValidateSet('minimal', 'full', 'all')]
|
|
16
|
+
[string]$Target = 'all'
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
$ErrorActionPreference = "Stop"
|
|
20
|
+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
21
|
+
$BuildDir = Join-Path $ScriptDir "build"
|
|
22
|
+
$DownloadDir = Join-Path $ScriptDir "downloads"
|
|
23
|
+
|
|
24
|
+
# Version configuration
|
|
25
|
+
$Versions = @{
|
|
26
|
+
Caddy = "2.8.4"
|
|
27
|
+
PHP = "8.3.14"
|
|
28
|
+
Node = "20.11.0"
|
|
29
|
+
SevenZip = "2401"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
$Downloads = @{
|
|
33
|
+
Caddy = "https://github.com/caddyserver/caddy/releases/download/v$($Versions.Caddy)/caddy_$($Versions.Caddy)_windows_amd64.zip"
|
|
34
|
+
PHP = "https://windows.php.net/downloads/releases/php-$($Versions.PHP)-nts-Win32-vs16-x64.zip"
|
|
35
|
+
Node = "https://nodejs.org/dist/v$($Versions.Node)/node-v$($Versions.Node)-win-x64.zip"
|
|
36
|
+
SevenZip = "https://www.7-zip.org/a/7z$($Versions.SevenZip)-x64.exe"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function Download-File {
|
|
40
|
+
param([string]$Url, [string]$OutFile)
|
|
41
|
+
|
|
42
|
+
if (Test-Path $OutFile) {
|
|
43
|
+
Write-Host " [CACHED] $(Split-Path $OutFile -Leaf)" -ForegroundColor Gray
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Write-Host " [DOWNLOAD] $Url" -ForegroundColor Cyan
|
|
48
|
+
Invoke-WebRequest -Uri $Url -OutFile $OutFile -UseBasicParsing
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function Build-Minimal {
|
|
52
|
+
Write-Host ""
|
|
53
|
+
Write-Host "Building MINIMAL package..." -ForegroundColor Green
|
|
54
|
+
|
|
55
|
+
$minimalDir = Join-Path $BuildDir "yakmesh-minimal"
|
|
56
|
+
|
|
57
|
+
# Clean and create
|
|
58
|
+
if (Test-Path $minimalDir) { Remove-Item $minimalDir -Recurse -Force }
|
|
59
|
+
New-Item -ItemType Directory -Path $minimalDir -Force | Out-Null
|
|
60
|
+
|
|
61
|
+
# Copy yakmesh-node source (excluding dev files)
|
|
62
|
+
$yakmeshSrc = Join-Path $ScriptDir "..\yakmesh-node"
|
|
63
|
+
$excludes = @('.git', 'node_modules', 'test-*', '*.test.js', 'data', 'database', 'logs')
|
|
64
|
+
|
|
65
|
+
Write-Host " Copying Yakmesh source..." -ForegroundColor Yellow
|
|
66
|
+
Get-ChildItem $yakmeshSrc -Exclude $excludes | Copy-Item -Destination $minimalDir -Recurse -Force
|
|
67
|
+
|
|
68
|
+
# Copy minimal config
|
|
69
|
+
$minimalCfg = Join-Path $ScriptDir "yakmesh-minimal"
|
|
70
|
+
Copy-Item (Join-Path $minimalCfg "config") -Destination $minimalDir -Recurse -Force
|
|
71
|
+
Copy-Item (Join-Path $minimalCfg "*.ps1") -Destination $minimalDir -Force
|
|
72
|
+
Copy-Item (Join-Path $minimalCfg "README.md") -Destination $minimalDir -Force
|
|
73
|
+
|
|
74
|
+
# Create empty directories
|
|
75
|
+
@("bin", "htdocs", "data", "logs") | ForEach-Object {
|
|
76
|
+
New-Item -ItemType Directory -Path (Join-Path $minimalDir $_) -Force | Out-Null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Create zip
|
|
80
|
+
$zipPath = Join-Path $BuildDir "yakmesh-minimal-win-x64.zip"
|
|
81
|
+
if (Test-Path $zipPath) { Remove-Item $zipPath }
|
|
82
|
+
|
|
83
|
+
Write-Host " Creating archive..." -ForegroundColor Yellow
|
|
84
|
+
Compress-Archive -Path "$minimalDir\*" -DestinationPath $zipPath -CompressionLevel Optimal
|
|
85
|
+
|
|
86
|
+
$size = (Get-Item $zipPath).Length / 1MB
|
|
87
|
+
Write-Host " [OK] yakmesh-minimal-win-x64.zip ($([math]::Round($size, 2)) MB)" -ForegroundColor Green
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function Build-Full {
|
|
91
|
+
Write-Host ""
|
|
92
|
+
Write-Host "Building FULL (self-contained) package..." -ForegroundColor Green
|
|
93
|
+
|
|
94
|
+
$fullDir = Join-Path $BuildDir "yakmesh-full"
|
|
95
|
+
|
|
96
|
+
# Clean and create
|
|
97
|
+
if (Test-Path $fullDir) { Remove-Item $fullDir -Recurse -Force }
|
|
98
|
+
New-Item -ItemType Directory -Path $fullDir -Force | Out-Null
|
|
99
|
+
|
|
100
|
+
# Create download directory
|
|
101
|
+
New-Item -ItemType Directory -Path $DownloadDir -Force | Out-Null
|
|
102
|
+
|
|
103
|
+
# Download binaries
|
|
104
|
+
Write-Host " Downloading binaries..." -ForegroundColor Yellow
|
|
105
|
+
|
|
106
|
+
$caddyZip = Join-Path $DownloadDir "caddy.zip"
|
|
107
|
+
Download-File -Url $Downloads.Caddy -OutFile $caddyZip
|
|
108
|
+
|
|
109
|
+
$phpZip = Join-Path $DownloadDir "php.zip"
|
|
110
|
+
Download-File -Url $Downloads.PHP -OutFile $phpZip
|
|
111
|
+
|
|
112
|
+
$nodeZip = Join-Path $DownloadDir "node.zip"
|
|
113
|
+
Download-File -Url $Downloads.Node -OutFile $nodeZip
|
|
114
|
+
|
|
115
|
+
# Note: 7-Zip is an installer, we'd need to extract it differently
|
|
116
|
+
# For now, skip 7z or use portable version
|
|
117
|
+
|
|
118
|
+
# Copy yakmesh-node source
|
|
119
|
+
$yakmeshSrc = Join-Path $ScriptDir "..\yakmesh-node"
|
|
120
|
+
$excludes = @('.git', 'node_modules', 'test-*', '*.test.js', 'data', 'database', 'logs')
|
|
121
|
+
|
|
122
|
+
Write-Host " Copying Yakmesh source..." -ForegroundColor Yellow
|
|
123
|
+
Get-ChildItem $yakmeshSrc -Exclude $excludes | Copy-Item -Destination $fullDir -Recurse -Force
|
|
124
|
+
|
|
125
|
+
# Extract Caddy
|
|
126
|
+
Write-Host " Extracting Caddy..." -ForegroundColor Yellow
|
|
127
|
+
$binDir = Join-Path $fullDir "bin"
|
|
128
|
+
New-Item -ItemType Directory -Path $binDir -Force | Out-Null
|
|
129
|
+
Expand-Archive -Path $caddyZip -DestinationPath $binDir -Force
|
|
130
|
+
|
|
131
|
+
# Extract PHP
|
|
132
|
+
Write-Host " Extracting PHP..." -ForegroundColor Yellow
|
|
133
|
+
$phpDir = Join-Path $binDir "php"
|
|
134
|
+
New-Item -ItemType Directory -Path $phpDir -Force | Out-Null
|
|
135
|
+
Expand-Archive -Path $phpZip -DestinationPath $phpDir -Force
|
|
136
|
+
|
|
137
|
+
# Extract Node
|
|
138
|
+
Write-Host " Extracting Node.js..." -ForegroundColor Yellow
|
|
139
|
+
$nodeTmpDir = Join-Path $DownloadDir "node-tmp"
|
|
140
|
+
Expand-Archive -Path $nodeZip -DestinationPath $nodeTmpDir -Force
|
|
141
|
+
$nodeExtracted = Get-ChildItem $nodeTmpDir | Select-Object -First 1
|
|
142
|
+
$nodeDir = Join-Path $binDir "node"
|
|
143
|
+
Move-Item $nodeExtracted.FullName $nodeDir -Force
|
|
144
|
+
Remove-Item $nodeTmpDir -Recurse -Force
|
|
145
|
+
|
|
146
|
+
# Copy full config
|
|
147
|
+
$fullCfg = Join-Path $ScriptDir "yakmesh-full"
|
|
148
|
+
Copy-Item (Join-Path $fullCfg "config") -Destination $fullDir -Recurse -Force
|
|
149
|
+
Copy-Item (Join-Path $fullCfg "*.ps1") -Destination $fullDir -Force
|
|
150
|
+
Copy-Item (Join-Path $fullCfg "README.md") -Destination $fullDir -Force
|
|
151
|
+
|
|
152
|
+
# Create directories
|
|
153
|
+
@("htdocs", "data", "data\content", "logs") | ForEach-Object {
|
|
154
|
+
New-Item -ItemType Directory -Path (Join-Path $fullDir $_) -Force | Out-Null
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
# Create PHP info file
|
|
158
|
+
"<?php phpinfo();" | Out-File -FilePath (Join-Path $fullDir "htdocs\info.php") -Encoding utf8
|
|
159
|
+
|
|
160
|
+
# Create zip
|
|
161
|
+
$zipPath = Join-Path $BuildDir "yakmesh-full-win-x64.zip"
|
|
162
|
+
if (Test-Path $zipPath) { Remove-Item $zipPath }
|
|
163
|
+
|
|
164
|
+
Write-Host " Creating archive..." -ForegroundColor Yellow
|
|
165
|
+
Compress-Archive -Path "$fullDir\*" -DestinationPath $zipPath -CompressionLevel Optimal
|
|
166
|
+
|
|
167
|
+
$size = (Get-Item $zipPath).Length / 1MB
|
|
168
|
+
Write-Host " [OK] yakmesh-full-win-x64.zip ($([math]::Round($size, 2)) MB)" -ForegroundColor Green
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# Main
|
|
172
|
+
Write-Host ""
|
|
173
|
+
Write-Host "=====================================" -ForegroundColor Cyan
|
|
174
|
+
Write-Host " YAKMESH Package Builder" -ForegroundColor Cyan
|
|
175
|
+
Write-Host "=====================================" -ForegroundColor Cyan
|
|
176
|
+
Write-Host ""
|
|
177
|
+
Write-Host "Versions:" -ForegroundColor Yellow
|
|
178
|
+
Write-Host " Caddy: $($Versions.Caddy)"
|
|
179
|
+
Write-Host " PHP: $($Versions.PHP)"
|
|
180
|
+
Write-Host " Node.js: $($Versions.Node)"
|
|
181
|
+
Write-Host ""
|
|
182
|
+
|
|
183
|
+
# Create build directory
|
|
184
|
+
New-Item -ItemType Directory -Path $BuildDir -Force | Out-Null
|
|
185
|
+
|
|
186
|
+
switch ($Target) {
|
|
187
|
+
'minimal' { Build-Minimal }
|
|
188
|
+
'full' { Build-Full }
|
|
189
|
+
'all' {
|
|
190
|
+
Build-Minimal
|
|
191
|
+
Build-Full
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
Write-Host ""
|
|
196
|
+
Write-Host "=====================================" -ForegroundColor Green
|
|
197
|
+
Write-Host " Build Complete!" -ForegroundColor Green
|
|
198
|
+
Write-Host "=====================================" -ForegroundColor Green
|
|
199
|
+
Write-Host ""
|
|
200
|
+
Write-Host "Packages created in: $BuildDir" -ForegroundColor Cyan
|
|
201
|
+
Get-ChildItem $BuildDir -Filter "*.zip" | ForEach-Object {
|
|
202
|
+
$size = $_.Length / 1MB
|
|
203
|
+
Write-Host " - $($_.Name) ($([math]::Round($size, 2)) MB)"
|
|
204
|
+
}
|
|
205
|
+
Write-Host ""
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# YAKMESH Self-Contained Deployment Package
|
|
2
|
+
# Everything included - no external dependencies needed
|
|
3
|
+
|
|
4
|
+
## Quick Start
|
|
5
|
+
|
|
6
|
+
```powershell
|
|
7
|
+
.\start.ps1
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
That's it! Everything is bundled.
|
|
11
|
+
|
|
12
|
+
## What's Included
|
|
13
|
+
|
|
14
|
+
- β
Yakmesh mesh network core
|
|
15
|
+
- β
Content delivery API (public HTTP)
|
|
16
|
+
- β
Caddy 2.8.4 web server
|
|
17
|
+
- β
PHP 8.3 portable (FastCGI)
|
|
18
|
+
- β
Node.js 20 LTS portable
|
|
19
|
+
- β
7-Zip CLI (archive handling)
|
|
20
|
+
- β
SQLite (embedded in Node)
|
|
21
|
+
- β
Pre-configured templates
|
|
22
|
+
- β
Demo website
|
|
23
|
+
|
|
24
|
+
## No External Dependencies
|
|
25
|
+
|
|
26
|
+
This package runs completely self-contained:
|
|
27
|
+
- No need to install Node.js globally
|
|
28
|
+
- No need to install PHP globally
|
|
29
|
+
- No need for internet on startup
|
|
30
|
+
- Works in air-gapped environments
|
|
31
|
+
|
|
32
|
+
## Configuration
|
|
33
|
+
|
|
34
|
+
Edit `config/yakmesh.config.js` to customize:
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
export default {
|
|
38
|
+
name: 'My Node',
|
|
39
|
+
port: 9001,
|
|
40
|
+
httpPort: 3000,
|
|
41
|
+
webPort: 8080,
|
|
42
|
+
bootstrap: [], // Add peer addresses here
|
|
43
|
+
php: {
|
|
44
|
+
enabled: true, // PHP ready out of the box
|
|
45
|
+
port: 9000,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Services
|
|
51
|
+
|
|
52
|
+
| URL | Service |
|
|
53
|
+
|-----|---------|
|
|
54
|
+
| http://localhost:9001 | Mesh P2P (WebSocket) |
|
|
55
|
+
| http://localhost:3000 | Content API |
|
|
56
|
+
| http://localhost:8080 | Web Server (PHP enabled) |
|
|
57
|
+
|
|
58
|
+
## Directory Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
yakmesh-full/
|
|
62
|
+
βββ bin/
|
|
63
|
+
β βββ caddy.exe # Caddy web server
|
|
64
|
+
β βββ php/ # PHP 8.3 portable
|
|
65
|
+
β β βββ php-cgi.exe
|
|
66
|
+
β β βββ php.ini
|
|
67
|
+
β βββ node/ # Node.js 20 portable
|
|
68
|
+
β β βββ node.exe
|
|
69
|
+
β βββ 7z/ # 7-Zip CLI
|
|
70
|
+
β βββ 7z.exe
|
|
71
|
+
βββ config/
|
|
72
|
+
β βββ yakmesh.config.js
|
|
73
|
+
β βββ Caddyfile
|
|
74
|
+
β βββ php.ini
|
|
75
|
+
βββ htdocs/
|
|
76
|
+
β βββ index.html
|
|
77
|
+
β βββ info.php # PHP info page
|
|
78
|
+
β βββ api/ # API examples
|
|
79
|
+
βββ data/
|
|
80
|
+
βββ logs/
|
|
81
|
+
βββ start.ps1
|
|
82
|
+
βββ stop.ps1
|
|
83
|
+
βββ README.md
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## PHP Features
|
|
87
|
+
|
|
88
|
+
The bundled PHP includes common extensions:
|
|
89
|
+
- curl, openssl, mbstring
|
|
90
|
+
- json, sqlite3, pdo_sqlite
|
|
91
|
+
- gd, zip, zlib
|
|
92
|
+
- xml, dom, simplexml
|
|
93
|
+
|
|
94
|
+
## Archive Handling (7-Zip)
|
|
95
|
+
|
|
96
|
+
Use the bundled 7z for backup/restore:
|
|
97
|
+
|
|
98
|
+
```powershell
|
|
99
|
+
# Backup content
|
|
100
|
+
.\bin\7z\7z.exe a backup.7z data\content\*
|
|
101
|
+
|
|
102
|
+
# Restore content
|
|
103
|
+
.\bin\7z\7z.exe x backup.7z -odata\content\
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Platform Support
|
|
107
|
+
|
|
108
|
+
This package is built for **Windows x64**.
|
|
109
|
+
|
|
110
|
+
For other platforms, download platform-specific binaries:
|
|
111
|
+
- Linux: Use `yakmesh-full-linux-x64.tar.gz`
|
|
112
|
+
- macOS: Use `yakmesh-full-darwin-arm64.tar.gz`
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT License - see LICENSE file
|
|
117
|
+
|
|
118
|
+
Bundled software licenses:
|
|
119
|
+
- Caddy: Apache 2.0
|
|
120
|
+
- PHP: PHP License
|
|
121
|
+
- Node.js: MIT
|
|
122
|
+
- 7-Zip: LGPL
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# YAKMESH Self-Contained - Caddyfile
|
|
2
|
+
# Full package with PHP enabled
|
|
3
|
+
|
|
4
|
+
{
|
|
5
|
+
admin off
|
|
6
|
+
auto_https off
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:8080 {
|
|
10
|
+
root * ./htdocs
|
|
11
|
+
|
|
12
|
+
# Enable file server with directory browsing
|
|
13
|
+
file_server browse
|
|
14
|
+
|
|
15
|
+
# PHP FastCGI handling
|
|
16
|
+
@phpFiles {
|
|
17
|
+
path *.php
|
|
18
|
+
}
|
|
19
|
+
handle @phpFiles {
|
|
20
|
+
root * ./htdocs
|
|
21
|
+
php_fastcgi localhost:9000 {
|
|
22
|
+
# Use bundled PHP-CGI
|
|
23
|
+
split .php
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# Reverse proxy to Content API
|
|
28
|
+
handle /content/* {
|
|
29
|
+
reverse_proxy localhost:3000
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# API proxy
|
|
33
|
+
handle /api/* {
|
|
34
|
+
reverse_proxy localhost:3000
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# Security headers
|
|
38
|
+
header {
|
|
39
|
+
X-Content-Type-Options nosniff
|
|
40
|
+
X-Frame-Options SAMEORIGIN
|
|
41
|
+
X-XSS-Protection "1; mode=block"
|
|
42
|
+
Referrer-Policy strict-origin-when-cross-origin
|
|
43
|
+
-Server
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# Enable compression
|
|
47
|
+
encode gzip zstd
|
|
48
|
+
|
|
49
|
+
# Logging
|
|
50
|
+
log {
|
|
51
|
+
output file ./logs/caddy-access.log
|
|
52
|
+
format json
|
|
53
|
+
level INFO
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# HTTPS site (uncomment for production)
|
|
58
|
+
# :8443 {
|
|
59
|
+
# tls internal
|
|
60
|
+
# import :8080
|
|
61
|
+
# }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[PHP]
|
|
2
|
+
; YAKMESH PHP Configuration
|
|
3
|
+
; Optimized for FastCGI/CGI operation
|
|
4
|
+
|
|
5
|
+
; Error handling
|
|
6
|
+
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
|
|
7
|
+
display_errors = Off
|
|
8
|
+
display_startup_errors = Off
|
|
9
|
+
log_errors = On
|
|
10
|
+
error_log = ../logs/php-error.log
|
|
11
|
+
|
|
12
|
+
; Resource limits
|
|
13
|
+
memory_limit = 128M
|
|
14
|
+
max_execution_time = 30
|
|
15
|
+
max_input_time = 60
|
|
16
|
+
post_max_size = 50M
|
|
17
|
+
upload_max_filesize = 50M
|
|
18
|
+
|
|
19
|
+
; Paths
|
|
20
|
+
doc_root = ../htdocs
|
|
21
|
+
include_path = ".;../htdocs"
|
|
22
|
+
|
|
23
|
+
; Session
|
|
24
|
+
session.save_path = ../data/sessions
|
|
25
|
+
session.use_strict_mode = 1
|
|
26
|
+
session.cookie_httponly = 1
|
|
27
|
+
session.cookie_samesite = Strict
|
|
28
|
+
|
|
29
|
+
; Extensions (Windows)
|
|
30
|
+
extension_dir = "ext"
|
|
31
|
+
extension=curl
|
|
32
|
+
extension=mbstring
|
|
33
|
+
extension=openssl
|
|
34
|
+
extension=pdo_sqlite
|
|
35
|
+
extension=sqlite3
|
|
36
|
+
extension=gd
|
|
37
|
+
extension=zip
|
|
38
|
+
extension=fileinfo
|
|
39
|
+
extension=exif
|
|
40
|
+
|
|
41
|
+
; Timezone
|
|
42
|
+
date.timezone = UTC
|
|
43
|
+
|
|
44
|
+
; Security
|
|
45
|
+
expose_php = Off
|
|
46
|
+
cgi.force_redirect = 0
|
|
47
|
+
cgi.fix_pathinfo = 1
|
|
48
|
+
|
|
49
|
+
; OPcache (performance)
|
|
50
|
+
opcache.enable = 1
|
|
51
|
+
opcache.enable_cli = 0
|
|
52
|
+
opcache.memory_consumption = 128
|
|
53
|
+
opcache.interned_strings_buffer = 8
|
|
54
|
+
opcache.max_accelerated_files = 4000
|
|
55
|
+
opcache.revalidate_freq = 60
|