Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into feature/removing_ruby_junk

This commit is contained in:
mgabdev 2020-11-25 16:43:09 -06:00
commit 20d4fc09af
11 changed files with 66 additions and 30 deletions

View File

@ -74,7 +74,7 @@ gem 'redis', '~> 4.1', require: ['redis', 'redis/connection/hiredis']
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
gem 'rqrcode', '~> 0.10'
gem 'sanitize', '~> 5.0'
gem 'sidekiq', '~> 5.2'
gem 'sidekiq', '~> 6.0'
gem 'sidekiq-scheduler', '~> 3.0'
gem 'sidekiq-unique-jobs', '~> 6.0'
gem 'sidekiq-bulk', '~>0.2.0'

View File

@ -152,7 +152,7 @@ GEM
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
connection_pool (2.2.3)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.4)
@ -426,12 +426,10 @@ GEM
pundit (2.0.1)
activesupport (>= 3.0.0)
raabro (1.1.6)
rack (2.0.7)
rack (2.2.3)
rack-attack (6.0.0)
rack (>= 1.0, < 3)
rack-cors (1.0.3)
rack-protection (2.0.5)
rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
@ -480,7 +478,7 @@ GEM
rdf-normalize (0.3.3)
rdf (>= 2.2, < 4.0)
redcarpet (3.4.0)
redis (4.1.2)
redis (4.2.5)
redis-actionpack (5.0.2)
actionpack (>= 4.0, < 6)
redis-rack (>= 1, < 3)
@ -554,11 +552,10 @@ GEM
scss_lint (0.58.0)
rake (>= 0.9, < 13)
sass (~> 3.5, >= 3.5.5)
sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
sidekiq (6.1.2)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-bulk (0.2.0)
sidekiq
sidekiq-scheduler (3.0.0)
@ -751,7 +748,7 @@ DEPENDENCIES
rubocop (~> 0.71)
sanitize (~> 5.0)
scss_lint (~> 0.58)
sidekiq (~> 5.2)
sidekiq (~> 6.0)
sidekiq-bulk (~> 0.2.0)
sidekiq-scheduler (~> 3.0)
sidekiq-unique-jobs (~> 6.0)

View File

@ -18,6 +18,7 @@ class Api::V1::Timelines::ListController < Api::BaseController
def set_list
@list = List.where(account: current_account).find(params[:id])
@accounts = ListAccount.select('account_id').where(list_id: @list)
end
def set_statuses
@ -29,16 +30,14 @@ class Api::V1::Timelines::ListController < Api::BaseController
end
def list_statuses
list_feed.get(
statuses = Status.where(
account: @accounts, reply: false
).where(
'updated_at > ?', 10.days.ago
).paginate_by_id(
limit_param(DEFAULT_STATUSES_LIMIT),
params[:max_id],
params[:since_id],
params[:min_id]
)
end
def list_feed
ListFeed.new(@list)
params_slice(:max_id, :since_id, :min_id)
).reject { |status| FeedManager.instance.filter?(:home, status, current_account.id) }
end
def insert_pagination_headers

View File

@ -98,8 +98,8 @@ class EditProfileModal extends ImmutablePureComponent {
if (account.get('avatar_static') !== avatarSrc) obj.avatar = avatarSrc
if (account.get('header_static') !== headerSrc) obj.header = headerSrc
this.props.onSave(obj)
this.handleOnClose()
this.props.onSave(obj, this.handleOnClose)
//this.handleOnClose()
}
render() {
@ -210,7 +210,7 @@ const mapStateToProps = (state) => ({
})
const mapDispatchToProps = (dispatch) => ({
onSave: (data) => dispatch(saveUserProfileInformation(data)),
onSave: (data, closer) => dispatch(saveUserProfileInformation(data, closer)),
})
EditProfileModal.propTypes = {

View File

@ -56,12 +56,14 @@ class GroupTimelineSortTopOptionsPopover extends React.PureComponent {
title: intl.formatMessage(messages.topYearTitle),
onClick: () => this.handleOnClick(GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_YEARLY),
},
/*
{
hideArrow: true,
isActive: sortByTopValue === GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_ALL_TIME,
title: intl.formatMessage(messages.topAllTitle),
onClick: () => this.handleOnClick(GROUP_TIMELINE_SORTING_TYPE_TOP_OPTION_ALL_TIME),
},
*/
]
return (

View File

@ -19,6 +19,7 @@ export default function (state = initialState, action) {
case SAVE_USER_PROFILE_INFORMATION_FETCH_SUCCESS:
return state
case SAVE_USER_PROFILE_INFORMATION_FETCH_FAIL:
alert('Failed to update your profile. Max profile image size is 2MB. Please update and try again.')
return state.set('isError', true)
case RESEND_USER_CONFIRMATION_EMAIL_SUCCESS:
return state.set('emailConfirmationResends', state.get('emailConfirmationResends') + 1)

View File

@ -90,7 +90,7 @@ class Status < ApplicationRecord
default_scope { recent }
scope :recent, -> { reorder(created_at: :desc) }
scope :recent, -> { reorder(updated_at: :desc) }
scope :remote, -> { where(local: false).or(where.not(uri: nil)) }
scope :local, -> { where(local: true).or(where(uri: nil)) }
@ -290,13 +290,14 @@ class Status < ApplicationRecord
end
def as_home_timeline(account)
query = where('updated_at > ?', 30.days.ago)
query = where('updated_at > ?', 5.days.ago)
query.where(visibility: [:public, :unlisted, :private])
query.where(account: [account] + account.following).without_replies
end
def as_group_timeline(group)
where(group: group).without_replies
query = where('updated_at > ?', 5.days.ago)
query.where(group: group).without_replies
end
def as_group_collection_timeline(groupIds)

View File

@ -2,8 +2,16 @@
class FanOutOnWriteService < BaseService
# Push a status into home and mentions feeds
# @param [Status] status
def call(status)
deliver_to_self(status) if status.account.local?
raise GabSocial::RaceConditionError if status.visibility.nil?
if status.direct_visibility? || status.limited_visibility?
#
else
deliver_to_self(status) if status.account.local?
end
end
private

View File

@ -37,7 +37,7 @@ if ENV['S3_ENABLED'] == 'true'
s3_options: {
signature_version: ENV.fetch('S3_SIGNATURE_VERSION') { 'v4' },
http_open_timeout: 5,
http_read_timeout: 5,
http_read_timeout: 30,
http_idle_timeout: 5,
}
)

View File

@ -19,4 +19,4 @@ Sidekiq.configure_client do |config|
config.redis = redis_params
end
Sidekiq::Logging.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
Sidekiq.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)

View File

@ -39,6 +39,34 @@ module GabSocial
say("Removed #{custom_emojis_count} custom emojis", :green)
end
option :dry_run, type: :boolean
desc 'deleteallremote', 'Remove all remote data'
def deleteallremote
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
Account.remote.by_domain_accounts.find_in_batches do |acct|
domain = acct.domain
say("\n\n\n - Starting domain block for #{domain} #{dry_run}", :green)
if domain.present?
existing_domain_block = DomainBlock.find_by(domain: domain)
unless existing_domain_block.present?
say("\nDomain block for #{domain} is starting #{dry_run}", :green)
unless options[:dry_run]
domain_block = DomainBlock.new(domain: domain, severity: :suspend)
DomainBlockWorker.perform_async(domain_block.id)
end
else
say("\nDomain block for #{domain} is already implemented #{dry_run}", :red)
end
end
end
say('\n\n - Domain block deleteallremote done', :green)
end
option :concurrency, type: :numeric, default: 50, aliases: [:c]
option :silent, type: :boolean, default: false, aliases: [:s]
option :format, type: :string, default: 'summary', aliases: [:f]