@danieltmn/openbridge 0.7.0 → 0.7.1
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 +9 -0
- package/README.md +4 -4
- package/docs/ARCHITECTURE.md +5 -4
- package/package.json +1 -1
- package/src/bridge/bridge.js +13 -4
- package/src/config.js +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ Todos los cambios relevantes de OpenBridge. Formato basado en
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/es-ES/1.1.0/) y
|
|
5
5
|
[Versionado Semantico](https://semver.org/lang/es/).
|
|
6
6
|
|
|
7
|
+
## [0.7.1] - 2026-09-17
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Corregido
|
|
11
|
+
|
|
12
|
+
- `processes.allow` con el default viejo (`npm`/`node`/`npx`) se actualiza solo al
|
|
13
|
+
actualizar OpenBridge, asi `php`/`python`/`composer` quedan permitidos sin editar
|
|
14
|
+
la config a mano. Los `allow` personalizados se respetan.
|
|
15
|
+
|
|
7
16
|
## [0.7.0] - 2026-09-17
|
|
8
17
|
|
|
9
18
|
|
package/README.md
CHANGED
|
@@ -184,10 +184,10 @@ El puente solo ejecuta binarios permitidos en `bridge/config.json`:
|
|
|
184
184
|
}
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
`allow` es la lista blanca (
|
|
188
|
-
`
|
|
189
|
-
una ruta absoluta cuando el ejecutable **no** está en el `PATH`.
|
|
190
|
-
corren **sin shell** y con `cwd` dentro del workspace.
|
|
187
|
+
`allow` es la lista blanca (ya trae `php`/`python`/`composer`; una config con el
|
|
188
|
+
default viejo `npm`/`node`/`npx` se actualiza sola al actualizar OpenBridge). `bins`
|
|
189
|
+
mapea un nombre a una ruta absoluta cuando el ejecutable **no** está en el `PATH`.
|
|
190
|
+
Los comandos corren **sin shell** y con `cwd` dentro del workspace.
|
|
191
191
|
|
|
192
192
|
## Hub en hosting PHP (URL fija, sin túnel)
|
|
193
193
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -106,10 +106,11 @@ y los argumentos con una whitelist (`OC_ALLOWED`). `proc_detect` es read-only:
|
|
|
106
106
|
inspecciona el proyecto (`package.json`, `composer.json`/`artisan`, entrypoints
|
|
107
107
|
PHP) y devuelve los comandos sugeridos para correrlo en dev.
|
|
108
108
|
|
|
109
|
-
`proc_start` solo ejecuta binarios de `bridge/config.json → processes.allow` (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`
|
|
109
|
+
`proc_start` solo ejecuta binarios de `bridge/config.json → processes.allow` (ya
|
|
110
|
+
incluye `php`/`python`/`composer`; una config con el default viejo `npm`/`node`/
|
|
111
|
+
`npx` se actualiza sola al actualizar OpenBridge, y los allow personalizados se
|
|
112
|
+
respetan); `processes.bins` mapea un nombre a una ruta absoluta para ejecutables
|
|
113
|
+
fuera del `PATH`. Corre sin shell y con `cwd` dentro del workspace.
|
|
113
114
|
|
|
114
115
|
## Decisiones
|
|
115
116
|
|
package/package.json
CHANGED
package/src/bridge/bridge.js
CHANGED
|
@@ -1915,22 +1915,31 @@ const PROC_LOG_CHUNK = 32 * 1024; // máx. caracteres por respuesta de proc_log
|
|
|
1915
1915
|
|
|
1916
1916
|
function procConfig() {
|
|
1917
1917
|
const p = (config && config.processes) || {};
|
|
1918
|
+
const norm = (a) => String(a).toLowerCase().replace(/\.(exe|cmd|bat|com)$/, '');
|
|
1919
|
+
const DEFAULT_ALLOW = ['npm', 'node', 'npx', 'php', 'python', 'python3', 'composer', 'pnpm', 'yarn'];
|
|
1920
|
+
const LEGACY_ALLOW = ['npm', 'node', 'npx'];
|
|
1921
|
+
let allow = Array.isArray(p.allow) ? p.allow.map(norm) : DEFAULT_ALLOW.slice();
|
|
1922
|
+
// Las configs viejas traian el allow por defecto de antes. No debe bloquear
|
|
1923
|
+
// los runtimes nuevos (php/python/composer) despues de `openbridge update`:
|
|
1924
|
+
// solo se reemplaza cuando es EXACTAMENTE ese default viejo (los allow
|
|
1925
|
+
// personalizados se respetan tal cual).
|
|
1926
|
+
if (allow.length === LEGACY_ALLOW.length && LEGACY_ALLOW.every((x) => allow.indexOf(x) >= 0)) {
|
|
1927
|
+
allow = DEFAULT_ALLOW.slice();
|
|
1928
|
+
}
|
|
1918
1929
|
// processes.bins: { php: "C:\\xampp\\php\\php.exe" } para runtimes que no
|
|
1919
1930
|
// estan en el PATH (Windows). La clave es el nombre que se escribe en el
|
|
1920
1931
|
// comando; el valor, la ruta al ejecutable.
|
|
1921
1932
|
const bins = {};
|
|
1922
1933
|
if (p.bins && typeof p.bins === 'object') {
|
|
1923
1934
|
for (const k of Object.keys(p.bins)) {
|
|
1924
|
-
const name =
|
|
1935
|
+
const name = norm(k);
|
|
1925
1936
|
const val = String(p.bins[k] || '').trim();
|
|
1926
1937
|
if (name && val) bins[name] = val;
|
|
1927
1938
|
}
|
|
1928
1939
|
}
|
|
1929
1940
|
return {
|
|
1930
1941
|
enabled: p.enabled !== false,
|
|
1931
|
-
allow
|
|
1932
|
-
? p.allow.map((a) => String(a).toLowerCase().replace(/\.(exe|cmd|bat|com)$/, ''))
|
|
1933
|
-
: ['npm', 'node', 'npx', 'php', 'python', 'python3', 'composer', 'pnpm', 'yarn'],
|
|
1942
|
+
allow,
|
|
1934
1943
|
maxGlobal: Math.max(1, parseInt(p.maxGlobal, 10) || 3),
|
|
1935
1944
|
bins,
|
|
1936
1945
|
};
|
package/src/config.js
CHANGED
|
@@ -20,7 +20,11 @@ const DEFAULT_BRIDGE = {
|
|
|
20
20
|
agents: ['build', 'plan'],
|
|
21
21
|
bridgeId: '',
|
|
22
22
|
bridgeName: '',
|
|
23
|
-
processes: {
|
|
23
|
+
processes: {
|
|
24
|
+
enabled: true,
|
|
25
|
+
allow: ['npm', 'node', 'npx', 'php', 'python', 'python3', 'composer', 'pnpm', 'yarn'],
|
|
26
|
+
maxGlobal: 3,
|
|
27
|
+
},
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
const DEFAULT_APP = {
|