Skip to content

Add support for app config#849

Merged
nightfury1204 merged 1 commit intostagingfrom
config-support
Dec 18, 2024
Merged

Add support for app config#849
nightfury1204 merged 1 commit intostagingfrom
config-support

Conversation

@nightfury1204
Copy link
Collaborator

@nightfury1204 nightfury1204 commented Dec 18, 2024

What is the feature/update/fix?

Feature: Add Support for Application Configuration Files

This update introduces app config support, allowing users to manage configuration files directly within Convox without triggering a new release. Configuration updates can be applied dynamically via the CLI, but services may require a restart to load new values.

Why is this important?

  • Separate Configuration from Code: Store environment-specific settings in configuration files instead of embedding them in the application source code.
  • No Release Required for Updates: Configuration changes do not create a new release, allowing for faster, less disruptive adjustments.
  • Improved Security & Maintainability: Centralizes configuration management and reduces the need for environment variables containing sensitive data.
  • Customizable File Paths & Names: Users can mount specific config files into desired directories and with custom filenames.

Common Use Cases

  • Application Logging & Debugging: Dynamically update logging levels (e.g., log-level: debug) for troubleshooting without redeploying services.
  • Feature Flags: Toggle experimental or feature-gated functionality with a config file rather than hardcoded logic.
  • Database & API Credentials Management: Store external service credentials, avoiding direct use of environment variables.
  • Kubernetes Controller or Sidecar Configuration: Define custom settings for sidecars, service meshes, or monitoring agents like Prometheus.
  • PHP, Node.js, or Go Applications with Config-Based Settings: Mount JSON, YAML, or INI-based settings into the expected directories.

How to Use It

Listing Available Configurations

To view existing configs for an application:

$ convox configs -a sampleapp
CONFIG-ID
convox-settings
custom-settings

Retrieving Configuration Contents

To get the contents of a specific config file:

$ convox config get convox-settings -a sampleapp
{
   "log-level": "info"
}

Updating a Configuration File

To update an existing configuration file:

$ convox config set convox-settings -a sampleapp --file ./config.json

Mounting Config Files in a Service

To specify config mounts in convox.yml:

configs:
  - id: convox-settings
  - id: custom-settings

services:
  web:
    configMounts:
      - id: convox-settings
        dir: /app/convox/settings/
        filename: settings.convox.php
      - id: custom-settings
        dir: /app/convox/custom/
        filename: settings.custom.php

In this example:

  • The convox-settings config file is mounted at /app/convox/settings/settings.convox.php
  • The custom-settings config file is mounted at /app/convox/custom/settings.custom.php
  • Services can reference these settings dynamically, avoiding hardcoded values.

Does it have a breaking change?

No breaking changes are introduced with this update.

Requirements

To use this update, you must be on at least version 3.19.7 for both the CLI and the rack.

Update the CLI: Run convox update to update your CLI to the latest version. You can verify your CLI version with convox version.

For a minor version update, you must manually update your rack with the command convox rack update 3.19.7 -r rackName.
You must be on at least rack version 3.18.0 to perform this update.

If you are already on minor version 3.19.x, you can simply run convox rack update -r rackName.

If you are unfamiliar with v3 rack versioning, we advise checking the documentation Updating a Rack for more information before applying any updates.

@nightfury1204 nightfury1204 changed the title Add support app config Add support for app config Dec 18, 2024
@nightfury1204 nightfury1204 merged commit 99883b0 into staging Dec 18, 2024
@nightfury1204 nightfury1204 deleted the config-support branch December 18, 2024 16:24
@nightfury1204 nightfury1204 restored the config-support branch December 18, 2024 16:25
@nightfury1204 nightfury1204 mentioned this pull request Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant