Public Access
initial-commit
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
# Adding Backstage to Charybdis Demo
|
||||
|
||||
Backstage requires a custom build and cannot be run from a pre-built Docker image.
|
||||
|
||||
## Option 1: Use the YAML Adapter Directly
|
||||
|
||||
You can read entities from Charybdis without Backstage:
|
||||
|
||||
```bash
|
||||
# List all entities
|
||||
curl http://localhost:8081/yaml/locations
|
||||
|
||||
# Get specific entity
|
||||
curl http://localhost:8081/yaml/entities/YOUR_ENTITY_ID
|
||||
```
|
||||
|
||||
## Option 2: Build and Run Backstage
|
||||
|
||||
### 1. Create a Backstage App
|
||||
|
||||
```bash
|
||||
# Install Node.js 18+ first
|
||||
npx @backstage/create-app@latest
|
||||
|
||||
# Follow prompts, name it "backstage-app"
|
||||
cd backstage-app
|
||||
```
|
||||
|
||||
### 2. Configure Charybdis Integration
|
||||
|
||||
Edit `app-config.yaml` and add:
|
||||
|
||||
```yaml
|
||||
catalog:
|
||||
locations:
|
||||
# Point to Charybdis YAML adapter
|
||||
- type: url
|
||||
target: http://charybdis:8080/yaml/locations
|
||||
rules:
|
||||
- allow: [Component, System, API, Resource, User, Group, Domain]
|
||||
```
|
||||
|
||||
### 3. Build Docker Image
|
||||
|
||||
Create `backstage-app/Dockerfile`:
|
||||
|
||||
```dockerfile
|
||||
FROM node:18-bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json yarn.lock ./
|
||||
COPY packages packages
|
||||
|
||||
# Install dependencies
|
||||
RUN yarn install --frozen-lockfile --production
|
||||
|
||||
# Build
|
||||
RUN yarn tsc
|
||||
RUN yarn build:backend
|
||||
|
||||
# Run
|
||||
EXPOSE 7007
|
||||
CMD ["node", "packages/backend", "--config", "app-config.yaml"]
|
||||
```
|
||||
|
||||
### 4. Update docker-compose.demo.yml
|
||||
|
||||
Uncomment the Backstage section in `docker-compose.demo.yml`.
|
||||
|
||||
### 5. Start
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.demo.yml up -d backstage
|
||||
```
|
||||
|
||||
Access Backstage at http://localhost:3000
|
||||
|
||||
## Option 3: Run Backstage Locally (Recommended for Development)
|
||||
|
||||
```bash
|
||||
# In backstage-app directory
|
||||
yarn dev
|
||||
```
|
||||
|
||||
Update `app-config.local.yaml`:
|
||||
|
||||
```yaml
|
||||
catalog:
|
||||
locations:
|
||||
- type: url
|
||||
target: http://localhost:8081/yaml/locations
|
||||
rules:
|
||||
- allow: [Component, System, API, Resource, User, Group, Domain]
|
||||
```
|
||||
|
||||
Access at http://localhost:3000
|
||||
|
||||
---
|
||||
|
||||
For more info: https://backstage.io/docs/getting-started/
|
||||
@@ -0,0 +1,92 @@
|
||||
app:
|
||||
title: Charybdis Demo
|
||||
baseUrl: http://localhost:3000
|
||||
|
||||
organization:
|
||||
name: Charybdis
|
||||
|
||||
backend:
|
||||
baseUrl: http://localhost:7007
|
||||
listen:
|
||||
port: 7007
|
||||
csp:
|
||||
connect-src: ["'self'", 'http:', 'https:']
|
||||
cors:
|
||||
origin: http://localhost:3000
|
||||
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
|
||||
credentials: true
|
||||
database:
|
||||
client: pg
|
||||
connection:
|
||||
host: ${POSTGRES_HOST}
|
||||
port: ${POSTGRES_PORT}
|
||||
user: ${POSTGRES_USER}
|
||||
password: ${POSTGRES_PASSWORD}
|
||||
database: backstage
|
||||
|
||||
integrations:
|
||||
github:
|
||||
- host: github.com
|
||||
# Optional: token for private repos
|
||||
# token: ${GITHUB_TOKEN}
|
||||
|
||||
proxy:
|
||||
'/charybdis':
|
||||
target: ${CHARYBDIS_URL}
|
||||
changeOrigin: true
|
||||
|
||||
# Catalog configuration - Point to Charybdis
|
||||
catalog:
|
||||
import:
|
||||
entityFilename: catalog-info.yaml
|
||||
pullRequestBranchName: backstage-integration
|
||||
|
||||
rules:
|
||||
- allow: [Component, System, API, Resource, Location]
|
||||
|
||||
# Charybdis as a location provider
|
||||
locations:
|
||||
# Dynamic location from Charybdis YAML adapter
|
||||
- type: url
|
||||
target: ${CHARYBDIS_URL}/yaml/locations
|
||||
rules:
|
||||
- allow: [Component, System, API, Resource, User, Group, Domain]
|
||||
|
||||
# Processors
|
||||
processors:
|
||||
githubOrg:
|
||||
providers:
|
||||
- target: https://github.com
|
||||
# Optional: token for private orgs
|
||||
# token: ${GITHUB_TOKEN}
|
||||
|
||||
auth:
|
||||
# For demo purposes, we use guest authentication
|
||||
# In production, configure proper authentication
|
||||
providers:
|
||||
guest:
|
||||
dangerouslyAllowOutsideDevelopment: true
|
||||
|
||||
# Scaffolder configuration
|
||||
scaffolder:
|
||||
defaultAuthor:
|
||||
name: Charybdis
|
||||
email: charybdis@example.com
|
||||
|
||||
# TechDocs configuration (optional)
|
||||
techdocs:
|
||||
builder: 'local'
|
||||
generator:
|
||||
runIn: 'local'
|
||||
publisher:
|
||||
type: 'local'
|
||||
|
||||
# Search configuration (optional)
|
||||
search:
|
||||
pg:
|
||||
highlightOptions:
|
||||
useHighlight: true
|
||||
maxWord: 35
|
||||
minWord: 15
|
||||
shortWord: 3
|
||||
highlightAll: false
|
||||
Reference in New Issue
Block a user