feat: skill expansion — browser, security, SQL, files (16 skills total)
Novas skills instaladas: - openclaw-agent-browser v1.0.0 CLI Chromium — navegação, login, screenshots, state - skill-security-audit v1.0.0 SAST scanning, prompt injection, secrets audit - sql-toolkit v1.0.0 PostgreSQL/MySQL/SQLite — schema, query, otimização - file v1.0.0 Organização de arquivos por contexto - file-summary v1.0.0 Extração e resumo de PDFs, Word, Excel Workspace expandido: - TOOLS.md: +Browser automation, Security audit, SQL, File management - AGENTS.md: +Linux Analyst section (comandos, logs, rede, scripts) + Full-stack strategy - MEMORY.md: 16 skills indexadas, stack map, comandos Linux ref - SESSION-STATE.md: atualizado com contexto completo - lock.json: sincronizado com 16 skills instaladas
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
# Example: Custom App with Dockerfile (Scenario A — Build-from-Source)
|
||||
|
||||
## Original docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: my-app:latest
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=myapp
|
||||
```
|
||||
|
||||
## Issues Detected
|
||||
|
||||
- `build: context: .` — xCloud cannot build images
|
||||
- Database port `5432` exposed to host (security risk)
|
||||
|
||||
## Fixed docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
app:
|
||||
image: ghcr.io/OWNER/my-app:latest
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
expose:
|
||||
- "5432" # internal only — removed host port binding
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=myapp
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
## .github/workflows/docker-build.yml
|
||||
|
||||
```yaml
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: my-app
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository_owner }}/my-app:latest
|
||||
ghcr.io/${{ github.repository_owner }}/my-app:sha-${{ github.sha }}
|
||||
|
||||
- name: Trigger xCloud deploy
|
||||
if: ${{ secrets.XCLOUD_DEPLOY_WEBHOOK != '' }}
|
||||
run: curl -X POST "${{ secrets.XCLOUD_DEPLOY_WEBHOOK }}"
|
||||
```
|
||||
|
||||
## .env.example
|
||||
|
||||
```
|
||||
SECRET_KEY=
|
||||
POSTGRES_PASSWORD=
|
||||
```
|
||||
|
||||
## xCloud Deploy Steps
|
||||
|
||||
1. Push repo to GitHub — GitHub Actions builds and pushes image automatically
|
||||
2. Go to GitHub → Packages → make `my-app` package **Public**
|
||||
3. Add `XCLOUD_DEPLOY_WEBHOOK` secret in GitHub repo settings (from xCloud site → Deploy settings)
|
||||
4. Server → New Site → Custom Docker → connect repo
|
||||
5. Exposed port: **8080**
|
||||
6. Env vars: `SECRET_KEY`, `POSTGRES_PASSWORD`
|
||||
7. Deploy
|
||||
@@ -0,0 +1,120 @@
|
||||
# Example: Fullstack Monorepo (Scenario C — Multi-Service Build)
|
||||
|
||||
## Original docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
frontend:
|
||||
build: ./frontend
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
|
||||
backend:
|
||||
build: ./backend
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
```
|
||||
|
||||
## Issues Detected
|
||||
|
||||
- `build: ./frontend` and `build: ./backend` — two services need building
|
||||
- Multiple exposed ports: 3000, 8000 (xCloud needs single port)
|
||||
- Database port exposed to host
|
||||
|
||||
## Fixed docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
nginx-router:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "3080:80"
|
||||
configs:
|
||||
- source: nginx_config
|
||||
target: /etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
frontend:
|
||||
image: ghcr.io/OWNER/REPO/frontend:latest
|
||||
expose:
|
||||
- "3000"
|
||||
environment:
|
||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
backend:
|
||||
image: ghcr.io/OWNER/REPO/backend:latest
|
||||
expose:
|
||||
- "8000"
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
expose:
|
||||
- "5432"
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
configs:
|
||||
nginx_config:
|
||||
content: |
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://frontend:3000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
## xCloud Deploy Steps
|
||||
|
||||
1. Push to GitHub — matrix workflow builds `frontend` and `backend` images in parallel
|
||||
2. Make both GHCR packages **Public** (github.com/OWNER/REPO → Packages)
|
||||
3. Server → New Site → Custom Docker → connect repo
|
||||
4. Exposed port: **3080**
|
||||
5. Env vars: `NEXT_PUBLIC_API_URL`, `DATABASE_URL`, `JWT_SECRET`, `POSTGRES_PASSWORD`
|
||||
6. Deploy
|
||||
@@ -0,0 +1,59 @@
|
||||
# Example: Fresh Laravel App → xCloud Native Deploy
|
||||
|
||||
## Project structure detected
|
||||
- composer.json ✓
|
||||
- artisan ✓
|
||||
|
||||
Detected: Laravel | Recommended: xCloud Native
|
||||
|
||||
## Step 1 — Prepare .env.example
|
||||
|
||||
```env
|
||||
APP_NAME=MyLaravelApp
|
||||
APP_ENV=production
|
||||
APP_KEY=
|
||||
APP_DEBUG=false
|
||||
APP_URL=https://yourdomain.com
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
```
|
||||
|
||||
## Step 2 — Add to .gitignore
|
||||
```
|
||||
.env
|
||||
/vendor
|
||||
/node_modules
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
```
|
||||
|
||||
## Step 3 — Push to GitHub
|
||||
```bash
|
||||
git init && git add . && git commit -m "Initial commit"
|
||||
git remote add origin https://github.com/OWNER/REPO.git
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
## Step 4 — Deploy in xCloud
|
||||
1. Server → New Site → Laravel tab
|
||||
2. Connect GitHub repo, PHP version: 8.2
|
||||
3. Deploy hooks:
|
||||
```
|
||||
composer install --no-dev --optimize-autoloader
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
php artisan migrate --force
|
||||
php artisan storage:link
|
||||
```
|
||||
4. Add env vars — APP_KEY from `php artisan key:generate --show`
|
||||
5. Deploy
|
||||
@@ -0,0 +1,41 @@
|
||||
# Example: Next.js App → xCloud via Docker
|
||||
|
||||
## Project structure detected
|
||||
- package.json ✓
|
||||
- next.config.js ✓
|
||||
|
||||
Detected: Next.js | Recommended: Docker (requires build step)
|
||||
|
||||
## Step 1 — Add standalone output to next.config.js
|
||||
```js
|
||||
const nextConfig = { output: 'standalone' }
|
||||
module.exports = nextConfig
|
||||
```
|
||||
|
||||
## Step 2 — Add Dockerfile
|
||||
Copy `dockerfiles/nextjs.Dockerfile` → rename to `Dockerfile` in repo root.
|
||||
|
||||
## Step 3 — Add docker-compose.yml
|
||||
Copy `compose-templates/nextjs-postgres.yml` → rename to `docker-compose.yml`. Replace OWNER/REPO.
|
||||
|
||||
## Step 4 — Add GitHub Actions
|
||||
Copy `assets/github-actions-build.yml` → `.github/workflows/docker-build.yml`
|
||||
|
||||
## Step 5 — Add .env.example
|
||||
```env
|
||||
POSTGRES_DB=myapp
|
||||
POSTGRES_USER=myuser
|
||||
POSTGRES_PASSWORD=
|
||||
NEXTAUTH_URL=https://yourdomain.com
|
||||
NEXTAUTH_SECRET=
|
||||
```
|
||||
|
||||
## Step 6 — Push and wait for GHCR build (~3-5 min)
|
||||
```bash
|
||||
git add . && git commit -m "Add xCloud deployment" && git push origin main
|
||||
```
|
||||
|
||||
## Step 7 — Deploy in xCloud
|
||||
1. Server → New Site → Custom Docker
|
||||
2. Connect repo, exposed port: 3000
|
||||
3. Add env vars, Deploy
|
||||
@@ -0,0 +1,124 @@
|
||||
# Example: Rybbit Analytics (Scenario B — Proxy Conflict + Multi-Port)
|
||||
|
||||
## Original docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
caddy:
|
||||
image: caddy:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
|
||||
clickhouse:
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
ports:
|
||||
- "8123:8123"
|
||||
|
||||
backend:
|
||||
image: rybbit/backend:latest
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
|
||||
frontend:
|
||||
image: rybbit/frontend:latest
|
||||
ports:
|
||||
- "3002:3002"
|
||||
environment:
|
||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
```
|
||||
|
||||
## Issues Detected
|
||||
|
||||
- Caddy service (proxy conflict with xCloud nginx)
|
||||
- Multiple exposed ports: 8123, 3001, 3002 (xCloud needs single port)
|
||||
- External Caddyfile volume mount
|
||||
|
||||
## Fixed docker-compose.yml
|
||||
|
||||
```yaml
|
||||
services:
|
||||
nginx-router:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "3080:80"
|
||||
configs:
|
||||
- source: nginx_config
|
||||
target: /etc/nginx/conf.d/default.conf
|
||||
depends_on:
|
||||
- backend
|
||||
- frontend
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
clickhouse:
|
||||
image: clickhouse/clickhouse-server:latest
|
||||
expose:
|
||||
- "8123"
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
backend:
|
||||
image: rybbit/backend:latest
|
||||
expose:
|
||||
- "3001"
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
frontend:
|
||||
image: rybbit/frontend:latest
|
||||
expose:
|
||||
- "3002"
|
||||
environment:
|
||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
configs:
|
||||
nginx_config:
|
||||
content: |
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://backend:3001/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://frontend:3002/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
## .env.example
|
||||
|
||||
```
|
||||
DATABASE_URL=
|
||||
NEXT_PUBLIC_API_URL=
|
||||
```
|
||||
|
||||
## xCloud Deploy Steps
|
||||
|
||||
1. Push repo to GitHub
|
||||
2. Server → New Site → Custom Docker → connect repo
|
||||
3. Exposed port: **3080**
|
||||
4. Env vars to add: `DATABASE_URL`, `NEXT_PUBLIC_API_URL`
|
||||
5. Deploy
|
||||
Reference in New Issue
Block a user