Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf7dc93bc4 | ||
|
|
05d4be1af0 | ||
|
|
ac6c8e1fbd | ||
|
|
34db92d5f7 | ||
|
|
bfb6f8df5b | ||
|
|
db7d85133a | ||
|
|
730237d1b9 | ||
|
|
586679d84e | ||
|
|
d00697ca36 | ||
|
|
9526443b4a | ||
|
|
c51c5222d5 | ||
|
|
555d2cb3c1 | ||
|
|
50a0bb9549 | ||
|
|
a90f3e1ef2 | ||
|
|
ec98ea6038 | ||
|
|
383f4bbda0 | ||
|
|
6d3d904aa6 | ||
|
|
8f38d9ea7d | ||
|
|
14c69ed0d2 | ||
|
|
dee931f100 | ||
|
|
adfbc1ded6 | ||
|
|
a0a14921cf | ||
|
|
fe0db50d12 | ||
|
|
490fe6104a | ||
|
|
84690ce1d3 |
@@ -0,0 +1,27 @@
|
||||
# Escaneo de secretos en cada push y pull request. Este repo es PUBLICO.
|
||||
# Falla si gitleaks encuentra una clave en los commits nuevos.
|
||||
name: gitleaks
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
gitleaks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Instalar gitleaks
|
||||
run: |
|
||||
set -e
|
||||
VERSION=8.21.2
|
||||
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${VERSION}/gitleaks_${VERSION}_linux_x64.tar.gz" -o /tmp/gitleaks.tgz
|
||||
tar -xzf /tmp/gitleaks.tgz -C /tmp gitleaks
|
||||
sudo install -m 755 /tmp/gitleaks /usr/local/bin/gitleaks
|
||||
gitleaks version
|
||||
|
||||
- name: Escanear el historial
|
||||
run: gitleaks git --no-banner --redact --verbose .
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# Hook pre-push: bloquea el push si lo que se va a subir contiene secretos.
|
||||
#
|
||||
# Activar una vez por clon: git config core.hooksPath .githooks
|
||||
#
|
||||
# Este repo es PUBLICO: un secreto que llega al remoto queda expuesto aunque se
|
||||
# borre en el commit siguiente (sigue en el historial). En 2026-03 se filtro asi
|
||||
# una clave de API pegada en .claude/settings.json.
|
||||
#
|
||||
# Si gitleaks esta instalado (https://github.com/gitleaks/gitleaks) se usa el;
|
||||
# si no, se aplica un escaneo minimo con grep sobre los formatos mas comunes.
|
||||
set -u
|
||||
|
||||
remote="$1"
|
||||
z40=0000000000000000000000000000000000000000
|
||||
fallo=0
|
||||
|
||||
while read -r local_ref local_sha remote_ref remote_sha; do
|
||||
[ "$local_sha" = "$z40" ] && continue # borrado de rama: nada que escanear
|
||||
if [ "$remote_sha" = "$z40" ]; then
|
||||
rango="$local_sha" # rama nueva: todo lo alcanzable
|
||||
else
|
||||
rango="$remote_sha..$local_sha"
|
||||
fi
|
||||
|
||||
if command -v gitleaks >/dev/null 2>&1; then
|
||||
if ! gitleaks git --no-banner --redact --log-opts="$rango" . ; then
|
||||
fallo=1
|
||||
fi
|
||||
else
|
||||
# Escaneo minimo: lineas AÑADIDAS en el rango con formatos de clave conocidos.
|
||||
hits=$(git log -p --no-color "$rango" -- . ':!*.min.*' ':!*.lock' \
|
||||
| grep -E '^\+' \
|
||||
| grep -E 'AIza[0-9A-Za-z_-]{35}|sk_(live|test)_[0-9A-Za-z]{20,}|ghp_[0-9A-Za-z]{30,}|xox[bp]-[0-9A-Za-z-]{10,}|AKIA[0-9A-Z]{16}|eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{10,}|-----BEGIN [A-Z ]*PRIVATE KEY|(ANTHROPIC_AUTH_TOKEN|ANTHROPIC_API_KEY|OPENAI_API_KEY|API_KEY|SECRET|PASSWORD|TOKEN)["'"'"']?[[:space:]]*[:=][[:space:]]*["'"'"'][^"'"'"']{8,}' \
|
||||
| grep -vE '\$\{?[A-Z_]+\}?|\*\*\*|EJEMPLO|EXAMPLE|placeholder' )
|
||||
if [ -n "$hits" ]; then
|
||||
echo "pre-push: posibles secretos en lo que vas a subir ($rango):" >&2
|
||||
printf '%s\n' "$hits" | cut -c1-120 | sed 's/^/ /' >&2
|
||||
echo "pre-push: instala gitleaks para un escaneo completo. Si es un falso positivo, --no-verify." >&2
|
||||
fallo=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$fallo" -ne 0 ]; then
|
||||
echo "pre-push: PUSH BLOQUEADO. Quita el secreto del commit (git commit --amend o rebase) y rota la clave si ya la has pegado en algun sitio." >&2
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
# Configuracion LOCAL de Claude Code: aqui van las claves (env con ANTHROPIC_*,
|
||||
# tokens de proveedores...). NUNCA en .claude/settings.json, que es la plantilla
|
||||
# versionada y este repo es PUBLICO. En 2026-03 se filtro una clave por ahi.
|
||||
.claude/settings.local.json
|
||||
|
||||
# Secretos y entorno
|
||||
.env
|
||||
.env.*
|
||||
*.pem
|
||||
*.key
|
||||
|
||||
# Ruido de sistema
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
@@ -129,6 +129,7 @@ Do NOT modify web-base files — they are shared across all projects.
|
||||
11. Twig concatenation uses `~` operator: `'value=' ~ variable`
|
||||
12. `enlace` (link) fields already include slashes — **NEVER modify an existing enlace** unless explicitly asked
|
||||
13. **NEVER modify the `controlador` field** of existing records — it defines whether a page is Builder or Standard
|
||||
14. **This repository is PUBLIC. NEVER commit secrets** (API keys, `ANTHROPIC_*` tokens, passwords). Local Claude Code config with credentials goes in `.claude/settings.local.json` (git-ignored), never in `.claude/settings.json`. Enable the secret-scanning hook once per clone: `git config core.hooksPath .githooks`. A leaked key stays in git history even after deleting it: rotate it immediately.
|
||||
|
||||
## MCP Tools
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
| `acai-line-replace` | Archivos | Reemplaza un bloque concreto en un archivo existente |
|
||||
| `acai-write` | Archivos | Crea o reescribe un archivo completo. Antes de usarlo, lee la doc correspondiente según el tipo de archivo (`module-creation-guide`, `builder-fields`, `css-js-conventions`, `hooks-and-api`) |
|
||||
| `acai-delete` | Archivos | Borra un archivo del proyecto |
|
||||
| `get_layout_field` | Layout global | Lee header/footer/CSS global/JS global (`field: header\|footer\|style\|javascript`) — NO son ficheros normales, ver [docs/modular-system.md](modular-system.md) |
|
||||
| `set_layout_field` | Layout global | Escribe header/footer/CSS global/JS global — **reemplazo destructivo del contenido completo**, no hay line-replace; verificar `compile_ok` en la respuesta |
|
||||
| `list_page_modules` | Registros | Lista módulos de una página |
|
||||
| `add_module_to_record` | Registros | Añade módulo a una página |
|
||||
| `remove_module_from_record` | Registros | Elimina módulo de una página |
|
||||
|
||||
@@ -89,6 +89,28 @@ Use `<set>` tag to create variables from queries:
|
||||
<set :featured="'productos' | get({destacado: 1}, 'orden ASC', 3)"></set>
|
||||
```
|
||||
|
||||
### Header, footer, and site-wide style/JS — NOT regular files
|
||||
|
||||
`template/estandar/modulos/custom-header-twig/index-base.tpl` and the equivalent `custom-footer-twig`
|
||||
one are **not editable as files** — `acai-write`/`acai-line-replace` reject them with
|
||||
`"Forbidden path: ... es un artefacto generado del layout global"`. They're special general sections
|
||||
(the header/footer of the **entire site**). The `.tpl` on disk is only a generated copy for fast reading
|
||||
(`acai-view` works fine on it), but the real source lives in `layout.json` and is edited with the
|
||||
`get_layout_field`/`set_layout_field` MCP tools (see
|
||||
[docs/mcp-tools-reference.md](mcp-tools-reference.md)):
|
||||
|
||||
- `field: 'header'` / `field: 'footer'` — the header/footer templates themselves.
|
||||
- `field: 'style'` — global CSS for the whole site.
|
||||
- `field: 'javascript'` — global JS for the whole site (delegated listeners shared by every page live
|
||||
here, not in any `.js` file in the repo — a `grep` of the repo for "how does X work in the header"
|
||||
can find nothing even though X works fine in production).
|
||||
|
||||
Workflow for a header/footer/global-CSS/global-JS change: `get_layout_field({field: '...'})` → edit the
|
||||
**full** string (there's no line-replace for this — `set_layout_field` is a destructive full-content
|
||||
replace) → `set_layout_field({field: '...', content: ...})`. The response includes `compile_ok` —
|
||||
verify it, same as any other write-op (see the reliability warning in
|
||||
[docs/mcp-tools-reference.md](mcp-tools-reference.md)).
|
||||
|
||||
|
||||
## Repeatable Content (multiv2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user