Unverified Commit d8c1b4f4 authored by Dennis Schubert's avatar Dennis Schubert

Merge branch 'release/0.7.7.0'

parents 2b3bbc1a af3e2e6d
......@@ -54,7 +54,6 @@ tmp/
.byebug_history
.sass-cache/
.DS_Store
.idea
.redcar
.stgit*
*.swap
......@@ -73,6 +72,8 @@ capybara-*.html
*.rbc
# IDE
.idea
.vscode
diaspora.iml
# Dolphin's directory's preferences files
......
# 0.7.7.0
## Refactor
* Remove mention of deprecated `statistic.json` [#7867](https://github.com/diaspora/diaspora/pull/7867)
* Add quotes in `database.yml.example` to fields that may contain special characters [#7875](https://github.com/diaspora/diaspora/pull/7875)
* Removed broken, and thus deprecated, Facebook integration [#7874](https://github.com/diaspora/diaspora/pull/7874)
## Bug fixes
* Add compatibility with macOS to `script/configure_bundler` [#7830](https://github.com/diaspora/diaspora/pull/7830)
* Fix comment and like notifications on posts without text [#7857](https://github.com/diaspora/diaspora/pull/7857) [#7853](https://github.com/diaspora/diaspora/pull/7853)
* Fix issue with some language fallbacks not working correctly [#7861](https://github.com/diaspora/diaspora/pull/7861)
* Make sure URLs are encoded before sending them to camo [#7871](https://github.com/diaspora/diaspora/pull/7871)
## Features
* Add `web+diaspora://` link handler [#7826](https://github.com/diaspora/diaspora/pull/7826)
# 0.7.6.0
## Refactor
......
......@@ -15,8 +15,8 @@ gem "unicorn-worker-killer", "0.4.4"
# Federation
gem "diaspora_federation-json_schema", "0.2.4"
gem "diaspora_federation-rails", "0.2.4"
gem "diaspora_federation-json_schema", "0.2.5"
gem "diaspora_federation-rails", "0.2.5"
# API and JSON
......@@ -140,7 +140,7 @@ gem "leaflet-rails", "1.3.1"
# Parsing
gem "nokogiri", "1.8.2"
gem "nokogiri", "1.8.5"
gem "open_graph_reader", "0.6.2" # also update User-Agent in features/support/webmock.rb
gem "redcarpet", "3.4.0"
gem "ruby-oembed", "0.12.0"
......@@ -157,14 +157,13 @@ gem "secure_headers", "5.0.5"
# Services
gem "omniauth", "1.8.1"
gem "omniauth-facebook", "4.0.0"
gem "omniauth-tumblr", "1.2"
gem "omniauth-twitter", "1.4.0"
gem "omniauth-wordpress", "0.2.2"
gem "twitter", "6.2.0"
# OpenID Connect
gem "openid_connect", "1.1.5"
gem "openid_connect", "1.1.6"
# Serializers
......@@ -200,7 +199,7 @@ gem "logging-rails", "0.6.0", require: "logging/rails"
# Reading and writing zip files
gem "rubyzip", "1.2.1", require: "zip"
gem "rubyzip", "1.2.2", require: "zip"
# Prevent occasions where minitest is not bundled in
# packaged versions of ruby. See following issues/prs:
......@@ -275,7 +274,7 @@ end
group :test do
# RSpec (unit tests, some integration tests)
gem "fixture_builder", "0.5.1"
gem "fixture_builder", "0.5.2.rc3"
gem "fuubar", "2.3.1"
gem "json-schema-rspec", "0.0.4"
gem "rspec-json_expectations", "~> 2.1"
......@@ -295,7 +294,7 @@ group :test do
gem "timecop", "0.9.1"
gem "webmock", "3.3.0", require: false
gem "diaspora_federation-test", "0.2.4"
gem "diaspora_federation-test", "0.2.5"
# Coverage
gem "coveralls", "0.8.21", require: false
......
......@@ -166,18 +166,18 @@ GEM
devise
rails (>= 3.0.4)
diaspora-prosody-config (0.0.7)
diaspora_federation (0.2.4)
faraday (>= 0.9.0, < 0.15.0)
diaspora_federation (0.2.5)
faraday (>= 0.9.0, < 0.16.0)
faraday_middleware (>= 0.10.0, < 0.13.0)
nokogiri (~> 1.6, >= 1.6.8)
typhoeus (~> 1.0)
valid (~> 1.0)
diaspora_federation-json_schema (0.2.4)
diaspora_federation-rails (0.2.4)
diaspora_federation-json_schema (0.2.5)
diaspora_federation-rails (0.2.5)
actionpack (>= 4.2, < 6)
diaspora_federation (= 0.2.4)
diaspora_federation-test (0.2.4)
diaspora_federation (= 0.2.4)
diaspora_federation (= 0.2.5)
diaspora_federation-test (0.2.5)
diaspora_federation (= 0.2.5)
fabrication (~> 2.16)
uuid (~> 2.3, >= 2.3.8)
diff-lcs (1.3)
......@@ -217,10 +217,11 @@ GEM
http-cookie (~> 1.0.0)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
ffi (1.9.23)
fixture_builder (0.5.1)
ffi (1.9.25)
fixture_builder (0.5.2.rc3)
activerecord (>= 2)
activesupport (>= 2)
hashdiff
fog-aws (2.0.1)
fog-core (~> 1.38)
fog-json (~> 1.0)
......@@ -305,7 +306,7 @@ GEM
httparty (0.16.2)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.0.0)
i18n (1.1.0)
concurrent-ruby (~> 1.0)
i18n-inflector (2.6.7)
i18n (>= 0.4.1)
......@@ -332,12 +333,10 @@ GEM
rails (>= 4.0, < 6.0)
sprockets (>= 3.0.0)
json (2.1.0)
json-jwt (1.9.2)
json-jwt (1.9.4)
activesupport
aes_key_wrap
bindata
securecompare
url_safe_base64
json-schema (2.8.0)
addressable (>= 2.4)
json-schema-rspec (0.0.4)
......@@ -378,7 +377,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.8.0)
mini_mime (1.0.0)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
mobile-fu (1.4.0)
......@@ -392,7 +391,7 @@ GEM
naught (1.1.0)
nenv (0.3.0)
nio4r (2.3.0)
nokogiri (1.8.2)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
notiffany (0.1.1)
nenv (~> 0.1)
......@@ -409,8 +408,6 @@ GEM
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
omniauth-facebook (4.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
......@@ -428,7 +425,7 @@ GEM
open_graph_reader (0.6.2)
faraday (>= 0.9.0)
nokogiri (~> 1.6)
openid_connect (1.1.5)
openid_connect (1.1.6)
activemodel
attr_required (>= 1.0.0)
json-jwt (>= 1.5.0)
......@@ -474,7 +471,7 @@ GEM
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
public_suffix (3.0.2)
public_suffix (3.0.3)
rack (2.0.5)
rack-cors (1.0.2)
rack-google-analytics (1.2.0)
......@@ -482,7 +479,7 @@ GEM
activesupport
rack-mobile-detect (0.4.0)
rack
rack-oauth2 (1.9.1)
rack-oauth2 (1.9.2)
activesupport
attr_required
httpclient
......@@ -621,7 +618,7 @@ GEM
ruby-oembed (0.12.0)
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
rubyzip (1.2.1)
rubyzip (1.2.2)
rufus-scheduler (3.4.2)
et-orbi (~> 1.0)
rugged (0.27.0)
......@@ -641,7 +638,6 @@ GEM
sass (~> 3.4.20)
secure_headers (5.0.5)
useragent (>= 0.15.0)
securecompare (1.0.0)
shellany (0.0.1)
shoulda-matchers (3.1.2)
activesupport (>= 4.0.0)
......@@ -720,14 +716,13 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.3.0)
unicode-display_width (1.4.0)
unicorn (5.4.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-worker-killer (0.4.4)
get_process_mem (~> 0)
unicorn (>= 4, < 6)
url_safe_base64 (0.2.2)
useragent (0.16.10)
uuid (2.3.8)
macaddr (~> 1.0)
......@@ -783,16 +778,16 @@ DEPENDENCIES
devise (= 4.4.3)
devise_lastseenable (= 0.0.6)
diaspora-prosody-config (= 0.0.7)
diaspora_federation-json_schema (= 0.2.4)
diaspora_federation-rails (= 0.2.4)
diaspora_federation-test (= 0.2.4)
diaspora_federation-json_schema (= 0.2.5)
diaspora_federation-rails (= 0.2.5)
diaspora_federation-test (= 0.2.5)
entypo-rails (= 3.0.0)
eye (= 0.10.0)
factory_girl_rails (= 4.8.0)
faraday (= 0.12.2)
faraday-cookie_jar (= 0.0.6)
faraday_middleware (= 0.12.2)
fixture_builder (= 0.5.1)
fixture_builder (= 0.5.2.rc3)
fog-aws (= 2.0.1)
fuubar (= 2.3.1)
gon (= 6.2.0)
......@@ -821,14 +816,13 @@ DEPENDENCIES
minitest
mobile-fu (= 1.4.0)
mysql2 (= 0.5.0)
nokogiri (= 1.8.2)
nokogiri (= 1.8.5)
omniauth (= 1.8.1)
omniauth-facebook (= 4.0.0)
omniauth-tumblr (= 1.2)
omniauth-twitter (= 1.4.0)
omniauth-wordpress (= 0.2.2)
open_graph_reader (= 0.6.2)
openid_connect (= 1.1.5)
openid_connect (= 1.1.6)
pg (= 1.0.0)
poltergeist (= 1.17.0)
pronto (= 0.9.5)
......@@ -878,7 +872,7 @@ DEPENDENCIES
rspec-rails (= 3.7.2)
rubocop (= 0.54.0)
ruby-oembed (= 0.12.0)
rubyzip (= 1.2.1)
rubyzip (= 1.2.2)
sass-rails (= 5.0.7)
secure_headers (= 5.0.5)
shoulda-matchers (= 3.1.2)
......@@ -906,4 +900,4 @@ DEPENDENCIES
will_paginate (= 3.1.6)
BUNDLED WITH
1.16.2
1.16.5
......@@ -15,6 +15,10 @@ app.pages.Settings = Backbone.View.extend({
form: $("#post-default-aspects")
});
$("#update_profile_form").areYouSure();
$("#register-protocol-handler").click(function() {
Diaspora.ProtocolHandler.register();
});
}
});
// @license-end
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
Diaspora.ProtocolHandler = {
register: function() {
if (!window.navigator.registerProtocolHandler) {
return false;
}
try {
window.navigator.registerProtocolHandler(
"web+diaspora",
[window.location.protocol, "//", window.location.host, "/link?q=%s"].join(""),
gon.appConfig.settings.podname
);
} catch (_) {
return false;
}
return true;
}
};
......@@ -45,4 +45,5 @@
//= require api/authorization_page
//= require bootstrap-markdown/bootstrap-markdown
//= require helpers/markdown_editor
//= require helpers/protocol_handler
//= require jquery.are-you-sure
......@@ -199,7 +199,6 @@
}
text-align: center;
.social-media-logos-facebook-24x24,
.social-media-logos-twitter-24x24,
.social-media-logos-tumblr-24x24,
.social-media-logos-wordpress-24x24 {
......
# frozen_string_literal: true
class LinksController < ApplicationController
def resolve
entity = DiasporaLinkService.new(query).find_or_fetch_entity
raise ActiveRecord::RecordNotFound if entity.nil?
redirect_to url_for(entity)
end
private
def query
@query ||= params.fetch(:q)
end
end
# frozen_string_literal: true
module NotifierHelper
include PostsHelper
# @param post [Post] The post object.
# @param opts [Hash] Optional hash. Accepts :length parameters.
......@@ -9,7 +10,7 @@ module NotifierHelper
if post.respond_to? :message
post.message.try(:plain_text_without_markdown).presence || post_page_title(post)
else
I18n.translate 'notifier.a_post_you_shared'
I18n.translate "notifier.a_post_you_shared"
end
end
......@@ -19,7 +20,7 @@ module NotifierHelper
if comment.post.public?
comment.message.plain_text_without_markdown
else
I18n.translate 'notifier.a_limited_post_comment'
I18n.translate "notifier.a_limited_post_comment"
end
end
end
......@@ -22,8 +22,7 @@ class Reference < ApplicationRecord
private
def add_reference(author, type, guid)
class_name = DiasporaFederation::Entity.entity_class(type).to_s.rpartition("::").last
entity = Diaspora::Federation::Mappings.model_class_for(class_name).find_by(guid: guid)
entity = Diaspora::EntityFinder.new(type, guid).find
references.find_or_create_by(target: entity) if entity&.diaspora_handle == author
rescue => e # rubocop:disable Lint/RescueWithoutErrorClass
logger.warn "ignoring invalid diaspora-url: diaspora://#{author}/#{type}/#{guid}: #{e.class}: #{e.message}"
......
# frozen_string_literal: true
class Services::Facebook < Service
include Rails.application.routes.url_helpers
OVERRIDE_FIELDS_ON_FB_UPDATE = [:contact_id, :person_id, :request_id, :invitation_id, :photo_url, :name, :username]
MAX_CHARACTERS = 63206
def provider
"facebook"
end
def post(post, url='')
logger.debug "event=post_to_service type=facebook sender_id=#{user_id} post=#{post.guid}"
response = post_to_facebook("https://graph.facebook.com/me/feed", create_post_params(post).to_param)
response = JSON.parse response.body
post.facebook_id = response["id"]
post.save
end
def post_to_facebook(url, body)
Faraday.post(url, body)
end
def create_post_params(post)
message = post.message.plain_text_without_markdown
post_url = short_post_url(post, protocol: AppConfig.pod_uri.scheme, host: AppConfig.pod_uri.authority)
message = if message.empty?
post_url
else
"#{message} (via #{post_url})"
end
{
message: message,
access_token: access_token,
link: post.message.urls.first
}
end
def profile_photo_url
"https://graph.facebook.com/#{self.uid}/picture?type=large&access_token=#{URI.escape(self.access_token)}"
end
def post_opts(post)
{facebook_id: post.facebook_id} if post.facebook_id.present?
end
def delete_from_service(opts)
logger.debug "event=delete_from_service type=facebook sender_id=#{user_id} facebook_id=#{opts[:facebook_id]}"
delete_from_facebook("https://graph.facebook.com/#{opts[:facebook_id]}/", access_token: access_token)
end
def delete_from_facebook(url, body)
Faraday.delete(url, body)
end
end
......@@ -37,6 +37,10 @@ class StatusMessage < Post
owned_or_visible_by_user(person.owner).joins(:mentions).where(mentions: {person_id: person.id})
}
def self.model_name
Post.model_name
end
def self.guids_for_author(person)
Post.connection.select_values(Post.where(:author_id => person.id).select('posts.guid').to_sql)
end
......@@ -58,7 +62,11 @@ class StatusMessage < Post
end
def comment_email_subject
message.title
if message.present?
message.title
elsif photos.present?
I18n.t("posts.show.photos_by", count: photos.size, author: author_name)
end
end
def first_photo_url(*args)
......
# frozen_string_literal: true
# Encapsulates logic of processing diaspora:// links
class DiasporaLinkService
attr_reader :type, :author, :guid
def initialize(link)
@link = link.dup
parse
end
def find_or_fetch_entity
entity_finder.find || fetch_entity
end
private
attr_accessor :link
def fetch_entity
DiasporaFederation::Federation::Fetcher.fetch_public(author, type, guid)
entity_finder.find
rescue DiasporaFederation::Federation::Fetcher::NotFetchable
nil
end
def entity_finder
@entity_finder ||= Diaspora::EntityFinder.new(type, guid)
end
def normalize
link.gsub!(%r{^web\+diaspora://}, "diaspora://") ||
link.gsub!(%r{^//}, "diaspora://") ||
%r{^diaspora://}.match(link) ||
self.link = "diaspora://#{link}"
end
def parse
normalize
match = DiasporaFederation::Federation::DiasporaUrlParser::DIASPORA_URL_REGEX.match(link)
@author = match[1]
@type = match[2]
@guid = match[3]
end
end
.row.publisher#publisher{class: ((aspect == :profile || publisher_open?) ? "mention_popup" : "closed")}
.content_creation
= form_for(StatusMessage.new) do |status|
= form_for StatusMessage.new, url: status_messages_path, as: :status_message do |status|
= status.error_messages
%params
.publisher-textarea-wrapper#publisher-textarea-wrapper
......
......@@ -2,7 +2,8 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= form_for StatusMessage.new, html: {class: "control-group", data: {ajax: false}} do |status|
= form_for StatusMessage.new, url: status_messages_path, as: :status_message,
html: {class: "control-group", data: {ajax: false}} do |status|
.form-group
= status.hidden_field :provider_display_name, value: 'mobile'
= status.text_area :text, placeholder: t('shared.publisher.whats_on_your_mind'), rows: 4, autofocus: "autofocus", class: "form-control"
......
......@@ -180,6 +180,16 @@
.clearfix= f.submit t(".change"), class: "btn btn-primary pull-right", id: "change_email_preferences"
%hr
.row
.col-md-12
%h3#protocol-handler
= t(".protocol_handler.title")
%p= t(".protocol_handler.description")
.form-group
%button.btn.btn-default#register-protocol-handler
= t(".protocol_handler.register")
%hr
.row
.col-md-6.account-data
%h3= t(".export_data")
......
......@@ -14,10 +14,6 @@
%h3
= t(".who_are_you")
- if AppConfig.configured_services.include? :facebook
%p
!= t('.connect_to_facebook', link: link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}"))
= form_tag profile_path, method: :put, remote: true, id: 'edit_profile' do
%fieldset
.form-group
......
......@@ -19,10 +19,6 @@
%h2
= t(".who_are_you")
- if AppConfig.configured_services.include? :facebook
%p
!= t('.connect_to_facebook', link: link_to(t('.connect_to_facebook_link'), "auth/facebook?callback_url=#{getting_started_url}"))
= form_tag profile_path, method: :put, remote: true, id: "edit_profile" do
%fieldset
.form-group
......
postgresql: &postgresql
adapter: postgresql
host: localhost
host: "localhost"
port: 5432
username: postgres
password:
username: "postgres"
password: ""
encoding: unicode
mysql: &mysql
......
......@@ -4,7 +4,7 @@
defaults:
version:
number: "0.7.6.0" # Do not touch unless doing a release, do not backport the version number that's in master
number: "0.7.7.0" # Do not touch unless doing a release, do not backport the version number that's in master
heroku: false
environment:
url: "http://localhost:3000/"
......@@ -153,12 +153,6 @@ defaults:
report_only: true
report_uri:
services:
facebook:
enable: false
app_id:
secret:
open_graph_namespace: 'joindiaspora'
authorized: false
twitter:
enable: false
key:
......@@ -234,11 +228,10 @@ test:
invitations:
open: true
services:
facebook:
twitter:
enable: true
app_id: 'fake'
key: 'fake'
secret: 'sdoigjosdfijg'
authorized: true
mail:
enable: true
integration1:
......
......@@ -21,7 +21,7 @@
## - Specify lists/arrays as comma-separated values
##
## - For example, on Heroku:
## heroku config:set SERVICES_FACEBOOK_APP_ID=yourappid SERVICES_FACEBOOK_SECRET=yourappsecret
## heroku config:set SERVICES_TWITTER_KEY=yourkey SERVICES_TWITTER_SECRET=yoursecret
configuration: ## Section
......@@ -308,7 +308,7 @@ configuration: ## Section
## Statistics
## Your pod will report its name, software version and whether
## or not registrations are open via /statistics.json.
## or not registrations are open via /statistics and NodeInfo.
## Uncomment the options below to enable more statistics.
statistics: ## Section
......@@ -583,20 +583,6 @@ configuration: ## Section
## Posting from Diaspora to external services (all are disabled by default).
services: ## Section
## OAuth credentials for Facebook
facebook: ## Section
#enable: true
#app_id: 'abcdef'
#secret: 'change_me'
## This setting is required to define whether the Facebook app has permissions to post
## false == No permissions (default)
## true == Permissions for all users to post. App MUST have 'publish_actions' approved by Facebook!
## "username" == Set to local username to allow a single user to cross-post. The person who has created
## the Facebook app will always be able to cross-post, even without 'publish_actions'.
#authorized: false
## OAuth credentials for Twitter
twitter: ## Section
......
......@@ -74,10 +74,6 @@ Rails.application.configure do
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
......
......@@ -13,17 +13,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do
provider :tumblr, AppConfig.services.tumblr.key, AppConfig.services.tumblr.secret
end
if AppConfig.services.facebook.enable?
provider :facebook, AppConfig.services.facebook.app_id, AppConfig.services.facebook.secret, {
scope: "public_profile,publish_actions",
client_options: {
ssl: {
ca_file: AppConfig.environment.certificate_authorities
}
}
}
end
if AppConfig.services.wordpress.enable?
provider :wordpress, AppConfig.services.wordpress.client_id, AppConfig.services.wordpress.secret
end
......
......@@ -7,21 +7,22 @@
cs:
devise:
confirmations:
confirmed: "Váš účet byl uspěšně potvrzen. Nyní jste přihlášeni."
confirmed: "Váš e-mail byl uspěšně potvrzen. Nyní jste přihlášeni."
new:
resend_confirmation: "Zaslat instrukce o potvrzení"
send_instructions: "Během několika minut obdržíte email s instrukcemi k potvrzení vašeho účtu."
send_instructions: "Během několika minut obdržíte e-mail s instrukcemi k potvrzení vašeho účtu."
send_paranoid_instructions: "Pokud vaše e-mailová adresa existuje v naší databázi, obdržíte za pár minut e-mail s instrukcemi pro potvrzení vaší e-mailové adresy"
failure: