nowo-tech / runtime-env-bundle
Store selected application environment variables in the database (encrypted at rest via DoctrineEncryptBundle) with an admin CRUD UI. FrankenPHP worker-safe.
Package info
github.com/nowo-tech/RuntimeEnvBundle
Type:symfony-bundle
pkg:composer/nowo-tech/runtime-env-bundle
Fund package maintenance!
Requires
- php: >=8.2 <8.6
- doctrine/doctrine-bundle: ^2.10 || ^3.0
- doctrine/orm: ^2.15 || ^3.0
- nowo-tech/doctrine-encrypt-bundle: ^2.2
- nowo-tech/form-kit-bundle: ^2.17
- nowo-tech/runtime-setting-contract: ^1.1
- nowo-tech/transaction-contract: ^1.0
- nowo-tech/transaction-doctrine: ^1.8.1
- nowo-tech/ui-kit-bundle: ^2.17.3
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^7.4 || ^8.0
- symfony/dependency-injection: ^7.4 || ^8.0
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/http-foundation: ^7.4 || ^8.0
- symfony/http-kernel: ^7.4 || ^8.0
- symfony/routing: ^7.4 || ^8.0
- symfony/security-bundle: ^7.4 || ^8.0
- symfony/security-core: ^7.4 || ^8.0
- symfony/security-csrf: ^7.4 || ^8.0
- symfony/twig-bundle: ^7.4 || ^8.0
- symfony/validator: ^7.4 || ^8.0
- symfony/yaml: ^7.4 || ^8.0
- twig/extra-bundle: ^3.12
- twig/string-extra: ^3.12
- twig/twig: ^3.12
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- igor-php/igor-php: ^0.10.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.0
- rector/rector: ^2.0
- symfony/cache: ^7.4 || ^8.0
- vincentlanglet/twig-cs-fixer: ^4.0
Suggests
- symfony/flex: For automatic recipe installation
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.10.0
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-chore/demo-symfony-8.2
- dev-feat/dbal-query-provider
- dev-ci/release-gates
- dev-feat/manage-edit-row-version
- dev-chore/demo-platform-shell
- dev-fix/schema-fk-collation
- dev-chore/transaction-doctrine-1.8
- dev-ci/deps-floor
- dev-fix/demo-lock-transaction-doctrine
- dev-fix/playwright-image-derive
- dev-fix/concurrency-409-conflict-codes
- dev-chore/deps-2026-11-18
- dev-chore/audit-se-sd-followups
- dev-chore/phase-c-req
- dev-feat/runtime-setting-contract
- dev-chore/demo-uikit
- dev-fix/console-boundary-counter
- dev-feat/arch-bar-w1
- dev-chore/symfony-security-2026-11-04
This package is auto-updated.
Last update: 2026-11-30 18:31:36 UTC
README
⭐ Found this useful? Install from Packagist · Give it a star on GitHub so more developers can find it.
Database-backed application environment variables with admin CRUD. Values are encrypted at rest with nowo-tech/doctrine-encrypt-bundle. Designed for FrankenPHP worker (no $_ENV / putenv mutation; safe with or without kernel.reset / services_resetter).
This bundle is FrankenPHP worker mode friendly.
Bootstrap secrets (
DATABASE_URL,APP_SECRET, encryptor key files,FRANKENPHP_MODE, …) stay in.env. This bundle is for agility on business/integration variables you want to edit without redeploy.
Manage panel: encrypted at rest, values masked, paginated |
Edit: stored value never shown; delete behind a confirm dialog |
RuntimeEnvBag reads the stored value on the next request |
Features
- Doctrine entity
RuntimeEnvVariablewith#[Encrypted]value column - Admin CRUD at
/_runtime_env(REQ-UI-002:ROLE_ADMINby default), paginated, CSRF-protected deletes behind a confirm dialog RuntimeEnvBagAPI + Twigruntime_env('KEY')— request-scoped memoization (worker-safe even whenresetKernelis false) +kernel.reset- Configurable
table_prefix(defaultruntime_env→ tableruntime_env_variables) - UiKit page contract (list / form scaffolds, one host theme for every Nowo bundle; no CDN, no inline JS)
- 1.6 (opt-in): database backend of nowo-tech/runtime-setting-contract — a bundle setting from
.envcan come from this table, change live (nowo:runtime-setting:*or the admin UI, same validator) and rotate without downtime; see USAGE - 1.10: DBAL query providers — read-only runtime value providers (runtime-setting-contract 1.1) configured in YAML:
one parameterised
SELECT, validated when the container is built, with a per-provider cache TTL; see USAGE
Installation
composer require nowo-tech/runtime-env-bundle
Requires a configured DoctrineEncryptBundle profile (Halite recommended). See docs/INSTALLATION.md.
Register routes (Flex recipe copies this):
# config/routes/nowo_runtime_env.yaml nowo_runtime_env: resource: . type: nowo_runtime_env
Requirements
- PHP >= 8.2, < 8.7
- Symfony 7.4, 8.0, or 8.1 (see
composer.json; CI exercises 7.4, 8.0, and 8.1) - Doctrine ORM + Doctrine Bundle
nowo-tech/doctrine-encrypt-bundle(Halite recommended)- Twig 3.12+
Configuration
# config/packages/nowo_runtime_env.yaml nowo_runtime_env: enabled: true table_prefix: runtime_env security: access_roles: [ROLE_ADMIN] allow_unauthenticated: false # never true in production web_ui: enabled: true path_prefix: /_runtime_env list_page_size: 50
The manage pages follow the UiKit page contract: they render inside
nowo_ui_kit.layouts.admin and use the host theme (nowo_ui_kit.css_framework, nowo_ui_kit.theme). Page map and
override points: docs/TEMPLATES.md.
Full tree: docs/CONFIGURATION.md.
Usage
use Nowo\RuntimeEnvBundle\Service\RuntimeEnvBag; public function __construct(private RuntimeEnvBag $runtimeEnv) {} public function __invoke(): void { $token = $this->runtimeEnv->get('MY_API_TOKEN'); }
{{ runtime_env('MY_API_TOKEN') }}
See docs/USAGE.md for more examples.
Development
make setup-hooks
make up
make test
make phpstan
make igor
make cs-check
Demo: cd demo/symfony8 && make up → http://localhost:8026 — see demo/README.md.
The screenshots at the top come from this demo: refresh them with make -C demo/symfony8 demo-screenshots; make -C demo/symfony8 test-e2e runs the Playwright happy path.
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
- Demo with FrankenPHP (development and production)
- Concurrency (write paths, conflict codes)
- FrankenPHP worker audit (
resetKernel=false) - GitHub Actions CI requirements
- PSR evaluation (REQ-CS-007)
Tests and coverage
- Tests: PHPUnit (PHP) under
tests/Unit/andtests/Integration/(FrankenPHP worker simulation) - Coverage:
- PHP: 100%
- TS/JS: N/A
- Python: N/A
- Badge / CI: PHPUnit coverage job on PHP 8.2 + Symfony 7.4
License
MIT. See LICENSE.
Author
Nowo.tech · Héctor Franco Aceituno



