docs: README real del portal (rutas, auth IT, env, deploy)
This commit is contained in:
1 parent
4a23ca63fe
commit
33d2cc2bcb
1 file changed
+40
-28
@@ -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
|
```bash
|
||||||
npm run dev
|
# Env del contenedor (las inyecta el deployer al registrar)
|
||||||
# or
|
DEPLOYER_URL=http://sam-deployer:3010
|
||||||
yarn dev
|
DEPLOYER_TOKEN=<token>
|
||||||
# or
|
NEXT_PUBLIC_API_URL=https://api.devops.norteamericano.cl
|
||||||
pnpm dev
|
IT_USERS=cgaray@norteamericano.cl,fmena@norteamericano.cl,jallende@norteamericano.cl
|
||||||
# or
|
IT_SESSION_SECRET=<openssl rand -hex 24>
|
||||||
bun dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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
|
||||||
## Learn More
|
(categoría `sam`, subdominio `sam`); sus pushes ya no autodespliegan solos
|
||||||
|
(ver deployer `state.json` en .4).
|
||||||
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.
|
|
||||||
Reference in new issue
Block a user