#23 Added the feature to use runtime-env for the LOGO_DEV_TOKEN#25
Merged
Merged
Conversation
…NABLE_DEBUG_MODE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
LOGO_DEV_TOKEN,ENABLE_DEBUG_MODE, andNEXT_PUBLIC_ENABLE_DEBUG_MODEare no longer injected at build time in Docker or CI; instead, they are set at runtime when starting the container. OnlyNEXT_PUBLIC_APP_VERSIONremains 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:
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:
src/app/api/runtime-config/route.tsthat 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:
TankifyCalculator.tsx) to fetch/api/runtime-configat 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:
docker runcommands. ([[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.