-
Notifications
You must be signed in to change notification settings - Fork 0
feat: comprehensive codebase refinement for security, performance, and robustness #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
02c5d11
18996be
6c87487
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -208,8 +208,8 @@ apply_feature() { | |||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| git_signing) GET_BASHED_GIT_SIGNING=$v ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| dev_tools) GROUP_INSTALLS="${GROUP_INSTALLS},rg,fd,bat,fzf,jq,yq,tree,direnv,starship,nodejs,python,bash" ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| ops_tools) GROUP_INSTALLS="${GROUP_INSTALLS},gh,git_lfs,terraform,awscli,kubectl,helm,stern,doppler,nodejs,python,java,bash" ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| dev_tools) GROUP_INSTALLS="${GROUP_INSTALLS},rg,fd,bat,eza,fzf,jq,yq,tree,direnv,starship,nodejs,python,bash" ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| ops_tools) GROUP_INSTALLS="${GROUP_INSTALLS},gh,git_lfs,terraform,awscli,kubectl,helm,stern,doppler,eza,nodejs,python,java,bash" ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| *) return 1 ;; | ||||||||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -264,6 +264,7 @@ backup_file() { | |||||||||||||||||||||||||||||||||||||||||||||
| [[ -e "$file" ]] || return 0 | ||||||||||||||||||||||||||||||||||||||||||||||
| local backup_dir="$PREFIX/backup" | ||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p "$backup_dir" | ||||||||||||||||||||||||||||||||||||||||||||||
| chmod 700 "$backup_dir" | ||||||||||||||||||||||||||||||||||||||||||||||
| local base | ||||||||||||||||||||||||||||||||||||||||||||||
|
jbdevprimary marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||
| base="$(basename "$file")" | ||||||||||||||||||||||||||||||||||||||||||||||
| base="${base#.}" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -539,11 +540,15 @@ cp -f "$REPO_DIR/gitconfig" "$PREFIX/gitconfig" | |||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| # secrets.d bootstrap (only inside GET_BASHED_HOME) | ||||||||||||||||||||||||||||||||||||||||||||||
| mkdir -p "$PREFIX/secrets.d" | ||||||||||||||||||||||||||||||||||||||||||||||
| chmod 700 "$PREFIX/secrets.d" | ||||||||||||||||||||||||||||||||||||||||||||||
| if [[ ! -e "$PREFIX/secrets.d/00-local.sh" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| cat <<'__SECRETS__' > "$PREFIX/secrets.d/00-local.sh" | ||||||||||||||||||||||||||||||||||||||||||||||
| ( | ||||||||||||||||||||||||||||||||||||||||||||||
| umask 077 | ||||||||||||||||||||||||||||||||||||||||||||||
|
jbdevprimary marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||
| cat <<'__SECRETS__' > "$PREFIX/secrets.d/00-local.sh" | ||||||||||||||||||||||||||||||||||||||||||||||
| # Place local secrets here. Example: | ||||||||||||||||||||||||||||||||||||||||||||||
| # export FOO="bar" | ||||||||||||||||||||||||||||||||||||||||||||||
| __SECRETS__ | ||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+543
to
552
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normalize Right now, Line 544 only creates the file if missing. If an existing 🔧 Proposed fix mkdir -p "$PREFIX/secrets.d"
chmod 700 "$PREFIX/secrets.d"
if [[ ! -e "$PREFIX/secrets.d/00-local.sh" ]]; then
(
umask 077
cat <<'__SECRETS__' > "$PREFIX/secrets.d/00-local.sh"
# Place local secrets here. Example:
# export FOO="bar"
__SECRETS__
)
fi
+chmod 600 "$PREFIX/secrets.d/00-local.sh"As per coding guidelines: Every script and module must be idempotent and safe to re-run without causing side effects or errors. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| # Write config file | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -558,10 +563,18 @@ fi | |||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_GIT_SIGNING=${GET_BASHED_GIT_SIGNING}" | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_VIMRC_MODE=\"${GET_BASHED_VIMRC_MODE}\"" | ||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -n "$USER_NAME" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_USER_NAME=\"${USER_NAME}\"" | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${USER_NAME//\\/\\\\}" # escape backslashes first | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\$/\\\$}" # escape dollar signs | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\"/\\\"}" # escape double quotes | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\`/\\\`}" # escape backticks | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_USER_NAME=\"${_escaped}\"" | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -n "$USER_EMAIL" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_USER_EMAIL=\"${USER_EMAIL}\"" | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${USER_EMAIL//\\/\\\\}" # escape backslashes first | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\$/\\\$}" # escape dollar signs | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\"/\\\"}" # escape double quotes | ||||||||||||||||||||||||||||||||||||||||||||||
| _escaped="${_escaped//\`/\\\`}" # escape backticks | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "export GET_BASHED_USER_EMAIL=\"${_escaped}\"" | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
|
jbdevprimary marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||
| } > "$PREFIX/get-bashedrc.sh" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.