From 05377c76bd16cbdc1539abe394232ab94053662c Mon Sep 17 00:00:00 2001 From: Mashiro Date: Sat, 17 Oct 2020 05:12:01 +0800 Subject: [PATCH] Revert "merge upstream & update theme (#234)" This reverts commit f9afbd05a3921141307f7c60b01790c14de0f242. --- Gemfile | 3 +- Gemfile.lock | 20 +- app/controllers/admin/ip_blocks_controller.rb | 56 --- app/controllers/api/v1/accounts_controller.rb | 4 +- app/controllers/api/v1/mutes_controller.rb | 2 +- .../auth/registrations_controller.rb | 6 +- app/helpers/admin/action_logs_helper.rb | 4 - app/helpers/webfinger_helper.rb | 33 +- app/javascript/mastodon/actions/accounts.js | 4 +- app/javascript/mastodon/actions/mutes.js | 10 - .../mastodon/actions/notifications.js | 45 -- app/javascript/mastodon/actions/onboarding.js | 13 - app/javascript/mastodon/components/account.js | 7 - .../mastodon/components/autosuggest_emoji.js | 3 +- .../mastodon/components/column_header.js | 18 +- .../mastodon/components/icon_with_badge.js | 4 +- .../components/emoji_picker_dropdown.js | 2 +- .../mastodon/features/emoji/emoji.js | 3 +- .../components/announcements.js | 3 +- .../components/column_settings.js | 36 +- .../notifications_permission_banner.js | 30 -- .../components/setting_toggle.js | 5 +- .../containers/column_settings_container.js | 35 +- .../mastodon/features/notifications/index.js | 7 +- .../ui/components/focal_point_modal.js | 3 +- .../features/ui/components/mute_modal.js | 44 +- app/javascript/mastodon/features/ui/index.js | 4 + .../mastodon/locales/defaultMessages.json | 49 -- app/javascript/mastodon/locales/en.json | 8 - app/javascript/mastodon/locales/ja.json | 2 - app/javascript/mastodon/main.js | 2 - app/javascript/mastodon/reducers/mutes.js | 4 - .../mastodon/reducers/notifications.js | 17 +- app/javascript/mastodon/reducers/settings.js | 13 +- app/javascript/mastodon/utils/config.js | 10 - .../mastodon/utils/notifications.js | 29 -- app/javascript/packs/about.js | 1 - app/javascript/packs/admin.js | 1 - app/javascript/packs/application.js | 1 - app/javascript/packs/error.js | 1 - app/javascript/packs/public-path.js | 21 - app/javascript/packs/public.js | 1 - app/javascript/packs/share.js | 1 - app/javascript/styles/cybre-base.scss | 14 +- .../styles/mastodon-light/diff.scss | 5 - .../styles/mastodon/components.scss | 62 --- app/javascript/styles/neon-city.scss | 32 +- app/lib/activitypub/activity.rb | 2 +- app/lib/fast_ip_map.rb | 32 -- app/lib/webfinger.rb | 93 ---- app/models/account_alias.rb | 2 +- app/models/account_migration.rb | 2 +- app/models/concerns/account_interactions.rb | 7 +- app/models/concerns/expireable.rb | 10 +- app/models/form/ip_block_batch.rb | 31 -- app/models/form/redirect.rb | 2 +- app/models/ip_block.rb | 41 -- app/models/mute.rb | 2 - app/models/remote_follow.rb | 10 +- app/models/user.rb | 16 +- app/policies/ip_block_policy.rb | 15 - .../rest/muted_account_serializer.rb | 10 - .../fetch_remote_account_service.rb | 7 +- app/services/app_sign_up_service.rb | 4 +- app/services/mute_service.rb | 6 +- app/services/process_mentions_service.rb | 2 +- app/services/resolve_account_service.rb | 9 +- app/views/admin/ip_blocks/_ip_block.html.haml | 11 - app/views/admin/ip_blocks/index.html.haml | 28 -- app/views/admin/ip_blocks/new.html.haml | 20 - .../admin/pending_accounts/_account.html.haml | 2 +- app/views/layouts/application.html.haml | 1 - app/views/layouts/embedded.html.haml | 1 - app/views/well_known/host_meta/show.xml.ruby | 1 + app/workers/delete_mute_worker.rb | 10 - app/workers/scheduler/ip_cleanup_scheduler.rb | 18 +- chart/templates/cronjob-media-remove.yaml | 73 --- chart/values.yaml.template | 6 - config/initializers/rack_attack.rb | 4 - config/locales/en.yml | 19 - config/locales/simple_form.en.yml | 15 - config/navigation.rb | 1 - config/routes.rb | 6 - config/webpack/configuration.js | 17 +- .../20200317021758_add_expires_at_to_mutes.rb | 5 - db/migrate/20201008202037_create_ip_blocks.rb | 12 - .../20201008220312_add_sign_up_ip_to_users.rb | 5 - db/schema.rb | 13 +- lib/cli.rb | 4 - lib/mastodon/ip_blocks_cli.rb | 132 ----- package.json | 24 +- .../remote_follow_controller_spec.rb | 10 +- .../well_known/host_meta_controller_spec.rb | 2 +- spec/fabricators/ip_block_fabricator.rb | 6 - spec/lib/fast_ip_map_spec.rb | 21 - spec/lib/feed_manager_spec.rb | 1 - spec/models/ip_block_spec.rb | 5 - spec/services/app_sign_up_service_spec.rb | 13 +- yarn.lock | 455 ++++++++---------- 99 files changed, 399 insertions(+), 1523 deletions(-) delete mode 100644 app/controllers/admin/ip_blocks_controller.rb delete mode 100644 app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js delete mode 100644 app/javascript/mastodon/utils/config.js delete mode 100644 app/javascript/mastodon/utils/notifications.js delete mode 100644 app/javascript/packs/public-path.js delete mode 100644 app/lib/fast_ip_map.rb delete mode 100644 app/lib/webfinger.rb delete mode 100644 app/models/form/ip_block_batch.rb delete mode 100644 app/models/ip_block.rb delete mode 100644 app/policies/ip_block_policy.rb delete mode 100644 app/serializers/rest/muted_account_serializer.rb delete mode 100644 app/views/admin/ip_blocks/_ip_block.html.haml delete mode 100644 app/views/admin/ip_blocks/index.html.haml delete mode 100644 app/views/admin/ip_blocks/new.html.haml delete mode 100644 app/workers/delete_mute_worker.rb delete mode 100644 chart/templates/cronjob-media-remove.yaml delete mode 100644 db/migrate/20200317021758_add_expires_at_to_mutes.rb delete mode 100644 db/migrate/20201008202037_create_ip_blocks.rb delete mode 100644 db/migrate/20201008220312_add_sign_up_ip_to_users.rb delete mode 100644 lib/mastodon/ip_blocks_cli.rb delete mode 100644 spec/fabricators/ip_block_fabricator.rb delete mode 100644 spec/lib/fast_ip_map_spec.rb delete mode 100644 spec/models/ip_block_spec.rb diff --git a/Gemfile b/Gemfile index 748f6c8b3707ca..db58d74de74b76 100644 --- a/Gemfile +++ b/Gemfile @@ -54,6 +54,7 @@ gem 'doorkeeper', '~> 5.4' gem 'ed25519', '~> 1.2' gem 'fast_blank', '~> 1.0' gem 'fastimage' +gem 'goldfinger', '~> 2.1' gem 'hiredis', '~> 0.6' gem 'redis-namespace', '~> 1.8' gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b' @@ -142,7 +143,7 @@ group :development do gem 'letter_opener', '~> 1.7' gem 'letter_opener_web', '~> 1.4' gem 'memory_profiler' - gem 'rubocop', '~> 0.93', require: false + gem 'rubocop', '~> 0.92', require: false gem 'rubocop-rails', '~> 2.8', require: false gem 'brakeman', '~> 4.10', require: false gem 'bundler-audit', '~> 0.7', require: false diff --git a/Gemfile.lock b/Gemfile.lock index a3ded10bbb86fb..23e88e27e99030 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -240,6 +240,11 @@ GEM ruby-progressbar (~> 1.4) globalid (0.4.2) activesupport (>= 4.2.0) + goldfinger (2.1.1) + addressable (~> 2.5) + http (~> 4.0) + nokogiri (~> 1.8) + oj (~> 3.0) hamlit (2.13.0) temple (>= 0.8.2) thor @@ -398,7 +403,7 @@ GEM parallel (1.19.2) parallel_tests (3.3.0) parallel - parser (2.7.2.0) + parser (2.7.1.5) ast (~> 2.4.1) parslet (2.0.0) pastel (0.8.0) @@ -498,7 +503,7 @@ GEM redis-store (>= 1.2, < 2) redis-store (1.9.0) redis (>= 4, < 5) - regexp_parser (1.8.2) + regexp_parser (1.8.1) request_store (1.5.0) rack (>= 1.4) responders (3.0.1) @@ -534,13 +539,13 @@ GEM rspec-support (3.9.3) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.93.0) + rubocop (0.92.0) parallel (~> 1.10) parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8) + regexp_parser (>= 1.7) rexml - rubocop-ast (>= 0.6.0) + rubocop-ast (>= 0.5.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) rubocop-ast (0.7.1) @@ -635,7 +640,7 @@ GEM unf (~> 0.1.0) tzinfo (1.2.7) thread_safe (~> 0.1) - tzinfo-data (1.2020.2) + tzinfo-data (1.2020.1) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext @@ -717,6 +722,7 @@ DEPENDENCIES fog-core (<= 2.1.0) fog-openstack (~> 0.3) fuubar (~> 2.5) + goldfinger (~> 2.1) hamlit-rails (~> 0.2) health_check! hiredis (~> 0.6) @@ -781,7 +787,7 @@ DEPENDENCIES rspec-rails (~> 4.0) rspec-sidekiq (~> 3.1) rspec_junit_formatter (~> 0.4) - rubocop (~> 0.93) + rubocop (~> 0.92) rubocop-rails (~> 2.8) ruby-progressbar (~> 1.10) sanitize (~> 5.2) diff --git a/app/controllers/admin/ip_blocks_controller.rb b/app/controllers/admin/ip_blocks_controller.rb deleted file mode 100644 index 92b8b0d2b8a260..00000000000000 --- a/app/controllers/admin/ip_blocks_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -module Admin - class IpBlocksController < BaseController - def index - authorize :ip_block, :index? - - @ip_blocks = IpBlock.page(params[:page]) - @form = Form::IpBlockBatch.new - end - - def new - authorize :ip_block, :create? - - @ip_block = IpBlock.new(ip: '', severity: :no_access, expires_in: 1.year) - end - - def create - authorize :ip_block, :create? - - @ip_block = IpBlock.new(resource_params) - - if @ip_block.save - log_action :create, @ip_block - redirect_to admin_ip_blocks_path, notice: I18n.t('admin.ip_blocks.created_msg') - else - render :new - end - end - - def batch - @form = Form::IpBlockBatch.new(form_ip_block_batch_params.merge(current_account: current_account, action: action_from_button)) - @form.save - rescue ActionController::ParameterMissing - flash[:alert] = I18n.t('admin.ip_blocks.no_ip_block_selected') - rescue Mastodon::NotPermittedError - flash[:alert] = I18n.t('admin.custom_emojis.not_permitted') - ensure - redirect_to admin_ip_blocks_path - end - - private - - def resource_params - params.require(:ip_block).permit(:ip, :severity, :comment, :expires_in) - end - - def action_from_button - 'delete' if params[:delete] - end - - def form_ip_block_batch_params - params.require(:form_ip_block_batch).permit(ip_block_ids: []) - end - end -end diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index 3e66ff212eba9b..aef51a6479ab26 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -20,7 +20,7 @@ def show end def create - token = AppSignUpService.new.call(doorkeeper_token.application, request.remote_ip, account_params) + token = AppSignUpService.new.call(doorkeeper_token.application, account_params) response = Doorkeeper::OAuth::TokenResponse.new(token) headers.merge!(response.headers) @@ -42,7 +42,7 @@ def block end def mute - MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications), duration: (params[:duration] || 0)) + MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications)) render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships end diff --git a/app/controllers/api/v1/mutes_controller.rb b/app/controllers/api/v1/mutes_controller.rb index fd52511d7eb049..805d0dee2abcb5 100644 --- a/app/controllers/api/v1/mutes_controller.rb +++ b/app/controllers/api/v1/mutes_controller.rb @@ -7,7 +7,7 @@ class Api::V1::MutesController < Api::BaseController def index @accounts = load_accounts - render json: @accounts, each_serializer: REST::MutedAccountSerializer + render json: @accounts, each_serializer: REST::AccountSerializer end private diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index eb09241902058d..d319662486a87b 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -45,9 +45,9 @@ def update_resource(resource, params) def build_resource(hash = nil) super(hash) - resource.locale = I18n.locale - resource.invite_code = params[:invite_code] if resource.invite_code.blank? - resource.sign_up_ip = request.remote_ip + resource.locale = I18n.locale + resource.invite_code = params[:invite_code] if resource.invite_code.blank? + resource.current_sign_in_ip = request.remote_ip resource.build_account if resource.account.nil? end diff --git a/app/helpers/admin/action_logs_helper.rb b/app/helpers/admin/action_logs_helper.rb index 0f3ca36e2df0f0..8e398c3b269627 100644 --- a/app/helpers/admin/action_logs_helper.rb +++ b/app/helpers/admin/action_logs_helper.rb @@ -29,8 +29,6 @@ def linkable_log_target(record) link_to record.target_account.acct, admin_account_path(record.target_account_id) when 'Announcement' link_to truncate(record.text), edit_admin_announcement_path(record.id) - when 'IpBlock' - "#{record.ip}/#{record.ip.prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{record.severity}")})" end end @@ -50,8 +48,6 @@ def log_target_from_history(type, attributes) end when 'Announcement' truncate(attributes['text'].is_a?(Array) ? attributes['text'].last : attributes['text']) - when 'IpBlock' - "#{attributes['ip']}/#{attributes['ip'].prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{attributes['severity']}")})" end end end diff --git a/app/helpers/webfinger_helper.rb b/app/helpers/webfinger_helper.rb index 482f4e19eabef0..ab7ca469811f12 100644 --- a/app/helpers/webfinger_helper.rb +++ b/app/helpers/webfinger_helper.rb @@ -1,7 +1,38 @@ # frozen_string_literal: true +# Monkey-patch on monkey-patch. +# Because it conflicts with the request.rb patch. +class HTTP::Timeout::PerOperationOriginal < HTTP::Timeout::PerOperation + def connect(socket_class, host, port, nodelay = false) + ::Timeout.timeout(@connect_timeout, HTTP::TimeoutError) do + @socket = socket_class.open(host, port) + @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) if nodelay + end + end +end + module WebfingerHelper def webfinger!(uri) - Webfinger.new(uri).perform + hidden_service_uri = /\.(onion|i2p)(:\d+)?$/.match(uri) + + raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if !Rails.configuration.x.access_to_hidden_service && hidden_service_uri + + opts = { + ssl: !hidden_service_uri, + + headers: { + 'User-Agent': Mastodon::Version.user_agent, + }, + + timeout_class: HTTP::Timeout::PerOperationOriginal, + + timeout_options: { + write_timeout: 10, + connect_timeout: 5, + read_timeout: 10, + }, + } + + Goldfinger::Client.new(uri, opts.merge(Rails.configuration.x.http_client_proxy)).finger end end diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js index 58b63660260971..723c04e554d96a 100644 --- a/app/javascript/mastodon/actions/accounts.js +++ b/app/javascript/mastodon/actions/accounts.js @@ -257,11 +257,11 @@ export function unblockAccountFail(error) { }; -export function muteAccount(id, notifications, duration=0) { +export function muteAccount(id, notifications) { return (dispatch, getState) => { dispatch(muteAccountRequest(id)); - api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => { + api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications }).then(response => { // Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers dispatch(muteAccountSuccess(response.data, getState().get('statuses'))); }).catch(error => { diff --git a/app/javascript/mastodon/actions/mutes.js b/app/javascript/mastodon/actions/mutes.js index d8874f353f42c4..9f645faee17bbf 100644 --- a/app/javascript/mastodon/actions/mutes.js +++ b/app/javascript/mastodon/actions/mutes.js @@ -13,7 +13,6 @@ export const MUTES_EXPAND_FAIL = 'MUTES_EXPAND_FAIL'; export const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL'; export const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS'; -export const MUTES_CHANGE_DURATION = 'MUTES_CHANGE_DURATION'; export function fetchMutes() { return (dispatch, getState) => { @@ -105,12 +104,3 @@ export function toggleHideNotifications() { dispatch({ type: MUTES_TOGGLE_HIDE_NOTIFICATIONS }); }; } - -export function changeMuteDuration(duration) { - return dispatch => { - dispatch({ - type: MUTES_CHANGE_DURATION, - duration, - }); - }; -} diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index c4fa66428215d4..cd03a1d784976d 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -16,7 +16,6 @@ import { getFiltersRegex } from '../selectors'; import { usePendingItems as preferPendingItems } from 'mastodon/initial_state'; import compareId from 'mastodon/compare_id'; import { searchTextFromRawStatus } from 'mastodon/actions/importer/normalizer'; -import { requestNotificationPermission } from '../utils/notifications'; export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE'; export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP'; @@ -34,12 +33,8 @@ export const NOTIFICATIONS_LOAD_PENDING = 'NOTIFICATIONS_LOAD_PENDING'; export const NOTIFICATIONS_MOUNT = 'NOTIFICATIONS_MOUNT'; export const NOTIFICATIONS_UNMOUNT = 'NOTIFICATIONS_UNMOUNT'; - export const NOTIFICATIONS_MARK_AS_READ = 'NOTIFICATIONS_MARK_AS_READ'; -export const NOTIFICATIONS_SET_BROWSER_SUPPORT = 'NOTIFICATIONS_SET_BROWSER_SUPPORT'; -export const NOTIFICATIONS_SET_BROWSER_PERMISSION = 'NOTIFICATIONS_SET_BROWSER_PERMISSION'; - defineMessages({ mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' }, group: { id: 'notifications.group', defaultMessage: '{count} notifications' }, @@ -240,46 +235,6 @@ export const unmountNotifications = () => ({ type: NOTIFICATIONS_UNMOUNT, }); - export const markNotificationsAsRead = () => ({ type: NOTIFICATIONS_MARK_AS_READ, }); - -// Browser support -export function setupBrowserNotifications() { - return dispatch => { - dispatch(setBrowserSupport('Notification' in window)); - if ('Notification' in window) { - dispatch(setBrowserPermission(Notification.permission)); - } - - if ('Notification' in window && 'permissions' in navigator) { - navigator.permissions.query({ name: 'notifications' }).then((status) => { - status.onchange = () => dispatch(setBrowserPermission(Notification.permission)); - }); - } - }; -} - -export function requestBrowserPermission(callback = noOp) { - return dispatch => { - requestNotificationPermission((permission) => { - dispatch(setBrowserPermission(permission)); - callback(permission); - }); - }; -}; - -export function setBrowserSupport (value) { - return { - type: NOTIFICATIONS_SET_BROWSER_SUPPORT, - value, - }; -} - -export function setBrowserPermission (value) { - return { - type: NOTIFICATIONS_SET_BROWSER_PERMISSION, - value, - }; -} diff --git a/app/javascript/mastodon/actions/onboarding.js b/app/javascript/mastodon/actions/onboarding.js index 42d8ea33fdd79d..a1dd3a731eddc1 100644 --- a/app/javascript/mastodon/actions/onboarding.js +++ b/app/javascript/mastodon/actions/onboarding.js @@ -1,21 +1,8 @@ import { changeSetting, saveSettings } from './settings'; -import { requestBrowserPermission } from './notifications'; export const INTRODUCTION_VERSION = 20181216044202; export const closeOnboarding = () => dispatch => { dispatch(changeSetting(['introductionVersion'], INTRODUCTION_VERSION)); dispatch(saveSettings()); - - dispatch(requestBrowserPermission((permission) => { - if (permission === 'granted') { - dispatch(changeSetting(['notifications', 'alerts', 'follow'], true)); - dispatch(changeSetting(['notifications', 'alerts', 'favourite'], true)); - dispatch(changeSetting(['notifications', 'alerts', 'reblog'], true)); - dispatch(changeSetting(['notifications', 'alerts', 'mention'], true)); - dispatch(changeSetting(['notifications', 'alerts', 'poll'], true)); - dispatch(changeSetting(['notifications', 'alerts', 'status'], true)); - dispatch(saveSettings()); - } - })); }; diff --git a/app/javascript/mastodon/components/account.js b/app/javascript/mastodon/components/account.js index 0e40ee1d6a5543..2705a6001341bf 100644 --- a/app/javascript/mastodon/components/account.js +++ b/app/javascript/mastodon/components/account.js @@ -8,7 +8,6 @@ import IconButton from './icon_button'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { me } from '../initial_state'; -import RelativeTimestamp from './relative_timestamp'; const messages = defineMessages({ follow: { id: 'account.follow', defaultMessage: 'Follow' }, @@ -108,17 +107,11 @@ class Account extends ImmutablePureComponent { } } - let mute_expires_at; - if (account.get('mute_expires_at')) { - mute_expires_at =
; - } - return (
- {mute_expires_at}
diff --git a/app/javascript/mastodon/components/autosuggest_emoji.js b/app/javascript/mastodon/components/autosuggest_emoji.js index 4937e4d9845f4d..ce4383a607f609 100644 --- a/app/javascript/mastodon/components/autosuggest_emoji.js +++ b/app/javascript/mastodon/components/autosuggest_emoji.js @@ -1,7 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import unicodeMapping from '../features/emoji/emoji_unicode_mapping_light'; -import { assetHost } from 'mastodon/utils/config'; + +const assetHost = process.env.CDN_HOST || ''; export default class AutosuggestEmoji extends React.PureComponent { diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 236e922969d770..1bb583583a3558 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -34,7 +34,6 @@ class ColumnHeader extends React.PureComponent { onMove: PropTypes.func, onClick: PropTypes.func, appendContent: PropTypes.node, - collapseIssues: PropTypes.bool, }; state = { @@ -84,7 +83,7 @@ class ColumnHeader extends React.PureComponent { } render () { - const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent, collapseIssues } = this.props; + const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder, appendContent } = this.props; const { collapsed, animating } = this.state; const wrapperClassName = classNames('column-header__wrapper', { @@ -146,20 +145,7 @@ class ColumnHeader extends React.PureComponent { } if (children || (multiColumn && this.props.onPin)) { - collapseButton = ( - - ); + collapseButton = ; } const hasTitle = icon && title; diff --git a/app/javascript/mastodon/components/icon_with_badge.js b/app/javascript/mastodon/components/icon_with_badge.js index 4214eccfde9405..7851eb4be99704 100644 --- a/app/javascript/mastodon/components/icon_with_badge.js +++ b/app/javascript/mastodon/components/icon_with_badge.js @@ -4,18 +4,16 @@ import Icon from 'mastodon/components/icon'; const formatNumber = num => num > 40 ? '40+' : num; -const IconWithBadge = ({ id, count, issueBadge, className }) => ( +const IconWithBadge = ({ id, count, className }) => ( {count > 0 && {formatNumber(count)}} - {issueBadge && } ); IconWithBadge.propTypes = { id: PropTypes.string.isRequired, count: PropTypes.number.isRequired, - issueBadge: PropTypes.bool, className: PropTypes.string, }; diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js index bf02a65c19dd1b..16f51946378226 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js @@ -7,7 +7,6 @@ import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; import detectPassiveEvents from 'detect-passive-events'; import { buildCustomEmojis, categoriesFromEmojis } from '../../emoji/emoji'; -import { assetHost } from 'mastodon/utils/config'; const messages = defineMessages({ emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' }, @@ -26,6 +25,7 @@ const messages = defineMessages({ flags: { id: 'emoji_button.flags', defaultMessage: 'Flags' }, }); +const assetHost = process.env.CDN_HOST || ''; let EmojiPicker, Emoji; // load asynchronously const backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`; diff --git a/app/javascript/mastodon/features/emoji/emoji.js b/app/javascript/mastodon/features/emoji/emoji.js index 4e37f3a809165d..5d9dad0978bb2d 100644 --- a/app/javascript/mastodon/features/emoji/emoji.js +++ b/app/javascript/mastodon/features/emoji/emoji.js @@ -1,10 +1,11 @@ import { autoPlayGif } from '../../initial_state'; import unicodeMapping from './emoji_unicode_mapping_light'; -import { assetHost } from 'mastodon/utils/config'; import Trie from 'substring-trie'; const trie = new Trie(Object.keys(unicodeMapping)); +const assetHost = process.env.CDN_HOST || ''; + // Convert to file names from emojis. (For different variation selector emojis) const emojiFilenames = (emojis) => { return emojis.map(v => unicodeMapping[v].filename); diff --git a/app/javascript/mastodon/features/getting_started/components/announcements.js b/app/javascript/mastodon/features/getting_started/components/announcements.js index e9651e2d409b04..d73c34df1fdf04 100644 --- a/app/javascript/mastodon/features/getting_started/components/announcements.js +++ b/app/javascript/mastodon/features/getting_started/components/announcements.js @@ -15,7 +15,6 @@ import EmojiPickerDropdown from 'mastodon/features/compose/containers/emoji_pick import AnimatedNumber from 'mastodon/components/animated_number'; import TransitionMotion from 'react-motion/lib/TransitionMotion'; import spring from 'react-motion/lib/spring'; -import { assetHost } from 'mastodon/utils/config'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, @@ -154,6 +153,8 @@ class Content extends ImmutablePureComponent { } +const assetHost = process.env.CDN_HOST || ''; + class Emoji extends React.PureComponent { static propTypes = { diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.js b/app/javascript/mastodon/features/notifications/components/column_settings.js index 169e4b44de8023..8bd03fbdab26ef 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings.js +++ b/app/javascript/mastodon/features/notifications/components/column_settings.js @@ -12,10 +12,6 @@ export default class ColumnSettings extends React.PureComponent { pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, onClear: PropTypes.func.isRequired, - onRequestNotificationPermission: PropTypes.func, - alertsEnabled: PropTypes.bool, - browserSupport: PropTypes.bool, - browserPermission: PropTypes.bool, }; onPushChange = (path, checked) => { @@ -23,7 +19,7 @@ export default class ColumnSettings extends React.PureComponent { } render () { - const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission } = this.props; + const { settings, pushSettings, onChange, onClear } = this.props; const filterShowStr = ; const filterAdvancedStr = ; @@ -36,12 +32,6 @@ export default class ColumnSettings extends React.PureComponent { return (
- {alertsEnabled && browserSupport && browserPermission === 'denied' && ( -
- -
- )} -
@@ -50,7 +40,6 @@ export default class ColumnSettings extends React.PureComponent { -
@@ -61,7 +50,7 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && } @@ -72,7 +61,7 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && } @@ -83,7 +72,7 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && } @@ -94,7 +83,7 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && } @@ -105,7 +94,7 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && } @@ -116,23 +105,12 @@ export default class ColumnSettings extends React.PureComponent {
- + {showPushSettings && }
- -
- - -
- - {showPushSettings && } - - -
-
); } diff --git a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js b/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js deleted file mode 100644 index 766c9bb5ba957b..00000000000000 --- a/app/javascript/mastodon/features/notifications/components/notifications_permission_banner.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import Icon from 'mastodon/components/icon'; -import Button from 'mastodon/components/button'; -import { requestBrowserPermission } from 'mastodon/actions/notifications'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import { FormattedMessage } from 'react-intl'; - -export default @connect(() => {}) -class NotificationsPermissionBanner extends React.PureComponent { - - static propTypes = { - dispatch: PropTypes.func.isRequired, - }; - - handleClick = () => { - this.props.dispatch(requestBrowserPermission()); - } - - render () { - return ( -
-

-

}} />

- -
- ); - } - -} diff --git a/app/javascript/mastodon/features/notifications/components/setting_toggle.js b/app/javascript/mastodon/features/notifications/components/setting_toggle.js index c4c8bffbe3240f..e6f593ef89f606 100644 --- a/app/javascript/mastodon/features/notifications/components/setting_toggle.js +++ b/app/javascript/mastodon/features/notifications/components/setting_toggle.js @@ -12,7 +12,6 @@ export default class SettingToggle extends React.PureComponent { label: PropTypes.node.isRequired, onChange: PropTypes.func.isRequired, defaultValue: PropTypes.bool, - disabled: PropTypes.bool, } onChange = ({ target }) => { @@ -20,12 +19,12 @@ export default class SettingToggle extends React.PureComponent { } render () { - const { prefix, settings, settingPath, label, defaultValue, disabled } = this.props; + const { prefix, settings, settingPath, label, defaultValue } = this.props; const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-'); return (
- +
); diff --git a/app/javascript/mastodon/features/notifications/containers/column_settings_container.js b/app/javascript/mastodon/features/notifications/containers/column_settings_container.js index 9a70bd4f36136c..a67f262953f6a6 100644 --- a/app/javascript/mastodon/features/notifications/containers/column_settings_container.js +++ b/app/javascript/mastodon/features/notifications/containers/column_settings_container.js @@ -3,55 +3,28 @@ import { defineMessages, injectIntl } from 'react-intl'; import ColumnSettings from '../components/column_settings'; import { changeSetting } from '../../../actions/settings'; import { setFilter } from '../../../actions/notifications'; -import { clearNotifications, requestBrowserPermission } from '../../../actions/notifications'; +import { clearNotifications } from '../../../actions/notifications'; import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications'; import { openModal } from '../../../actions/modal'; -import { showAlert } from '../../../actions/alerts'; const messages = defineMessages({ clearMessage: { id: 'notifications.clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all your notifications?' }, clearConfirm: { id: 'notifications.clear', defaultMessage: 'Clear notifications' }, - permissionDenied: { id: 'notifications.permission_denied_alert', defaultMessage: 'Desktop notifications can\'t be enabled, as browser permission has been denied before' }, }); const mapStateToProps = state => ({ settings: state.getIn(['settings', 'notifications']), pushSettings: state.get('push_notifications'), - alertsEnabled: state.getIn(['settings', 'notifications', 'alerts']).includes(true), - browserSupport: state.getIn(['notifications', 'browserSupport']), - browserPermission: state.getIn(['notifications', 'browserPermission']), }); const mapDispatchToProps = (dispatch, { intl }) => ({ onChange (path, checked) { if (path[0] === 'push') { - if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') { - dispatch(requestBrowserPermission((permission) => { - if (permission === 'granted') { - dispatch(changePushNotifications(path.slice(1), checked)); - } else { - dispatch(showAlert(undefined, messages.permissionDenied)); - } - })); - } else { - dispatch(changePushNotifications(path.slice(1), checked)); - } + dispatch(changePushNotifications(path.slice(1), checked)); } else if (path[0] === 'quickFilter') { dispatch(changeSetting(['notifications', ...path], checked)); dispatch(setFilter('all')); - } else if (path[0] === 'alerts' && checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') { - if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') { - dispatch(requestBrowserPermission((permission) => { - if (permission === 'granted') { - dispatch(changeSetting(['notifications', ...path], checked)); - } else { - dispatch(showAlert(undefined, messages.permissionDenied)); - } - })); - } else { - dispatch(changeSetting(['notifications', ...path], checked)); - } } else { dispatch(changeSetting(['notifications', ...path], checked)); } @@ -65,10 +38,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ })); }, - onRequestNotificationPermission () { - dispatch(requestBrowserPermission()); - }, - }); export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ColumnSettings)); diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js index 73df7f49d0f8db..68afe593d2ff8d 100644 --- a/app/javascript/mastodon/features/notifications/index.js +++ b/app/javascript/mastodon/features/notifications/index.js @@ -25,7 +25,6 @@ import ScrollableList from '../../components/scrollable_list'; import LoadGap from '../../components/load_gap'; import Icon from 'mastodon/components/icon'; import compareId from 'mastodon/compare_id'; -import NotificationsPermissionBanner from './components/notifications_permission_banner'; const messages = defineMessages({ title: { id: 'column.notifications', defaultMessage: 'Notifications' }, @@ -56,7 +55,6 @@ const mapStateToProps = state => ({ numPending: state.getIn(['notifications', 'pendingItems'], ImmutableList()).size, lastReadId: state.getIn(['notifications', 'readMarkerId']), canMarkAsRead: state.getIn(['notifications', 'readMarkerId']) !== '0' && getNotifications(state).some(item => item !== null && compareId(item.get('id'), state.getIn(['notifications', 'readMarkerId'])) > 0), - needsNotificationPermission: state.getIn(['settings', 'notifications', 'alerts']).includes(true) && state.getIn(['notifications', 'browserSupport']) && state.getIn(['notifications', 'browserPermission']) === 'default', }); export default @connect(mapStateToProps) @@ -77,7 +75,6 @@ class Notifications extends React.PureComponent { numPending: PropTypes.number, lastReadId: PropTypes.string, canMarkAsRead: PropTypes.bool, - needsNotificationPermission: PropTypes.bool, }; static defaultProps = { @@ -170,7 +167,7 @@ class Notifications extends React.PureComponent { }; render () { - const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props; + const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead } = this.props; const pinned = !!columnId; const emptyMessage = ; @@ -214,8 +211,6 @@ class Notifications extends React.PureComponent { showLoading={isLoading && notifications.size === 0} hasMore={hasMore} numPending={numPending} - prepend={needsNotificationPermission && } - alwaysPrepend emptyMessage={emptyMessage} onLoadMore={this.handleLoadOlder} onLoadPending={this.handleLoadPending} diff --git a/app/javascript/mastodon/features/ui/components/focal_point_modal.js b/app/javascript/mastodon/features/ui/components/focal_point_modal.js index e19f277d8e1d4a..926a495d1c3db4 100644 --- a/app/javascript/mastodon/features/ui/components/focal_point_modal.js +++ b/app/javascript/mastodon/features/ui/components/focal_point_modal.js @@ -20,7 +20,6 @@ import GIFV from 'mastodon/components/gifv'; import { me } from 'mastodon/initial_state'; import tesseractCorePath from 'tesseract.js-core/tesseract-core.wasm.js'; import tesseractWorkerPath from 'tesseract.js/dist/worker.min.js'; -import { assetHost } from 'mastodon/utils/config'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, @@ -51,6 +50,8 @@ const removeExtraLineBreaks = str => str.replace(/\n\n/g, '******') .replace(/\n/g, ' ') .replace(/\*\*\*\*\*\*/g, '\n\n'); +const assetHost = process.env.CDN_HOST || ''; + class ImageLoader extends React.PureComponent { static propTypes = { diff --git a/app/javascript/mastodon/features/ui/components/mute_modal.js b/app/javascript/mastodon/features/ui/components/mute_modal.js index d8d8e68c384dbc..852830c3c2c93f 100644 --- a/app/javascript/mastodon/features/ui/components/mute_modal.js +++ b/app/javascript/mastodon/features/ui/components/mute_modal.js @@ -1,32 +1,25 @@ import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import { injectIntl, FormattedMessage } from 'react-intl'; import Toggle from 'react-toggle'; import Button from '../../../components/button'; import { closeModal } from '../../../actions/modal'; import { muteAccount } from '../../../actions/accounts'; -import { toggleHideNotifications, changeMuteDuration } from '../../../actions/mutes'; +import { toggleHideNotifications } from '../../../actions/mutes'; -const messages = defineMessages({ - minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' }, - hours: { id: 'intervals.full.hours', defaultMessage: '{number, plural, one {# hour} other {# hours}}' }, - days: { id: 'intervals.full.days', defaultMessage: '{number, plural, one {# day} other {# days}}' }, - indefinite: { id: 'mute_modal.indefinite', defaultMessage: 'Indefinite' }, -}); const mapStateToProps = state => { return { account: state.getIn(['mutes', 'new', 'account']), notifications: state.getIn(['mutes', 'new', 'notifications']), - muteDuration: state.getIn(['mutes', 'new', 'duration']), }; }; const mapDispatchToProps = dispatch => { return { - onConfirm(account, notifications, muteDuration) { - dispatch(muteAccount(account.get('id'), notifications, muteDuration)); + onConfirm(account, notifications) { + dispatch(muteAccount(account.get('id'), notifications)); }, onClose() { @@ -36,10 +29,6 @@ const mapDispatchToProps = dispatch => { onToggleNotifications() { dispatch(toggleHideNotifications()); }, - - onChangeMuteDuration(e) { - dispatch(changeMuteDuration(e.target.value)); - }, }; }; @@ -54,8 +43,6 @@ class MuteModal extends React.PureComponent { onConfirm: PropTypes.func.isRequired, onToggleNotifications: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - muteDuration: PropTypes.number.isRequired, - onChangeMuteDuration: PropTypes.func.isRequired, }; componentDidMount() { @@ -64,7 +51,7 @@ class MuteModal extends React.PureComponent { handleClick = () => { this.props.onClose(); - this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration); + this.props.onConfirm(this.props.account, this.props.notifications); } handleCancel = () => { @@ -79,12 +66,8 @@ class MuteModal extends React.PureComponent { this.props.onToggleNotifications(); } - changeMuteDuration = (e) => { - this.props.onChangeMuteDuration(e); - } - render () { - const { account, notifications, muteDuration, intl } = this.props; + const { account, notifications } = this.props; return (
@@ -108,21 +91,6 @@ class MuteModal extends React.PureComponent {
-
- : - - {/* eslint-disable-next-line jsx-a11y/no-onchange */} - -
diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index c6df49a5fb7f50..91c86b505ad6b2 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -366,6 +366,10 @@ class UI extends React.PureComponent { navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage); } + if (typeof window.Notification !== 'undefined' && Notification.permission === 'default') { + window.setTimeout(() => Notification.requestPermission(), 120 * 1000); + } + this.props.dispatch(fetchMarkers()); this.props.dispatch(expandHomeTimeline()); this.props.dispatch(expandNotifications()); diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 47e5af5573f75a..1b89208b78b1b5 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -2330,10 +2330,6 @@ "defaultMessage": "Push notifications", "id": "notifications.column_settings.push" }, - { - "defaultMessage": "Desktop notifications are unavailable due to previously denied browser permissions request", - "id": "notifications.permission_denied" - }, { "defaultMessage": "Quick filter bar", "id": "notifications.column_settings.filter_bar.category" @@ -2361,10 +2357,6 @@ { "defaultMessage": "Poll results:", "id": "notifications.column_settings.poll" - }, - { - "defaultMessage": "New toots:", - "id": "notifications.column_settings.status" } ], "path": "app/javascript/mastodon/features/notifications/components/column_settings.json" @@ -2448,23 +2440,6 @@ ], "path": "app/javascript/mastodon/features/notifications/components/notification.json" }, - { - "descriptors": [ - { - "defaultMessage": "Never miss a thing", - "id": "notifications_permission_banner.title" - }, - { - "defaultMessage": "To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.", - "id": "notifications_permission_banner.how_to_control" - }, - { - "defaultMessage": "Enable desktop notifications", - "id": "notifications_permission_banner.enable" - } - ], - "path": "app/javascript/mastodon/features/notifications/components/notifications_permission_banner.json" - }, { "descriptors": [ { @@ -2474,10 +2449,6 @@ { "defaultMessage": "Clear notifications", "id": "notifications.clear" - }, - { - "defaultMessage": "Desktop notifications can't be enabled, as browser permission has been denied before", - "id": "notifications.permission_denied_alert" } ], "path": "app/javascript/mastodon/features/notifications/containers/column_settings_container.json" @@ -3099,22 +3070,6 @@ }, { "descriptors": [ - { - "defaultMessage": "{number, plural, one {# minute} other {# minutes}}", - "id": "intervals.full.minutes" - }, - { - "defaultMessage": "{number, plural, one {# hour} other {# hours}}", - "id": "intervals.full.hours" - }, - { - "defaultMessage": "{number, plural, one {# day} other {# days}}", - "id": "intervals.full.days" - }, - { - "defaultMessage": "Indefinite", - "id": "mute_modal.indefinite" - }, { "defaultMessage": "Are you sure you want to mute {name}?", "id": "confirmations.mute.message" @@ -3127,10 +3082,6 @@ "defaultMessage": "Hide notifications from this user?", "id": "mute_modal.hide_notifications" }, - { - "defaultMessage": "Duration", - "id": "mute_modal.duration" - }, { "defaultMessage": "Cancel", "id": "confirmation_modal.cancel" diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index dbfbe9ed82183f..6a49bac2a7a35d 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -283,9 +283,7 @@ "media_gallery.toggle_visible": "Hide {number, plural, one {image} other {images}}", "missing_indicator.label": "Not found", "missing_indicator.sublabel": "This resource could not be found", - "mute_modal.duration": "Duration", "mute_modal.hide_notifications": "Hide notifications from this user?", - "mute_modal.indefinite": "Indefinite", "navigation_bar.apps": "Mobile apps", "navigation_bar.blocks": "Blocked users", "navigation_bar.bookmarks": "Bookmarks", @@ -332,7 +330,6 @@ "notifications.column_settings.reblog": "Boosts:", "notifications.column_settings.show": "Show in column", "notifications.column_settings.sound": "Play sound", - "notifications.column_settings.status": "New toots:", "notifications.filter.all": "All", "notifications.filter.boosts": "Boosts", "notifications.filter.favourites": "Favourites", @@ -342,11 +339,6 @@ "notifications.filter.statuses": "Updates from people you follow", "notifications.group": "{count} notifications", "notifications.mark_as_read": "Mark every notification as read", - "notifications.permission_denied": "Desktop notifications are unavailable due to previously denied browser permissions request", - "notifications.permission_denied_alert": "Desktop notifications can't be enabled, as browser permission has been denied before", - "notifications_permission_banner.enable": "Enable desktop notifications", - "notifications_permission_banner.how_to_control": "To receive notifications when Mastodon isn't open, enable desktop notifications. You can control precisely which types of interactions generate desktop notifications through the {icon} button above once they're enabled.", - "notifications_permission_banner.title": "Never miss a thing", "picture_in_picture.restore": "Put it back", "poll.closed": "Closed", "poll.refresh": "Refresh", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index b7f7e768d8d3eb..b9fe6489e7a8e2 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -284,8 +284,6 @@ "missing_indicator.label": "見つかりません", "missing_indicator.sublabel": "見つかりませんでした", "mute_modal.hide_notifications": "このユーザーからの通知を隠しますか?", - "mute_modal.duration": "ミュートする期間", - "mute_modal.indefinite": "無期限", "navigation_bar.apps": "アプリ", "navigation_bar.blocks": "ブロックしたユーザー", "navigation_bar.bookmarks": "ブックマーク", diff --git a/app/javascript/mastodon/main.js b/app/javascript/mastodon/main.js index bda51f692b770f..da4884fd3d7764 100644 --- a/app/javascript/mastodon/main.js +++ b/app/javascript/mastodon/main.js @@ -1,5 +1,4 @@ import * as registerPushNotifications from './actions/push_notifications'; -import { setupBrowserNotifications } from './actions/notifications'; import { default as Mastodon, store } from './containers/mastodon'; import React from 'react'; import ReactDOM from 'react-dom'; @@ -23,7 +22,6 @@ function main() { const props = JSON.parse(mountNode.getAttribute('data-props')); ReactDOM.render(, mountNode); - store.dispatch(setupBrowserNotifications()); if (process.env.NODE_ENV === 'production') { // avoid offline in dev mode because it's harder to debug require('offline-plugin/runtime').install(); diff --git a/app/javascript/mastodon/reducers/mutes.js b/app/javascript/mastodon/reducers/mutes.js index a9eb61ff834cbc..4672e50974eaa2 100644 --- a/app/javascript/mastodon/reducers/mutes.js +++ b/app/javascript/mastodon/reducers/mutes.js @@ -3,14 +3,12 @@ import Immutable from 'immutable'; import { MUTES_INIT_MODAL, MUTES_TOGGLE_HIDE_NOTIFICATIONS, - MUTES_CHANGE_DURATION, } from '../actions/mutes'; const initialState = Immutable.Map({ new: Immutable.Map({ account: null, notifications: true, - duration: 0, }), }); @@ -23,8 +21,6 @@ export default function mutes(state = initialState, action) { }); case MUTES_TOGGLE_HIDE_NOTIFICATIONS: return state.updateIn(['new', 'notifications'], (old) => !old); - case MUTES_CHANGE_DURATION: - return state.setIn(['new', 'duration'], Number(action.duration)); default: return state; } diff --git a/app/javascript/mastodon/reducers/notifications.js b/app/javascript/mastodon/reducers/notifications.js index 1d48747176b092..b01db806fa5580 100644 --- a/app/javascript/mastodon/reducers/notifications.js +++ b/app/javascript/mastodon/reducers/notifications.js @@ -10,8 +10,6 @@ import { NOTIFICATIONS_MOUNT, NOTIFICATIONS_UNMOUNT, NOTIFICATIONS_MARK_AS_READ, - NOTIFICATIONS_SET_BROWSER_SUPPORT, - NOTIFICATIONS_SET_BROWSER_PERMISSION, } from '../actions/notifications'; import { ACCOUNT_BLOCK_SUCCESS, @@ -42,8 +40,6 @@ const initialState = ImmutableMap({ readMarkerId: '0', isTabVisible: true, isLoading: false, - browserSupport: false, - browserPermission: 'default', }); const notificationToMap = notification => ImmutableMap({ @@ -155,7 +151,7 @@ const deleteByStatus = (state, statusId) => { const updateMounted = (state) => { state = state.update('mounted', count => count + 1); - if (!shouldCountUnreadNotifications(state, state.get('mounted') === 1)) { + if (!shouldCountUnreadNotifications(state)) { state = state.set('readMarkerId', state.get('lastReadId')); state = clearUnread(state); } @@ -171,15 +167,14 @@ const updateVisibility = (state, visibility) => { return state; }; -const shouldCountUnreadNotifications = (state, ignoreScroll = false) => { +const shouldCountUnreadNotifications = (state) => { const isTabVisible = state.get('isTabVisible'); const isOnTop = state.get('top'); const isMounted = state.get('mounted') > 0; const lastReadId = state.get('lastReadId'); - const lastItem = state.get('items').findLast(item => item !== null); - const lastItemReached = !state.get('hasMore') || lastReadId === '0' || (lastItem && compareId(lastItem.get('id'), lastReadId) <= 0); + const lastItemReached = !state.get('hasMore') || lastReadId === '0' || (!state.get('items').isEmpty() && compareId(state.get('items').last().get('id'), lastReadId) <= 0); - return !(isTabVisible && (ignoreScroll || isOnTop) && isMounted && lastItemReached); + return !(isTabVisible && isOnTop && isMounted && lastItemReached); }; const recountUnread = (state, last_read_id) => { @@ -246,10 +241,6 @@ export default function notifications(state = initialState, action) { case NOTIFICATIONS_MARK_AS_READ: const lastNotification = state.get('items').find(item => item !== null); return lastNotification ? recountUnread(state, lastNotification.get('id')) : state; - case NOTIFICATIONS_SET_BROWSER_SUPPORT: - return state.set('browserSupport', action.value); - case NOTIFICATIONS_SET_BROWSER_PERMISSION: - return state.set('browserPermission', action.value); default: return state; } diff --git a/app/javascript/mastodon/reducers/settings.js b/app/javascript/mastodon/reducers/settings.js index 057fa353a275af..efef2ad9a5364b 100644 --- a/app/javascript/mastodon/reducers/settings.js +++ b/app/javascript/mastodon/reducers/settings.js @@ -29,13 +29,12 @@ const initialState = ImmutableMap({ notifications: ImmutableMap({ alerts: ImmutableMap({ - follow: false, + follow: true, follow_request: false, - favourite: false, - reblog: false, - mention: false, - poll: false, - status: false, + favourite: true, + reblog: true, + mention: true, + poll: true, }), quickFilter: ImmutableMap({ @@ -51,7 +50,6 @@ const initialState = ImmutableMap({ reblog: true, mention: true, poll: true, - status: true, }), sounds: ImmutableMap({ @@ -61,7 +59,6 @@ const initialState = ImmutableMap({ reblog: true, mention: true, poll: true, - status: true, }), }), diff --git a/app/javascript/mastodon/utils/config.js b/app/javascript/mastodon/utils/config.js deleted file mode 100644 index 932cd0cbf543e1..00000000000000 --- a/app/javascript/mastodon/utils/config.js +++ /dev/null @@ -1,10 +0,0 @@ -import ready from '../ready'; - -export let assetHost = ''; - -ready(() => { - const cdnHost = document.querySelector('meta[name=cdn-host]'); - if (cdnHost) { - assetHost = cdnHost.content || ''; - } -}); diff --git a/app/javascript/mastodon/utils/notifications.js b/app/javascript/mastodon/utils/notifications.js deleted file mode 100644 index ab119c2e34f8b2..00000000000000 --- a/app/javascript/mastodon/utils/notifications.js +++ /dev/null @@ -1,29 +0,0 @@ -// Handles browser quirks, based on -// https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API - -const checkNotificationPromise = () => { - try { - Notification.requestPermission().then(); - } catch(e) { - return false; - } - - return true; -}; - -const handlePermission = (permission, callback) => { - // Whatever the user answers, we make sure Chrome stores the information - if(!('permission' in Notification)) { - Notification.permission = permission; - } - - callback(Notification.permission); -}; - -export const requestNotificationPermission = (callback) => { - if (checkNotificationPromise()) { - Notification.requestPermission().then((permission) => handlePermission(permission, callback)); - } else { - Notification.requestPermission((permission) => handlePermission(permission, callback)); - } -}; diff --git a/app/javascript/packs/about.js b/app/javascript/packs/about.js index 892d825ece23e5..843cb2c87d4386 100644 --- a/app/javascript/packs/about.js +++ b/app/javascript/packs/about.js @@ -1,4 +1,3 @@ -import './public-path'; import loadPolyfills from '../mastodon/load_polyfills'; import { start } from '../mastodon/common'; diff --git a/app/javascript/packs/admin.js b/app/javascript/packs/admin.js index 65b8dc040d24d4..51f92de8aa58a7 100644 --- a/app/javascript/packs/admin.js +++ b/app/javascript/packs/admin.js @@ -1,4 +1,3 @@ -import './public-path'; import { delegate } from '@rails/ujs'; import ready from '../mastodon/ready'; diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 91240aecfb85a0..c65ebed74f8b94 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -1,4 +1,3 @@ -import './public-path'; import loadPolyfills from '../mastodon/load_polyfills'; import { start } from '../mastodon/common'; diff --git a/app/javascript/packs/error.js b/app/javascript/packs/error.js index 6376dc2f5dfcc1..685c890658a007 100644 --- a/app/javascript/packs/error.js +++ b/app/javascript/packs/error.js @@ -1,4 +1,3 @@ -import './public-path'; import ready from '../mastodon/ready'; ready(() => { diff --git a/app/javascript/packs/public-path.js b/app/javascript/packs/public-path.js deleted file mode 100644 index f96109f4fcd182..00000000000000 --- a/app/javascript/packs/public-path.js +++ /dev/null @@ -1,21 +0,0 @@ -// Dynamically set webpack's loading path depending on a meta header, in order -// to share the same assets regardless of instance configuration. -// See https://webpack.js.org/guides/public-path/#on-the-fly - -function removeOuterSlashes(string) { - return string.replace(/^\/*/, '').replace(/\/*$/, ''); -} - -function formatPublicPath(host = '', path = '') { - let formattedHost = removeOuterSlashes(host); - if (formattedHost && !/^http/i.test(formattedHost)) { - formattedHost = `//${formattedHost}`; - } - const formattedPath = removeOuterSlashes(path); - return `${formattedHost}/${formattedPath}/`; -} - -const cdnHost = document.querySelector('meta[name=cdn-host]'); - -// eslint-disable-next-line camelcase, no-undef, no-unused-vars -__webpack_public_path__ = formatPublicPath(cdnHost ? cdnHost.content : '', process.env.PUBLIC_OUTPUT_PATH); diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 39defa7ae9ee8d..551e281a8eeb38 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -1,4 +1,3 @@ -import './public-path'; import escapeTextContentForBrowser from 'escape-html'; import loadPolyfills from '../mastodon/load_polyfills'; import ready from '../mastodon/ready'; diff --git a/app/javascript/packs/share.js b/app/javascript/packs/share.js index 1225d7b5294315..4ef23e1b2e9b8e 100644 --- a/app/javascript/packs/share.js +++ b/app/javascript/packs/share.js @@ -1,4 +1,3 @@ -import './public-path'; import loadPolyfills from '../mastodon/load_polyfills'; import { start } from '../mastodon/common'; diff --git a/app/javascript/styles/cybre-base.scss b/app/javascript/styles/cybre-base.scss index 8d890c51a853c7..d56e96546424a7 100644 --- a/app/javascript/styles/cybre-base.scss +++ b/app/javascript/styles/cybre-base.scss @@ -25,14 +25,14 @@ } /* Less emphatic show more */ -// .status__content__read-more-button { -// font-size: 14px; -// color: $dark-text-color; +.status__content__read-more-button { + font-size: 14px; + color: $dark-text-color; -// .status__prepend-icon { -// padding-right: 4px; -// } -// } + .status__prepend-icon { + padding-right: 4px; + } +} /* Show a little arrowey thing after the time in a * status to signal that you can click it to see diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss index dda7ff88222247..88af3200a35562 100644 --- a/app/javascript/styles/mastodon-light/diff.scss +++ b/app/javascript/styles/mastodon-light/diff.scss @@ -765,8 +765,3 @@ html { .compose-form .compose-form__warning { box-shadow: none; } - -.mute-modal select { - border: 1px solid lighten($ui-base-color, 8%); - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; -} diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6ae884096b076d..bd69dc61b7e162 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2431,17 +2431,6 @@ a.account__display-name { line-height: 14px; color: $primary-text-color; } - - &__issue-badge { - position: absolute; - left: 11px; - bottom: 1px; - display: block; - background: $error-red; - border-radius: 50%; - width: 0.625rem; - height: 0.625rem; - } } .column-link--transparent .icon-with-badge__badge { @@ -3477,15 +3466,6 @@ a.status-card.compact:hover { cursor: pointer; } -.column-header__issue-btn { - color: $warning-red; - - &:hover { - color: $error-red; - text-decoration: underline; - } -} - .column-header__icon { display: inline-block; margin-right: 5px; @@ -3745,10 +3725,6 @@ a.status-card.compact:hover { margin-bottom: 10px; } -.column-settings__row--with-margin { - margin-bottom: 15px; -} - .column-settings__hashtags { .column-settings__row { margin-bottom: 15px; @@ -5093,22 +5069,6 @@ a.status-card.compact:hover { } } } - - select { - appearance: none; - box-sizing: border-box; - font-size: 14px; - color: $inverted-text-color; - display: inline-block; - width: auto; - outline: 0; - font-family: inherit; - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; - border: 1px solid darken($simple-background-color, 14%); - border-radius: 4px; - padding: 6px 10px; - padding-right: 30px; - } } .confirmation-modal__container, @@ -7187,25 +7147,3 @@ noscript { border-color: lighten($ui-base-color, 12%); } } - -.notifications-permission-banner { - padding: 30px; - border-bottom: 1px solid lighten($ui-base-color, 8%); - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - h2 { - font-size: 16px; - font-weight: 500; - margin-bottom: 15px; - text-align: center; - } - - p { - color: $darker-text-color; - margin-bottom: 15px; - text-align: center; - } -} diff --git a/app/javascript/styles/neon-city.scss b/app/javascript/styles/neon-city.scss index 856b1a250ba482..738cfefa3e91b6 100644 --- a/app/javascript/styles/neon-city.scss +++ b/app/javascript/styles/neon-city.scss @@ -40,14 +40,14 @@ $transparent-dark:rgba(17, 17, 17, 0.9); } /* Less emphatic show more */ -// .status__content__read-more-button { -// font-size: 14px; -// color: $dark-text-color; +.status__content__read-more-button { + font-size: 14px; + color: $dark-text-color; -// .status__prepend-icon { -// padding-right: 4px; -// } -// } + .status__prepend-icon { + padding-right: 4px; + } +} /* Show a little arrowey thing after the time in a * status to signal that you can click it to see @@ -255,8 +255,6 @@ $transparent-dark:rgba(17, 17, 17, 0.9); .box-widget, .hero-widget__text, .trends-widget, - .public-account-header, - .public-account-bio, .footer { // background: $ui-base-color; background: $transparent-light; @@ -264,7 +262,6 @@ $transparent-dark:rgba(17, 17, 17, 0.9); .contact-widget, .trends-widget, - .public-account-header, .footer { border-radius: 4px; } @@ -381,16 +378,8 @@ $transparent-dark:rgba(17, 17, 17, 0.9); /* customize color and opacity */ .status__content a, -.status__content a.unhandled-link, -.hashtag, -.u-url.status-link:not(.unhandled-link) { +.status__content a.unhandled-link { color: $ui-link-text-color; - // linear-gradient(92.05deg, #BCA1F7 12.09%, #E577B4 42.58%, #FF7170 84.96%); - background: linear-gradient(92.05deg, $ui-highlight-color 12.09%, #E577B4 42.58%, #FF7170 84.96%); - -webkit-background-clip: text; - background-clip: text; - -webkit-text-fill-color: transparent; - -webkit-box-decoration-break: clone; } .status__content { @@ -499,9 +488,4 @@ body, .detailed-status, .detailed-status__action-bar { background: transparent; -} - -.simple_form .label_input__append:after { - background-image: linear-gradient(90deg, rgba(2, 2, 2, 0), transparent); - } \ No newline at end of file diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index 2b5d3ffc29c7a0..224451f41737bf 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -74,7 +74,7 @@ def object_uri @object_uri ||= begin str = value_or_id(@object) - if str&.start_with?('bear:') + if str.start_with?('bear:') Addressable::URI.parse(str).query_values['u'] else str diff --git a/app/lib/fast_ip_map.rb b/app/lib/fast_ip_map.rb deleted file mode 100644 index ba30b45f3320e7..00000000000000 --- a/app/lib/fast_ip_map.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class FastIpMap - MAX_IPV4_PREFIX = 32 - MAX_IPV6_PREFIX = 128 - - # @param [Enumerable] addresses - def initialize(addresses) - @fast_lookup = {} - @ranges = [] - - # Hash look-up is faster but only works for exact matches, so we split - # exact addresses from non-exact ones - addresses.each do |address| - if (address.ipv4? && address.prefix == MAX_IPV4_PREFIX) || (address.ipv6? && address.prefix == MAX_IPV6_PREFIX) - @fast_lookup[address.to_s] = true - else - @ranges << address - end - end - - # We're more likely to hit wider-reaching ranges when checking for - # inclusion, so make sure they're sorted first - @ranges.sort_by!(&:prefix) - end - - # @param [IPAddr] address - # @return [Boolean] - def include?(address) - @fast_lookup[address.to_s] || @ranges.any? { |cidr| cidr.include?(address) } - end -end diff --git a/app/lib/webfinger.rb b/app/lib/webfinger.rb deleted file mode 100644 index b2374c49418496..00000000000000 --- a/app/lib/webfinger.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -class Webfinger - class Error < StandardError; end - - class Response - def initialize(body) - @json = Oj.load(body, mode: :strict) - end - - def subject - @json['subject'] - end - - def link(rel, attribute) - links.dig(rel, attribute) - end - - private - - def links - @links ||= @json['links'].map { |link| [link['rel'], link] }.to_h - end - end - - def initialize(uri) - _, @domain = uri.split('@') - - raise ArgumentError, 'Webfinger requested for local account' if @domain.nil? - - @uri = uri - end - - def perform - Response.new(body_from_webfinger) - rescue Oj::ParseError - raise Webfinger::Error, "Invalid JSON in response for #{@uri}" - rescue Addressable::URI::InvalidURIError - raise Webfinger::Error, "Invalid URI for #{@uri}" - end - - private - - def body_from_webfinger(url = standard_url, use_fallback = true) - webfinger_request(url).perform do |res| - if res.code == 200 - res.body_with_limit - elsif res.code == 404 && use_fallback - body_from_host_meta - else - raise Webfinger::Error, "Request for #{@uri} returned HTTP #{res.code}" - end - end - end - - def body_from_host_meta - host_meta_request.perform do |res| - if res.code == 200 - body_from_webfinger(url_from_template(res.body_with_limit), false) - else - raise Webfinger::Error, "Request for #{@uri} returned HTTP #{res.code}" - end - end - end - - def url_from_template(str) - link = Nokogiri::XML(str).at_xpath('//xmlns:Link[@rel="lrdd"]') - - if link.present? - link['template'].gsub('{uri}', @uri) - else - raise Webfinger::Error, "Request for #{@uri} returned host-meta without link to Webfinger" - end - rescue Nokogiri::XML::XPath::SyntaxError - raise Webfinger::Error, "Invalid XML encountered in host-meta for #{@uri}" - end - - def host_meta_request - Request.new(:get, host_meta_url).add_headers('Accept' => 'application/xrd+xml, application/xml, text/xml') - end - - def webfinger_request(url) - Request.new(:get, url).add_headers('Accept' => 'application/jrd+json, application/json') - end - - def standard_url - "https://#{@domain}/.well-known/webfinger?resource=#{@uri}" - end - - def host_meta_url - "https://#{@domain}/.well-known/host-meta" - end -end diff --git a/app/models/account_alias.rb b/app/models/account_alias.rb index 3d659142a05548..792e9e8d4da757 100644 --- a/app/models/account_alias.rb +++ b/app/models/account_alias.rb @@ -33,7 +33,7 @@ def acct=(val) def set_uri target_account = ResolveAccountService.new.call(acct) self.uri = ActivityPub::TagManager.instance.uri_for(target_account) unless target_account.nil? - rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error + rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error # Validation will take care of it end diff --git a/app/models/account_migration.rb b/app/models/account_migration.rb index 4fae98ed7260d5..681b5b2cd0bc9e 100644 --- a/app/models/account_migration.rb +++ b/app/models/account_migration.rb @@ -54,7 +54,7 @@ def acct=(val) def set_target_account self.target_account = ResolveAccountService.new.call(acct) - rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error + rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error # Validation will take care of it end diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb index 6a0ad5aa982552..427ebdae29c36b 100644 --- a/app/models/concerns/account_interactions.rb +++ b/app/models/concerns/account_interactions.rb @@ -131,12 +131,9 @@ def block!(other_account, uri: nil) .find_or_create_by!(target_account: other_account) end - def mute!(other_account, notifications: nil, duration: 0) + def mute!(other_account, notifications: nil) notifications = true if notifications.nil? - mute = mute_relationships.create_with(hide_notifications: notifications).find_or_initialize_by(target_account: other_account) - mute.expires_in = duration.zero? ? nil : duration - mute.save! - + mute = mute_relationships.create_with(hide_notifications: notifications).find_or_create_by!(target_account: other_account) remove_potential_friendship(other_account) # When toggling a mute between hiding and allowing notifications, the mute will already exist, so the find_or_create_by! call will return the existing Mute without updating the hide_notifications attribute. Therefore, we check that hide_notifications? is what we want and set it if it isn't. diff --git a/app/models/concerns/expireable.rb b/app/models/concerns/expireable.rb index a66a4661b1cca3..f7d2bab498a195 100644 --- a/app/models/concerns/expireable.rb +++ b/app/models/concerns/expireable.rb @@ -6,15 +6,7 @@ module Expireable included do scope :expired, -> { where.not(expires_at: nil).where('expires_at < ?', Time.now.utc) } - def expires_in - return @expires_in if defined?(@expires_in) - - if expires_at.nil? - nil - else - (expires_at - created_at).to_i - end - end + attr_reader :expires_in def expires_in=(interval) self.expires_at = interval.to_i.seconds.from_now if interval.present? diff --git a/app/models/form/ip_block_batch.rb b/app/models/form/ip_block_batch.rb deleted file mode 100644 index f6fe9b59357779..00000000000000 --- a/app/models/form/ip_block_batch.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class Form::IpBlockBatch - include ActiveModel::Model - include Authorization - include AccountableConcern - - attr_accessor :ip_block_ids, :action, :current_account - - def save - case action - when 'delete' - delete! - end - end - - private - - def ip_blocks - @ip_blocks ||= IpBlock.where(id: ip_block_ids) - end - - def delete! - ip_blocks.each { |ip_block| authorize(ip_block, :destroy?) } - - ip_blocks.each do |ip_block| - ip_block.destroy - log_action :destroy, ip_block - end - end -end diff --git a/app/models/form/redirect.rb b/app/models/form/redirect.rb index 19ee9faedd046b..a7961f8e8aa00e 100644 --- a/app/models/form/redirect.rb +++ b/app/models/form/redirect.rb @@ -32,7 +32,7 @@ def acct=(val) def set_target_account @target_account = ResolveAccountService.new.call(acct) - rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error + rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::Error # Validation will take care of it end diff --git a/app/models/ip_block.rb b/app/models/ip_block.rb deleted file mode 100644 index aedd3ca0d4d91e..00000000000000 --- a/app/models/ip_block.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# == Schema Information -# -# Table name: ip_blocks -# -# id :bigint(8) not null, primary key -# created_at :datetime not null -# updated_at :datetime not null -# expires_at :datetime -# ip :inet default(#), not null -# severity :integer default(NULL), not null -# comment :text default(""), not null -# - -class IpBlock < ApplicationRecord - CACHE_KEY = 'blocked_ips' - - include Expireable - - enum severity: { - sign_up_requires_approval: 5000, - no_access: 9999, - } - - validates :ip, :severity, presence: true - - after_commit :reset_cache - - class << self - def blocked?(remote_ip) - blocked_ips_map = Rails.cache.fetch(CACHE_KEY) { FastIpMap.new(IpBlock.where(severity: :no_access).pluck(:ip)) } - blocked_ips_map.include?(remote_ip) - end - end - - private - - def reset_cache - Rails.cache.delete(CACHE_KEY) - end -end diff --git a/app/models/mute.rb b/app/models/mute.rb index 578345ef644ad4..0e00c2278f6f6b 100644 --- a/app/models/mute.rb +++ b/app/models/mute.rb @@ -9,13 +9,11 @@ # account_id :bigint(8) not null # target_account_id :bigint(8) not null # hide_notifications :boolean default(TRUE), not null -# expires_at :datetime # class Mute < ApplicationRecord include Paginable include RelationshipCacheable - include Expireable belongs_to :account belongs_to :target_account, class_name: 'Account' diff --git a/app/models/remote_follow.rb b/app/models/remote_follow.rb index 911c067133c35f..30b84f7d529574 100644 --- a/app/models/remote_follow.rb +++ b/app/models/remote_follow.rb @@ -56,7 +56,7 @@ def fetch_template! if domain.nil? @addressable_template = Addressable::Template.new("#{authorize_interaction_url}?uri={uri}") - elsif redirect_uri_template.nil? + elsif redirect_url_link.nil? || redirect_url_link.template.nil? missing_resource_error else @addressable_template = Addressable::Template.new(redirect_uri_template) @@ -64,12 +64,16 @@ def fetch_template! end def redirect_uri_template - acct_resource&.link('http://ostatus.org/schema/1.0/subscribe', 'template') + redirect_url_link.template + end + + def redirect_url_link + acct_resource&.link('http://ostatus.org/schema/1.0/subscribe') end def acct_resource @acct_resource ||= webfinger!("acct:#{acct}") - rescue Webfinger::Error, HTTP::ConnectionError + rescue Goldfinger::Error, HTTP::ConnectionError nil end diff --git a/app/models/user.rb b/app/models/user.rb index a5bb0f442fcf11..bd8e2d6f74e017 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -41,7 +41,6 @@ # sign_in_token :string # sign_in_token_sent_at :datetime # webauthn_id :string -# sign_up_ip :inet # class User < ApplicationRecord @@ -98,7 +97,7 @@ class User < ApplicationRecord scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended_at: nil }) } scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) } - scope :matches_ip, ->(value) { left_joins(:session_activations).where('users.current_sign_in_ip <<= ?', value).or(left_joins(:session_activations).where('users.sign_up_ip <<= ?', value)).or(left_joins(:session_activations).where('users.last_sign_in_ip <<= ?', value)).or(left_joins(:session_activations).where('session_activations.ip <<= ?', value)) } + scope :matches_ip, ->(value) { left_joins(:session_activations).where('users.current_sign_in_ip <<= ?', value).or(left_joins(:session_activations).where('users.last_sign_in_ip <<= ?', value)).or(left_joins(:session_activations).where('session_activations.ip <<= ?', value)) } scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) } before_validation :sanitize_languages @@ -333,7 +332,6 @@ def recent_ips arr << [current_sign_in_at, current_sign_in_ip] if current_sign_in_ip.present? arr << [last_sign_in_at, last_sign_in_ip] if last_sign_in_ip.present? - arr << [created_at, sign_up_ip] if sign_up_ip.present? arr.sort_by { |pair| pair.first || Time.now.utc }.uniq(&:last).reverse! end @@ -388,17 +386,7 @@ def render_and_send_devise_message(notification, *args) end def set_approved - self.approved = begin - if sign_up_from_ip_requires_approval? - false - else - open_registrations? || valid_invitation? || external? - end - end - end - - def sign_up_from_ip_requires_approval? - !sign_up_ip.nil? && IpBlock.where(severity: :sign_up_requires_approval).where('ip >>= ?', sign_up_ip.to_s).exists? + self.approved = open_registrations? || valid_invitation? || external? end def open_registrations? diff --git a/app/policies/ip_block_policy.rb b/app/policies/ip_block_policy.rb deleted file mode 100644 index 34dbd746a33f35..00000000000000 --- a/app/policies/ip_block_policy.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class IpBlockPolicy < ApplicationPolicy - def index? - admin? - end - - def create? - admin? - end - - def destroy? - admin? - end -end diff --git a/app/serializers/rest/muted_account_serializer.rb b/app/serializers/rest/muted_account_serializer.rb deleted file mode 100644 index 3ddd706dcd327b..00000000000000 --- a/app/serializers/rest/muted_account_serializer.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class REST::MutedAccountSerializer < REST::AccountSerializer - attribute :mute_expires_at - - def mute_expires_at - mute = current_user.account.mute_relationships.find_by(target_account_id: object.id) - mute && !mute.expired? ? mute.expires_at : nil - end -end diff --git a/app/services/activitypub/fetch_remote_account_service.rb b/app/services/activitypub/fetch_remote_account_service.rb index e5bd0c47c8ee5e..83fbf6d07d32bd 100644 --- a/app/services/activitypub/fetch_remote_account_service.rb +++ b/app/services/activitypub/fetch_remote_account_service.rb @@ -39,16 +39,17 @@ def verified_webfinger? webfinger = webfinger!("acct:#{@username}@#{@domain}") confirmed_username, confirmed_domain = split_acct(webfinger.subject) - return webfinger.link('self', 'href') == @uri if @username.casecmp(confirmed_username).zero? && @domain.casecmp(confirmed_domain).zero? + return webfinger.link('self')&.href == @uri if @username.casecmp(confirmed_username).zero? && @domain.casecmp(confirmed_domain).zero? webfinger = webfinger!("acct:#{confirmed_username}@#{confirmed_domain}") @username, @domain = split_acct(webfinger.subject) + self_reference = webfinger.link('self') return false unless @username.casecmp(confirmed_username).zero? && @domain.casecmp(confirmed_domain).zero? - return false if webfinger.link('self', 'href') != @uri + return false if self_reference&.href != @uri true - rescue Webfinger::Error + rescue Goldfinger::Error false end diff --git a/app/services/app_sign_up_service.rb b/app/services/app_sign_up_service.rb index e006941577228e..c9739c77d19479 100644 --- a/app/services/app_sign_up_service.rb +++ b/app/services/app_sign_up_service.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true class AppSignUpService < BaseService - def call(app, remote_ip, params) + def call(app, params) return unless allowed_registrations? user_params = params.slice(:email, :password, :agreement, :locale) account_params = params.slice(:username) invite_request_params = { text: params[:reason] } - user = User.create!(user_params.merge(created_by_application: app, sign_up_ip: remote_ip, password_confirmation: user_params[:password], account_attributes: account_params, invite_request_attributes: invite_request_params)) + user = User.create!(user_params.merge(created_by_application: app, password_confirmation: user_params[:password], account_attributes: account_params, invite_request_attributes: invite_request_params)) Doorkeeper::AccessToken.create!(application: app, resource_owner_id: user.id, diff --git a/app/services/mute_service.rb b/app/services/mute_service.rb index 9ae9afd623498d..676804cb991d97 100644 --- a/app/services/mute_service.rb +++ b/app/services/mute_service.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true class MuteService < BaseService - def call(account, target_account, notifications: nil, duration: 0) + def call(account, target_account, notifications: nil) return if account.id == target_account.id - mute = account.mute!(target_account, notifications: notifications, duration: duration) + mute = account.mute!(target_account, notifications: notifications) if mute.hide_notifications? BlockWorker.perform_async(account.id, target_account.id) @@ -12,8 +12,6 @@ def call(account, target_account, notifications: nil, duration: 0) MuteWorker.perform_async(account.id, target_account.id) end - DeleteMuteWorker.perform_at(duration.seconds, mute.id) if duration != 0 - mute end end diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index d5ea69da1354b9..feffb872bec184 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -29,7 +29,7 @@ def call(status) if mention_undeliverable?(mentioned_account) begin mentioned_account = resolve_account_service.call(Regexp.last_match(1)) - rescue Webfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::UnexpectedResponseError + rescue Goldfinger::Error, HTTP::Error, OpenSSL::SSL::SSLError, Mastodon::UnexpectedResponseError mentioned_account = nil end end diff --git a/app/services/resolve_account_service.rb b/app/services/resolve_account_service.rb index 3f7bb7cc52c862..ba77552c6c0279 100644 --- a/app/services/resolve_account_service.rb +++ b/app/services/resolve_account_service.rb @@ -26,10 +26,11 @@ def call(uri, options = {}) @account ||= Account.find_remote(@username, @domain) - return @account if @account&.local? || @domain.nil? || !webfinger_update_due? + return @account if @account&.local? || !webfinger_update_due? # At this point we are in need of a Webfinger query, which may # yield us a different username/domain through a redirect + process_webfinger!(@uri) # Because the username/domain pair may be different than what @@ -46,7 +47,7 @@ def call(uri, options = {}) # either needs to be created, or updated from fresh data process_account! - rescue Webfinger::Error, WebfingerRedirectError, Oj::ParseError => e + rescue Goldfinger::Error, WebfingerRedirectError, Oj::ParseError => e Rails.logger.debug "Webfinger query for #{@uri} failed: #{e}" nil end @@ -117,11 +118,11 @@ def webfinger_update_due? end def activitypub_ready? - ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(@webfinger.link('self', 'type')) + !@webfinger.link('self').nil? && ['application/activity+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'].include?(@webfinger.link('self').type) end def actor_url - @actor_url ||= @webfinger.link('self', 'href') + @actor_url ||= @webfinger.link('self').href end def actor_json diff --git a/app/views/admin/ip_blocks/_ip_block.html.haml b/app/views/admin/ip_blocks/_ip_block.html.haml deleted file mode 100644 index e07e2b4448b726..00000000000000 --- a/app/views/admin/ip_blocks/_ip_block.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -.batch-table__row - %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox - = f.check_box :ip_block_ids, { multiple: true, include_hidden: false }, ip_block.id - .batch-table__row__content - .batch-table__row__content__text - %samp= "#{ip_block.ip}/#{ip_block.ip.prefix}" - - if ip_block.comment.present? - • - = ip_block.comment - %br/ - = t("simple_form.labels.ip_block.severities.#{ip_block.severity}") diff --git a/app/views/admin/ip_blocks/index.html.haml b/app/views/admin/ip_blocks/index.html.haml deleted file mode 100644 index a282a4cfefbe54..00000000000000 --- a/app/views/admin/ip_blocks/index.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -- content_for :page_title do - = t('admin.ip_blocks.title') - -- content_for :header_tags do - = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous' - -- if can?(:create, :ip_block) - - content_for :heading_actions do - = link_to t('admin.ip_blocks.add_new'), new_admin_ip_block_path, class: 'button' - -= form_for(@form, url: batch_admin_ip_blocks_path) do |f| - = hidden_field_tag :page, params[:page] || 1 - - .batch-table - .batch-table__toolbar - %label.batch-table__toolbar__select.batch-checkbox-all - = check_box_tag :batch_checkbox_all, nil, false - .batch-table__toolbar__actions - - if can?(:destroy, :ip_block) - = f.button safe_join([fa_icon('times'), t('admin.ip_blocks.delete')]), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') } - .batch-table__body - - if @ip_blocks.empty? - = nothing_here 'nothing-here--under-tabs' - - else - = render partial: 'ip_block', collection: @ip_blocks, locals: { f: f } - -= paginate @ip_blocks - diff --git a/app/views/admin/ip_blocks/new.html.haml b/app/views/admin/ip_blocks/new.html.haml deleted file mode 100644 index 69f6b98b9b676f..00000000000000 --- a/app/views/admin/ip_blocks/new.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- content_for :page_title do - = t('.title') - -= simple_form_for @ip_block, url: admin_ip_blocks_path do |f| - = render 'shared/error_messages', object: @ip_block - - .fields-group - = f.input :ip, as: :string, wrapper: :with_block_label, input_html: { placeholder: '192.0.2.0/24' } - - .fields-group - = f.input :expires_in, wrapper: :with_block_label, collection: [1.day, 2.weeks, 1.month, 6.months, 1.year, 3.years].map(&:to_i), label_method: lambda { |i| I18n.t("admin.ip_blocks.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt') - - .fields-group - = f.input :severity, as: :radio_buttons, collection: IpBlock.severities.keys, include_blank: false, wrapper: :with_block_label, label_method: lambda { |severity| safe_join([I18n.t("simple_form.labels.ip_block.severities.#{severity}"), content_tag(:span, I18n.t("simple_form.hints.ip_block.severities.#{severity}"), class: 'hint')]) } - - .fields-group - = f.input :comment, as: :string, wrapper: :with_block_label - - .actions - = f.button :button, t('admin.ip_blocks.add_new'), type: :submit diff --git a/app/views/admin/pending_accounts/_account.html.haml b/app/views/admin/pending_accounts/_account.html.haml index 5b475b59a90107..7a9796a6741b96 100644 --- a/app/views/admin/pending_accounts/_account.html.haml +++ b/app/views/admin/pending_accounts/_account.html.haml @@ -7,7 +7,7 @@ %strong= account.user_email = "(@#{account.username})" %br/ - %samp= account.user_current_sign_in_ip + = account.user_current_sign_in_ip • = t 'admin.accounts.time_in_queue', time: time_ago_in_words(account.user&.created_at) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 1f10f40c0a3925..e32cdcabb3f601 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,7 +6,6 @@ - if cdn_host? %link{ rel: 'dns-prefetch', href: cdn_host }/ - %meta{ name: 'cdn-host', content: cdn_host }/ - if storage_host? %link{ rel: 'dns-prefetch', href: storage_host }/ diff --git a/app/views/layouts/embedded.html.haml b/app/views/layouts/embedded.html.haml index 37051e70cf8dd2..4a40b8584b407d 100644 --- a/app/views/layouts/embedded.html.haml +++ b/app/views/layouts/embedded.html.haml @@ -6,7 +6,6 @@ - if cdn_host? %link{ rel: 'dns-prefetch', href: cdn_host }/ - %meta{ name: 'cdn-host', content: cdn_host }/ - if storage_host? %link{ rel: 'dns-prefetch', href: storage_host }/ diff --git a/app/views/well_known/host_meta/show.xml.ruby b/app/views/well_known/host_meta/show.xml.ruby index b4e867c5f88a7c..0a6bdc322fb130 100644 --- a/app/views/well_known/host_meta/show.xml.ruby +++ b/app/views/well_known/host_meta/show.xml.ruby @@ -5,6 +5,7 @@ doc << Ox::Element.new('XRD').tap do |xrd| xrd << Ox::Element.new('Link').tap do |link| link['rel'] = 'lrdd' + link['type'] = 'application/xrd+xml' link['template'] = @webfinger_template end end diff --git a/app/workers/delete_mute_worker.rb b/app/workers/delete_mute_worker.rb deleted file mode 100644 index eb031020e1b2cf..00000000000000 --- a/app/workers/delete_mute_worker.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class DeleteMuteWorker - include Sidekiq::Worker - - def perform(mute_id) - mute = Mute.find_by(id: mute_id) - UnmuteService.new.call(mute.account, mute.target_account) if mute&.expired? - end -end diff --git a/app/workers/scheduler/ip_cleanup_scheduler.rb b/app/workers/scheduler/ip_cleanup_scheduler.rb index 853f20e2515c36..6d38b52a2988de 100644 --- a/app/workers/scheduler/ip_cleanup_scheduler.rb +++ b/app/workers/scheduler/ip_cleanup_scheduler.rb @@ -3,23 +3,13 @@ class Scheduler::IpCleanupScheduler include Sidekiq::Worker - IP_RETENTION_PERIOD = 1.year.freeze + RETENTION_PERIOD = 1.year sidekiq_options lock: :until_executed, retry: 0 def perform - clean_ip_columns! - clean_expired_ip_blocks! - end - - private - - def clean_ip_columns! - SessionActivation.where('updated_at < ?', IP_RETENTION_PERIOD.ago).in_batches.destroy_all - User.where('current_sign_in_at < ?', IP_RETENTION_PERIOD.ago).in_batches.update_all(last_sign_in_ip: nil, current_sign_in_ip: nil, sign_up_ip: nil) - end - - def clean_expired_ip_blocks! - IpBlock.expired.in_batches.destroy_all + time_ago = RETENTION_PERIOD.ago + SessionActivation.where('updated_at < ?', time_ago).in_batches.destroy_all + User.where('last_sign_in_at < ?', time_ago).where.not(last_sign_in_ip: nil).in_batches.update_all(last_sign_in_ip: nil) end end diff --git a/chart/templates/cronjob-media-remove.yaml b/chart/templates/cronjob-media-remove.yaml deleted file mode 100644 index 5d78f3395c1e4b..00000000000000 --- a/chart/templates/cronjob-media-remove.yaml +++ /dev/null @@ -1,73 +0,0 @@ -{{ if .Values.cron.removeMedia.enabled }} -apiVersion: batch/v1beta1 -kind: CronJob -metadata: - name: {{ include "mastodon.fullname" . }}-media-remove - labels: - {{- include "mastodon.labels" . | nindent 4 }} -spec: - schedule: {{ .Values.cron.removeMedia.schedule }} - jobTemplate: - spec: - template: - metadata: - name: {{ include "mastodon.fullname" . }}-media-remove - spec: - restartPolicy: OnFailure - # ensure we run on the same node as the other rails components; only - # required when using PVCs that are ReadWriteOnce - {{- if or (eq "ReadWriteOnce" .Values.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.persistence.system.accessMode) }} - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: component - operator: In - values: - - rails - topologyKey: kubernetes.io/hostname - {{- end }} - volumes: - - name: assets - persistentVolumeClaim: - claimName: {{ template "mastodon.fullname" . }}-assets - - name: system - persistentVolumeClaim: - claimName: {{ template "mastodon.fullname" . }}-system - containers: - - name: {{ include "mastodon.fullname" . }}-media-remove - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: - - bin/tootctl - - media - - remove - envFrom: - - configMapRef: - name: {{ include "mastodon.fullname" . }}-env - - secretRef: - name: {{ template "mastodon.fullname" . }} - env: - - name: "DB_PASS" - valueFrom: - secretKeyRef: - {{- if .Values.postgresql.enabled }} - name: {{ .Release.Name }}-postgresql - {{- else }} - name: {{ template "mastodon.fullname" . }} - {{- end }} - key: postgresql-password - - name: "REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-redis - key: redis-password - - name: "PORT" - value: {{ .Values.application.web.port | quote }} - volumeMounts: - - name: assets - mountPath: /opt/mastodon/public/assets - - name: system - mountPath: /opt/mastodon/public/system -{{- end }} diff --git a/chart/values.yaml.template b/chart/values.yaml.template index c18d2f0b5b5545..ff680b81f771db 100644 --- a/chart/values.yaml.template +++ b/chart/values.yaml.template @@ -39,12 +39,6 @@ createAdmin: # available locales: https://github.com/tootsuite/mastodon/blob/master/config/application.rb#L43 locale: en -cron: - # run `tootctl media remove` every week - removeMedia: - enabled: true - schedule: "0 0 * * 0" - application: web: port: 3000 diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index 6662ef40b035a0..cd29afac5258bc 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -42,10 +42,6 @@ def paging_request? req.remote_ip == '127.0.0.1' || req.remote_ip == '::1' end - Rack::Attack.blocklist('deny from blocklist') do |req| - IpBlock.blocked?(req.remote_ip) - end - throttle('throttle_authenticated_api', limit: 300, period: 5.minutes) do |req| req.authenticated_user_id if req.api_request? end diff --git a/config/locales/en.yml b/config/locales/en.yml index f84216f0de6e89..e69c47b5e7a404 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -223,14 +223,12 @@ en: create_domain_allow: Create Domain Allow create_domain_block: Create Domain Block create_email_domain_block: Create E-mail Domain Block - create_ip_block: Create IP rule demote_user: Demote User destroy_announcement: Delete Announcement destroy_custom_emoji: Delete Custom Emoji destroy_domain_allow: Delete Domain Allow destroy_domain_block: Delete Domain Block destroy_email_domain_block: Delete e-mail domain block - destroy_ip_block: Delete IP rule destroy_status: Delete Status disable_2fa_user: Disable 2FA disable_custom_emoji: Disable Custom Emoji @@ -261,14 +259,12 @@ en: create_domain_allow: "%{name} allowed federation with domain %{target}" create_domain_block: "%{name} blocked domain %{target}" create_email_domain_block: "%{name} blocked e-mail domain %{target}" - create_ip_block: "%{name} created rule for IP %{target}" demote_user: "%{name} demoted user %{target}" destroy_announcement: "%{name} deleted announcement %{target}" destroy_custom_emoji: "%{name} destroyed emoji %{target}" destroy_domain_allow: "%{name} disallowed federation with domain %{target}" destroy_domain_block: "%{name} unblocked domain %{target}" destroy_email_domain_block: "%{name} unblocked e-mail domain %{target}" - destroy_ip_block: "%{name} deleted rule for IP %{target}" destroy_status: "%{name} removed status by %{target}" disable_2fa_user: "%{name} disabled two factor requirement for user %{target}" disable_custom_emoji: "%{name} disabled emoji %{target}" @@ -453,21 +449,6 @@ en: expired: Expired title: Filter title: Invites - ip_blocks: - add_new: Create rule - created_msg: Successfully added new IP rule - delete: Delete - expires_in: - '1209600': 2 weeks - '15778476': 6 months - '2629746': 1 month - '31556952': 1 year - '86400': 1 day - '94670856': 3 years - new: - title: Create new IP rule - no_ip_block_selected: No IP rules were changed as none were selected - title: IP rules pending_accounts: title: Pending accounts (%{count}) relationships: diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 1eaa5b573e5fb5..5504a19b451362 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -66,14 +66,6 @@ en: data: CSV file exported from another Mastodon server invite_request: text: This will help us review your application

Be sure to answer the following questions with an appropriate level of detail. Aside from yes/no questions a few sentences, a short paragraph will do. Please construct your registration request message carefully. We expect thoughtful detailed answers, not a single word.

1) Have you read all of the server rules and terms of service, and understand them (yes or no)? Rules are important for Mastodon Instances.

2) Tell us about your interests and what sorts of projects or work you are involved in and the type of topics you would like to post about?

3) How did you hear about this site and why would you like to join our community as opposed to one of the many other Mastodon instances?

If you are invited by user on this instance, please attach the link or ID of the inviter. - ip_block: - comment: Optional. Remember why you added this rule. - expires_in: IP addresses are a finite resource, they are sometimes shared and often change hands. For this reason, indefinite IP blocks are not recommended. - ip: Enter an IPv4 or IPv6 address. You can block entire ranges using the CIDR syntax. Be careful not to lock yourself out! - severities: - no_access: Block access to all resources - sign_up_requires_approval: New sign-ups will require your approval - severity: Choose what will happen with requests from this IP sessions: otp: 'Enter the two-factor code generated by your phone app or use one of your recovery codes:' webauthn: If it's an USB key be sure to insert it and, if necessary, tap it. @@ -181,13 +173,6 @@ en: comment: Comment invite_request: text: Why do you want to join? - ip_block: - comment: Comment - ip: IP - severities: - no_access: Block access - sign_up_requires_approval: Limit sign-ups - severity: Rule notification_emails: digest: Send digest e-mails favourite: Someone favourited your status diff --git a/config/navigation.rb b/config/navigation.rb index 4a56abe18cb639..c113a3c3eed025 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -41,7 +41,6 @@ s.item :tags, safe_join([fa_icon('hashtag fw'), t('admin.tags.title')]), admin_tags_path, highlights_on: %r{/admin/tags} s.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url(limited: whitelist_mode? ? nil : '1'), highlights_on: %r{/admin/instances|/admin/domain_blocks|/admin/domain_allows}, if: -> { current_user.admin? } s.item :email_domain_blocks, safe_join([fa_icon('envelope fw'), t('admin.email_domain_blocks.title')]), admin_email_domain_blocks_url, highlights_on: %r{/admin/email_domain_blocks}, if: -> { current_user.admin? } - s.item :ip_blocks, safe_join([fa_icon('ban fw'), t('admin.ip_blocks.title')]), admin_ip_blocks_url, highlights_on: %r{/admin/ip_blocks}, if: -> { current_user.admin? } end n.item :admin, safe_join([fa_icon('cogs fw'), t('admin.title')]), admin_dashboard_url, if: proc { current_user.staff? } do |s| diff --git a/config/routes.rb b/config/routes.rb index df8e86a1c4e346..83aa7d7bde60a8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -286,12 +286,6 @@ end end - resources :ip_blocks, only: [:index, :new, :create] do - collection do - post :batch - end - end - resources :account_moderation_notes, only: [:create, :destroy] resources :tags, only: [:index, :show, :update] do diff --git a/config/webpack/configuration.js b/config/webpack/configuration.js index e4f88a9c4dfd6f..80a094c724e6a1 100644 --- a/config/webpack/configuration.js +++ b/config/webpack/configuration.js @@ -11,17 +11,30 @@ const settings = safeLoad(readFileSync(configPath), 'utf8')[env.RAILS_ENV || env const themePath = resolve('config', 'themes.yml'); const themes = safeLoad(readFileSync(themePath), 'utf8'); +function removeOuterSlashes(string) { + return string.replace(/^\/*/, '').replace(/\/*$/, ''); +} + +function formatPublicPath(host = '', path = '') { + let formattedHost = removeOuterSlashes(host); + if (formattedHost && !/^http/i.test(formattedHost)) { + formattedHost = `//${formattedHost}`; + } + const formattedPath = removeOuterSlashes(path); + return `${formattedHost}/${formattedPath}/`; +} + const output = { path: resolve('public', settings.public_output_path), - publicPath: `/${settings.public_output_path}/`, + publicPath: formatPublicPath(env.CDN_HOST, settings.public_output_path), }; module.exports = { settings, themes, env: { + CDN_HOST: env.CDN_HOST, NODE_ENV: env.NODE_ENV, - PUBLIC_OUTPUT_PATH: settings.public_output_path, }, output, }; diff --git a/db/migrate/20200317021758_add_expires_at_to_mutes.rb b/db/migrate/20200317021758_add_expires_at_to_mutes.rb deleted file mode 100644 index eaae8319d7c110..00000000000000 --- a/db/migrate/20200317021758_add_expires_at_to_mutes.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddExpiresAtToMutes < ActiveRecord::Migration[5.2] - def change - add_column :mutes, :expires_at, :datetime - end -end diff --git a/db/migrate/20201008202037_create_ip_blocks.rb b/db/migrate/20201008202037_create_ip_blocks.rb deleted file mode 100644 index 32acd6ede1759c..00000000000000 --- a/db/migrate/20201008202037_create_ip_blocks.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateIpBlocks < ActiveRecord::Migration[5.2] - def change - create_table :ip_blocks do |t| - t.inet :ip, null: false, default: '0.0.0.0' - t.integer :severity, null: false, default: 0 - t.datetime :expires_at - t.text :comment, null: false, default: '' - - t.timestamps - end - end -end diff --git a/db/migrate/20201008220312_add_sign_up_ip_to_users.rb b/db/migrate/20201008220312_add_sign_up_ip_to_users.rb deleted file mode 100644 index 66cd624bbb8e1f..00000000000000 --- a/db/migrate/20201008220312_add_sign_up_ip_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSignUpIpToUsers < ActiveRecord::Migration[5.2] - def change - add_column :users, :sign_up_ip, :inet - end -end diff --git a/db/schema.rb b/db/schema.rb index 38638deb2cded5..8f0e45695b6781 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_10_08_220312) do +ActiveRecord::Schema.define(version: 2020_09_26_190114) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -463,15 +463,6 @@ t.index ["user_id"], name: "index_invites_on_user_id" end - create_table "ip_blocks", force: :cascade do |t| - t.inet "ip", default: "0.0.0.0", null: false - t.integer "severity", default: 0, null: false - t.datetime "expires_at" - t.text "comment", default: "", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - create_table "list_accounts", force: :cascade do |t| t.bigint "list_id", null: false t.bigint "account_id", null: false @@ -545,7 +536,6 @@ t.boolean "hide_notifications", default: true, null: false t.bigint "account_id", null: false t.bigint "target_account_id", null: false - t.datetime "expires_at" t.index ["account_id", "target_account_id"], name: "index_mutes_on_account_id_and_target_account_id", unique: true t.index ["target_account_id"], name: "index_mutes_on_target_account_id" end @@ -903,7 +893,6 @@ t.string "sign_in_token" t.datetime "sign_in_token_sent_at" t.string "webauthn_id" - t.inet "sign_up_ip" t.index ["account_id"], name: "index_users_on_account_id" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id" diff --git a/lib/cli.rb b/lib/cli.rb index 2a4dd11b217bce..9162144cc48c59 100644 --- a/lib/cli.rb +++ b/lib/cli.rb @@ -13,7 +13,6 @@ require_relative 'mastodon/cache_cli' require_relative 'mastodon/upgrade_cli' require_relative 'mastodon/email_domain_blocks_cli' -require_relative 'mastodon/ip_blocks_cli' require_relative 'mastodon/version' module Mastodon @@ -58,9 +57,6 @@ def self.exit_on_failure? desc 'email_domain_blocks SUBCOMMAND ...ARGS', 'Manage e-mail domain blocks' subcommand 'email_domain_blocks', Mastodon::EmailDomainBlocksCLI - desc 'ip_blocks SUBCOMMAND ...ARGS', 'Manage IP blocks' - subcommand 'ip_blocks', Mastodon::IpBlocksCLI - option :dry_run, type: :boolean desc 'self-destruct', 'Erase the server from the federation' long_desc <<~LONG_DESC diff --git a/lib/mastodon/ip_blocks_cli.rb b/lib/mastodon/ip_blocks_cli.rb deleted file mode 100644 index 6aff36d90886db..00000000000000 --- a/lib/mastodon/ip_blocks_cli.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -require 'rubygems/package' -require_relative '../../config/boot' -require_relative '../../config/environment' -require_relative 'cli_helper' - -module Mastodon - class IpBlocksCLI < Thor - def self.exit_on_failure? - true - end - - option :severity, required: true, enum: %w(no_access sign_up_requires_approval), desc: 'Severity of the block' - option :comment, aliases: [:c], desc: 'Optional comment' - option :duration, aliases: [:d], type: :numeric, desc: 'Duration of the block in seconds' - option :force, type: :boolean, aliases: [:f], desc: 'Overwrite existing blocks' - desc 'add IP...', 'Add one or more IP blocks' - long_desc <<-LONG_DESC - Add one or more IP blocks. You can use CIDR syntax to - block IP ranges. You must specify --severity of the block. All - options will be copied for each IP block you create in one command. - - You can add a --comment. If an IP block already exists for one of - the provided IPs, it will be skipped unless you use the --force - option to overwrite it. - LONG_DESC - def add(*addresses) - if addresses.empty? - say('No IP(s) given', :red) - exit(1) - end - - skipped = 0 - processed = 0 - failed = 0 - - addresses.each do |address| - ip_block = IpBlock.find_by(ip: address) - - if ip_block.present? && !options[:force] - say("#{address} is already blocked", :yellow) - skipped += 1 - next - end - - ip_block ||= IpBlock.new(ip: address) - - ip_block.severity = options[:severity] - ip_block.comment = options[:comment] - ip_block.expires_in = options[:duration] - - if ip_block.save - processed += 1 - else - say("#{address} could not be saved", :red) - failed += 1 - end - end - - say("Added #{processed}, skipped #{skipped}, failed #{failed}", color(processed, failed)) - end - - option :force, type: :boolean, aliases: [:f], desc: 'Remove blocks for ranges that cover given IP(s)' - desc 'remove IP...', 'Remove one or more IP blocks' - long_desc <<-LONG_DESC - Remove one or more IP blocks. Normally, only exact matches are removed. If - you want to ensure that all of the given IP addresses are unblocked, you - can use --force which will also remove any blocks for IP ranges that would - cover the given IP(s). - LONG_DESC - def remove(*addresses) - if addresses.empty? - say('No IP(s) given', :red) - exit(1) - end - - processed = 0 - skipped = 0 - - addresses.each do |address| - ip_blocks = begin - if options[:force] - IpBlock.where('ip >>= ?', address) - else - IpBlock.where('ip <<= ?', address) - end - end - - if ip_blocks.empty? - say("#{address} is not yet blocked", :yellow) - skipped += 1 - next - end - - ip_blocks.in_batches.destroy_all - processed += 1 - end - - say("Removed #{processed}, skipped #{skipped}", color(processed, 0)) - end - - option :format, aliases: [:f], enum: %w(plain nginx), desc: 'Format of the output' - desc 'export', 'Export blocked IPs' - long_desc <<-LONG_DESC - Export blocked IPs. Different formats are supported for usage with other - tools. Only blocks with no_access severity are returned. - LONG_DESC - def export - IpBlock.where(severity: :no_access).find_each do |ip_block| - case options[:format] - when 'nginx' - puts "deny #{ip_block.ip}/#{ip_block.ip.prefix};" - else - puts "#{ip_block.ip}/#{ip_block.ip.prefix}" - end - end - end - - private - - def color(processed, failed) - if !processed.zero? && failed.zero? - :green - elsif failed.zero? - :yellow - else - :red - end - end - end -end diff --git a/package.json b/package.json index 900795731ef200..12d84f67a740e8 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@babel/runtime": "^7.11.2", "@clusterws/cws": "^3.0.0", "@gamestdio/websocket": "^0.3.2", - "@github/webauthn-json": "^0.5.6", + "@github/webauthn-json": "^0.5.5", "@moezx/fontawesome-pro": "https://gitee.com/mashirozx/Font-Awesome.git", "@rails/ujs": "^6.0.3", "array-includes": "^3.1.1", @@ -84,7 +84,7 @@ "babel-runtime": "^6.26.0", "blurhash": "^1.1.3", "classnames": "^2.2.5", - "compression-webpack-plugin": "^6.0.3", + "compression-webpack-plugin": "^6.0.2", "cross-env": "^7.0.2", "css-loader": "^4.3.0", "cssnano": "^4.1.10", @@ -95,13 +95,13 @@ "escape-html": "^1.0.3", "exif-js": "^2.3.0", "express": "^4.17.1", - "file-loader": "^6.1.1", + "file-loader": "^6.1.0", "font-awesome": "^4.7.0", "glob": "^7.1.6", "history": "^4.10.1", "http-link-header": "^1.0.3", "immutable": "^3.8.2", - "imports-loader": "^1.2.0", + "imports-loader": "^1.1.0", "intersection-observer": "^0.11.0", "intl": "^1.2.5", "intl-messageformat": "^2.2.0", @@ -111,7 +111,7 @@ "lodash": "^4.17.19", "mark-loader": "^0.1.6", "marky": "^1.2.1", - "mini-css-extract-plugin": "^0.11.3", + "mini-css-extract-plugin": "^0.11.0", "mkdirp": "^1.0.4", "node-html-parser": "^1.2.20", "npmlog": "^4.1.2", @@ -154,12 +154,12 @@ "requestidlecallback": "^0.3.0", "reselect": "^4.0.0", "rimraf": "^3.0.2", - "sass": "^1.27.0", - "sass-loader": "^10.0.3", + "sass": "^1.26.11", + "sass-loader": "^10.0.2", "stacktrace-js": "^2.0.2", "stringz": "^2.1.0", "substring-trie": "^1.0.2", - "terser-webpack-plugin": "^4.2.3", + "terser-webpack-plugin": "^4.2.2", "tesseract.js": "^2.1.1", "throng": "^4.0.0", "tiny-queue": "^0.2.1", @@ -175,13 +175,13 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.0.4", "babel-eslint": "^10.1.0", - "babel-jest": "^26.5.2", - "eslint": "^7.11.0", + "babel-jest": "^26.3.0", + "eslint": "^7.6.0", "eslint-plugin-import": "~2.22.1", "eslint-plugin-jsx-a11y": "~6.3.1", "eslint-plugin-promise": "~4.2.1", - "eslint-plugin-react": "~7.21.4", - "jest": "^26.5.3", + "eslint-plugin-react": "~7.21.2", + "jest": "^26.4.2", "raf": "^3.4.1", "react-intl-translations-manager": "^5.0.3", "react-test-renderer": "^16.13.1", diff --git a/spec/controllers/remote_follow_controller_spec.rb b/spec/controllers/remote_follow_controller_spec.rb index 7312dde582e92b..3ef8f14d9f68c3 100644 --- a/spec/controllers/remote_follow_controller_spec.rb +++ b/spec/controllers/remote_follow_controller_spec.rb @@ -43,7 +43,8 @@ end it 'renders new when template is nil' do - resource_with_link = double(link: nil) + link_with_nil_template = double(template: nil) + resource_with_link = double(link: link_with_nil_template) allow_any_instance_of(WebfingerHelper).to receive(:webfinger!).with('acct:user@example.com').and_return(resource_with_link) post :create, params: { account_username: @account.to_param, remote_follow: { acct: 'user@example.com' } } @@ -54,7 +55,8 @@ context 'when webfinger values are good' do before do - resource_with_link = double(link: 'http://example.com/follow_me?acct={uri}') + link_with_template = double(template: 'http://example.com/follow_me?acct={uri}') + resource_with_link = double(link: link_with_template) allow_any_instance_of(WebfingerHelper).to receive(:webfinger!).with('acct:user@example.com').and_return(resource_with_link) post :create, params: { account_username: @account.to_param, remote_follow: { acct: 'user@example.com' } } end @@ -76,8 +78,8 @@ expect(response).to render_template(:new) end - it 'renders new with error when webfinger fails' do - allow_any_instance_of(WebfingerHelper).to receive(:webfinger!).with('acct:user@example.com').and_raise(Webfinger::Error) + it 'renders new with error when goldfinger fails' do + allow_any_instance_of(WebfingerHelper).to receive(:webfinger!).with('acct:user@example.com').and_raise(Goldfinger::Error) post :create, params: { account_username: @account.to_param, remote_follow: { acct: 'user@example.com' } } expect(response).to render_template(:new) diff --git a/spec/controllers/well_known/host_meta_controller_spec.rb b/spec/controllers/well_known/host_meta_controller_spec.rb index 643ba9cd3283aa..b43ae19d87a292 100644 --- a/spec/controllers/well_known/host_meta_controller_spec.rb +++ b/spec/controllers/well_known/host_meta_controller_spec.rb @@ -12,7 +12,7 @@ expect(response.body).to eq < - + XML end diff --git a/spec/fabricators/ip_block_fabricator.rb b/spec/fabricators/ip_block_fabricator.rb deleted file mode 100644 index 31dc336e64be30..00000000000000 --- a/spec/fabricators/ip_block_fabricator.rb +++ /dev/null @@ -1,6 +0,0 @@ -Fabricator(:ip_block) do - ip "" - severity "" - expires_at "2020-10-08 22:20:37" - comment "MyText" -end \ No newline at end of file diff --git a/spec/lib/fast_ip_map_spec.rb b/spec/lib/fast_ip_map_spec.rb deleted file mode 100644 index c66f64828ac551..00000000000000 --- a/spec/lib/fast_ip_map_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe FastIpMap do - describe '#include?' do - subject { described_class.new([IPAddr.new('20.4.0.0/16'), IPAddr.new('145.22.30.0/24'), IPAddr.new('189.45.86.3')])} - - it 'returns true for an exact match' do - expect(subject.include?(IPAddr.new('189.45.86.3'))).to be true - end - - it 'returns true for a range match' do - expect(subject.include?(IPAddr.new('20.4.45.7'))).to be true - end - - it 'returns false for no match' do - expect(subject.include?(IPAddr.new('145.22.40.64'))).to be false - end - end -end diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index 7d775a86d7be74..d9c17470f5a65a 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -108,7 +108,6 @@ it 'returns false for status by followee mentioning another account' do bob.follow!(alice) - jeff.follow!(alice) status = PostStatusService.new.call(alice, text: 'Hey @jeff') expect(FeedManager.instance.filter?(:home, status, bob)).to be false end diff --git a/spec/models/ip_block_spec.rb b/spec/models/ip_block_spec.rb deleted file mode 100644 index 6603c6417aac93..00000000000000 --- a/spec/models/ip_block_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe IpBlock, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/services/app_sign_up_service_spec.rb b/spec/services/app_sign_up_service_spec.rb index e0c83b7041d160..e7c7f3ba15e6bf 100644 --- a/spec/services/app_sign_up_service_spec.rb +++ b/spec/services/app_sign_up_service_spec.rb @@ -3,7 +3,6 @@ RSpec.describe AppSignUpService, type: :service do let(:app) { Fabricate(:application, scopes: 'read write') } let(:good_params) { { username: 'alice', password: '12345678', email: 'good@email.com', agreement: true } } - let(:remote_ip) { IPAddr.new('198.0.2.1') } subject { described_class.new } @@ -11,16 +10,16 @@ it 'returns nil when registrations are closed' do tmp = Setting.registrations_mode Setting.registrations_mode = 'none' - expect(subject.call(app, remote_ip, good_params)).to be_nil + expect(subject.call(app, good_params)).to be_nil Setting.registrations_mode = tmp end it 'raises an error when params are missing' do - expect { subject.call(app, remote_ip, {}) }.to raise_error ActiveRecord::RecordInvalid + expect { subject.call(app, {}) }.to raise_error ActiveRecord::RecordInvalid end it 'creates an unconfirmed user with access token' do - access_token = subject.call(app, remote_ip, good_params) + access_token = subject.call(app, good_params) expect(access_token).to_not be_nil user = User.find_by(id: access_token.resource_owner_id) expect(user).to_not be_nil @@ -28,13 +27,13 @@ end it 'creates access token with the app\'s scopes' do - access_token = subject.call(app, remote_ip, good_params) + access_token = subject.call(app, good_params) expect(access_token).to_not be_nil expect(access_token.scopes.to_s).to eq 'read write' end it 'creates an account' do - access_token = subject.call(app, remote_ip, good_params) + access_token = subject.call(app, good_params) expect(access_token).to_not be_nil user = User.find_by(id: access_token.resource_owner_id) expect(user).to_not be_nil @@ -43,7 +42,7 @@ end it 'creates an account with invite request text' do - access_token = subject.call(app, remote_ip, good_params.merge(reason: 'Foo bar')) + access_token = subject.call(app, good_params.merge(reason: 'Foo bar')) expect(access_token).to_not be_nil user = User.find_by(id: access_token.resource_owner_id) expect(user).to_not be_nil diff --git a/yarn.lock b/yarn.lock index 41461eb53b0a5a..c57f1af8434b86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1075,8 +1075,8 @@ "@eslint/eslintrc@^0.1.3": version "0.1.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.1.3.tgz#7d1a2b2358552cc04834c0979bd4275362e37085" - integrity sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA== + resolved "https://registry.npm.taobao.org/@eslint/eslintrc/download/@eslint/eslintrc-0.1.3.tgz#7d1a2b2358552cc04834c0979bd4275362e37085" + integrity sha1-fRorI1hVLMBINMCXm9QnU2LjcIU= dependencies: ajv "^6.12.4" debug "^4.1.1" @@ -1106,10 +1106,10 @@ resolved "https://registry.npm.taobao.org/@gamestdio/websocket/download/@gamestdio/websocket-0.3.2.tgz#321ba0976ee30fd14e51dbf8faa85ce7b325f76a" integrity sha1-Mhugl27jD9FOUdv4+qhc57Ml92o= -"@github/webauthn-json@^0.5.6": +"@github/webauthn-json@^0.5.5": version "0.5.6" - resolved "https://registry.yarnpkg.com/@github/webauthn-json/-/webauthn-json-0.5.6.tgz#dd0c2c284d6b1b806fea3c534da72d65cbdafed2" - integrity sha512-38PqUby4jxRHFKryRFsqmlznXrl/Tray0lmHOaLq12uTdLIjO4i++FUrThf/IOcNmee+qYhEZS1kVSOuSPbY2Q== + resolved "https://registry.npm.taobao.org/@github/webauthn-json/download/@github/webauthn-json-0.5.6.tgz#dd0c2c284d6b1b806fea3c534da72d65cbdafed2" + integrity sha1-3QwsKE1rG4Bv6jxTTactZcva/tI= "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -1129,8 +1129,8 @@ "@jest/console@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" - integrity sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw== + resolved "https://registry.npm.taobao.org/@jest/console/download/@jest/console-26.5.2.tgz?cache=0&sync_timestamp=1601981812710&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fconsole%2Fdownload%2F%40jest%2Fconsole-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" + integrity sha1-lPxIZbGr7Xw1K14h5sV75LlWBKY= dependencies: "@jest/types" "^26.5.2" "@types/node" "*" @@ -1139,13 +1139,13 @@ jest-util "^26.5.2" slash "^3.0.0" -"@jest/core@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-26.5.3.tgz#712ed4adb64c3bda256a3f400ff1d3eb2a031f13" - integrity sha512-CiU0UKFF1V7KzYTVEtFbFmGLdb2g4aTtY0WlyUfLgj/RtoTnJFhh50xKKr7OYkdmBUlGFSa2mD1TU3UZ6OLd4g== +"@jest/core@^26.5.2": + version "26.5.2" + resolved "https://registry.npm.taobao.org/@jest/core/download/@jest/core-26.5.2.tgz?cache=0&sync_timestamp=1601981789045&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fcore%2Fdownload%2F%40jest%2Fcore-26.5.2.tgz#e39f14676f4ba4632ecabfdc374071ab22131f22" + integrity sha1-458UZ29LpGMuyr/cN0BxqyITHyI= dependencies: "@jest/console" "^26.5.2" - "@jest/reporters" "^26.5.3" + "@jest/reporters" "^26.5.2" "@jest/test-result" "^26.5.2" "@jest/transform" "^26.5.2" "@jest/types" "^26.5.2" @@ -1155,17 +1155,17 @@ exit "^0.1.2" graceful-fs "^4.2.4" jest-changed-files "^26.5.2" - jest-config "^26.5.3" + jest-config "^26.5.2" jest-haste-map "^26.5.2" jest-message-util "^26.5.2" jest-regex-util "^26.0.0" jest-resolve "^26.5.2" - jest-resolve-dependencies "^26.5.3" - jest-runner "^26.5.3" - jest-runtime "^26.5.3" - jest-snapshot "^26.5.3" + jest-resolve-dependencies "^26.5.2" + jest-runner "^26.5.2" + jest-runtime "^26.5.2" + jest-snapshot "^26.5.2" jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-validate "^26.5.2" jest-watcher "^26.5.2" micromatch "^4.0.2" p-each-series "^2.1.0" @@ -1175,8 +1175,8 @@ "@jest/environment@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" - integrity sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw== + resolved "https://registry.npm.taobao.org/@jest/environment/download/@jest/environment-26.5.2.tgz?cache=0&sync_timestamp=1601981783870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fenvironment%2Fdownload%2F%40jest%2Fenvironment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" + integrity sha1-66PPxpj24Dc5Yo9pnCjooH9eZf4= dependencies: "@jest/fake-timers" "^26.5.2" "@jest/types" "^26.5.2" @@ -1185,8 +1185,8 @@ "@jest/fake-timers@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" - integrity sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw== + resolved "https://registry.npm.taobao.org/@jest/fake-timers/download/@jest/fake-timers-26.5.2.tgz?cache=0&sync_timestamp=1601981813627&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ffake-timers%2Fdownload%2F%40jest%2Ffake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" + integrity sha1-EpGsgWgM6w3H2qH5LAWTB+6mQAo= dependencies: "@jest/types" "^26.5.2" "@sinonjs/fake-timers" "^6.0.1" @@ -1195,19 +1195,19 @@ jest-mock "^26.5.2" jest-util "^26.5.2" -"@jest/globals@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-26.5.3.tgz#90769b40e0af3fa0b28f6d8c5bbe3712467243fd" - integrity sha512-7QztI0JC2CuB+Wx1VdnOUNeIGm8+PIaqngYsZXQCkH2QV0GFqzAYc9BZfU0nuqA6cbYrWh5wkuMzyii3P7deug== +"@jest/globals@^26.5.2": + version "26.5.2" + resolved "https://registry.npm.taobao.org/@jest/globals/download/@jest/globals-26.5.2.tgz?cache=0&sync_timestamp=1601981786903&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fglobals%2Fdownload%2F%40jest%2Fglobals-26.5.2.tgz#c333f82c29e19ecb609a75d1a532915a5c956c59" + integrity sha1-wzP4LCnhnstgmnXRpTKRWlyVbFk= dependencies: "@jest/environment" "^26.5.2" "@jest/types" "^26.5.2" - expect "^26.5.3" + expect "^26.5.2" -"@jest/reporters@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-26.5.3.tgz#e810e9c2b670f33f1c09e9975749260ca12f1c17" - integrity sha512-X+vR0CpfMQzYcYmMFKNY9n4jklcb14Kffffp7+H/MqitWnb0440bW2L76NGWKAa+bnXhNoZr+lCVtdtPmfJVOQ== +"@jest/reporters@^26.5.2": + version "26.5.2" + resolved "https://registry.npm.taobao.org/@jest/reporters/download/@jest/reporters-26.5.2.tgz?cache=0&sync_timestamp=1601981786717&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Freporters%2Fdownload%2F%40jest%2Freporters-26.5.2.tgz#0f1c900c6af712b46853d9d486c9c0382e4050f6" + integrity sha1-DxyQDGr3ErRoU9nUhsnAOC5AUPY= dependencies: "@bcoe/v8-coverage" "^0.2.3" "@jest/console" "^26.5.2" @@ -1232,14 +1232,14 @@ source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^6.0.1" + v8-to-istanbul "^5.0.1" optionalDependencies: node-notifier "^8.0.0" "@jest/source-map@^26.5.0": version "26.5.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-26.5.0.tgz#98792457c85bdd902365cd2847b58fff05d96367" - integrity sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g== + resolved "https://registry.npm.taobao.org/@jest/source-map/download/@jest/source-map-26.5.0.tgz?cache=0&sync_timestamp=1601890413378&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fsource-map%2Fdownload%2F%40jest%2Fsource-map-26.5.0.tgz#98792457c85bdd902365cd2847b58fff05d96367" + integrity sha1-mHkkV8hb3ZAjZc0oR7WP/wXZY2c= dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" @@ -1247,29 +1247,29 @@ "@jest/test-result@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" - integrity sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw== + resolved "https://registry.npm.taobao.org/@jest/test-result/download/@jest/test-result-26.5.2.tgz?cache=0&sync_timestamp=1601981816087&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftest-result%2Fdownload%2F%40jest%2Ftest-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" + integrity sha1-zBpEz9TbLs7j+wvE6f4IeqVLUjA= dependencies: "@jest/console" "^26.5.2" "@jest/types" "^26.5.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.5.3": - version "26.5.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-26.5.3.tgz#9ae0ab9bc37d5171b28424029192e50229814f8d" - integrity sha512-Wqzb7aQ13L3T47xHdpUqYMOpiqz6Dx2QDDghp5AV/eUDXR7JieY+E1s233TQlNyl+PqtqgjVokmyjzX/HA51BA== +"@jest/test-sequencer@^26.5.2": + version "26.5.2" + resolved "https://registry.npm.taobao.org/@jest/test-sequencer/download/@jest/test-sequencer-26.5.2.tgz?cache=0&sync_timestamp=1601981788251&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftest-sequencer%2Fdownload%2F%40jest%2Ftest-sequencer-26.5.2.tgz#c4559c7e134b27b020317303ee5399bf62917a4b" + integrity sha1-xFWcfhNLJ7AgMXMD7lOZv2KReks= dependencies: "@jest/test-result" "^26.5.2" graceful-fs "^4.2.4" jest-haste-map "^26.5.2" - jest-runner "^26.5.3" - jest-runtime "^26.5.3" + jest-runner "^26.5.2" + jest-runtime "^26.5.2" "@jest/transform@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" - integrity sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg== + resolved "https://registry.npm.taobao.org/@jest/transform/download/@jest/transform-26.5.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftransform%2Fdownload%2F%40jest%2Ftransform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" + integrity sha1-agAzodJDFqHHUYTQENhk8saBvvU= dependencies: "@babel/core" "^7.1.0" "@jest/types" "^26.5.2" @@ -1299,8 +1299,8 @@ "@jest/types@^26.5.2": version "26.5.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" - integrity sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg== + resolved "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.5.2.tgz?cache=0&sync_timestamp=1601981802866&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftypes%2Fdownload%2F%40jest%2Ftypes-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" + integrity sha1-RMJPMMjubH9JLq2ew/PGKlKJdW0= dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -1461,7 +1461,7 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" -"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6": +"@types/json-schema@^7.0.5": version "7.0.6" resolved "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" integrity sha1-9MfsQ+gbMZqYFRFQMXCfJph4kfA= @@ -1508,8 +1508,8 @@ "@types/stack-utils@^2.0.0": version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" - integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== + resolved "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-2.0.0.tgz?cache=0&sync_timestamp=1600733056390&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fstack-utils%2Fdownload%2F%40types%2Fstack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + integrity sha1-cDZkC04hzC8lmugmzoQ9J32tjP8= "@types/testing-library__jest-dom@^5.9.1": version "5.9.4" @@ -1738,15 +1738,10 @@ acorn@^6.4.1: resolved "https://registry.npm.taobao.org/acorn/download/acorn-6.4.2.tgz?cache=0&sync_timestamp=1601885832302&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha1-NYZv1xBSjpLeEM8GAWSY5H454eY= -acorn@^7.1.1: - version "7.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" - integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== - -acorn@^7.4.0: +acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + resolved "https://registry.npm.taobao.org/acorn/download/acorn-7.4.1.tgz?cache=0&sync_timestamp=1601885832302&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo= aggregate-error@^3.0.0: version "3.1.0" @@ -1789,16 +1784,6 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^6.12.5: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - alphanum-sort@^1.0.0: version "1.0.2" resolved "https://registry.npm.taobao.org/alphanum-sort/download/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" @@ -2111,10 +2096,10 @@ babel-eslint@^10.1.0: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^26.5.2: +babel-jest@^26.3.0, babel-jest@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" - integrity sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A== + resolved "https://registry.npm.taobao.org/babel-jest/download/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" + integrity sha1-Fk82ejWUbGz1TqzN6HYt7FBCIlA= dependencies: "@jest/transform" "^26.5.2" "@jest/types" "^26.5.2" @@ -2172,8 +2157,8 @@ babel-plugin-istanbul@^6.0.0: babel-plugin-jest-hoist@^26.5.0: version "26.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz#3916b3a28129c29528de91e5784a44680db46385" - integrity sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw== + resolved "https://registry.npm.taobao.org/babel-plugin-jest-hoist/download/babel-plugin-jest-hoist-26.5.0.tgz?cache=0&sync_timestamp=1601890412578&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-jest-hoist%2Fdownload%2Fbabel-plugin-jest-hoist-26.5.0.tgz#3916b3a28129c29528de91e5784a44680db46385" + integrity sha1-ORazooEpwpUo3pHleEpEaA20Y4U= dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -2251,8 +2236,8 @@ babel-preset-current-node-syntax@^0.1.3: babel-preset-jest@^26.5.0: version "26.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz#f1b166045cd21437d1188d29f7fba470d5bdb0e7" - integrity sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA== + resolved "https://registry.npm.taobao.org/babel-preset-jest/download/babel-preset-jest-26.5.0.tgz?cache=0&sync_timestamp=1601890338356&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-preset-jest%2Fdownload%2Fbabel-preset-jest-26.5.0.tgz#f1b166045cd21437d1188d29f7fba470d5bdb0e7" + integrity sha1-8bFmBFzSFDfRGI0p9/ukcNW9sOc= dependencies: babel-plugin-jest-hoist "^26.5.0" babel-preset-current-node-syntax "^0.1.3" @@ -2987,14 +2972,14 @@ compressible@~2.0.16: dependencies: mime-db ">= 1.43.0 < 2" -compression-webpack-plugin@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-6.0.3.tgz#d0d3e913810e3bf67462e1cecd794b3109af89de" - integrity sha512-xzSWiZWwBs+HHGhlYxw0oFaYL/0VYErEqDHCAJhJ3Mza5fmF5JJ4iaB6Ap2JT68C0UhhmoI4Mh37LVz/THv2Fw== +compression-webpack-plugin@^6.0.2: + version "6.0.2" + resolved "https://registry.npm.taobao.org/compression-webpack-plugin/download/compression-webpack-plugin-6.0.2.tgz?cache=0&sync_timestamp=1600528589573&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompression-webpack-plugin%2Fdownload%2Fcompression-webpack-plugin-6.0.2.tgz#13482bfa81e0472e5d6af1165b6ee9f29f98178b" + integrity sha1-E0gr+oHgRy5davEWW27p8p+YF4s= dependencies: cacache "^15.0.5" find-cache-dir "^3.3.1" - schema-utils "^3.0.0" + schema-utils "^2.7.1" serialize-javascript "^5.0.1" webpack-sources "^1.4.3" @@ -3648,8 +3633,8 @@ diff-sequences@^25.2.6: diff-sequences@^26.5.0: version "26.5.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.5.0.tgz#ef766cf09d43ed40406611f11c6d8d9dd8b2fefd" - integrity sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q== + resolved "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-26.5.0.tgz?cache=0&sync_timestamp=1601890413010&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdiff-sequences%2Fdownload%2Fdiff-sequences-26.5.0.tgz#ef766cf09d43ed40406611f11c6d8d9dd8b2fefd" + integrity sha1-73Zs8J1D7UBAZhHxHG2Nndiy/v0= diffie-hellman@^5.0.0: version "5.0.3" @@ -4121,16 +4106,16 @@ eslint-plugin-promise@~4.2.1: resolved "https://registry.npm.taobao.org/eslint-plugin-promise/download/eslint-plugin-promise-4.2.1.tgz#845fd8b2260ad8f82564c1222fce44ad71d9418a" integrity sha1-hF/YsiYK2PglZMEiL85ErXHZQYo= -eslint-plugin-react@~7.21.4: - version "7.21.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.21.4.tgz#31060b2e5ff82b12e24a3cc33edb7d12f904775c" - integrity sha512-uHeQ8A0hg0ltNDXFu3qSfFqTNPXm1XithH6/SY318UX76CMj7Q599qWpgmMhVQyvhq36pm7qvoN3pb6/3jsTFg== +eslint-plugin-react@~7.21.2: + version "7.21.3" + resolved "https://registry.npm.taobao.org/eslint-plugin-react/download/eslint-plugin-react-7.21.3.tgz?cache=0&sync_timestamp=1601663780163&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-react%2Fdownload%2Feslint-plugin-react-7.21.3.tgz#71655d2af5155b19285ec929dd2cdc67a4470b52" + integrity sha1-cWVdKvUVWxkoXskp3SzcZ6RHC1I= dependencies: array-includes "^3.1.1" array.prototype.flatmap "^1.2.3" doctrine "^2.1.0" has "^1.0.3" - jsx-ast-utils "^2.4.1 || ^3.0.0" + jsx-ast-utils "^2.4.1" object.entries "^1.1.2" object.fromentries "^2.0.2" object.values "^1.1.1" @@ -4148,8 +4133,8 @@ eslint-scope@^4.0.3: eslint-scope@^5.1.1: version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + resolved "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.1.tgz?cache=0&sync_timestamp=1600070417656&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-scope%2Fdownload%2Feslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha1-54blmmbLkrP2wfsNUIqrF0hI9Iw= dependencies: esrecurse "^4.3.0" estraverse "^4.1.1" @@ -4166,11 +4151,6 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3 resolved "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.3.0.tgz?cache=0&sync_timestamp=1599829544231&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha1-MOvR73wv3/AcOk8VEESvJfqwUj4= -eslint-visitor-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" - integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== - eslint@^2.7.0: version "2.13.1" resolved "https://registry.npm.taobao.org/eslint/download/eslint-2.13.1.tgz?cache=0&sync_timestamp=1601156924389&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-2.13.1.tgz#e4cc8fa0f009fb829aaae23855a29360be1f6c11" @@ -4210,10 +4190,10 @@ eslint@^2.7.0: text-table "~0.2.0" user-home "^2.0.0" -eslint@^7.11.0: - version "7.11.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.11.0.tgz#aaf2d23a0b5f1d652a08edacea0c19f7fadc0b3b" - integrity sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw== +eslint@^7.6.0: + version "7.10.0" + resolved "https://registry.npm.taobao.org/eslint/download/eslint-7.10.0.tgz?cache=0&sync_timestamp=1601156924389&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-7.10.0.tgz#494edb3e4750fb791133ca379e786a8f648c72b9" + integrity sha1-SU7bPkdQ+3kRM8o3nnhqj2SMcrk= dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.1.3" @@ -4225,7 +4205,7 @@ eslint@^7.11.0: enquirer "^2.3.5" eslint-scope "^5.1.1" eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" + eslint-visitor-keys "^1.3.0" espree "^7.3.0" esquery "^1.2.0" esutils "^2.0.2" @@ -4263,8 +4243,8 @@ espree@^3.1.6: espree@^7.3.0: version "7.3.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" - integrity sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw== + resolved "https://registry.npm.taobao.org/espree/download/espree-7.3.0.tgz#dc30437cf67947cf576121ebd780f15eeac72348" + integrity sha1-3DBDfPZ5R89XYSHr14DxXurHI0g= dependencies: acorn "^7.4.0" acorn-jsx "^5.2.0" @@ -4410,10 +4390,10 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-26.5.3.tgz#89d9795036f7358b0a9a5243238eb8086482d741" - integrity sha512-kkpOhGRWGOr+TEFUnYAjfGvv35bfP+OlPtqPIJpOCR9DVtv8QV+p8zG0Edqafh80fsjeE+7RBcVUq1xApnYglw== +expect@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/expect/download/expect-26.5.2.tgz?cache=0&sync_timestamp=1601981786192&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpect%2Fdownload%2Fexpect-26.5.2.tgz#3e0631c4a657a83dbec769ad246a2998953a55a6" + integrity sha1-PgYxxKZXqD2+x2mtJGopmJU6VaY= dependencies: "@jest/types" "^26.5.2" ansi-styles "^4.0.0" @@ -4573,13 +4553,13 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" -file-loader@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.1.1.tgz#a6f29dfb3f5933a1c350b2dbaa20ac5be0539baa" - integrity sha512-Klt8C4BjWSXYQAfhpYYkG4qHNTna4toMHEbWrI5IuVoxbU6uiDKeKAP99R8mmbJi3lvewn/jQBOgU4+NS3tDQw== +file-loader@^6.1.0: + version "6.1.0" + resolved "https://registry.npm.taobao.org/file-loader/download/file-loader-6.1.0.tgz#65b9fcfb0ea7f65a234a1f10cdd7f1ab9a33f253" + integrity sha1-Zbn8+w6n9lojSh8Qzdfxq5oz8lM= dependencies: loader-utils "^2.0.0" - schema-utils "^3.0.0" + schema-utils "^2.7.1" file-type@^12.4.1: version "12.4.2" @@ -5418,13 +5398,13 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" -imports-loader@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/imports-loader/-/imports-loader-1.2.0.tgz#b06823d0bb42e6f5ff89bc893829000eda46693f" - integrity sha512-zPvangKEgrrPeqeUqH0Uhc59YqK07JqZBi9a9cQ3v/EKUIqrbJHY4CvUrDus2lgQa5AmPyXuGrWP8JJTqzE5RQ== +imports-loader@^1.1.0: + version "1.1.0" + resolved "https://registry.npm.taobao.org/imports-loader/download/imports-loader-1.1.0.tgz#1c3a388d0c5cd7f9eb08f3646d4aae3b70e57933" + integrity sha1-HDo4jQxc1/nrCPNkbUquO3DleTM= dependencies: loader-utils "^2.0.0" - schema-utils "^3.0.0" + schema-utils "^2.7.0" source-map "^0.6.1" strip-comments "^2.0.1" @@ -5996,19 +5976,19 @@ istanbul-reports@^3.0.2: jest-changed-files@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" - integrity sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w== + resolved "https://registry.npm.taobao.org/jest-changed-files/download/jest-changed-files-26.5.2.tgz?cache=0&sync_timestamp=1601981780401&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-changed-files%2Fdownload%2Fjest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" + integrity sha1-MwIyxqXAmn8EClhw6PCpxqvNvtU= dependencies: "@jest/types" "^26.5.2" execa "^4.0.0" throat "^5.0.0" -jest-cli@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-26.5.3.tgz#f936b98f247b76b7bc89c7af50af82c88e356a80" - integrity sha512-HkbSvtugpSXBf2660v9FrNVUgxvPkssN8CRGj9gPM8PLhnaa6zziFiCEKQAkQS4uRzseww45o0TR+l6KeRYV9A== +jest-cli@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-cli/download/jest-cli-26.5.2.tgz?cache=0&sync_timestamp=1601981830926&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-cli%2Fdownload%2Fjest-cli-26.5.2.tgz#0df114399b4036a3f046f0a9f25c50372c76b3a2" + integrity sha1-DfEUOZtANqPwRvCp8lxQNyx2s6I= dependencies: - "@jest/core" "^26.5.3" + "@jest/core" "^26.5.2" "@jest/test-result" "^26.5.2" "@jest/types" "^26.5.2" chalk "^4.0.0" @@ -6016,19 +5996,19 @@ jest-cli@^26.5.3: graceful-fs "^4.2.4" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^26.5.3" + jest-config "^26.5.2" jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-validate "^26.5.2" prompts "^2.0.1" yargs "^15.4.1" -jest-config@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-26.5.3.tgz#baf51c9be078c2c755c8f8a51ec0f06c762c1d3f" - integrity sha512-NVhZiIuN0GQM6b6as4CI5FSCyXKxdrx5ACMCcv/7Pf+TeCajJhJc+6dwgdAVPyerUFB9pRBIz3bE7clSrRge/w== +jest-config@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-config/download/jest-config-26.5.2.tgz?cache=0&sync_timestamp=1601981787987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-config%2Fdownload%2Fjest-config-26.5.2.tgz#6e828e25f10124433dd008fbd83348636de0972a" + integrity sha1-boKOJfEBJEM90Aj72DNIY23glyo= dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.5.3" + "@jest/test-sequencer" "^26.5.2" "@jest/types" "^26.5.2" babel-jest "^26.5.2" chalk "^4.0.0" @@ -6038,11 +6018,11 @@ jest-config@^26.5.3: jest-environment-jsdom "^26.5.2" jest-environment-node "^26.5.2" jest-get-type "^26.3.0" - jest-jasmine2 "^26.5.3" + jest-jasmine2 "^26.5.2" jest-regex-util "^26.0.0" jest-resolve "^26.5.2" jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-validate "^26.5.2" micromatch "^4.0.2" pretty-format "^26.5.2" @@ -6058,8 +6038,8 @@ jest-diff@^25.2.1: jest-diff@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" - integrity sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA== + resolved "https://registry.npm.taobao.org/jest-diff/download/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" + integrity sha1-jibLMtxZjouKG53v9VMW+DE8gFM= dependencies: chalk "^4.0.0" diff-sequences "^26.5.0" @@ -6075,8 +6055,8 @@ jest-docblock@^26.0.0: jest-each@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" - integrity sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg== + resolved "https://registry.npm.taobao.org/jest-each/download/jest-each-26.5.2.tgz?cache=0&sync_timestamp=1601981783070&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-each%2Fdownload%2Fjest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" + integrity sha1-NeaNaQan+CbTylgDz+kdF6WjTDE= dependencies: "@jest/types" "^26.5.2" chalk "^4.0.0" @@ -6086,8 +6066,8 @@ jest-each@^26.5.2: jest-environment-jsdom@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" - integrity sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw== + resolved "https://registry.npm.taobao.org/jest-environment-jsdom/download/jest-environment-jsdom-26.5.2.tgz?cache=0&sync_timestamp=1601981785506&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-environment-jsdom%2Fdownload%2Fjest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" + integrity sha1-X+qwW4KP0+S5a+5eBJNGTd0rtLw= dependencies: "@jest/environment" "^26.5.2" "@jest/fake-timers" "^26.5.2" @@ -6099,8 +6079,8 @@ jest-environment-jsdom@^26.5.2: jest-environment-node@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" - integrity sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA== + resolved "https://registry.npm.taobao.org/jest-environment-node/download/jest-environment-node-26.5.2.tgz?cache=0&sync_timestamp=1601981786447&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-environment-node%2Fdownload%2Fjest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" + integrity sha1-J1oPAbXkdEcFbxVBoV7U2hSsygM= dependencies: "@jest/environment" "^26.5.2" "@jest/fake-timers" "^26.5.2" @@ -6121,8 +6101,8 @@ jest-get-type@^26.3.0: jest-haste-map@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" - integrity sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA== + resolved "https://registry.npm.taobao.org/jest-haste-map/download/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" + integrity sha1-oVAIq/xQLBiqVuSRntjJYwTOsj0= dependencies: "@jest/types" "^26.5.2" "@types/graceful-fs" "^4.1.2" @@ -6140,10 +6120,10 @@ jest-haste-map@^26.5.2: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-26.5.3.tgz#baad2114ce32d16aff25aeb877d18bb4e332dc4c" - integrity sha512-nFlZOpnGlNc7y/+UkkeHnvbOM+rLz4wB1AimgI9QhtnqSZte0wYjbAm8hf7TCwXlXgDwZxAXo6z0a2Wzn9FoOg== +jest-jasmine2@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-jasmine2/download/jest-jasmine2-26.5.2.tgz?cache=0&sync_timestamp=1601981787696&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-jasmine2%2Fdownload%2Fjest-jasmine2-26.5.2.tgz#0e33819d31b1f2aab5efd1e02ce502209c0e64a2" + integrity sha1-DjOBnTGx8qq179HgLOUCIJwOZKI= dependencies: "@babel/traverse" "^7.1.0" "@jest/environment" "^26.5.2" @@ -6153,29 +6133,29 @@ jest-jasmine2@^26.5.3: "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.5.3" + expect "^26.5.2" is-generator-fn "^2.0.0" jest-each "^26.5.2" jest-matcher-utils "^26.5.2" jest-message-util "^26.5.2" - jest-runtime "^26.5.3" - jest-snapshot "^26.5.3" + jest-runtime "^26.5.2" + jest-snapshot "^26.5.2" jest-util "^26.5.2" pretty-format "^26.5.2" throat "^5.0.0" jest-leak-detector@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" - integrity sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw== + resolved "https://registry.npm.taobao.org/jest-leak-detector/download/jest-leak-detector-26.5.2.tgz?cache=0&sync_timestamp=1601981781935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-leak-detector%2Fdownload%2Fjest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" + integrity sha1-g/z5pKbvFXVJVSy08yyh1iIe6mk= dependencies: jest-get-type "^26.3.0" pretty-format "^26.5.2" jest-matcher-utils@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" - integrity sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA== + resolved "https://registry.npm.taobao.org/jest-matcher-utils/download/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" + integrity sha1-aqLHbOi5wz5m+IVv86Urq1nmyFo= dependencies: chalk "^4.0.0" jest-diff "^26.5.2" @@ -6184,8 +6164,8 @@ jest-matcher-utils@^26.5.2: jest-message-util@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" - integrity sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw== + resolved "https://registry.npm.taobao.org/jest-message-util/download/jest-message-util-26.5.2.tgz?cache=0&sync_timestamp=1601981810029&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-message-util%2Fdownload%2Fjest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" + integrity sha1-bExMRtz7q7R80bovY1FVlym8Ebs= dependencies: "@babel/code-frame" "^7.0.0" "@jest/types" "^26.5.2" @@ -6198,8 +6178,8 @@ jest-message-util@^26.5.2: jest-mock@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" - integrity sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw== + resolved "https://registry.npm.taobao.org/jest-mock/download/jest-mock-26.5.2.tgz?cache=0&sync_timestamp=1601981808493&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-mock%2Fdownload%2Fjest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" + integrity sha1-yTAujvgH8r/HSe5S5lrREWahtqE= dependencies: "@jest/types" "^26.5.2" "@types/node" "*" @@ -6214,19 +6194,19 @@ jest-regex-util@^26.0.0: resolved "https://registry.npm.taobao.org/jest-regex-util/download/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha1-0l5xhLNuOf1GbDvEG+CXHoIf7ig= -jest-resolve-dependencies@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.3.tgz#11483f91e534bdcd257ab21e8622799e59701aba" - integrity sha512-+KMDeke/BFK+mIQ2IYSyBz010h7zQaVt4Xie6cLqUGChorx66vVeQVv4ErNoMwInnyYHi1Ud73tDS01UbXbfLQ== +jest-resolve-dependencies@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-resolve-dependencies/download/jest-resolve-dependencies-26.5.2.tgz?cache=0&sync_timestamp=1601981787105&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve-dependencies%2Fdownload%2Fjest-resolve-dependencies-26.5.2.tgz#ee30b7cfea81c81bf5e195a9287d7ec07f893170" + integrity sha1-7jC3z+qByBv14ZWpKH1+wH+JMXA= dependencies: "@jest/types" "^26.5.2" jest-regex-util "^26.0.0" - jest-snapshot "^26.5.3" + jest-snapshot "^26.5.2" jest-resolve@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" - integrity sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg== + resolved "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" + integrity sha1-DXGRRPYZRKQoZXt1Wg5cavT8hgI= dependencies: "@jest/types" "^26.5.2" chalk "^4.0.0" @@ -6237,10 +6217,10 @@ jest-resolve@^26.5.2: resolve "^1.17.0" slash "^3.0.0" -jest-runner@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-26.5.3.tgz#800787459ea59c68e7505952933e33981dc3db38" - integrity sha512-qproP0Pq7IIule+263W57k2+8kWCszVJTC9TJWGUz0xJBr+gNiniGXlG8rotd0XxwonD5UiJloYoSO5vbUr5FQ== +jest-runner@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-runner/download/jest-runner-26.5.2.tgz?cache=0&sync_timestamp=1601981788807&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-runner%2Fdownload%2Fjest-runner-26.5.2.tgz#4f9e6b0bb7eb4710c209a9e145b8a10894f4c19f" + integrity sha1-T55rC7frRxDCCanhRbihCJT0wZ8= dependencies: "@jest/console" "^26.5.2" "@jest/environment" "^26.5.2" @@ -6251,27 +6231,27 @@ jest-runner@^26.5.3: emittery "^0.7.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^26.5.3" + jest-config "^26.5.2" jest-docblock "^26.0.0" jest-haste-map "^26.5.2" jest-leak-detector "^26.5.2" jest-message-util "^26.5.2" jest-resolve "^26.5.2" - jest-runtime "^26.5.3" + jest-runtime "^26.5.2" jest-util "^26.5.2" jest-worker "^26.5.0" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-26.5.3.tgz#5882ae91fd88304310f069549e6bf82f3f198bea" - integrity sha512-IDjalmn2s/Tc4GvUwhPHZ0iaXCdMRq5p6taW9P8RpU+FpG01O3+H8z+p3rDCQ9mbyyyviDgxy/LHPLzrIOKBkQ== +jest-runtime@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-26.5.2.tgz?cache=0&sync_timestamp=1601981788550&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-runtime%2Fdownload%2Fjest-runtime-26.5.2.tgz#b72f5f79eb2fe0c46bfef4cdb9c1e01d1c69ba41" + integrity sha1-ty9feesv4MRr/vTNucHgHRxpukE= dependencies: "@jest/console" "^26.5.2" "@jest/environment" "^26.5.2" "@jest/fake-timers" "^26.5.2" - "@jest/globals" "^26.5.3" + "@jest/globals" "^26.5.2" "@jest/source-map" "^26.5.0" "@jest/test-result" "^26.5.2" "@jest/transform" "^26.5.2" @@ -6282,38 +6262,38 @@ jest-runtime@^26.5.3: exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-config "^26.5.3" + jest-config "^26.5.2" jest-haste-map "^26.5.2" jest-message-util "^26.5.2" jest-mock "^26.5.2" jest-regex-util "^26.0.0" jest-resolve "^26.5.2" - jest-snapshot "^26.5.3" + jest-snapshot "^26.5.2" jest-util "^26.5.2" - jest-validate "^26.5.3" + jest-validate "^26.5.2" slash "^3.0.0" strip-bom "^4.0.0" yargs "^15.4.1" jest-serializer@^26.5.0: version "26.5.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-26.5.0.tgz#f5425cc4c5f6b4b355f854b5f0f23ec6b962bc13" - integrity sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA== + resolved "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-26.5.0.tgz?cache=0&sync_timestamp=1601890414006&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-serializer%2Fdownload%2Fjest-serializer-26.5.0.tgz#f5425cc4c5f6b4b355f854b5f0f23ec6b962bc13" + integrity sha1-9UJcxMX2tLNV+FS18PI+xrlivBM= dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-26.5.3.tgz#f6b4b4b845f85d4b0dadd7cf119c55d0c1688601" - integrity sha512-ZgAk0Wm0JJ75WS4lGaeRfa0zIgpL0KD595+XmtwlIEMe8j4FaYHyZhP1LNOO+8fXq7HJ3hll54+sFV9X4+CGVw== +jest-snapshot@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-26.5.2.tgz?cache=0&sync_timestamp=1601981787373&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-snapshot%2Fdownload%2Fjest-snapshot-26.5.2.tgz#0cf7642eaf8e8d2736bd443f619959bf237f9ccf" + integrity sha1-DPdkLq+OjSc2vUQ/YZlZvyN/nM8= dependencies: "@babel/types" "^7.0.0" "@jest/types" "^26.5.2" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.0.0" chalk "^4.0.0" - expect "^26.5.3" + expect "^26.5.2" graceful-fs "^4.2.4" jest-diff "^26.5.2" jest-get-type "^26.3.0" @@ -6327,8 +6307,8 @@ jest-snapshot@^26.5.3: jest-util@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" - integrity sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg== + resolved "https://registry.npm.taobao.org/jest-util/download/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" + integrity sha1-hAP3VneQLMUqGyFA9WjpH47U9Nc= dependencies: "@jest/types" "^26.5.2" "@types/node" "*" @@ -6337,10 +6317,10 @@ jest-util@^26.5.2: is-ci "^2.0.0" micromatch "^4.0.2" -jest-validate@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-26.5.3.tgz#eefd5a5c87059550548c5ad8d6589746c66929e3" - integrity sha512-LX07qKeAtY+lsU0o3IvfDdN5KH9OulEGOMN1sFo6PnEf5/qjS1LZIwNk9blcBeW94pQUI9dLN9FlDYDWI5tyaA== +jest-validate@^26.5.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest-validate/download/jest-validate-26.5.2.tgz?cache=0&sync_timestamp=1601981782848&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-validate%2Fdownload%2Fjest-validate-26.5.2.tgz#7ea266700b64234cd1c0cee982490c5a80e9b0f0" + integrity sha1-fqJmcAtkI0zRwM7pgkkMWoDpsPA= dependencies: "@jest/types" "^26.5.2" camelcase "^6.0.0" @@ -6351,8 +6331,8 @@ jest-validate@^26.5.3: jest-watcher@^26.5.2: version "26.5.2" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" - integrity sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw== + resolved "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-26.5.2.tgz?cache=0&sync_timestamp=1601981783300&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-watcher%2Fdownload%2Fjest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" + integrity sha1-KVf0RhAH4HaddLU3N57Pa3xpaRY= dependencies: "@jest/test-result" "^26.5.2" "@jest/types" "^26.5.2" @@ -6362,7 +6342,7 @@ jest-watcher@^26.5.2: jest-util "^26.5.2" string-length "^4.0.1" -jest-worker@^26.5.0: +jest-worker@^26.3.0, jest-worker@^26.5.0: version "26.5.0" resolved "https://registry.npm.taobao.org/jest-worker/download/jest-worker-26.5.0.tgz?cache=0&sync_timestamp=1601890194081&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-worker%2Fdownload%2Fjest-worker-26.5.0.tgz#87deee86dbbc5f98d9919e0dadf2c40e3152fa30" integrity sha1-h97uhtu8X5jZkZ4NrfLEDjFS+jA= @@ -6371,14 +6351,14 @@ jest-worker@^26.5.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jest@^26.5.3: - version "26.5.3" - resolved "https://registry.yarnpkg.com/jest/-/jest-26.5.3.tgz#5e7a322d16f558dc565ca97639e85993ef5affe6" - integrity sha512-uJi3FuVSLmkZrWvaDyaVTZGLL8WcfynbRnFXyAHuEtYiSZ+ijDDIMOw1ytmftK+y/+OdAtsG9QrtbF7WIBmOyA== +jest@^26.4.2: + version "26.5.2" + resolved "https://registry.npm.taobao.org/jest/download/jest-26.5.2.tgz?cache=0&sync_timestamp=1601981701772&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest%2Fdownload%2Fjest-26.5.2.tgz#c6791642b331fe7abd2f993b0a74aa546f7be0fb" + integrity sha1-xnkWQrMx/nq9L5k7CnSqVG974Ps= dependencies: - "@jest/core" "^26.5.3" + "@jest/core" "^26.5.2" import-local "^3.0.2" - jest-cli "^26.5.3" + jest-cli "^26.5.2" jpeg-autorotate@^5.0.3: version "5.0.3" @@ -6569,14 +6549,6 @@ jsx-ast-utils@^2.4.1: array-includes "^3.1.1" object.assign "^4.1.0" -"jsx-ast-utils@^2.4.1 || ^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.0.0.tgz#0f49d5093bafa4b45d3fe02147d8b40ffc6c7438" - integrity sha512-sPuicm6EPKYI/UnWpOatvg4pI50qaBo4dSOMGUPutmJ26ttedFKXr0It0XXPk4HKnQ/1X0st4eSS2w2jhFk9Ow== - dependencies: - array-includes "^3.1.1" - object.assign "^4.1.1" - keycode@^2.1.7: version "2.2.0" resolved "https://registry.npm.taobao.org/keycode/download/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04" @@ -6597,10 +6569,10 @@ kleur@^3.0.3: resolved "https://registry.npm.taobao.org/kleur/download/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha1-p5yezIbuHOP6YgbRIWxQHxR/wH4= -klona@^2.0.4: +klona@^2.0.3: version "2.0.4" - resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" - integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== + resolved "https://registry.npm.taobao.org/klona/download/klona-2.0.4.tgz?cache=0&sync_timestamp=1600226733470&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fklona%2Fdownload%2Fklona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" + integrity sha1-e7Hjr/sMuGJFR+9+j2cI6i4538A= knot.js@^1.1.5: version "1.1.5" @@ -6990,10 +6962,10 @@ min-indent@^1.0.0: resolved "https://registry.npm.taobao.org/min-indent/download/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha1-pj9oFnOzBXH76LwlaGrnRu76mGk= -mini-css-extract-plugin@^0.11.3: +mini-css-extract-plugin@^0.11.0: version "0.11.3" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz#15b0910a7f32e62ffde4a7430cfefbd700724ea6" - integrity sha512-n9BA8LonkOkW1/zn+IbLPQmovsL0wMb9yx75fMJQZf2X1Zoec9yTZtyMePcyu19wPkmFbzZZA6fLTotpFhQsOA== + resolved "https://registry.npm.taobao.org/mini-css-extract-plugin/download/mini-css-extract-plugin-0.11.3.tgz#15b0910a7f32e62ffde4a7430cfefbd700724ea6" + integrity sha1-FbCRCn8y5i/95KdDDP771wByTqY= dependencies: loader-utils "^1.1.0" normalize-url "1.9.1" @@ -9393,21 +9365,21 @@ sass-lint@^1.13.1: path-is-absolute "^1.0.0" util "^0.10.3" -sass-loader@^10.0.3: - version "10.0.3" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.0.3.tgz#9e2f1bfdd6355f2adde4e4835d838b020bf800b0" - integrity sha512-W4+FV5oUdYy0PnC11ZoPrcAexODgDCa3ngxoy5X5qBhZYoPz9FPjb6Oox8Aa0ZYEyx34k8AQfOVuvqefOSAAUQ== +sass-loader@^10.0.2: + version "10.0.2" + resolved "https://registry.npm.taobao.org/sass-loader/download/sass-loader-10.0.2.tgz#c7b73010848b264792dd45372eea0b87cba4401e" + integrity sha1-x7cwEISLJkeS3UU3LuoLh8ukQB4= dependencies: - klona "^2.0.4" + klona "^2.0.3" loader-utils "^2.0.0" neo-async "^2.6.2" - schema-utils "^3.0.0" + schema-utils "^2.7.1" semver "^7.3.2" -sass@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.27.0.tgz#0657ff674206b95ec20dc638a93e179c78f6ada2" - integrity sha512-0gcrER56OkzotK/GGwgg4fPrKuiFlPNitO7eUJ18Bs+/NBlofJfMxmxqpqJxjae9vu0Wq8TZzrSyxZal00WDig== +sass@^1.26.11: + version "1.26.12" + resolved "https://registry.npm.taobao.org/sass/download/sass-1.26.12.tgz?cache=0&sync_timestamp=1602008185216&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsass%2Fdownload%2Fsass-1.26.12.tgz#79eddaa1773fff32ccf19e00d1ce380fc2afc7d0" + integrity sha1-ee3aoXc//zLM8Z4A0c44D8Kvx9A= dependencies: chokidar ">=2.0.0 <4.0.0" @@ -9440,7 +9412,7 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^2.2.0, schema-utils@^2.6.5, schema-utils@^2.7.1: +schema-utils@^2.2.0, schema-utils@^2.6.5, schema-utils@^2.7.0, schema-utils@^2.7.1: version "2.7.1" resolved "https://registry.npm.taobao.org/schema-utils/download/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" integrity sha1-HKTzLRskxZDCA7jnpQvw6kzTlNc= @@ -9449,15 +9421,6 @@ schema-utils@^2.2.0, schema-utils@^2.6.5, schema-utils@^2.7.1: ajv "^6.12.4" ajv-keywords "^3.5.2" -schema-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef" - integrity sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA== - dependencies: - "@types/json-schema" "^7.0.6" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - scroll-behavior@^0.9.1: version "0.9.12" resolved "https://registry.npm.taobao.org/scroll-behavior/download/scroll-behavior-0.9.12.tgz#1c22d273ec4ce6cd4714a443fead50227da9424c" @@ -10306,19 +10269,19 @@ terser-webpack-plugin@^1.4.3: webpack-sources "^1.4.0" worker-farm "^1.7.0" -terser-webpack-plugin@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.3.tgz#28daef4a83bd17c1db0297070adc07fc8cfc6a9a" - integrity sha512-jTgXh40RnvOrLQNgIkwEKnQ8rmHjHK4u+6UBEi+W+FPmvb+uo+chJXntKe7/3lW5mNysgSWD60KyesnhW8D6MQ== +terser-webpack-plugin@^4.2.2: + version "4.2.2" + resolved "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-4.2.2.tgz?cache=0&sync_timestamp=1600531979075&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-4.2.2.tgz#d86200c700053bba637913fe4310ba1bdeb5568e" + integrity sha1-2GIAxwAFO7pjeRP+QxC6G961Vo4= dependencies: cacache "^15.0.5" find-cache-dir "^3.3.1" - jest-worker "^26.5.0" + jest-worker "^26.3.0" p-limit "^3.0.2" - schema-utils "^3.0.0" + schema-utils "^2.7.1" serialize-javascript "^5.0.1" source-map "^0.6.1" - terser "^5.3.4" + terser "^5.3.2" webpack-sources "^1.4.3" terser@^4.1.2: @@ -10330,10 +10293,10 @@ terser@^4.1.2: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.3.4: +terser@^5.3.2: version "5.3.4" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.4.tgz#e510e05f86e0bd87f01835c3238839193f77a60c" - integrity sha512-dxuB8KQo8Gt6OVOeLg/rxfcxdNZI/V1G6ze1czFUzPeCFWZRtvZMgSzlZZ5OYBZ4HoG607F6pFPNLekJyV+yVw== + resolved "https://registry.npm.taobao.org/terser/download/terser-5.3.4.tgz#e510e05f86e0bd87f01835c3238839193f77a60c" + integrity sha1-5RDgX4bgvYfwGDXDI4g5GT93pgw= dependencies: commander "^2.20.0" source-map "~0.7.2" @@ -10816,10 +10779,10 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1: resolved "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" integrity sha1-VLw83UMxe8qR413K8wWxpyN950U= -v8-to-istanbul@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz#7ef0e32faa10f841fe4c1b0f8de96ed067c0be1e" - integrity sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w== +v8-to-istanbul@^5.0.1: + version "5.0.1" + resolved "https://registry.npm.taobao.org/v8-to-istanbul/download/v8-to-istanbul-5.0.1.tgz#0608f5b49a481458625edb058488607f25498ba5" + integrity sha1-Bgj1tJpIFFhiXtsFhIhgfyVJi6U= dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0"