From 6a7e937d909f96297e6b8e2635b290d665144ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sun, 25 Aug 2019 19:45:18 +0200 Subject: [PATCH 1/4] Update open_graph_reader to 0.7.0 This should fix undefined method `og' for # for sites that have OpenGraph tags of other namespaces but no actual OpenGraph core tags --- Gemfile | 2 +- Gemfile.lock | 4 ++-- features/support/webmock.rb | 2 +- spec/models/open_graph_cache_spec.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 0b64155aa..87a3965d4 100644 --- a/Gemfile +++ b/Gemfile @@ -143,7 +143,7 @@ gem "leaflet-rails", "1.5.1" # Parsing gem "nokogiri", "1.10.3" -gem "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb +gem "open_graph_reader", "0.7.0" # also update User-Agent in features/support/webmock.rb gem "redcarpet", "3.4.0" gem "ruby-oembed", "0.12.0" gem "twitter-text", "1.14.7" diff --git a/Gemfile.lock b/Gemfile.lock index 01b6acdcd..a8c30bee3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -439,7 +439,7 @@ GEM rack omniauth-wordpress (0.2.2) omniauth-oauth2 (>= 1.1.0) - open_graph_reader (0.6.2) + open_graph_reader (0.7.0) faraday (>= 0.9.0) nokogiri (~> 1.6) openid_connect (1.1.8) @@ -842,7 +842,7 @@ DEPENDENCIES omniauth-tumblr (= 1.2) omniauth-twitter (= 1.4.0) omniauth-wordpress (= 0.2.2) - open_graph_reader (= 0.6.2) + open_graph_reader (= 0.7.0) openid_connect (= 1.1.8) pg (= 1.1.4) poltergeist (= 1.18.1) diff --git a/features/support/webmock.rb b/features/support/webmock.rb index f6d4726bf..cce1de904 100644 --- a/features/support/webmock.rb +++ b/features/support/webmock.rb @@ -7,7 +7,7 @@ Before do stub_request(:head, /.+/).with( headers: { "Accept" => "text/html", - "User-Agent" => "OpenGraphReader/0.6.2 (+https://github.com/jhass/open_graph_reader)" + "User-Agent" => "OpenGraphReader/0.7.0 (+https://github.com/jhass/open_graph_reader)" } ).to_return(status: 200, body: "", headers: {"Content-Type" => "text/plain"}) end diff --git a/spec/models/open_graph_cache_spec.rb b/spec/models/open_graph_cache_spec.rb index 7bd0c81a4..799f726ac 100644 --- a/spec/models/open_graph_cache_spec.rb +++ b/spec/models/open_graph_cache_spec.rb @@ -63,7 +63,7 @@ describe OpenGraphCache, type: :model do stub_request(:head, "http:///wetter.com") .with(headers: { "Accept" => "text/html", - "User-Agent" => "OpenGraphReader/0.6.2 (+https://github.com/jhass/open_graph_reader)" + "User-Agent" => "OpenGraphReader/0.7.0 (+https://github.com/jhass/open_graph_reader)" }) .to_return(status: 200, body: "", headers: {"Set-Cookie" => "Dabgroup=A;path=/;Expires=Thu, 23 May 2019 16:12:01 GMT;httpOnly"}) From 5b09e9d38d772663c2d5b9bca62f5fa2249b5ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Fri, 30 Aug 2019 12:41:18 +0200 Subject: [PATCH 2/4] install libidn-dev on travis --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6df40becc..a998fd3e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,10 @@ cache: - app/assets/images - tmp/cache/assets +addons: + apt: + packages: libidn11-dev + branches: only: - 'master' From 6937fa13e5c6b3c06101c107ceba4af22482b059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Fri, 30 Aug 2019 13:51:16 +0200 Subject: [PATCH 3/4] travis: ensure postgresql and mysql are available --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index a998fd3e2..22e924937 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ addons: apt: packages: libidn11-dev +services: + - postgresql + - mysql + branches: only: - 'master' From ba16185b8e6062346a0bf54975929632ed4c667d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Fri, 30 Aug 2019 15:28:14 +0200 Subject: [PATCH 4/4] install ghostscript on travis closes #8049 --- .travis.yml | 4 +++- Changelog.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 22e924937..e32431bdd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,9 @@ cache: addons: apt: - packages: libidn11-dev + packages: + - libidn11-dev + - ghostscript services: - postgresql diff --git a/Changelog.md b/Changelog.md index 1f18982b5..8b37f409b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ ## Refactor ## Bug fixes +* Fix error while trying to fetch some sites with invalid OpenGraph data [#8049](https://github.com/diaspora/diaspora/pull/8049) ## Features * Add cronjob to cleanup pending photos which were never posted [#8041](https://github.com/diaspora/diaspora/pull/8041)