feat: automated setup.sh, OCIR login helper with encrypted credentials, README updates

This commit is contained in:
nogueiraguh
2026-04-03 17:51:53 -03:00
parent 2e74d316ae
commit 03db9d6b8a
4 changed files with 300 additions and 49 deletions

View File

@@ -301,43 +301,30 @@ The platform combines security compliance scanning, AI-powered chat with **RAG (
## Quick Start
### Option A — Automated Setup (from OCIR image)
```bash
bash distribution/setup.sh
```
One command: authenticates to OCIR, pulls the image, starts the container. Access `http://localhost:8080` — default credentials `admin` / `admin123` (forced password change on first login).
### Option B — Development (Docker Compose)
```bash
cp .env.example .env
# Edit .env: set APP_SECRET (openssl rand -hex 64)
docker compose up -d --build
```
Access `http://localhost:8080`.
### Prerequisites
- Docker and Docker Compose
- OCI API Key pair (private `.pem` key + fingerprint)
- OCI Tenancy OCID, User OCID, Compartment OCID
### 1. Clone & Configure
```bash
git clone https://github.com/nogueiragustavo/oci-cis-agent.git
cd oci-cis-agent
cp .env.example .env
```
Edit `.env`:
```env
APP_SECRET=your-very-long-random-secret-string-here-at-least-64-chars
JWT_EXPIRY_HOURS=12
PORT=8080
```
### 2. Build & Run
```bash
docker compose up -d --build
```
### 3. Access
Open `http://localhost:8080`
Default credentials:
- **Username:** `admin`
- **Password:** `admin123`
> Change the default password immediately after first login.
---
## Configuration Guide
@@ -877,18 +864,33 @@ pip install -r requirements.txt
DATA_DIR=./data uvicorn app:app --reload --port 8000
```
### Run with Docker
### Run with Docker Compose
```bash
docker compose up -d --build
docker compose logs -f backend
```
### Run Tests
```bash
cd backend
pip install pytest httpx pytest-asyncio
python -m pytest tests/ -v
```
86 baseline tests covering auth, CRUD, settings, chat, terraform, reports, terminal, and user isolation.
### Build & Push OCIR Image
```bash
OCIR_REGION=us-ashburn-1 OCIR_NAMESPACE=idi1o0a010nx ./deploy/scripts/push-images.sh
```
### Rebuild After Changes
```bash
docker compose down
docker compose up -d --build
docker compose up -d --build backend && docker compose restart frontend
```
---