Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: dotnet restore "./Atlas Balance/backend/GestionCaja.sln"

- name: Pull PostgreSQL test image
run: docker pull postgres:16-alpine
run: docker pull postgres:16-alpine@sha256:4e6e670bb069649261c9c18031f0aded7bb249a5b6664ddec29c013a89310d50

- name: Test backend
run: dotnet test "./Atlas Balance/backend/GestionCaja.sln" -c Release --no-restore
Expand All @@ -46,6 +46,36 @@ jobs:
throw 'NuGet vulnerability audit failed.'
}

- name: Scan high-confidence secrets
shell: pwsh
run: |
$patterns = @(
'-----BEGIN (RSA|DSA|EC|OPENSSH|PRIVATE) KEY-----',
'AKIA[0-9A-Z]{16}',
'gh[pousr]_[A-Za-z0-9_]{36,}',
'xox[baprs]-[A-Za-z0-9-]{20,}',
'sk-live-[A-Za-z0-9]{20,}'
)
$files = (git -c core.quotepath=false ls-files -z) -split "`0" | Where-Object {
$_ -and
$_ -notmatch '(^|/)(Otros|Skills)/' -and
$_ -notmatch '(^|/)(bin|obj|node_modules|dist)/'
}
$findings = @()
foreach ($file in $files) {
if (-not (Test-Path -LiteralPath $file -PathType Leaf)) { continue }
$content = Get-Content -LiteralPath $file -Raw -ErrorAction SilentlyContinue
foreach ($pattern in $patterns) {
if ($content -match $pattern) {
$findings += "$file matches $pattern"
}
}
}
if ($findings.Count -gt 0) {
$findings | ForEach-Object { Write-Error $_ }
throw 'Secret scan failed.'
}

- name: Install frontend dependencies
working-directory: "Atlas Balance/frontend"
run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ logs/
.claude/
artifacts/
.codex-logs/
.codex-runlogs/
output/
.tmp*/
tmp*
test-results/
Expand Down
93 changes: 47 additions & 46 deletions Atlas Balance/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

## Que es este proyecto

Este proyecto pertenece a la empresa Atlas Labs y la aplicacion se llama Atlas Balance.
Aplicacion web on-premise para gestion de tesoreria multi-banco, multi-titular, multi-divisa. Corre en Windows Server, accesible por 4-8 usuarios en red local via navegador.

**Stack:**
Expand Down Expand Up @@ -139,51 +140,51 @@ Guardar toda la documentacion en `Documentacion`.

```
Atlas Balance/
├── CLAUDE.md
├── AGENTS.md
├── .github/
├── .gitignore
├── .gitattributes
├── Atlas Balance/
├── AGENTS.md
├── CLAUDE.md
├── VERSION
├── Directory.Build.props
├── docker-compose.yml
├── Atlas Balance Release/
├── backend/
├── GestionCaja.sln
├── src/
├── GestionCaja.API/
├── Program.cs
├── appsettings.json
├── appsettings.Development.json
├── Models/
├── Data/
├── DTOs/
├── Services/
├── Controllers/
├── Middleware/
├── Jobs/
├── Migrations/
└── wwwroot/
└── GestionCaja.Watchdog/
└── tests/
├── frontend/
├── package.json
├── vite.config.ts
├── tsconfig.json
├── index.html
└── src/
├── scripts/
└── tests/
├── Documentacion/
├── Versiones/
├── Diseno/
├── SPEC.md
├── documentacion.md
└── DOCUMENTACION_CAMBIOS.md
└── Otros/
+-- CLAUDE.md
+-- AGENTS.md
+-- .github/
+-- .gitignore
+-- .gitattributes
+-- Atlas Balance/
¦ +-- AGENTS.md
¦ +-- CLAUDE.md
¦ +-- VERSION
¦ +-- Directory.Build.props
¦ +-- docker-compose.yml
¦ +-- Atlas Balance Release/
¦ +-- backend/
¦ ¦ +-- GestionCaja.sln
¦ ¦ +-- src/
¦ ¦ ¦ +-- GestionCaja.API/
¦ ¦ ¦ ¦ +-- Program.cs
¦ ¦ ¦ ¦ +-- appsettings.json
¦ ¦ ¦ ¦ +-- appsettings.Development.json
¦ ¦ ¦ ¦ +-- Models/
¦ ¦ ¦ ¦ +-- Data/
¦ ¦ ¦ ¦ +-- DTOs/
¦ ¦ ¦ ¦ +-- Services/
¦ ¦ ¦ ¦ +-- Controllers/
¦ ¦ ¦ ¦ +-- Middleware/
¦ ¦ ¦ ¦ +-- Jobs/
¦ ¦ ¦ ¦ +-- Migrations/
¦ ¦ ¦ ¦ +-- wwwroot/
¦ ¦ ¦ +-- GestionCaja.Watchdog/
¦ ¦ +-- tests/
¦ +-- frontend/
¦ ¦ +-- package.json
¦ ¦ +-- vite.config.ts
¦ ¦ +-- tsconfig.json
¦ ¦ +-- index.html
¦ ¦ +-- src/
¦ +-- scripts/
¦ +-- tests/
+-- Documentacion/
¦ +-- Versiones/
¦ +-- Diseno/
¦ +-- SPEC.md
¦ +-- documentacion.md
¦ +-- DOCUMENTACION_CAMBIOS.md
+-- Otros/
```

## Esquema de BD corregido
Expand Down Expand Up @@ -227,7 +228,7 @@ npm run build

# Release Windows x64
cd "Atlas Balance"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\Build-Release.ps1" -Version V-01.04
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\Build-Release.ps1" -Version V-01.05

# Conectar a PostgreSQL
psql -h localhost -p 5433 -U app_user -d atlas_balance
Expand Down
93 changes: 47 additions & 46 deletions Atlas Balance/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

## Que es este proyecto

Este proyecto pertenece a la empresa Atlas Labs y la aplicacion se llama Atlas Balance.
Aplicacion web on-premise para gestion de tesoreria multi-banco, multi-titular, multi-divisa. Corre en Windows Server, accesible por 4-8 usuarios en red local via navegador.

**Stack:**
Expand Down Expand Up @@ -139,51 +140,51 @@ Guardar toda la documentacion en `Documentacion`.

```
Atlas Balance/
├── CLAUDE.md
├── AGENTS.md
├── .github/
├── .gitignore
├── .gitattributes
├── Atlas Balance/
├── AGENTS.md
├── CLAUDE.md
├── VERSION
├── Directory.Build.props
├── docker-compose.yml
├── Atlas Balance Release/
├── backend/
├── GestionCaja.sln
├── src/
├── GestionCaja.API/
├── Program.cs
├── appsettings.json
├── appsettings.Development.json.template
├── Constants/
├── Models/
├── Data/
├── DTOs/
├── Services/
├── Controllers/
├── Middleware/
├── Jobs/
├── Migrations/
└── wwwroot/
└── GestionCaja.Watchdog/
└── tests/
├── frontend/
├── package.json
├── vite.config.ts
├── tsconfig.json
├── index.html
└── src/
└── scripts/
├── Documentacion/
├── Versiones/
├── Diseno/
├── SPEC.md
├── documentacion.md
└── DOCUMENTACION_CAMBIOS.md
└── Otros/
+-- CLAUDE.md
+-- AGENTS.md
+-- .github/
+-- .gitignore
+-- .gitattributes
+-- Atlas Balance/
¦ +-- AGENTS.md
¦ +-- CLAUDE.md
¦ +-- VERSION
¦ +-- Directory.Build.props
¦ +-- docker-compose.yml
¦ +-- Atlas Balance Release/
¦ +-- backend/
¦ ¦ +-- GestionCaja.sln
¦ ¦ +-- src/
¦ ¦ ¦ +-- GestionCaja.API/
¦ ¦ ¦ ¦ +-- Program.cs
¦ ¦ ¦ ¦ +-- appsettings.json
¦ ¦ ¦ ¦ +-- appsettings.Development.json.template
¦ ¦ ¦ ¦ +-- Constants/
¦ ¦ ¦ ¦ +-- Models/
¦ ¦ ¦ ¦ +-- Data/
¦ ¦ ¦ ¦ +-- DTOs/
¦ ¦ ¦ ¦ +-- Services/
¦ ¦ ¦ ¦ +-- Controllers/
¦ ¦ ¦ ¦ +-- Middleware/
¦ ¦ ¦ ¦ +-- Jobs/
¦ ¦ ¦ ¦ +-- Migrations/
¦ ¦ ¦ ¦ +-- wwwroot/
¦ ¦ ¦ +-- GestionCaja.Watchdog/
¦ ¦ +-- tests/
¦ +-- frontend/
¦ ¦ +-- package.json
¦ ¦ +-- vite.config.ts
¦ ¦ +-- tsconfig.json
¦ ¦ +-- index.html
¦ ¦ +-- src/
¦ +-- scripts/
+-- Documentacion/
¦ +-- Versiones/
¦ +-- Diseno/
¦ +-- SPEC.md
¦ +-- documentacion.md
¦ +-- DOCUMENTACION_CAMBIOS.md
+-- Otros/
```

## Esquema de BD corregido
Expand Down Expand Up @@ -227,7 +228,7 @@ npm run build

# Release Windows x64
cd "Atlas Balance"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\Build-Release.ps1" -Version V-01.04
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\Build-Release.ps1" -Version V-01.05

# Conectar a PostgreSQL
psql -h localhost -p 5433 -U app_user -d atlas_balance
Expand Down
8 changes: 4 additions & 4 deletions Atlas Balance/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<PropertyGroup>
<Company>Atlas Labs</Company>
<Product>Atlas Balance</Product>
<Version>1.4.0</Version>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<FileVersion>1.4.0.0</FileVersion>
<InformationalVersion>V-01.04</InformationalVersion>
<Version>1.5.0</Version>
<AssemblyVersion>1.5.0.0</AssemblyVersion>
<FileVersion>1.5.0.0</FileVersion>
<InformationalVersion>V-01.05</InformationalVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
</Project>
24 changes: 19 additions & 5 deletions Atlas Balance/README_RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Atlas Balance V-01.04 - release Windows x64
# Atlas Balance V-01.05 - release Windows x64

Este paquete es autonomo para servidor Windows: el frontend ya esta compilado, el backend y Watchdog van publicados self-contained y la base de datos se prepara desde el instalador.

El ZIP `main` de GitHub no sirve como instalador. Usa `AtlasBalance-V-01.04-win-x64.zip`; dentro deben existir `api\GestionCaja.API.exe` y `watchdog\GestionCaja.Watchdog.exe`.
El ZIP `main` de GitHub no sirve como instalador. Usa `AtlasBalance-V-01.05-win-x64.zip`; dentro deben existir `api\GestionCaja.API.exe` y `watchdog\GestionCaja.Watchdog.exe`.

## Scripts de un clic

Expand Down Expand Up @@ -40,10 +40,10 @@ En Windows Server 2019, instala PostgreSQL manualmente si `winget` falla o no es
El instalador genera passwords fuertes y guarda las credenciales iniciales en:

```text
C:\AtlasBalance\INSTALL_CREDENTIALS_ONCE.txt
C:\AtlasBalance\config\INSTALL_CREDENTIALS_ONCE.txt
```

Guarda ese contenido en un gestor de passwords y borra el archivo despues del primer acceso. Dejarlo ahi es mala seguridad con sombrero.
El directorio `config` queda restringido a Administrators/SYSTEM antes de escribir ese archivo. Guarda ese contenido en un gestor de passwords y borra el archivo despues del primer acceso. Dejarlo ahi es mala seguridad con sombrero.

Si ya tienes PostgreSQL y quieres usarlo:

Expand All @@ -59,6 +59,8 @@ Si reinstalas sobre una BD existente, las credenciales iniciales no se regeneran
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\Reset-AdminPassword.ps1" -InstallPath C:\AtlasBalance -AdminEmail admin@atlasbalance.local -GeneratePassword
```

Ejecuta el reset como Administrador. Si usas `-GeneratePassword`, la password temporal queda en `C:\AtlasBalance\config\RESET_ADMIN_CREDENTIALS_ONCE.txt`.

Health check recomendado:

```powershell
Expand All @@ -76,7 +78,19 @@ Desde la carpeta descomprimida de este paquete:
Si la instalacion ya tiene los scripts nuevos, tambien puedes lanzar desde la carpeta instalada apuntando al paquete:

```powershell
C:\AtlasBalance\update.cmd -PackagePath C:\Temp\AtlasBalance-V-01.04-win-x64 -InstallPath C:\AtlasBalance
C:\AtlasBalance\update.cmd -PackagePath C:\Temp\AtlasBalance-V-01.05-win-x64 -InstallPath C:\AtlasBalance
```

El actualizador crea backup previo, conserva configuracion, reemplaza API/Watchdog, actualiza scripts operativos instalados, actualiza `VERSION`/runtime y valida `/api/health` con `curl.exe -k`.

## Actualizacion desde la app

En `Configuracion > Sistema`, deja el repositorio:

```text
https://github.com/AtlasLabs797/AtlasBalance
```

`Verificar actualizacion` consulta el ultimo GitHub Release. `Actualizar ahora` descarga el asset `AtlasBalance-*-win-x64.zip`, lo valida, lo prepara en `C:\AtlasBalance\updates` y pide al Watchdog aplicar la API nueva.

El Watchdog crea backup PostgreSQL previo, rollback de binarios y health check posterior. Si no puede crear backup o la API no responde despues de actualizar, revierte o rechaza la operacion.
2 changes: 1 addition & 1 deletion Atlas Balance/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
V-01.04
V-01.05
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ public static class AuditActions
public const string Login = "LOGIN";
public const string Logout = "LOGOUT";
public const string LoginFailed = "LOGIN_FAILED";
public const string LoginMfaRequired = "LOGIN_MFA_REQUIRED";
public const string MfaVerified = "MFA_VERIFIED";
public const string MfaEnabled = "MFA_ENABLED";
public const string AccountLocked = "ACCOUNT_LOCKED";
public const string PasswordChanged = "PASSWORD_CHANGED";
public const string PasswordReset = "PASSWORD_RESET";
Expand Down
Loading
Loading