Skip to content

fix: error in decoding SECRET_APP_CONFIG#254

Open
gureckis wants to merge 1 commit into
mainfrom
base64_secrets_225
Open

fix: error in decoding SECRET_APP_CONFIG#254
gureckis wants to merge 1 commit into
mainfrom
base64_secrets_225

Conversation

@gureckis

Copy link
Copy Markdown
Member

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 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.
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.

error in npm run upload_config

1 participant