diff --git a/app/lib/activitypub/activity/announce.rb b/app/lib/activitypub/activity/announce.rb index b84098933..abf2b9b80 100644 --- a/app/lib/activitypub/activity/announce.rb +++ b/app/lib/activitypub/activity/announce.rb @@ -5,7 +5,7 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity original_status = status_from_uri(object_uri) original_status ||= fetch_remote_original_status - return if original_status.nil? || delete_arrived_first?(@json['id']) + return if original_status.nil? || delete_arrived_first?(@json['id']) || !announceable?(original_status) status = Status.find_by(account: @account, reblog: original_status) @@ -33,4 +33,8 @@ class ActivityPub::Activity::Announce < ActivityPub::Activity ::FetchRemoteStatusService.new.call(@object['url']) end end + + def announceable?(status) + status.public_visibility? || status.unlisted_visibility? + end end diff --git a/app/lib/ostatus/activity/creation.rb b/app/lib/ostatus/activity/creation.rb index f210e134a..b38407cd3 100644 --- a/app/lib/ostatus/activity/creation.rb +++ b/app/lib/ostatus/activity/creation.rb @@ -26,6 +26,9 @@ class OStatus::Activity::Creation < OStatus::Activity::Base cached_reblog = reblog status = nil + # Skip if the reblogged status is not public + return if cached_reblog && !(cached_reblog.public_visibility? || cached_reblog.unlisted_visibility?) + media_attachments = save_media ApplicationRecord.transaction do diff --git a/app/views/stream_entries/show.html.haml b/app/views/stream_entries/show.html.haml index b52334a28..cf6671e67 100644 --- a/app/views/stream_entries/show.html.haml +++ b/app/views/stream_entries/show.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - = t('statuses.title', name: display_name(@account), quote: truncate(@stream_entry.activity.text, length: 50, omission: '…')) + = t('statuses.title', name: display_name(@account), quote: truncate(@stream_entry.activity.spoiler_text.presence || @stream_entry.activity.text, length: 50, omission: '…')) - content_for :header_tags do - if @account.user&.setting_noindex diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index b38fb302b..b35452f04 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -53,7 +53,7 @@ class Rack::Attack req.ip if req.api_request? end - throttle('protected_paths', limit: 5, period: 5.minutes) do |req| + throttle('protected_paths', limit: 25, period: 5.minutes) do |req| req.ip if req.post? && req.path =~ PROTECTED_PATHS_REGEX end diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 5eb7f256a..697a1aa27 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -39,6 +39,7 @@ ru: followers: Подписчики following: Подписан(а) media: Медиаконтент + moved_html: "%{name} переехал(а) на %{new_profile_link}:" nothing_here: Здесь ничего нет! people_followed_by: Люди, на которых подписан(а) %{name} people_who_follow: Подписчики %{name} @@ -59,9 +60,13 @@ ru: destroyed_msg: Заметка модератора успешно удалена! accounts: are_you_sure: Вы уверены? + by_domain: Домен confirm: Подтвердить confirmed: Подтверждено + demote: Разжаловать + disable: Отключить disable_two_factor_authentication: Отключить 2FA + disabled: Отключено display_name: Отображаемое имя domain: Домен edit: Изменить @@ -77,7 +82,9 @@ ru: local: Локальные remote: Удаленные title: Размещение + login_status: Статус аккаунта media_attachments: Мультимедийные вложения + memorialize: Превратить в Памятник moderation: all: Все silenced: Заглушенные @@ -94,6 +101,7 @@ ru: outbox_url: URL исходящих perform_full_suspension: Полная блокировка profile_url: URL профиля + promote: Повысить protocol: Протокол public: Публичный push_subscription_expires: Подписка PuSH истекает @@ -101,6 +109,12 @@ ru: reset: Сбросить reset_password: Сбросить пароль resubscribe: Переподписаться + role: Разрешения + roles: + admin: Администратор + moderator: Модератор + staff: Персонал + user: Пользователь salmon_url: Salmon URL search: Поиск shared_inbox_url: URL общих входящих @@ -117,6 +131,32 @@ ru: unsubscribe: Отписаться username: Имя пользователя web: WWW + action_logs: + actions: + confirm_user: "%{name} подтвердил(а) e-mail адрес пользователя %{target}" + create_custom_emoji: "%{name} загрузил(а) новый эмодзи %{target}" + create_domain_block: "%{name} заблокировал(а) домен %{target}" + create_email_domain_block: "%{name} добавил(а) e-mail домен %{target} в чёрный список" + demote_user: "%{name} разжаловал(а) пользователя %{target}" + destroy_domain_block: "%{name} разблокировал(а) домен %{target}" + destroy_email_domain_block: "%{name} добавил(а) e-mail домен %{target} в белый список" + destroy_status: "%{name} удалил(а) статус пользователя %{target}" + disable_2fa_user: "%{name} отключил(а) двухэтапную авторизацию у пользователя %{target}" + disable_custom_emoji: "%{name} отключил(а) эмодзи %{target}" + disable_user: "%{name} запретил(а) вход пользователя %{target}" + enable_custom_emoji: "%{name} включил(а) эмодзи %{target}" + enable_user: "%{name} включил(а) вход пользователя %{target}" + memorialize_account: "%{name} перевел(а) аккаунт пользователя %{target} в режим памятника" + promote_user: "%{name} повысил(а) пользователя %{target}" + reset_password_user: "%{name} сбросил(а) пароль пользователя %{target}" + resolve_report: "%{name} dismissed report %{target}" + silence_account: "%{name} заглушил(а) аккаунт %{target}" + suspend_account: "%{name} заморозил(а) аккаунт %{target}" + unsilence_account: "%{name} снял(а) глушение аккаунта %{target}" + unsuspend_account: "%{name} разморозил(а) аккаунт %{target}" + update_custom_emoji: "%{name} обновил(а) эмодзи %{target}" + update_status: "%{name} изменил(а) статус пользователя %{target}" + title: Журнал событий custom_emojis: copied_msg: Локальная копия эмодзи успешно создана copy: Скопироват @@ -130,11 +170,16 @@ ru: enable: Включить enabled_msg: Эмодзи успешно включено image_hint: PNG до 50KB + listed: В списке new: - title: Добавить новое эмодзи + title: Добавить новый эмодзи + overwrite: Заменить shortcode: Шорткод shortcode_hint: Как минимум 2 символа, только алфавитно-цифровые символы и подчеркивания title: Собственные эмодзи + unlisted: Не в списке + update_failed_msg: Невозможно обновить этот эмодзи + updated_msg: Эмодзи обновлён! upload: Загрузить domain_blocks: add_new: Добавить новую @@ -186,6 +231,13 @@ ru: reset: Сбросить search: Поиск title: Известные узлы + invites: + filter: + all: Все + available: Актуальные + expired: Истёкшие + title: Фильтр + title: Приглашения reports: action_taken_by: 'Действие предпринято:' are_you_sure: Вы уверены? @@ -199,6 +251,7 @@ ru: 'false': Показать мультимедийные вложения 'true': Скрыть мультимедийные вложения report: 'Жалоба #%{id}' + report_contents: Содержимое reported_account: Аккаунт нарушителя reported_by: Отправитель жалобы resolved: Разрешено @@ -210,12 +263,18 @@ ru: unresolved: Неразрешенные view: Просмотреть settings: + activity_api_enabled: + desc_html: Подсчёт количества локальных статусов, активных пользователей и новых регистраций на еженедельной основе + title: Публикация агрегированной статистики активности пользователей bootstrap_timeline_accounts: desc_html: Разделяйте имена пользователей запятыми. Сработает только для локальных незакрытых аккаунтов. По умолчанию включены все локальные администраторы. title: Подписки по умолчанию для новых пользователей contact_information: email: Введите публичный e-mail username: Введите имя пользователя + peers_api_enabled: + desc_html: Домены, которые были замечены этим узлом среди всей федерации + title: Публикация списка обнаруженных узлов registrations: closed_message: desc_html: Отображается на титульной странице, когда закрыта регистрация
Можно использовать HTML-теги @@ -223,9 +282,15 @@ ru: deletion: desc_html: Позволяет всем удалять собственные аккаунты title: Разрешить удаление аккаунтов + min_invite_role: + disabled: Никого + title: Разрешает приглашения от open: desc_html: Позволяет любому создавать аккаунт title: Открыть регистрацию + show_staff_badge: + desc_html: Показывать метку персонала на странице пользователя + title: Показывать метку персонала site_description: desc_html: Отображается в качестве параграфа на титульной странице и используется в качестве мета-тега.
Можно использовать HTML-теги, в особенности <a> и <em>. title: Описание сайта @@ -293,6 +358,8 @@ ru: invalid_reset_password_token: Токен сброса пароля неверен или устарел. Пожалуйста, запросите новый. login: Войти logout: Выйти + migrate_account: Перенести аккаунт + migrate_account_html: Если Вы хотите перенести этот аккаунт на другой, вы можете сделать это здесь. register: Зарегистрироваться resend_confirmation: Повторить отправку инструкции для подтверждения reset_password: Сбросить пароль @@ -374,12 +441,43 @@ ru: following: Подписки muting: Список глушения upload: Загрузить + in_memoriam_html: Памятник. + invites: + delete: Удалить + expired: Истекло + expires_in: + '1800': 30 минут + '21600': 6 часов + '3600': 1 час + '43200': 12 часов + '86400': 1 день + expires_in_prompt: Никогда + generate: Сгенерировать + max_uses: + one: 1 исп. + other: "%{count} исп." + max_uses_prompt: Без лимита + prompt: Генерируйте и делитесь ссылками с другими, чтобы предоставить им доступ к этому узлу. + table: + expires_at: Истекает + uses: Исп. + title: Пригласить людей landing_strip_html: "%{name} - пользователь на %{link_to_root_path}. Вы можете подписаться на него/нее и общаться с ним/ней, если у Вас есть аккаунт на любом узле общей сети." landing_strip_signup_html: Если у Вас его нет, вы можете зарегистрироваться здесь. + lists: + errors: + limit: Вы достигли максимального числа списков media_attachments: validations: images_and_video: Нельзя добавить видео к статусу с изображениями too_many: Нельзя добавить более 4 файлов + migrations: + acct: имя@домен нового аккаунта + currently_redirecting: 'Ваш профиль будет перенаправлен на:' + proceed: Сохранить + updated_msg: Настройки миграции Вашего аккаунта обновлены! + moderation: + title: Модерация notification_mailer: digest: body: 'Кратко о пропущенном Вами на %{instance} с Вашего последнего захода %{since}:' @@ -484,6 +582,8 @@ ru: windows: Windows windows_mobile: Windows Mobile windows_phone: Windows Phone + revoke: Завершить + revoke_success: Сессия завершена успешно title: Сессии settings: authorized_apps: Авторизованные приложения @@ -494,6 +594,7 @@ ru: export: Экспорт данных followers: Авторизованные подписчики import: Импорт + migrate: Перенос аккаунта notifications: Уведомления preferences: Настройки settings: Опции @@ -503,7 +604,7 @@ ru: open_in_web: Открыть в WWW over_character_limit: превышен лимит символов (%{max}) pin_errors: - limit: Слишком много закрепленных статусов + limit: Вы закрепили максимально возможное число статусов ownership: Нельзя закрепить чужой статус private: Нельзя закрепить непубличный статус reblog: Нельзя закрепить продвинутый статус @@ -517,10 +618,52 @@ ru: unlisted_long: Показывать всем, но не отображать в публичных лентах stream_entries: click_to_show: Показать + pinned: Закреплённое сообщение reblogged: продвинул(а) sensitive_content: Чувствительный контент terms: + body_html: | +

Privacy Policy

+

What information do we collect?

+

We collect information from you when you register on our site and gather data when you participate in the forum by reading, writing, and evaluating the content shared here.

+

When registering on our site, you may be asked to enter your name and e-mail address. You may, however, visit our site without registering. Your e-mail address will be verified by an email containing a unique link. If that link is visited, we know that you control the e-mail address.

+

When registered and posting, we record the IP address that the post originated from. We also may retain server logs which include the IP address of every request to our server.

+

What do we use your information for?

+

Any of the information we collect from you may be used in one of the following ways:

+ +

How do we protect your information?

+

We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information.

+

What is your data retention policy?

+

We will make a good faith effort to:

+ +

Do we use cookies?

+

Yes. Cookies are small files that a site or its service provider transfers to your computer's hard drive through your Web browser (if you allow). These cookies enable the site to recognize your browser and, if you have a registered account, associate it with your registered account.

+

We use cookies to understand and save your preferences for future visits and compile aggregate data about site traffic and site interaction so that we can offer better site experiences and tools in the future. We may contract with third-party service providers to assist us in better understanding our site visitors. These service providers are not permitted to use the information collected on our behalf except to help us conduct and improve our business.

+

Do we disclose any information to outside parties?

+

We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our site, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.

+

Third party links

+

Occasionally, at our discretion, we may include or offer third party products or services on our site. These third party sites have separate and independent privacy policies. We therefore have no responsibility or liability for the content and activities of these linked sites. Nonetheless, we seek to protect the integrity of our site and welcome any feedback about these sites.

+

Children's Online Privacy Protection Act Compliance

+

Our site, products and services are all directed to people who are at least 13 years old. If this server is in the USA, and you are under the age of 13, per the requirements of COPPA (Children's Online Privacy Protection Act) do not use this site.

+

Online Privacy Policy Only

+

This online privacy policy applies only to information collected through our site and not to information collected offline.

+ +

By using our site, you consent to our web site privacy policy.

+

Changes to our Privacy Policy

+

If we decide to change our privacy policy, we will post those changes on this page.

+

This document is CC-BY-SA. It was last updated May 31, 2013.

+

Originally adapted from the Discourse privacy policy.

title: Условия обслуживания и политика конфиденциальности %{instance} + themes: + default: Mastodon time: formats: default: "%b %d, %Y, %H:%M" diff --git a/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb b/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb new file mode 100644 index 000000000..401fc5e62 --- /dev/null +++ b/db/migrate/20180106000232_add_index_on_statuses_for_api_v1_accounts_account_id_statuses.rb @@ -0,0 +1,10 @@ +class AddIndexOnStatusesForApiV1AccountsAccountIdStatuses < ActiveRecord::Migration[5.1] + disable_ddl_transaction! + + def change + safety_assured do + add_index :statuses, [:account_id, :id, :visibility, :updated_at], order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_20180106 + end + remove_index :statuses, name: :index_statuses_on_account_id_id + end +end diff --git a/db/schema.rb b/db/schema.rb index b480c9c46..11ca12235 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: 20171226094803) do +ActiveRecord::Schema.define(version: 20180106000232) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -419,7 +419,7 @@ ActiveRecord::Schema.define(version: 20171226094803) do t.bigint "application_id" t.bigint "in_reply_to_account_id" t.boolean "local_only" - t.index ["account_id", "id"], name: "index_statuses_on_account_id_id" + t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20180106", order: { id: :desc } t.index ["conversation_id"], name: "index_statuses_on_conversation_id" t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id" t.index ["reblog_of_id", "account_id"], name: "index_statuses_on_reblog_of_id_and_account_id"