Compare commits

...

4 commits

Author SHA1 Message Date
KMY(雪あすか)
ba21ed51fe
Merge pull request #594 from kmycode/kb-draft-11.0
Release: 11.0
2024-02-21 08:18:54 +09:00
KMY(雪あすか)
8a9a29cba1 Fix: 新規登録可能時間帯を空欄にすると、画面が表示できなくなる問題 (#603)
* Fix: 新規登録可能時間帯を空欄にすると、画面が表示できなくなる問題

* リファクタリング

* Fix test
2024-02-20 09:25:22 +09:00
KMY(雪あすか)
ad723b0cbd Change: ホワイトリストが空でも設定が有効であればアカウント作成を保留 (#601)
* Change: ホワイトリストが空でも設定が有効であればアカウント作成を保留

* Fix test
2024-02-19 09:21:28 +09:00
KMY
9d57a83555 Pumb version to 11.0 2024-02-18 14:33:10 +09:00
6 changed files with 18 additions and 17 deletions

View file

@ -32,20 +32,22 @@ module RegistrationLimitationHelper
end
def registrations_in_time?
start_hour = Setting.registrations_start_hour || 0
end_hour = Setting.registrations_end_hour || 24
secondary_start_hour = Setting.registrations_secondary_start_hour || 0
secondary_end_hour = Setting.registrations_secondary_end_hour || 0
start_hour = Setting.registrations_start_hour
end_hour = Setting.registrations_end_hour
secondary_start_hour = Setting.registrations_secondary_start_hour
secondary_end_hour = Setting.registrations_secondary_end_hour
start_hour = 0 unless start_hour.is_a?(Integer)
end_hour = 0 unless end_hour.is_a?(Integer)
secondary_start_hour = 0 unless secondary_start_hour.is_a?(Integer)
secondary_end_hour = 0 unless secondary_end_hour.is_a?(Integer)
return true if start_hour >= end_hour && secondary_start_hour >= secondary_end_hour
current_hour = Time.now.utc.hour
primary_permitted = false
primary_permitted = start_hour <= current_hour && current_hour < end_hour if start_hour < end_hour && end_hour.positive?
secondary_permitted = false
secondary_permitted = secondary_start_hour <= current_hour && current_hour < secondary_end_hour if secondary_start_hour < secondary_end_hour && secondary_end_hour.positive?
primary_permitted || secondary_permitted
(start_hour < end_hour && end_hour.positive? && current_hour.between?(start_hour, end_hour - 1)) ||
(secondary_start_hour < secondary_end_hour && secondary_end_hour.positive? && current_hour.between?(secondary_start_hour, secondary_end_hour - 1))
end
def reset_registration_limit_caches!

View file

@ -141,7 +141,6 @@ class ActivityPub::ProcessAccountService < BaseService
def blocking_new_account?
return false unless Setting.hold_remote_new_accounts
return false if permit_new_account_domains.blank?
permit_new_account_domains.exclude?(@domain)
end

View file

@ -661,7 +661,7 @@ en:
post_mentions_max: Mentions max for posts
post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (If the mentions include at least one person who is not a follower of yours)
remote_approval_list: List of remote accounts awaiting approval
remote_approval_hint: If you set one or more domains on the list of domains for which you want to automatically approve new users, newly recognized accounts on unspecified domains will be placed in suspend status. You can review that list and approve them if necessary. If none is specified, all remote accounts are approved immediately.
remote_approval_hint: Newly recognized accounts with unspecified domains will be placed in Suspended status. You can review that list and approve them if necessary. If this setting is not enabled, all remote accounts will be approved immediately.
stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する
stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります
test_error: Testing is returned any errors

View file

@ -654,7 +654,7 @@ ja:
post_mentions_max: 投稿に設定可能なメンションの最大数
post_stranger_mentions_max: 投稿に設定可能なメンションの最大数 (メンション先にフォロワー以外を1人でも含む場合)
remote_approval_list: 承認待ちのリモートアカウント一覧
remote_approval_hint: 新規ユーザーを自動承認するドメインリストに1つ以上のドメインを設定すると、指定されていないドメインで新しく認識されたアカウントはサスペンド状態になります。その一覧を確認し、必要であれば承認を行うことができます。何も指定しなかった場合、全てのリモートアカウントが即座に承認されます。
remote_approval_hint: 指定されていないドメインで新しく認識されたアカウントはサスペンド状態になります。その一覧を確認し、必要であれば承認を行うことができます。この設定が有効でない場合、全てのリモートアカウントが即座に承認されます。
stranger_mention_from_local_ng: フォローしていないアカウントへのメンションのNGワードを、ローカルユーザーによる投稿にも適用する
stranger_mention_from_local_ng_hint: サーバーの登録が承認制でない場合、あなたのサーバーにもスパムが入り込む可能性があります
test_error: NGワードのテストに失敗しました。正規表現のミスが含まれているかもしれません

View file

@ -14,8 +14,8 @@ module Mastodon
def kmyblue_flag
# 'LTS'
'dev'
# nil
# 'dev'
nil
end
def major

View file

@ -29,11 +29,11 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
Setting.permit_new_account_domains = permit_new_account_domains
end
it 'created account in a simple case' do
it 'creates pending account in a simple case' do
expect(subject).to_not be_nil
expect(subject.uri).to eq 'https://foo.test'
expect(subject.suspended?).to be false
expect(subject.remote_pending).to be false
expect(subject.suspended?).to be true
expect(subject.remote_pending).to be true
end
context 'when is blocked' do