### Clone and Build ComposeFlux Source: https://veerendra2.github.io/composeflux/Development Clone the repository, download Go modules, and build the application binary. This is the initial setup for development. ```bash git clone https://github.com/veerendra2/composeflux.git cd composeflux go mod download task install # Install dev tools task build ./dist/composeflux --help ``` -------------------------------- ### Starting ComposeFlux with Docker Compose Source: https://veerendra2.github.io/composeflux/GettingStarted Commands to start ComposeFlux in daemon mode and follow its logs for real-time updates. ```bash # Default: Run in daemon mode (continuous reconciliation) docker compose up -d docker compose logs -f ``` -------------------------------- ### Install MkDocs Dependencies Source: https://veerendra2.github.io/composeflux/Development Install the MkDocs Material theme and other necessary Python packages for serving documentation locally. ```bash pip install mkdocs-material ``` -------------------------------- ### Example Stack Configuration Source: https://veerendra2.github.io/composeflux/Introduction An example `stack.yml` file for ComposeFlux. It defines the deployment order for specific stacks and sets common environment variables for all stacks. ```yaml # Only list stacks that need specific order # Everything else deploys in whatever order startup_order: - traefik # Must match the directory name in STACK_PATH # Common variables available to all stacks envs: DOMAIN: homeserver.local TZ: America/New_York ENVIRONMENT: production ``` -------------------------------- ### Set Up Python Virtual Environment for MkDocs Source: https://veerendra2.github.io/composeflux/Development Manually set up a Python virtual environment for installing MkDocs dependencies. This is necessary if you are not using direnv and pyenv. ```bash python3 -m venv venv/ source venv/bin/activate ``` -------------------------------- ### Multi-Server Setup Diagram Source: https://veerendra2.github.io/composeflux/Introduction A diagram illustrating the multi-server setup for ComposeFlux, where each server runs its own instance and manages stacks from a shared Git repository. ```diagram Server 1 (homeserver-1) Server 2 (homeserver-2) ┌─────────────────────┐ ┌─────────────────────┐ │ ComposeFlux │ │ ComposeFlux │ │ → stacks/server-1/ │ │ → stacks/server-2/ │ └─────────────────────┘ └─────────────────────┘ ↓ ↓ ┌────────────────────────────────────────┐ │ Git Repository (shared) │ │ your-stacks-repo/ │ │ └── stacks/ │ │ ├── server-1/ ← Server 1 stacks│ │ │ ├── app1/ │ │ │ └── app2/ │ │ └── server-2/ ← Server 2 stacks│ │ ├── app3/ │ │ └── app4/ │ └────────────────────────────────────────┘ ``` -------------------------------- ### Stack Discovery Structure Example Source: https://veerendra2.github.io/composeflux/Introduction Illustrates the one-level deep stack discovery limitation of ComposeFlux. Only directories directly under the root 'stacks/' directory are scanned. ```tree stacks/ ├── app1/ ← Discovered ✓ │ └── compose.yml ├── app2/ ← Discovered ✓ │ └── compose.yml └── nested/ └── app3/ ← NOT discovered ✗ └── compose.yml ``` -------------------------------- ### Example .env File for ComposeFlux Source: https://veerendra2.github.io/composeflux/GettingStarted A sample .env file demonstrating required and optional environment variables for configuring ComposeFlux. This includes Git repository details and secrets manager settings. ```dotenv GIT_REPO_URL=git@github.com:user/repo.git STACK_PATH=stacks SECRETS_PROVIDER=infisical INFISICAL_CLIENT_ID=... INFISICAL_CLIENT_SECRET=... INFISICAL_ENVIRONMENT=... INFISICAL_PROJECT_ID=... INFISICAL_SITE_URL=https://app.infisical.com INFISICAL_SECRET_PATH=/ ``` -------------------------------- ### Run ComposeFlux in Daemon Mode Source: https://veerendra2.github.io/composeflux/GettingStarted Starts ComposeFlux in daemon mode for continuous reconciliation. It performs an initial sync and then periodically checks the Git repository for changes. ```bash composeflux run ``` -------------------------------- ### Serve MkDocs Documentation Locally Source: https://veerendra2.github.io/composeflux/Development Use the task runner to serve the MkDocs documentation locally. This allows for live previewing of changes. ```bash task docs # or task serve-docs ``` -------------------------------- ### Prometheus Query for Deployment Success Rate Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Calculates the percentage of successful deployments over the last 5 minutes using Prometheus. ```promql ( sum(rate(composeflux_deployments_total[5m])) - sum(rate(composeflux_deployment_failures_total[5m])) ) / sum(rate(composeflux_deployments_total[5m])) * 100 ``` -------------------------------- ### ComposeFlux CLI Usage Source: https://veerendra2.github.io/composeflux/GettingStarted Displays the available commands and global flags for the ComposeFlux CLI. Use `run` for continuous reconciliation and `sync` for a one-shot deployment. ```bash Usage: composeflux [flags) A GitOps continuous deployment tool for Docker Compose. Flags: -h, --help Show context-sensitive help. --log-format="console" Set the output format of the logs. Must be "console" or "json" ($LOG_FORMAT). --log-level=INFO Set the log level. Must be "DEBUG", "INFO", "WARN" or "ERROR" ($LOG_LEVEL). --log-add-source Whether to add source file and line number to log records ($LOG_ADD_SOURCE). --version Print version information and exit Commands: run Run ComposeFlux in daemon mode (continuous reconciliation) sync Perform a one-shot sync and deploy Run "composeflux --help" for more information on a command. ``` -------------------------------- ### Available Project Tasks Source: https://veerendra2.github.io/composeflux/Development Lists all available tasks for the ComposeFlux project, including build, test, lint, and documentation serving. ```bash task: Available tasks for this project: * all: Run comprehensive checks; format, lint, security and test * build: Build the application binary for the current platform * build-docker: Build Docker image * compose: Run the application in development mode using Docker Compose * fmt: Formats all Go source files * install: Install required tools and dependencies * lint: Run static analysis and code linting using golangci-lint * run: Runs the main application * security: Run security vulnerability scan * serve-docs: Serve MkDocs documentation locally with live reload (aliases: docs) * test: Runs all tests in the project (aliases: tests) * vet: Examines Go source code and reports suspicious constructs ``` -------------------------------- ### Stack Configuration Directory Structure Source: https://veerendra2.github.io/composeflux/Introduction Illustrates the expected directory structure for ComposeFlux stack configuration. The `stack.yml` file should be placed within the `STACK_PATH` directory. ```directory structure your-stacks-repo/ └── stacks/ ← STACK_PATH ├── stack.yml ← Config file here ├── traefik/ │ └── compose.yml ├── nextcloud/ │ └── compose.yml └── jellyfin/ └── compose.yml ``` -------------------------------- ### Perform a One-Shot Sync with ComposeFlux Source: https://veerendra2.github.io/composeflux/GettingStarted Manually triggers an immediate synchronization and deployment. This command is useful for applying changes, such as updated secrets, without modifying the Git repository. ```bash composeflux sync ``` -------------------------------- ### Verifying ComposeFlux Deployment Source: https://veerendra2.github.io/composeflux/GettingStarted Commands to check ComposeFlux logs, list managed stacks by label, and list all Docker Compose projects. ```bash # Check logs docker compose logs -f # List managed stacks (should show containers with composeflux label) docker ps --filter "label=composeflux.managed=true" # List all compose projects docker compose ls ``` -------------------------------- ### ComposeFlux Environment Variables Configuration Source: https://veerendra2.github.io/composeflux/GettingStarted Set up essential environment variables for ComposeFlux, including Git repository URL and stack path. Optional variables for secrets providers and logging are also shown. ```dotenv GIT_REPO_URL=git@github.com:user/stacks-repo.git STACK_PATH=stacks # Optional - Choose a secrets provider (omit to run without secrets): # Option A: Bitwarden SECRETS_PROVIDER=bitwarden GIT_DEPLOY_KEY_SECRET_REF=aaaaaaa-bbbbb-bbbb-cccc-ddddd BITWARDEN_ACCESS_TOKEN=your-access-token BITWARDEN_ORGANIZATION_ID=your-org-id BITWARDEN_PROJECT_ID=your-project-id # Option B: Infisical # SECRETS_PROVIDER=infisical # GIT_DEPLOY_KEY_SECRET_REF=SSH_PRIVATE_KEY # INFISICAL_CLIENT_ID=your-client-id # INFISICAL_CLIENT_SECRET=your-client-secret # INFISICAL_ENVIRONMENT=prod # INFISICAL_PROJECT_ID=your-project-id ``` -------------------------------- ### Configure Infisical Environment Variables Source: https://veerendra2.github.io/composeflux/how-to-guides/Infisical Set these environment variables in your .env file or compose file to connect ComposeFlux to your Infisical project. Ensure you replace placeholders with your actual credentials and configuration. ```bash SECRETS_PROVIDER=infisical INFISICAL_CLIENT_ID= INFISICAL_CLIENT_SECRET= INFISICAL_ENVIRONMENT=prod INFISICAL_PROJECT_ID= # Optional (supports comma-separated paths) INFISICAL_SECRET_PATH=/ # INFISICAL_SITE_URL=https://app.infisical.com # Optional: only if using a custom key name for SSH deploy key # GIT_DEPLOY_KEY_SECRET_REF=SSH_PRIVATE_KEY ``` -------------------------------- ### Test SSH Access to GitHub Source: https://veerendra2.github.io/composeflux/how-to-guides/GithubDeployKeys Tests the SSH connection to GitHub using the generated private key. This verifies that the key is correctly configured and accepted by GitHub. ```bash # Test GitHub connection with your key ssh -i ~/.ssh/composeflux_deploy -T git@github.com # Expected output: # Hi user/repo! You've successfully authenticated, but GitHub does not provide shell access. ``` -------------------------------- ### Configure Bitwarden Environment Variables Source: https://veerendra2.github.io/composeflux/how-to-guides/Bitwarden Set these environment variables in your .env file or compose file to connect ComposeFlux to Bitwarden Secrets Manager. Include optional variables for self-hosted instances or SSH deploy key references. ```dotenv SECRETS_PROVIDER=bitwarden BITWARDEN_ACCESS_TOKEN= BITWARDEN_ORGANIZATION_ID= BITWARDEN_PROJECT_ID= # Optional: only if fetching SSH deploy key from Bitwarden GIT_DEPLOY_KEY_SECRET_REF= # Optional: only for self-hosted Bitwarden # BITWARDEN_API_URL=https://vault.bitwarden.com/api # BITWARDEN_IDENTITY_URL=https://vault.bitwarden.com/identity ``` -------------------------------- ### Timeseries Panel Configuration Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Configuration for a 'timeseries' panel to visualize deployment attempts and failures over time. It uses two Prometheus queries, one for attempts and one for failures, with specific legend formats and color overrides for clarity. ```json { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Rate of deployments and failures per stack", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 38, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": true, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byRegexp", "options": ".*failures.*" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": ".*attempts.*" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 6 }, "id": 6, "options": { "annotations": { "clustering": -1, "multiLane": false }, "legend": { "calcs": [ "lastNotNull" ], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "multi", "sort": "none" } }, "pluginVersion": "13.0.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(rate(composeflux_deployments_total[5m])) by (stack_name)", "legendFormat": "{{stack_name}} attempts", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(rate(composeflux_deployment_failures_total[5m])) by (stack_name)", "legendFormat": "{{stack_name}} - Failures", "range": true, "refId": "B" } ], "title": "Deployments Over Time", "type": "timeseries" } ``` -------------------------------- ### Prometheus Query for Image Update Success Rate Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Calculates the percentage of successful image updates over the last 5 minutes using Prometheus. ```promql ( sum(rate(composeflux_image_updates_total[5m])) - sum(rate(composeflux_image_update_failures_total[5m])) ) / sum(rate(composeflux_image_updates_total[5m])) * 100 ``` -------------------------------- ### Expose Secrets as Environment Variables in Compose Stack Source: https://veerendra2.github.io/composeflux/how-to-guides/Infisical Define your services in the Compose file and use the ${SECRET_KEY} syntax to expose secrets fetched from Infisical as environment variables for your application containers. ```yaml services: app: image: myapp:latest environment: DATABASE_PASSWORD: ${DATABASE_PASSWORD} API_KEY: ${API_KEY} ``` -------------------------------- ### Stat Panel Configuration Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Configuration for a 'stat' type panel displaying the total sum of increased 'composeflux_stacks_pruned_total' over a specified range. This is useful for showing a single aggregated metric. ```json { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "id": 5, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value", "wideLayout": true }, "pluginVersion": "13.0.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "expr": "sum(increase(composeflux_stacks_pruned_total[$__range]))", "legendFormat": "Pruned", "refId": "A" } ], "title": "Stacks Pruned", "type": "stat" } ``` -------------------------------- ### Prometheus Bar Chart Panel Configuration Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Configures a bar chart panel to display pruned stacks over time by stack name, using Prometheus as the data source. It includes default field configurations for the bar chart. ```json { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Pruned stacks over time by stack name", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "bars", "fillOpacity": 50, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", ``` -------------------------------- ### Configure ComposeFlux with Mounted Key Source: https://veerendra2.github.io/composeflux/how-to-guides/GithubDeployKeys Configures ComposeFlux to use a directly mounted SSH private key, bypassing the secrets manager. The GIT_SSH_KEY_PATH environment variable specifies the key's location within the container. ```yaml # In compose.yml environment: GIT_SSH_KEY_PATH: /.ssh/composeflux_id_rsa # Where the key will be mounted volumes: - ~/.ssh/composeflux_deploy:/.ssh/composeflux_id_rsa:ro ``` -------------------------------- ### Configure ComposeFlux with Secrets Manager Source: https://veerendra2.github.io/composeflux/how-to-guides/GithubDeployKeys Configures ComposeFlux to fetch the SSH private key from a secrets manager. Ensure the SECRETS_PROVIDER and GIT_DEPLOY_KEY_SECRET_REF environment variables are set correctly. ```yaml # In compose.yml environment: GIT_REPO_URL: git@github.com:user/repo.git # SSH URL SECRETS_PROVIDER: bitwarden # or infisical GIT_DEPLOY_KEY_SECRET_REF: SSH_PRIVATE_KEY # Change if using a different name ``` -------------------------------- ### Prometheus Time Series Panel Configuration Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Configures a time series panel to display image updates and failures over time using Prometheus. It sets up two targets for attempts and failures, with custom legend formats and overrides for colors based on metric names. ```json { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(rate(composeflux_image_updates_total[5m])) by (stack_name)", "legendFormat": "{{stack_name}} attempts", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(rate(composeflux_image_update_failures_total[5m])) by (stack_name)", "legendFormat": "{{stack_name}} - Failures", "range": true, "refId": "B" } ], "title": "Image Updates Over Time (by Stack)", "type": "timeseries" } ``` -------------------------------- ### Expose Bitwarden Secrets as Environment Variables in Compose Stack Source: https://veerendra2.github.io/composeflux/how-to-guides/Bitwarden Configure your Compose stack to use secrets fetched from Bitwarden. ComposeFlux will expose these secrets as environment variables for your services. ```yaml services: app: image: myapp:latest environment: DATABASE_URL: ${DATABASE_URL} API_KEY: ${API_KEY} ``` -------------------------------- ### ComposeFlux Docker Compose Service Definition Source: https://veerendra2.github.io/composeflux/GettingStarted Defines the ComposeFlux service within a Docker Compose file, specifying the image, container name, restart policy, and environment variables. Includes commented-out options for secrets management and logging. ```yaml services: composeflux: image: ghcr.io/veerendra2/composeflux:latest container_name: composeflux restart: unless-stopped environment: # Git Configuration GIT_REPO_URL: ${GIT_REPO_URL} STACK_PATH: ${STACK_PATH} # GIT_INTERVAL: 5m # Sync interval # GIT_BRANCH: main # Secrets Manager - Bitwarden (optional) # SECRETS_PROVIDER: ${SECRETS_PROVIDER} # GIT_DEPLOY_KEY_SECRET_REF: ${GIT_DEPLOY_KEY_SECRET_REF} # BITWARDEN_ACCESS_TOKEN: ${BITWARDEN_ACCESS_TOKEN} # BITWARDEN_ORGANIZATION_ID: ${BITWARDEN_ORGANIZATION_ID} # BITWARDEN_PROJECT_ID: ${BITWARDEN_PROJECT_ID} # Secrets Manager - Infisical (comment out Bitwarden above if using this) # SECRETS_PROVIDER: infisical # GIT_DEPLOY_KEY_SECRET_REF: ${GIT_DEPLOY_KEY_SECRET_REF} # INFISICAL_CLIENT_ID: ${INFISICAL_CLIENT_ID} # INFISICAL_CLIENT_SECRET: ${INFISICAL_CLIENT_SECRET} # INFISICAL_ENVIRONMENT: ${INFISICAL_ENVIRONMENT} # INFISICAL_PROJECT_ID: ${INFISICAL_PROJECT_ID} # INFISICAL_SITE_URL: https://app.infisical.com # Logging # LOG_LEVEL: info # LOG_FORMAT: console # console or json # Metrics # METRICS_ADDR: ":9090" # Prometheus metrics endpoint, empty to disable ports: - "9090:9090" # Prometheus metrics volumes: - /var/run/docker.sock:/var/run/docker.sock # Optional: Custom SSH known_hosts # - ./ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro # Optional: Mount local SSH key instead of fetching from secrets manager # - ~/.ssh/id_rsa:/.ssh/composeflux_id_rsa:ro ``` -------------------------------- ### Prometheus Query for Total Stacks Removed Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json Retrieves the total count of managed stacks that have been removed. ```promql sum(composeflux_stacks_removed_total) ``` -------------------------------- ### Grafana Dashboard Configuration Source: https://veerendra2.github.io/composeflux/dashboards/grafana-dashboard.json This JSON represents the full configuration of a Grafana dashboard. It includes settings for annotations, links, and panels. ```json { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [ { "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": false, "tags": [], "targetBlank": true, "title": "ComposeFlux GitHub", "tooltip": "", "type": "link", "url": "https://github.com/veerendra2/composeflux" } ], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Percentage of successful deployments across all stacks", "fieldConfig": { "defaults": { "max": 100, "min": 0, "noValue": "N/A", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "orange", "value": 80 }, { "color": "green", "value": 95 } ] }, "unit": "percent" } }, "gridPos": { "h": 6, "w": 8, "x": 0, "y": 0 }, "id": 1, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value", "wideLayout": true }, "pluginVersion": "13.0.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "( sum(rate(composeflux_deployments_total[5m])) - sum(rate(composeflux_deployment_failures_total[5m])) ) / sum(rate(composeflux_deployments_total[5m])) * 100", "legendFormat": "Success Rate", "range": true, "refId": "A" } ], "title": "Deployment Success Rate", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Percentage of successful image updates across all stacks", "fieldConfig": { "defaults": { "max": 100, "min": 0, "noValue": "N/A", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": 0 }, { "color": "orange", "value": 80 }, { "color": "green", "value": 95 } ] }, "unit": "percent" } }, "gridPos": { "h": 6, "w": 8, "x": 8, "y": 0 }, "id": 2, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value", "wideLayout": true }, "pluginVersion": "13.0.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "( sum(rate(composeflux_image_updates_total[5m])) - sum(rate(composeflux_image_update_failures_total[5m])) ) / sum(rate(composeflux_image_updates_total[5m])) * 100", "legendFormat": "Success Rate", "range": true, "refId": "A" } ], "title": "Image Update Success Rate", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Total managed stacks removed", "fieldConfig": { "defaults": { "noValue": "0", "thresholds": { "mode": "absolute", "steps": [ { "color": "purple", "value": 0 } ] } } }, "gridPos": { "h": 6, "w": 8, "x": 16, "y": 0 }, "id": 3, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value", "wideLayout": true }, "pluginVersion": "13.0.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(composeflux_stacks_removed_total)", "legendFormat": "Stacks Removed", "range": true, "refId": "A" } ], "title": "Stacks Removed", "type": "stat" } ], "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "ComposeFlux", "uid": "composeflux-dashboard", "version": 1 } ``` -------------------------------- ### Generate SSH Key Pair Source: https://veerendra2.github.io/composeflux/how-to-guides/GithubDeployKeys Generates a new ed25519 SSH key pair without a passphrase for automated use. This creates both a private and a public key file. ```bash # Generate new key pair (no passphrase for automation) ssh-keygen -t ed25519 -C "composeflux-deploy-key" -f ~/.ssh/composeflux_deploy # This creates: # - Private key: ~/.ssh/composeflux_deploy # - Public key: ~/.ssh/composeflux_deploy.pub ``` -------------------------------- ### Exclude Stack from Image Updates Source: https://veerendra2.github.io/composeflux/Introduction Add this label to any service within a Docker Compose file to prevent the entire stack from automatic image updates. If any service has this label, the stack is skipped. ```yaml services: db: image: postgres:15 labels: composeflux.image-update.exclude: "true" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.