Skip to content

Commit

Permalink
Removing external hub completely, fix mastodon#333 fixing digit-only …
Browse files Browse the repository at this point in the history
…hashtags,

removing web app capability from non-webapp pages
  • Loading branch information
Gargron committed Dec 18, 2016
1 parent c4ffffb commit 6de079a
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 32 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ If you would like, you can [support the development of this project on Patreon][

- `LOCAL_DOMAIN` should be the domain/hostname of your instance. This is **absolutely required** as it is used for generating unique IDs for everything federation-related
- `LOCAL_HTTPS` set it to `true` if HTTPS works on your website. This is used to generate canonical URLs, which is also important when generating and parsing federation-related IDs
- `HUB_URL` should be the URL of the PubsubHubbub service that your instance is going to use. By default it is the open service of Superfeedr

Consult the example configuration file, `.env.production.sample` for the full list. Among other things you need to set details for the SMTP server you are going to use.

Expand Down
2 changes: 1 addition & 1 deletion app/models/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Tag < ApplicationRecord
has_and_belongs_to_many :statuses

HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]+)/i
HASHTAG_RE = /(?:^|[^\/\w])#([[:word:]_]*[[:alpha:]_][[:word:]_]*)/i

validates :name, presence: true, uniqueness: true

Expand Down
1 change: 0 additions & 1 deletion app/services/favourite_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class FavouriteService < BaseService
def call(account, status)
favourite = Favourite.create!(account: account, status: status)

HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(favourite.stream_entry.id)

if status.local?
Expand Down
1 change: 0 additions & 1 deletion app/services/follow_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def call(source_account, uri)

merge_into_timeline(target_account, source_account)

HubPingWorker.perform_async(source_account.id)
Pubsubhubbub::DistributionWorker.perform_async(follow.stream_entry.id)

follow
Expand Down
1 change: 0 additions & 1 deletion app/services/post_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def call(account, text, in_reply_to = nil, options = {})
process_hashtags_service.call(status)

DistributionWorker.perform_async(status.id)
HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)

status
Expand Down
1 change: 0 additions & 1 deletion app/services/reblog_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def call(account, reblogged_status)
reblog = account.statuses.create!(reblog: reblogged_status, text: '')

DistributionWorker.perform_async(reblog.id)
HubPingWorker.perform_async(account.id)
Pubsubhubbub::DistributionWorker.perform_async(reblog.stream_entry.id)

if reblogged_status.local?
Expand Down
1 change: 0 additions & 1 deletion app/services/remove_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def call(status)

return unless status.account.local?

HubPingWorker.perform_async(status.account.id)
Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
end

Expand Down
1 change: 0 additions & 1 deletion app/views/accounts/show.atom.ruby
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Nokogiri::XML::Builder.new do |xml|
link_alternate xml, TagManager.instance.url_for(@account)
link_self xml, account_url(@account, format: 'atom')
link_hub xml, api_push_url
link_hub xml, Rails.configuration.x.hub_url
link_salmon xml, api_salmon_url(@account.id)

@entries.each do |stream_entry|
Expand Down
1 change: 1 addition & 0 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- content_for :header_tags do
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/
= javascript_include_tag 'application'

= react_component 'Mastodon', default_props, class: 'app-holder', prerender: false
1 change: 0 additions & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
%link{:rel => "manifest", :href => "/manifest.json"}/
%meta{:name => "msapplication-config", :content => "/browserconfig.xml"}/
%meta{:name => "theme-color", :content => "#2b90d9"}/
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/

%title
= "#{yield(:page_title)} - " if content_for?(:page_title)
Expand Down
12 changes: 0 additions & 12 deletions app/workers/hub_ping_worker.rb

This file was deleted.

1 change: 0 additions & 1 deletion config/initializers/ostatus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

Rails.application.configure do
config.x.local_domain = host
config.x.hub_url = ENV.fetch('HUB_URL') { 'https://pubsubhubbub.superfeedr.com' }
config.x.use_https = https
config.x.use_s3 = ENV['S3_ENABLED'] == 'true'

Expand Down
5 changes: 0 additions & 5 deletions spec/controllers/api/v1/follows_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
stub_request(:get, "https://quitter.no/avatar/7477-300-20160211190340.png").to_return(request_fixture('avatar.txt'))
stub_request(:post, "https://quitter.no/main/push/hub").to_return(:status => 200, :body => "", :headers => {})
stub_request(:post, "https://quitter.no/main/salmon/user/7477").to_return(:status => 200, :body => "", :headers => {})
stub_request(:post, "https://pubsubhubbub.superfeedr.com/").to_return(:status => 200, :body => "", :headers => {})

post :create, params: { uri: 'gargron@quitter.no' }
end
Expand All @@ -39,10 +38,6 @@
expect(a_request(:post, "https://quitter.no/main/salmon/user/7477")).to have_been_made
end

it 'notifies own hub' do
expect(a_request(:post, "https://pubsubhubbub.superfeedr.com/")).to have_been_made
end

it 'subscribes to remote hub' do
expect(a_request(:post, "https://quitter.no/main/push/hub")).to have_been_made
end
Expand Down
5 changes: 0 additions & 5 deletions spec/services/reblog_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
subject { ReblogService.new }

before do
stub_request(:post, Rails.configuration.x.hub_url)
stub_request(:post, 'http://salmon.example.com')

subject.(alice, status)
Expand All @@ -18,10 +17,6 @@
expect(status.reblogs.count).to eq 1
end

it 'pings PubSubHubbub hubs' do
expect(a_request(:post, Rails.configuration.x.hub_url)).to have_been_made
end

it 'sends a Salmon slap for a remote reblog' do
expect(a_request(:post, 'http://salmon.example.com')).to have_been_made
end
Expand Down

0 comments on commit 6de079a

Please sign in to comment.