yakmesh 1.3.1 → 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/CHANGELOG.md +20 -0
- package/README.md +6 -0
- package/announcements/discord-v1.3.1.md +55 -0
- package/content/api.js +348 -0
- package/content/index.js +19 -0
- package/content/store.js +683 -0
- 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 -58
- 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 +64 -3
- package/yakmesh.config.js +8 -0
|
@@ -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
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAKMESH Self-Contained Configuration
|
|
3
|
+
* Full package with all features enabled
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
// ========================================
|
|
8
|
+
// NODE IDENTITY
|
|
9
|
+
// ========================================
|
|
10
|
+
name: 'Yakmesh Node',
|
|
11
|
+
|
|
12
|
+
// ========================================
|
|
13
|
+
// NETWORK PORTS
|
|
14
|
+
// ========================================
|
|
15
|
+
port: 9001, // Mesh P2P WebSocket
|
|
16
|
+
httpPort: 3000, // Content API (public HTTP)
|
|
17
|
+
webPort: 8080, // Caddy web server
|
|
18
|
+
|
|
19
|
+
// ========================================
|
|
20
|
+
// BOOTSTRAP PEERS
|
|
21
|
+
// ========================================
|
|
22
|
+
bootstrap: [
|
|
23
|
+
// 'ws://peer1.example.com:9001',
|
|
24
|
+
// 'ws://192.168.1.100:9001',
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
// ========================================
|
|
28
|
+
// WEB SERVER (CADDY) - Pre-configured
|
|
29
|
+
// ========================================
|
|
30
|
+
web: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
port: 8080,
|
|
33
|
+
httpsPort: 8443,
|
|
34
|
+
root: './htdocs',
|
|
35
|
+
autoHttps: false,
|
|
36
|
+
domain: null,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// ========================================
|
|
40
|
+
// PHP SUPPORT - Bundled & Ready
|
|
41
|
+
// ========================================
|
|
42
|
+
php: {
|
|
43
|
+
enabled: true,
|
|
44
|
+
port: 9000,
|
|
45
|
+
binary: './bin/php/php-cgi.exe',
|
|
46
|
+
ini: './bin/php/php.ini',
|
|
47
|
+
extensions: [
|
|
48
|
+
'curl', 'openssl', 'mbstring',
|
|
49
|
+
'json', 'sqlite3', 'pdo_sqlite',
|
|
50
|
+
'gd', 'zip', 'zlib',
|
|
51
|
+
'xml', 'dom', 'simplexml',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// ========================================
|
|
56
|
+
// NODE.JS - Bundled Runtime
|
|
57
|
+
// ========================================
|
|
58
|
+
node: {
|
|
59
|
+
binary: './bin/node/node.exe',
|
|
60
|
+
version: '20.x LTS',
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
// ========================================
|
|
64
|
+
// ARCHIVE HANDLING (7-Zip)
|
|
65
|
+
// ========================================
|
|
66
|
+
archive: {
|
|
67
|
+
binary: './bin/7z/7z.exe',
|
|
68
|
+
formats: ['7z', 'zip', 'tar', 'gz'],
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
// ========================================
|
|
72
|
+
// CONTENT DELIVERY
|
|
73
|
+
// ========================================
|
|
74
|
+
content: {
|
|
75
|
+
enabled: true,
|
|
76
|
+
storagePath: './data/content',
|
|
77
|
+
maxSize: 100 * 1024 * 1024, // 100 MB per item
|
|
78
|
+
cacheMaxAge: 86400, // 24 hours
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
// ========================================
|
|
82
|
+
// SECURITY
|
|
83
|
+
// ========================================
|
|
84
|
+
security: {
|
|
85
|
+
enableCodeProof: true,
|
|
86
|
+
rateLimit: {
|
|
87
|
+
windowMs: 60000,
|
|
88
|
+
maxRequests: 100,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// ========================================
|
|
93
|
+
// LOGGING
|
|
94
|
+
// ========================================
|
|
95
|
+
logging: {
|
|
96
|
+
level: 'info',
|
|
97
|
+
path: './logs',
|
|
98
|
+
maxFiles: 7,
|
|
99
|
+
},
|
|
100
|
+
};
|