-
Notifications
You must be signed in to change notification settings - Fork 3
Fix bash not loading correct profile, upgrade xmlsec1 #12
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
Open
tangyisheng2
wants to merge
4
commits into
openshift-eng:main
Choose a base branch
from
tangyisheng2:bash_profile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,12 +152,12 @@ function macos_install() { | |
| brew services start redis | ||
| brew services start "postgresql@15" | ||
|
|
||
| # This is a workaround for a problem with the 1.3.7 version of xmlsec1. It forces a downgrade to 1.2.7. | ||
| # The Atlas Toy IDP uses xmlsec1 to sign the SAML requests. | ||
| # https://stackoverflow.com/questions/76805174/getting-key-not-found-with-xmlsec1-on-macos | ||
| local desired_sha="7f35e6ede954326a10949891af2dba47bbe1fc17" tmp_libxmlsec1_path=/tmp/libxmlsec1.rb | ||
| curl -o "${tmp_libxmlsec1_path}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/${desired_sha}/Formula/libxmlsec1.rb" | ||
| HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --formula "${tmp_libxmlsec1_path}" | ||
| # # This is a workaround for a problem with the 1.3.7 version of xmlsec1. It forces a downgrade to 1.2.7. | ||
| # # The Atlas Toy IDP uses xmlsec1 to sign the SAML requests. | ||
| # # https://stackoverflow.com/questions/76805174/getting-key-not-found-with-xmlsec1-on-macos | ||
| # local desired_sha="7f35e6ede954326a10949891af2dba47bbe1fc17" tmp_libxmlsec1_path=/tmp/libxmlsec1.rb | ||
| # curl -o "${tmp_libxmlsec1_path}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/${desired_sha}/Formula/libxmlsec1.rb" | ||
| # HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --formula "${tmp_libxmlsec1_path}" | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -184,6 +184,18 @@ unset rc | |
| EOF | ||
| fi | ||
|
|
||
| if [[ ! -f ~/.bash_profile ]]; then | ||
| # Install skeleton .bashrc if one is not present | ||
| cat >> ~/.bashrc <<"EOF" | ||
| if [ -n "$BASH_VERSION" ]; then | ||
| # include .bashrc if it exists | ||
| if [ -f "$HOME/.bashrc" ]; then | ||
| . "$HOME/.bashrc" | ||
| fi | ||
| fi | ||
| EOF | ||
| fi | ||
|
|
||
|
Comment on lines
+187
to
+198
Contributor
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. This looks fine, but should be part of a separate PR.
Contributor
Author
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. ACK, will move it into a separate PR. |
||
| # Stop the annoying zsh default shell warning | ||
| if [[ ! -f ~/.bash_profile ]] || ! grep -E BASH_SILENCE_DEPRECATION_WARNING ~/.bash_profile >/dev/null 2>&1 ; then | ||
| echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we comment something out, then we always add a comment to say why that was commented out, and when the commented-out section can be restored. Because otherwise, it's not clear to anyone why this code has been disabled.
If the answer is "we want to disable this for now, but let's comment it out because we intende to restore it in the future", then please include a comment that explains that, and what the conditions are for restoring the code.
Aside from that, it's not clear that this is a "fix". The problem with libxmlsec1 is still an issue. So, what problem are you attempting to solve with this? Something about openssl@1.1, but why is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how do we proceed with this one.
xmlsec1@1.2.7, we will need to includeopenssl@1.1that has already been deprecated fromhomebrew.xmlsec1to1.3.7, we can useopenssl@3, but thexmlsec1would not work.I was thinking the following solution:
xmlsec1package for those who don't doAtlasdevelopment. ORopenssl@1.1from a 3rd-party forked repo. We can not be 100% sure about the security of this solution.openssl@1.1: https://github.com/openssl/openssl/releases/tag/OpenSSL_1_1_1w. This solution involves additional engineering efforts.Looking for some insights here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the specific problem? Is homebrew refusing to install
xmlsec1becauseopenssl@1.1has been marked as deprecated? And if so, can we somehow override that and tell homebrew to install it anyway? (Normally I wouldn't want to do this, but it's not a big security risk in our situation)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Homebrew no longer installs from local formulas. It looks like we need to do a local tap. I'm researching what this actually means for next steps and potential updates to the script
https://github.com/orgs/Homebrew/discussions/6351#discussioncomment-14257503