Skip to content

Commit

Permalink
No longer install the keeper CLI as part of khan-dotfiles. (#118)
Browse files Browse the repository at this point in the history
## Summary:
While we still have keeper around, we don't use it for anything that
needs to be automated or scripted; we use Google Secrets Manager for
that.  Devs can use the normal keeper UI for accessing keeper.  That
way, we don't have to install keeper-commander as part of
khan-dotfiles, which simplifies life a surprising amount!

Issue: https://khanacademy.slack.com/archives/C04SEFXQBNU/p1713991732960289?thread_ts=1713981688.953129&cid=C04SEFXQBNU

## Test plan:
Fingers crossed

Author: csilvers

Reviewers: nathanjd

Required Reviewers:

Approved By: nathanjd

Checks:

Pull Request URL: #118
  • Loading branch information
csilvers authored Apr 25, 2024
1 parent fe1ab03 commit 2642202
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 99 deletions.
3 changes: 0 additions & 3 deletions .bash_profile.khan
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
alias brew86="arch -x86_64 /usr/local/bin/brew $@"
fi

# Add a mykeeper alias to run keeper with KA config
alias mykeeper="keeper --config $HOME/.keeper-config.json"

if [ "$(uname -s)" = "Darwin" ]; then
# Setting this allows us to store ssh-keys in the keychain without generating
# a warning. See ssh-add man page.
Expand Down
3 changes: 0 additions & 3 deletions .zprofile.khan
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
alias brew86="arch -x86_64 /usr/local/bin/brew $@"
fi

# Add a mykeeper alias to run keeper with KA config
alias mykeeper="keeper --config $HOME/.keeper-config.json"

# Setting this allows us to store ssh-keys in the keychain without generating
# a warning. See ssh-add man page.
export APPLE_SSH_ADD_BEHAVIOR=macos
Expand Down
28 changes: 0 additions & 28 deletions bin/mac-setup-keeper.sh

This file was deleted.

2 changes: 0 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ install_deps # pre-reqs: clone_repos, install_and_setup_gcloud
install_hooks # pre-req: clone_repos
download_db_dump # pre-req: install_deps
create_pg_databases # pre-req: install_deps
create_default_keeper_config # pre-req: update_userinfo
install_keeper

echo
echo "---------------------------------------------------------------------"
Expand Down
63 changes: 0 additions & 63 deletions shared-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,55 +228,6 @@ pip3_install() {
|| "$PIP3" install "$@"
}

# Creates keeper config for command line access
# This is interactive
create_default_keeper_config() {
config_file=${HOME}/.keeper-config.json
if [ -e "${config_file}" ]; then
if [ "$(get_yn_input "Keeper config exists, do you want to recreate it now?" "n")" = "y" ]; then
rm -f ${config_file}
fi
fi

if [ ! -e "${config_file}" ]; then
gitemail=$(git config kaclone.email)
echo "Keeper Command Line setup"
echo "-------------------------"
read -p "Enter your KA email (or blank if ${gitemail} is correct): " email
email=${email:-$gitemail}

echo
echo "Keeper Master Password"
echo "----------------------"
echo "If you've setup keeper, enter your master password."
echo
echo "If you have not setup keeper, use your browser to set it up"
echo "at https://khanacademy.org/r/keeper"
echo "If you want to do this later (not recommended), just hit enter"
echo "and run mac-setup-keeper.sh script later."
echo

read -s -p "Keeper Master Password: " master_password

echo
cat << EOF > ${config_file}
{
"server": "https://keepersecurity.com/api/v2/",
"user": "${email}",
"password": "${master_password}",
"sso_master_password": true,
"mfa_duration": "12_hours",
"mfa_token": "",
"mfa_type": "",
"debug": false,
"login_v3": false,
"plugins": [],
"commands": []
}
EOF
fi
}

maybe_generate_ssh_keys() {
# Create a public key if need be.
info "Checking for ssh keys"
Expand Down Expand Up @@ -310,20 +261,6 @@ maybe_generate_ssh_keys() {
return 0
}

install_keeper() {
# NOTE(miguel): we have had issues in our deploy system and with devs
# in their local environment with keeper throttling requests since
# we have upgraded from 16.5.18. So we are moving keeper back to version
# 16.5.18. The last version we had issues with was 16.8.24.
# Version 16.5.18 is what we use in jenkins so we want to match that
# https://github.com/Khan/aws-config/commit/fd89852562ca3719f8936c04c847ad73d4ba82f8
version=16.5.18
pip3_install -q keepercommander==${version}
# Show the keeper version (and warning if out of date)
keeper version
echo "(Any warning above about the latest version can probably be ignored)"
}

# If we exit unexpectedly, log this warning.
# Scripts should call "trap exit_warning EXIT" near the top to enable,
# then "trap - EXIT" just before exiting on success.
Expand Down

0 comments on commit 2642202

Please sign in to comment.