diff --git a/README.md b/README.md index cf74c838..c4d97027 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ bin/aws/ecs_rake searchkick:reindex ## Importing a production database into your development environment ``` bash -AWS_PROFILE=nabu-prod bin/aws/ecs_shell jobs -c 'mysqldump -u nabu -h "$NABU_DATABASE_HOSTNAME" -p"$NABU_DATABASE_PASSWORD" --single-transaction nabu | bzip2 | base64' | base64 -d > /tmp/nabu.sql.bz2 +AWS_PROFILE=nabu-prod bin/aws/ecs_shell jobs -c "'mysqldump -u nabu -h \"\$NABU_DATABASE_HOSTNAME\" -p\"\$NABU_DATABASE_PASSWORD\" --single-transaction nabu' | bzip2 | base64" >| ../nabu.sql.bz2.b64 +base64 -id < ../nabu.sql.bz2.b64 > ../nabu.sql.bz2 nabu_run bundle exec rake db:drop db:create bzip2 -dc ../nabu.sql.bz2 | mysql -h 127.0.0.1 -u root nabu_devel nabu_run bin/rails db:environment:set RAILS_ENV=development diff --git a/app/controllers/concerns/has_search.rb b/app/controllers/concerns/has_search.rb index a4bb1f11..c4e5c5c4 100644 --- a/app/controllers/concerns/has_search.rb +++ b/app/controllers/concerns/has_search.rb @@ -43,7 +43,7 @@ def build_basic_search order:, page: params[:page], per_page: params[:per_page] || 10, - track: { user_id: current_user&.id, search_family: 'basic' }, + track: params[:search] ? { user_id: current_user&.id, search_family: 'basic' } : nil, misspellings: false ) diff --git a/bin/nabu_run b/bin/nabu_run index 5ba763ec..098d5f7a 100755 --- a/bin/nabu_run +++ b/bin/nabu_run @@ -4,12 +4,12 @@ docker compose run \ --rm \ -v "$PWD":/rails \ -v "$PWD"/vendor/bundle:/bundler \ - -v "$HOME"/.aws:/root/.aws \ + -v "$HOME"/.aws:/home/rails/.aws \ -e SSH_AUTH_SOCK=/tmp/ssh.sock \ -e SENTRY_API_TOKEN="$SENTRY_API_TOKEN" \ -e ELASTICSEARCH_URL="$(grep ^ELASTICSEARCH_URL .env | sed 's/^.*=//')" \ - -e AWS_PROFILE=nabu-prod \ + -e AWS_PROFILE="$AWS_PROFILE" \ -v "$SSH_AUTH_SOCK:/tmp/ssh.sock" \ - -v "$HOME"/.irb_history:/rails/.irb_history \ + -v "$HOME"/.irb_history:/home/rails/.irb_history \ app \ "$@"