feat: AR
This commit is contained in:
@@ -11,19 +11,19 @@ description: Export, import, and manage PostgreSQL databases
|
||||
- **Cleanup utilities**: Keep only the latest dumps, remove old backups
|
||||
- **Hook integration**: Custom pre/post operations for each database action
|
||||
|
||||
### 🪝 Extensibility
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/meat-hook.svg" alt="hook" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Extensibility
|
||||
- **Custom hooks**: Define `pre_db_export`, `post_db_export`, `pre_db_import`, `post_db_import`
|
||||
- **Stack-specific logic**: Each stack can have unique operational requirements
|
||||
- **Environment access**: Hooks inherit all environment variables
|
||||
- **Dry-run aware**: Test hook execution without side effects
|
||||
|
||||
### 🌐 Network Management
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/globe.svg" alt="network" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Network Management
|
||||
- **Unified network**: All stacks communicate on a single Docker network
|
||||
- **CLI overrides**: Change network on-the-fly without editing configs
|
||||
- **Traefik integration**: Seamless reverse proxy setup with proper network awareness
|
||||
- **Multi-network support**: Special stacks can have additional internal networks
|
||||
|
||||
### 🔧 Environment Control
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/wrench.svg" alt="tools" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Environment Control
|
||||
- **Global overrides**: Set environment variables via CLI flags
|
||||
- **Layered configs**: Root `.env` + stack `.env` + CLI overrides
|
||||
- **Precedence rules**: CLI > Stack > Root configuration hierarchy
|
||||
|
||||
@@ -77,14 +77,14 @@ The `sexy` stack uses hooks for Directus schema management:
|
||||
|
||||
### Hook Best Practices
|
||||
|
||||
✅ **DO:**
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **DO:**
|
||||
- Return 0 for success, 1 for failure
|
||||
- Use indented output: `echo " Message"`
|
||||
- Make non-critical operations return 0
|
||||
- Check container status before `docker exec`
|
||||
- Test in dry-run mode first
|
||||
|
||||
❌ **DON'T:**
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/cancel.svg" alt="cancel" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **DON'T:**
|
||||
- Assume containers are running
|
||||
- Use blocking operations without timeouts
|
||||
- Forget error handling
|
||||
|
||||
@@ -25,5 +25,5 @@ chmod +x kompose.sh
|
||||
# Export all databases
|
||||
./kompose.sh "*" db:export
|
||||
|
||||
# That's it! 🎉
|
||||
# That's it! <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/firework-rocket.svg" alt="celebration" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;">
|
||||
```
|
||||
|
||||
@@ -7,7 +7,7 @@ description: Common issues and solutions
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### 🚫 404 Error from Traefik
|
||||
#### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/cancel.svg" alt="error" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> 404 Error from Traefik
|
||||
|
||||
**Problem:** Websites return 404 even though containers are running
|
||||
|
||||
@@ -33,7 +33,7 @@ http://your-server:8080
|
||||
docker inspect blog_app | grep traefik
|
||||
```
|
||||
|
||||
#### 💾 Database Import Fails
|
||||
#### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/save.svg" alt="database" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Database Import Fails
|
||||
|
||||
**Problem:** `db:import` command fails
|
||||
|
||||
@@ -55,7 +55,7 @@ ls -lh news/*.sql
|
||||
./kompose.sh news db:import 2>&1 | tee import.log
|
||||
```
|
||||
|
||||
#### 🔌 Container Won't Connect to Network
|
||||
#### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/plug.svg" alt="connection" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Container Won't Connect to Network
|
||||
|
||||
**Problem:** Container fails to join kompose network
|
||||
|
||||
@@ -70,7 +70,7 @@ docker network create kompose
|
||||
./kompose.sh "*" up -d
|
||||
```
|
||||
|
||||
#### 🪝 Hooks Not Executing
|
||||
#### <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/meat-hook.svg" alt="hook" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Hooks Not Executing
|
||||
|
||||
**Problem:** Custom hooks aren't running
|
||||
|
||||
|
||||
@@ -11,40 +11,40 @@ description: Learn about Kompose, your Docker Compose Symphony Conductor for man
|
||||
|
||||
### Why Kompose?
|
||||
|
||||
🎯 **One Command to Rule Them All** - Manage dozens of stacks with a single command
|
||||
🔄 **Database Wizardry** - Export, import, and clean up PostgreSQL databases like a boss
|
||||
🎪 **Hook System** - Extend functionality with custom pre/post operation hooks
|
||||
🌐 **Network Maestro** - Smart network management with CLI overrides
|
||||
🔐 **Environment Juggler** - Override any environment variable on the fly
|
||||
🎨 **Beautiful Output** - Color-coded logs and status indicators
|
||||
🧪 **Dry-Run Mode** - Test changes before applying them
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/archery-target.svg" alt="target" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **One Command to Rule Them All** - Manage dozens of stacks with a single command
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/reload.svg" alt="reload" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Database Wizardry** - Export, import, and clean up PostgreSQL databases like a boss
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/circus-tent.svg" alt="tent" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Hook System** - Extend functionality with custom pre/post operation hooks
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/globe.svg" alt="network" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Network Maestro** - Smart network management with CLI overrides
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/padlock.svg" alt="lock" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Environment Juggler** - Override any environment variable on the fly
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/paint-brush.svg" alt="colors" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Beautiful Output** - Color-coded logs and status indicators
|
||||
<img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/round-bottom-flask.svg" alt="test" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Dry-Run Mode** - Test changes before applying them
|
||||
|
||||
### 🎼 Stack Management
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/musical-notes.svg" alt="music" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Stack Management
|
||||
- **Pattern-based selection**: Target stacks with globs, comma-separated lists, or wildcards
|
||||
- **Bulk operations**: Execute commands across multiple stacks simultaneously
|
||||
- **Status monitoring**: Visual feedback with color-coded success/failure indicators
|
||||
- **Smart filtering**: Include/exclude stacks with flexible pattern matching
|
||||
|
||||
### 💾 Database Operations
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/save.svg" alt="database" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Database Operations
|
||||
- **Automated backups**: Export PostgreSQL databases with timestamped dumps
|
||||
- **Smart imports**: Auto-detect latest dumps or specify exact files
|
||||
- **Drop & recreate**: Safe database import with connection termination
|
||||
- **Cleanup utilities**: Keep only the latest dumps, remove old backups
|
||||
- **Hook integration**: Custom pre/post operations for each database action
|
||||
|
||||
### 🪝 Extensibility
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/meat-hook.svg" alt="hook" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Extensibility
|
||||
- **Custom hooks**: Define `pre_db_export`, `post_db_export`, `pre_db_import`, `post_db_import`
|
||||
- **Stack-specific logic**: Each stack can have unique operational requirements
|
||||
- **Environment access**: Hooks inherit all environment variables
|
||||
- **Dry-run aware**: Test hook execution without side effects
|
||||
|
||||
### 🌐 Network Management
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/globe.svg" alt="network" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Network Management
|
||||
- **Unified network**: All stacks communicate on a single Docker network
|
||||
- **CLI overrides**: Change network on-the-fly without editing configs
|
||||
- **Traefik integration**: Seamless reverse proxy setup with proper network awareness
|
||||
- **Multi-network support**: Special stacks can have additional internal networks
|
||||
|
||||
### 🔧 Environment Control
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/wrench.svg" alt="tools" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Environment Control
|
||||
- **Global overrides**: Set environment variables via CLI flags
|
||||
- **Layered configs**: Root `.env` + stack `.env` + CLI overrides
|
||||
- **Precedence rules**: CLI > Stack > Root configuration hierarchy
|
||||
|
||||
@@ -116,7 +116,7 @@ Import PostgreSQL database from SQL dump file.
|
||||
./kompose.sh <stack> db:import path/to/dump.sql
|
||||
```
|
||||
|
||||
**⚠️ WARNING:** Drops and recreates the database!
|
||||
**<img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/warning-sign.svg" alt="warning" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> WARNING:** Drops and recreates the database!
|
||||
|
||||
### db:cleanup
|
||||
|
||||
|
||||
@@ -107,17 +107,17 @@ DB_HOST=news-postgres # Overrides root
|
||||
|
||||
### Security
|
||||
|
||||
- ✅ Use strong, random passwords
|
||||
- ✅ Never commit `.env` files to version control
|
||||
- ✅ Use `.env.example` as template
|
||||
- ✅ Rotate secrets regularly
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Use strong, random passwords
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Never commit `.env` files to version control
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Use `.env.example` as template
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Rotate secrets regularly
|
||||
|
||||
### Organization
|
||||
|
||||
- ✅ Document custom variables
|
||||
- ✅ Group related variables
|
||||
- ✅ Use consistent naming
|
||||
- ✅ Keep defaults in root `.env`
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Document custom variables
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Group related variables
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Use consistent naming
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/check-mark.svg" alt="check" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Keep defaults in root `.env`
|
||||
|
||||
## Generating Secrets
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Auth Stack - The Bouncer at Your Digital Club
|
||||
description: "You shall not pass... without proper credentials!"
|
||||
---
|
||||
|
||||
# 🔐 Auth Stack - The Bouncer at Your Digital Club
|
||||
# <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/padlock.svg" alt="lock" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Auth Stack - The Bouncer at Your Digital Club
|
||||
|
||||
> *"You shall not pass... without proper credentials!"* - Keycloak, probably
|
||||
|
||||
@@ -13,18 +13,18 @@ This stack is your authentication and identity management powerhouse. Think of i
|
||||
|
||||
## The Star of the Show
|
||||
|
||||
### 🎭 Keycloak
|
||||
### <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/theater.svg" alt="theater" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Keycloak
|
||||
|
||||
**Container**: `auth_keycloak`
|
||||
**Image**: `quay.io/keycloak/keycloak:latest`
|
||||
**Home**: https://auth.pivoine.art
|
||||
|
||||
Keycloak is like having a Swiss Army knife for authentication. It handles:
|
||||
- 👤 **Single Sign-On (SSO)**: Log in once, access everything. Magic!
|
||||
- 🎫 **Identity Brokering**: Connect with Google, GitHub, and other OAuth providers
|
||||
- 👥 **User Management**: Keep track of who's who in your digital zoo
|
||||
- 🔒 **OAuth 2.0 & OpenID Connect**: Industry-standard security protocols (the fancy stuff)
|
||||
- 🛡️ **Authorization Services**: Fine-grained control over who can do what
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/person.svg" alt="user" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Single Sign-On (SSO)**: Log in once, access everything. Magic!
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/ticket.svg" alt="ticket" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Identity Brokering**: Connect with Google, GitHub, and other OAuth providers
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/three-friends.svg" alt="users" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **User Management**: Keep track of who's who in your digital zoo
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/locked-fortress.svg" alt="security" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **OAuth 2.0 & OpenID Connect**: Industry-standard security protocols (the fancy stuff)
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/shield.svg" alt="shield" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Authorization Services**: Fine-grained control over who can do what
|
||||
|
||||
## Configuration Breakdown
|
||||
|
||||
@@ -53,11 +53,11 @@ Running in `edge` mode because we're living on the edge (behind Traefik)! This t
|
||||
|
||||
| Variable | What It Does | Cool Factor |
|
||||
|----------|-------------|-------------|
|
||||
| `KC_DB` | Database type (postgres) | 🐘 Elephants never forget |
|
||||
| `KC_DB_URL` | JDBC connection string | 🔌 The digital umbilical cord |
|
||||
| `KC_HOSTNAME` | Public-facing URL | 🌐 Your internet identity |
|
||||
| `KC_PROXY` | Proxy mode setting | 🎭 Trust the middleman |
|
||||
| `KC_FEATURES` | Enabled features (docker) | 🐳 Whale hello there! |
|
||||
| `KC_DB` | Database type (postgres) | <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/elephant.svg" alt="elephant" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Elephants never forget |
|
||||
| `KC_DB_URL` | JDBC connection string | <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/plug.svg" alt="plug" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> The digital umbilical cord |
|
||||
| `KC_HOSTNAME` | Public-facing URL | <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/globe.svg" alt="globe" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Your internet identity |
|
||||
| `KC_PROXY` | Proxy mode setting | <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/theater.svg" alt="proxy" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Trust the middleman |
|
||||
| `KC_FEATURES` | Enabled features (docker) | <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/whale-tail.svg" alt="docker" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Whale hello there! |
|
||||
|
||||
## Ports & Networking
|
||||
|
||||
@@ -119,13 +119,13 @@ A: Clear your browser cache, Keycloak loves to cache things
|
||||
**Q: Database connection issues?**
|
||||
A: Ensure the `data` stack is running and healthy
|
||||
|
||||
## Security Notes 🔒
|
||||
## Security Notes <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/locked-fortress.svg" alt="security" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;">
|
||||
|
||||
- 🚨 **Change the default admin password** (seriously, do it now)
|
||||
- 🔐 Database credentials are shared via root `.env`
|
||||
- 🌐 Always access via HTTPS in production
|
||||
- 📝 Enable audit logging for compliance
|
||||
- 🎯 Use realms to separate different applications/teams
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/siren.svg" alt="alert" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> **Change the default admin password** (seriously, do it now)
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/padlock.svg" alt="lock" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Database credentials are shared via root `.env`
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/globe.svg" alt="globe" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Always access via HTTPS in production
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/scroll-unfurled.svg" alt="log" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Enable audit logging for compliance
|
||||
- <img src="https://game-icons.net/icons/000000/transparent/1x1/delapouite/archery-target.svg" alt="target" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;"> Use realms to separate different applications/teams
|
||||
|
||||
## Fun Facts
|
||||
|
||||
@@ -142,4 +142,4 @@ A: Ensure the `data` stack is running and healthy
|
||||
|
||||
---
|
||||
|
||||
*Remember: With great authentication power comes great responsibility. Don't be the person who uses "admin/admin" in production.* 🦸♂️
|
||||
*Remember: With great authentication power comes great responsibility. Don't be the person who uses "admin/admin" in production.* <img src="https://game-icons.net/icons/000000/transparent/1x1/lorc/superhero.svg" alt="hero" style="display:inline; width:1.2em; height:1.2em; vertical-align:-0.15em;">
|
||||
|
||||
Reference in New Issue
Block a user