From 4c779be2ed14d109e4cd0b6897ce82a853199931 Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Wed, 29 Apr 2020 10:11:57 -0500 Subject: [PATCH] [deploy] Remove ALL Algolia Code (#7577) --- .gitpod.yml | 8 -- Envfile | 7 -- Gemfile | 1 - Gemfile.lock | 7 -- app/javascript/packs/homePage.jsx | 5 +- app/views/reading_list_items/index.html.erb | 2 +- app/views/shell/_top.html.erb | 4 +- config/initializers/algoliasearch.rb | 23 ------ config/sample_application.yml | 4 - docker-run.sh | 59 +------------ dockerhub-readme.md | 19 +---- docs/backend/algolia.md | 67 --------------- docs/backend/elasticsearch.md | 92 +++++++++++++++++++++ docs/backend/readme.md | 2 +- docs/frontend/linting-formatting.md | 1 - docs/getting-started/config-env.md | 7 +- docs/installation/docker.md | 4 +- docs/installation/linux.md | 4 +- docs/installation/mac.md | 5 +- docs/installation/windows.md | 4 +- docs/internal/internal-search.md | 4 +- docs/technical-overview/architecture.md | 6 +- docs/technical-overview/stack.md | 3 +- spec/models/podcast_episode_spec.rb | 2 +- spec/rails_helper.rb | 1 - spec/support/stubs.rb | 86 ------------------- 26 files changed, 112 insertions(+), 315 deletions(-) delete mode 100644 config/initializers/algoliasearch.rb delete mode 100644 docs/backend/algolia.md create mode 100644 docs/backend/elasticsearch.md delete mode 100644 spec/support/stubs.rb diff --git a/.gitpod.yml b/.gitpod.yml index b5caafa69..500c352af 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -18,14 +18,6 @@ tasks: - command: /home/gitpod/elasticsearch-7.5.2/bin/elasticsearch - init: cp config/sample_application.yml config/application.yml command: > - while [ -z "${ALGOLIASEARCH_APPLICATION_ID:=$(cat config/application.yml | grep ALGOLIASEARCH_APPLICATION_ID | sed 's/.*:\s*//')}" ] || - [ -z "${ALGOLIASEARCH_SEARCH_ONLY_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_SEARCH_ONLY_KEY | sed 's/.*:\s*//')}" ] || - [ -z "${ALGOLIASEARCH_API_KEY:=$(cat config/application.yml | grep ALGOLIASEARCH_API_KEY | sed 's/.*:\s*//')}" ] ; do - gp open config/application.yml 2>/dev/null && - printf "\nā— Dev.to requires free Algolia credentials.\n" && - printf "ā— To get them, please follow https://docs.dev.to/backend/algolia/#get-api-keys\n\n" && - read -p "Add them to config/application.yml, save the file, and press any key to continue... " -n 1 -r - done ; gem install solargraph; bin/setup && bin/startup diff --git a/Envfile b/Envfile index 6e586c31b..3bd67e392 100644 --- a/Envfile +++ b/Envfile @@ -65,13 +65,6 @@ variable :TWITTER_SECRET, :String, default: "Optional" variable :HONEYBADGER_API_KEY, :String, default: "Optional" variable :HONEYBADGER_JS_API_KEY, :String, default: "Optional" -# Algolia for search (not optional) -# (https://www.algolia.com/doc/) -only_in_test = proc { ENV["RACK_ENV"] == "test" ? "test-test" : nil } -variable :ALGOLIASEARCH_API_KEY, :String, default: only_in_test -variable :ALGOLIASEARCH_APPLICATION_ID, :String, default: only_in_test -variable :ALGOLIASEARCH_SEARCH_ONLY_KEY, :String, default: only_in_test - # AWS for images storages variable :AWS_ID, :String, default: "Optional" variable :AWS_SECRET, :String, default: "Optional" diff --git a/Gemfile b/Gemfile index dd67c5202..45d20011f 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,6 @@ gem "acts_as_follower", github: "thepracticaldev/acts_as_follower", branch: "mas gem "addressable", "~> 2.7" # A replacement for the URI implementation that is part of Ruby's standard library gem "administrate", "~> 0.13" # A Rails engine that helps you put together a super-flexible admin dashboard gem "ahoy_email", "~> 1.1" # Email analytics for Rails -gem "algoliasearch-rails", "~> 1.24" # Algolia Search is a hosted search engine capable of delivering real-time results from the first keystroke gem "algorithmia", "~> 1.1" # Ruby Client for Algorithmia Algorithms and Data API gem "ancestry", "~> 3.0" # Ancestry allows the records of a ActiveRecord model to be organized in a tree structure gem "autoprefixer-rails", "~> 9.7" # Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website diff --git a/Gemfile.lock b/Gemfile.lock index f509869fd..6a3b1b8ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,12 +77,6 @@ GEM addressable (>= 2.3.2) nokogiri safely_block (>= 0.1.1) - algoliasearch (1.27.1) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - algoliasearch-rails (1.24.0) - algoliasearch (>= 1.26.0, < 2.0.0) - json (>= 1.5.1) algorithmia (1.1.0) httparty (~> 0.13) json (~> 2.0) @@ -852,7 +846,6 @@ DEPENDENCIES addressable (~> 2.7) administrate (~> 0.13) ahoy_email (~> 1.1) - algoliasearch-rails (~> 1.24) algorithmia (~> 1.1) amazing_print (~> 1.0) ancestry (~> 3.0) diff --git a/app/javascript/packs/homePage.jsx b/app/javascript/packs/homePage.jsx index f915df4a0..17c18904d 100644 --- a/app/javascript/packs/homePage.jsx +++ b/app/javascript/packs/homePage.jsx @@ -3,7 +3,6 @@ import { h, render } from 'preact'; /* global userData */ // This logic is similar to that in initScrolling.js.erb -// that prevents the classic Algolia scrolling for the front page. const frontPageFeedPathNames = new Map([ ['/', ''], ['/top/week', 'week'], @@ -13,9 +12,7 @@ const frontPageFeedPathNames = new Map([ ['/latest', 'latest'], ]); -const mainNavMoreTrigger = document.getElementById( - 'main-nav-more-trigger', -); +const mainNavMoreTrigger = document.getElementById('main-nav-more-trigger'); function toggleMainNavMore() { document.getElementById('main-nav-more').classList.remove('hidden'); mainNavMoreTrigger.classList.add('hidden'); diff --git a/app/views/reading_list_items/index.html.erb b/app/views/reading_list_items/index.html.erb index 16744019c..983f7fede 100644 --- a/app/views/reading_list_items/index.html.erb +++ b/app/views/reading_list_items/index.html.erb @@ -18,7 +18,7 @@ <% end %>
-
+
<%= javascript_packs_with_chunks_tag "readingList", defer: true %> diff --git a/app/views/shell/_top.html.erb b/app/views/shell/_top.html.erb index 9c0c81786..f4ff1d7d2 100644 --- a/app/views/shell/_top.html.erb +++ b/app/views/shell/_top.html.erb @@ -3,12 +3,10 @@ <% title = yield(:title) %> - <%= title || "#{community_qualified_name}" %> + <%= title || community_qualified_name.to_s %> <% unless internal_navigation? %> - "> - <%= render "layouts/styles" %>