Change update check source to kmyblue origin
This commit is contained in:
parent
ee6186a197
commit
7696216cbd
7 changed files with 19 additions and 4 deletions
|
@ -46,6 +46,7 @@ class Form::AdminSettings
|
||||||
receive_other_servers_emoji_reaction
|
receive_other_servers_emoji_reaction
|
||||||
streaming_other_servers_emoji_reaction
|
streaming_other_servers_emoji_reaction
|
||||||
enable_emoji_reaction
|
enable_emoji_reaction
|
||||||
|
check_lts_version_only
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
INTEGER_KEYS = %i(
|
INTEGER_KEYS = %i(
|
||||||
|
@ -72,6 +73,7 @@ class Form::AdminSettings
|
||||||
receive_other_servers_emoji_reaction
|
receive_other_servers_emoji_reaction
|
||||||
streaming_other_servers_emoji_reaction
|
streaming_other_servers_emoji_reaction
|
||||||
enable_emoji_reaction
|
enable_emoji_reaction
|
||||||
|
check_lts_version_only
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
UPLOAD_KEYS = %i(
|
UPLOAD_KEYS = %i(
|
||||||
|
|
|
@ -27,11 +27,18 @@ class SoftwareUpdateCheckService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def api_url
|
def api_url
|
||||||
ENV.fetch('UPDATE_CHECK_URL', 'https://api.joinmastodon.org/update-check')
|
ENV.fetch('UPDATE_CHECK_URL', 'https://kmy.blue/update-check')
|
||||||
end
|
end
|
||||||
|
|
||||||
def version
|
def version
|
||||||
@version ||= Mastodon::Version.to_s.split('+')[0]
|
return @version if @version.present?
|
||||||
|
|
||||||
|
if ENV.fetch('UPDATE_CHECK_SOURCE', 'kmyblue') == 'kmyblue'
|
||||||
|
@version = "#{Mastodon::Version.kmyblue_major}.#{Mastodon::Version.kmyblue_minor}"
|
||||||
|
@version += '-lts' if Setting.check_lts_version_only
|
||||||
|
else
|
||||||
|
@version = Mastodon::Version.to_s.split('+')[0]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_update_notices!(update_notices)
|
def process_update_notices!(update_notices)
|
||||||
|
|
|
@ -55,6 +55,9 @@
|
||||||
.fields-group
|
.fields-group
|
||||||
= f.input :authorized_fetch, as: :boolean, wrapper: :with_label, label: t('admin.settings.security.authorized_fetch'), warning_hint: authorized_fetch_overridden? ? t('admin.settings.security.authorized_fetch_overridden_hint') : nil, hint: t('admin.settings.security.authorized_fetch_hint'), disabled: authorized_fetch_overridden?, recommended: authorized_fetch_overridden? ? :overridden : nil
|
= f.input :authorized_fetch, as: :boolean, wrapper: :with_label, label: t('admin.settings.security.authorized_fetch'), warning_hint: authorized_fetch_overridden? ? t('admin.settings.security.authorized_fetch_overridden_hint') : nil, hint: t('admin.settings.security.authorized_fetch_hint'), disabled: authorized_fetch_overridden?, recommended: authorized_fetch_overridden? ? :overridden : nil
|
||||||
|
|
||||||
|
.fields-group
|
||||||
|
= f.input :check_lts_version_only, as: :boolean, wrapper: :with_label, kmyblue: true, hint: false
|
||||||
|
|
||||||
%h4= t('admin.settings.discovery.follow_recommendations')
|
%h4= t('admin.settings.discovery.follow_recommendations')
|
||||||
|
|
||||||
.fields-group
|
.fields-group
|
||||||
|
|
|
@ -315,6 +315,7 @@ en:
|
||||||
activity_api_enabled: Publish aggregate statistics about user activity in the API
|
activity_api_enabled: Publish aggregate statistics about user activity in the API
|
||||||
backups_retention_period: User archive retention period
|
backups_retention_period: User archive retention period
|
||||||
bootstrap_timeline_accounts: Always recommend these accounts to new users
|
bootstrap_timeline_accounts: Always recommend these accounts to new users
|
||||||
|
check_lts_version_only: Check kmyblue LTS version only when update check
|
||||||
closed_registrations_message: Custom message when sign-ups are not available
|
closed_registrations_message: Custom message when sign-ups are not available
|
||||||
content_cache_retention_period: Content cache retention period
|
content_cache_retention_period: Content cache retention period
|
||||||
custom_css: Custom CSS
|
custom_css: Custom CSS
|
||||||
|
|
|
@ -330,6 +330,7 @@ ja:
|
||||||
activity_api_enabled: APIでユーザーアクティビティに関する集計統計を公開する
|
activity_api_enabled: APIでユーザーアクティビティに関する集計統計を公開する
|
||||||
backups_retention_period: ユーザーアーカイブの保持期間
|
backups_retention_period: ユーザーアーカイブの保持期間
|
||||||
bootstrap_timeline_accounts: おすすめユーザーに常に表示するアカウント
|
bootstrap_timeline_accounts: おすすめユーザーに常に表示するアカウント
|
||||||
|
check_lts_version_only: 更新チェックの時、LTSバージョンのみ確認する
|
||||||
closed_registrations_message: アカウント作成を停止している時のカスタムメッセージ
|
closed_registrations_message: アカウント作成を停止している時のカスタムメッセージ
|
||||||
content_cache_retention_period: コンテンツキャッシュの保持期間
|
content_cache_retention_period: コンテンツキャッシュの保持期間
|
||||||
custom_css: カスタムCSS
|
custom_css: カスタムCSS
|
||||||
|
|
|
@ -41,6 +41,7 @@ defaults: &defaults
|
||||||
receive_other_servers_emoji_reaction: false
|
receive_other_servers_emoji_reaction: false
|
||||||
streaming_other_servers_emoji_reaction: false
|
streaming_other_servers_emoji_reaction: false
|
||||||
enable_emoji_reaction: true
|
enable_emoji_reaction: true
|
||||||
|
check_lts_version_only: true
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe SoftwareUpdateCheckService, type: :service do
|
||||||
subject { described_class.new }
|
subject { described_class.new }
|
||||||
|
|
||||||
shared_examples 'when the feature is enabled' do
|
shared_examples 'when the feature is enabled' do
|
||||||
let(:full_update_check_url) { "#{update_check_url}?version=#{Mastodon::Version.to_s.split('+')[0]}" }
|
let(:full_update_check_url) { "#{update_check_url}?version=#{Mastodon::Version.kmyblue_major}.#{Mastodon::Version.kmyblue_minor}-lts" }
|
||||||
|
|
||||||
let(:devops_role) { Fabricate(:user_role, name: 'DevOps', permissions: UserRole::FLAGS[:view_devops]) }
|
let(:devops_role) { Fabricate(:user_role, name: 'DevOps', permissions: UserRole::FLAGS[:view_devops]) }
|
||||||
let(:owner_user) { Fabricate(:user, role: UserRole.find_by(name: 'Owner')) }
|
let(:owner_user) { Fabricate(:user, role: UserRole.find_by(name: 'Owner')) }
|
||||||
|
@ -139,7 +139,7 @@ RSpec.describe SoftwareUpdateCheckService, type: :service do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when using the default update checking API' do
|
context 'when using the default update checking API' do
|
||||||
let(:update_check_url) { 'https://api.joinmastodon.org/update-check' }
|
let(:update_check_url) { 'https://kmy.blue/update-check' }
|
||||||
|
|
||||||
it_behaves_like 'when the feature is enabled'
|
it_behaves_like 'when the feature is enabled'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue