fix: error in decoding SECRET_APP_CONFIG#254
Open
gureckis wants to merge 1 commit into
Open
Conversation
- This issue may fix #215 and #225 - The issue is: 1. On Ubuntu, base64 adds line breaks every 76 characters by default 2. When stored in GitHub Secrets, these newlines cause decoding issues Solution: - In update_config.sh: Use tr -d '\n' to remove newlines (cross-platform compatible with both macOS and Linux) - In workflow files: Add -i flag to ignore invalid characters during decode (Linux only, which is fine since GitHub Actions uses ubuntu-latest) Why these fixes work: 1. Encoding fix (tr -d '\n'): On Ubuntu/Linux, base64 adds line breaks every 76 characters by default. Using tr -d '\n' removes all newlines and is compatible with both macOS and Linux (unlike -w 0 which only works on Linux). 2. Decoding fix (-i flag): The -i flag tells base64 --decode to ignore invalid input characters. This provides resilience against any stray whitespace or other characters that might have been introduced during secret storage.
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.
npm run upload_config#215 and Deployment error when developing on Ubuntu #225Solution:
Why these fixes work:
Encoding fix (tr -d '\n'): On Ubuntu/Linux, base64 adds line breaks every 76 characters by default. Using tr -d '\n' removes all newlines and is compatible with both macOS and Linux (unlike -w 0 which only works on Linux).
Decoding fix (-i flag): The -i flag tells base64 --decode to ignore invalid input characters. This provides resilience against any stray whitespace or other characters that might have been introduced during secret storage.