diff --git a/README.md b/README.md index e215bc4..04fdae2 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,48 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# SAM Portal (Portal IT) -## Getting Started +Índice de aplicaciones SAM + portal de gestión IT. Next.js 16 + Bootstrap 5 + Boxicons. -First, run the development server: +- **Índice público**: https://sam.devops.norteamericano.cl (aplicaciones integradas por sección) +- **Portal IT** (login): https://it.sam.devops.norteamericano.cl (tablero, gestión y tableros por módulo) + +## Rutas + +| Ruta | Auth | Descripción | +|------|------|-------------| +| `/` | no | Índice: módulos visibles por sección | +| `/login` | no | Ingreso IT (estilo legacy, USUARIO=idUsuario + CLAVE) | +| `/tablero` | sí | Tablero IT: estado global, carga por app (docker stats), servicios base | +| `/m/:name` | sí | Tablero del módulo (Portal IT redirige al tablero) | +| `/upload` | sí | Integrar módulo (categoría, tipo, visibilidad) | +| `/actualizar` | sí | Redeploy + webhook + toggle visibilidad | +| `/eliminar` | sí | Baja de módulos (con/sin código) | +| `/api/modules`, `/api/stats` | no/sí | Proxy al deployer (token server-side) | +| `/api/deployer/*` | sí | Proxy genérico al deployer | +| `/api/auth`, `/api/me` | — | Sesión HMAC 12h en cookie httpOnly | + +## Auth IT + +Login contra el backend (`POST /api/Auth/it-login`, tabla `sige_sam_v3.usuario`, +clave en texto plano o SHA256) + allowlist `IT_USERS` (solo esos correos entran). ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +# Env del contenedor (las inyecta el deployer al registrar) +DEPLOYER_URL=http://sam-deployer:3010 +DEPLOYER_TOKEN= +NEXT_PUBLIC_API_URL=https://api.devops.norteamericano.cl +IT_USERS=cgaray@norteamericano.cl,fmena@norteamericano.cl,jallende@norteamericano.cl +IT_SESSION_SECRET= ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## Desarrollo -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +```bash +npm install +npm run dev # http://localhost:3000 +npm run lint && npm run build +``` -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +El deploy a producción (.4) es vía push a `main` del repo + rebuild del +contenedor (`portal-frontend`). El módulo está registrado en el deployer +(categoría `sam`, subdominio `sam`); sus pushes ya no autodespliegan solos +(ver deployer `state.json` en .4).