Skip to content

#23 Added the feature to use runtime-env for the LOGO_DEV_TOKEN#25

Merged
marcelreit merged 1 commit into
mainfrom
feature/23-make-env-logo_dev_token-customizable
Mar 30, 2026
Merged

#23 Added the feature to use runtime-env for the LOGO_DEV_TOKEN#25
marcelreit merged 1 commit into
mainfrom
feature/23-make-env-logo_dev_token-customizable

Conversation

@marcelreit

Copy link
Copy Markdown
Contributor

This pull request refactors how debug-related environment variables are handled, moving from build-time injection to runtime configuration for greater flexibility and security. The documentation and Docker setup are updated to reflect this change, and a new API endpoint is introduced to expose runtime config to the client. The main code is updated to use this endpoint to determine if debug UI controls should be enabled, ensuring that changes to runtime environment variables take effect without rebuilding the Docker image.

Runtime vs Build-Time Configuration Refactor:

  • Environment variables LOGO_DEV_TOKEN, ENABLE_DEBUG_MODE, and NEXT_PUBLIC_ENABLE_DEBUG_MODE are no longer injected at build time in Docker or CI; instead, they are set at runtime when starting the container. Only NEXT_PUBLIC_APP_VERSION remains a build-time variable. ([[1]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L71-L73), [[2]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L12-L13), [[3]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L25-L34), [[4]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L34-R40))

Documentation Updates:

  • All relevant documentation files (doc/README.md, doc/configuration.md, doc/deployment.md, doc/running-docker.md, doc/product.md, doc/development.md, doc/architecture.md, README.md, doc/troubleshooting.md) are updated to clarify which environment variables are set at build time vs runtime, how to configure them, and how debug features are enabled in different environments. ([[1]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-a0842ea73f3a116eff7958fbf833dd2280c366c0d8985aa05f8e1403e0f39273L3-R8), [[2]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-c2f1f64eeb5238c809d70b333d9987646e84982e0b133ffa4e0ca1ff86c78448L11-L51), [[3]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-5c8349f737d543dd1b743fb95bf07007781e58e77d243fab4aff5016c79a0c5dL51-R59), [[4]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-aa57448eb80e8553834c2f5298f90c316d9fa012726ca703edb5754ffb56a430L1-R73), [[5]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-35a7c32cb1c91b17b6744fb4b39ef8ef12d055c6810fd06ac7fb3d6c5b620330L28-R28), [[6]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-6adcafbfe72d43bfc98b6b463102a9479c7548b480626650824a92415c546b58R92-R93), [[7]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-35f100357010f37296df44ddf3990785bfeaae4a8935177f4063b4f8028bbc71R29), [[8]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L34-R40), [[9]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-6f21344470815bff488d18edd851993d6b4c0cff71bfa0c1dfbd356e98a44a73L12-R13), [[10]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-6f21344470815bff488d18edd851993d6b4c0cff71bfa0c1dfbd356e98a44a73L31-R55))

Runtime Debug UI Configuration API:

  • Adds a new API route src/app/api/runtime-config/route.ts that returns whether debug UI controls are allowed, based on runtime environment variables. This endpoint disables caching to ensure changes take effect immediately. ([src/app/api/runtime-config/route.tsR1-R23](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-d4673481a744f2c6345d8563285470219c333191551eccd2bc80ff0666229423R1-R23))

Client-Side Debug UI Enablement Logic:

  • Refactors the main calculator component (TankifyCalculator.tsx) to fetch /api/runtime-config at startup to determine if debug UI controls should be shown. This replaces the previous logic that checked environment variables at build time, allowing debug UI to be toggled at runtime without rebuilding. The component now waits for the runtime config check before enabling debug UI and properly synchronizes local storage state. ([[1]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6L54-R56), [[2]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6R205-R241), [[3]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6L234-R269), [[4]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6L273-R313), [[5]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6R331-R337), [[6]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-ed80f8a10195865c5bbb0a0795f1d399a5ff00eb2746ff1e5b3577d715c9aee6R378-R380))

Improved Local and Docker Usage Examples:

  • Updates examples in documentation and Docker-related files to show how to set debug and logo environment variables at runtime, including Docker Compose and manual docker run commands. ([[1]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L34-R40), [[2]](https://github.com/RedMotionMedia/tankify-frontend/pull/25/files#diff-aa57448eb80e8553834c2f5298f90c316d9fa012726ca703edb5754ffb56a430L1-R73))

These changes make it easier and safer to enable debug features in production or staging environments without rebuilding images, and clarify the configuration process for developers and operators.

@marcelreit marcelreit self-assigned this Mar 30, 2026
@marcelreit marcelreit added the enhancement New feature or request label Mar 30, 2026
@marcelreit marcelreit linked an issue Mar 30, 2026 that may be closed by this pull request
@marcelreit marcelreit merged commit 126f493 into main Mar 30, 2026
2 checks passed
@marcelreit marcelreit deleted the feature/23-make-env-logo_dev_token-customizable branch March 30, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Env LOGO_DEV_TOKEN customizable

1 participant