Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ME3をv2.1.2に追従。 #6

Merged
merged 69 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a434d9c
Remove period from the version number (#6039)
zunda Dec 15, 2017
f38e6a1
Add Slovak translation (#6052)
petzah Dec 17, 2017
e522934
Update Korean translation (#6050)
tribela Dec 20, 2017
c11a52d
Replace <code> to <kbd> in KeyboardShortcuts component (#6049)
Dec 20, 2017
81d29e4
Rename settingKey in setting_toggle to settingPath (#6046)
akihikodaki Dec 20, 2017
6eb6026
Display deleted users' role as “Suspended” (#6080)
ClearlyClaire Dec 22, 2017
cea98e0
Reduce the number of synchronous resolves when posting toots (#6075)
ClearlyClaire Dec 22, 2017
9592b5e
enforce LOCAL_HTTPS=true in production (#6061)
nightpool Dec 22, 2017
8528fd8
Move dropdown transform origin to top edge (#6091)
cpsdqs Dec 23, 2017
0819567
removed references to hideOnMobile in column_link and getting_started…
chriswmartin Dec 24, 2017
35fdf56
Refactor web_push_subscription (#6047)
akihikodaki Dec 24, 2017
a8eb0bf
Reduce motion for boost animation (#5871)
nolanlawson Dec 24, 2017
7e6214b
Add validation for onMuteNotifications (#6092)
Dec 24, 2017
cafe27f
Add rake task to check and purge accounts that are missing in origin …
Gargron Dec 24, 2017
43c37a4
Add supported Node.js version to package.json (#6096)
ykzts Dec 25, 2017
a3b3693
Additional prop name change. (#6098)
MitarashiDango Dec 25, 2017
1e5d1fa
Add mute, block, conversation mute actions to detailed status dropdow…
chriswmartin Dec 25, 2017
1494509
more faster index on notifications table (#6108)
takayamaki Dec 26, 2017
127bfda
add ruby-progressbar to gemfile (fixes #6110) (#6111)
beatrix-bitrot Dec 26, 2017
e0ef7f9
Fix XML oEmbed support discovery (#6104)
akihikodaki Dec 27, 2017
65f30f6
Move the mastodon on Getting Started column to drawer column (#6109)
akihikodaki Dec 27, 2017
868568d
Make host_meta/webfinger replies cacheable (fixes #6100) (#6101)
ClearlyClaire Dec 27, 2017
511c6f9
bug fix (WebPush does not work) (#6120)
MitarashiDango Dec 28, 2017
38fc1b4
Add more instance stats APIs (#6125)
Gargron Dec 29, 2017
a56c474
keep the same filters and page when doing custom emojo stuff (fixes #…
beatrix-bitrot Dec 30, 2017
f4b80e6
Translate Korean (#6131)
tribela Dec 30, 2017
7d376e4
Adding Serbian translation (#6133)
stalker314314 Dec 31, 2017
2c1ed5f
Show mastodon on modal (#6129)
akihikodaki Jan 2, 2018
764f876
Use const instead of let for constant (#6106)
akihikodaki Jan 2, 2018
21b9da6
Adding Serbian latin translations (#6146)
stalker314314 Jan 2, 2018
ce854ed
delete X-UA-Compatible (#6068)
Otakan951 Jan 2, 2018
3ba7cde
Rename key to path in actions and reducers for settings (#6105)
akihikodaki Jan 2, 2018
1419f65
Fix stats expiring too quickly because of variable mistake (#6155)
Gargron Jan 2, 2018
b6af881
Display a warning when composing unlisted toots with something lookin…
ClearlyClaire Jan 2, 2018
04ecf44
Add confirmation step for email changes (#6071)
pfigel Jan 2, 2018
94230fe
Fix newlines-to-spaces functionality (#6158)
noiob Jan 2, 2018
d60fd87
Don't leave behind husk of remotely-deleted profile (#6159)
Gargron Jan 2, 2018
d319b3d
Update moved-to property when it's removed too (#6160)
Gargron Jan 2, 2018
545095b
[!] Sanitize incoming classlist properly (#6162)
puckipedia Jan 3, 2018
2471796
Set background to the navigation of Getting Started column (#6163)
akihikodaki Jan 3, 2018
99f962b
Allow HTTP caching of json view of public statuses (#6115)
ClearlyClaire Jan 3, 2018
1001922
Add Japanese translations #5997, #6003, #6004, #6071, #6099, #6125 an…
ykzts Jan 3, 2018
53d99eb
i18n: Update Polish translation (#6168)
Jan 3, 2018
161c72d
Allow to dereference Follow object for ActivityPub (#5772)
akihikodaki Jan 3, 2018
a8b5112
Don't normalize URLs in toots (#6134)
ClearlyClaire Jan 3, 2018
d907d43
l10n OC language (#6169)
Quenty31 Jan 3, 2018
c10f4bd
Cache JSON of immutable ActivityPub representations (#6171)
Gargron Jan 4, 2018
ff924f9
Fix OpenSSL dependency in ostatus2 (#6174)
Gargron Jan 4, 2018
02e3e1e
Fix nil error in log_target_from_history helper (#6173)
Gargron Jan 4, 2018
256c2b1
Rearrange items in Getting Started navigation (#6126)
akihikodaki Jan 4, 2018
7d4f4f9
Fix FetchAtomService not finding alternatives if there's a Link heade…
Gargron Jan 4, 2018
89daeb4
Improve Traditional Chinese translation (#6166)
muan Jan 4, 2018
3bee099
Make sure private toots remain private and do not end up in HTTP cach…
ClearlyClaire Jan 4, 2018
02ba03d
Send one Delete of Actor in ActivityPub when account is suspended (#6…
Gargron Jan 4, 2018
c61dd91
i18n: Update Polish translation (#6176)
Jan 4, 2018
3c18964
Fallback default thumbnail in instance status API (#6177)
ykzts Jan 4, 2018
7571c37
Bump version to 2.1.1 (#6164)
Gargron Jan 4, 2018
7347d4f
Use disable_ddl_transaction! to prevent warnings on migration (#6183)
unarist Jan 4, 2018
49e296e
Fix overflowing audit logs (#6184)
lynlynlynx Jan 4, 2018
5ec25ff
Fix email confirmation link not updating email (#6187)
pfigel Jan 4, 2018
d872902
Small translation fixes for Serbian (and sr@Latn too) (#6188)
stalker314314 Jan 4, 2018
9a61b0e
Fix RFC 5646 Regular Expression (#6190)
ykzts Jan 5, 2018
e9822a4
Bump version to 2.1.2
Gargron Jan 5, 2018
06636c6
l10n Occitan language: mailer update (#6193)
Quenty31 Jan 5, 2018
8d51ce4
Fix enforce HTTPS in production. (#6180)
Jan 5, 2018
95bd85d
Represent numbers by strings in instance activity API (#6198)
TheKinrar Jan 5, 2018
a594139
When fetching an ActivityPub-enabled status, do not re-request it as …
ClearlyClaire Jan 5, 2018
10f6793
Fix PuSH workers (#6200)
ClearlyClaire Jan 5, 2018
22ef09a
fixup! check-v2.1.2
GenbuHase Jan 8, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ DB_PASS=
DB_PORT=5432

# Federation
# Note: Changing LOCAL_DOMAIN or LOCAL_HTTPS at a later time will cause unwanted side effects.
# Note: Changing LOCAL_DOMAIN at a later time will cause unwanted side effects, including breaking all existing federation.
# LOCAL_DOMAIN should *NOT* contain the protocol part of the domain e.g https://example.com.
LOCAL_DOMAIN=example.com
LOCAL_HTTPS=true

# Changing LOCAL_HTTPS in production is no longer supported. (Mastodon will always serve https:// links)

# Use this only if you need to run mastodon on a different domain than the one used for federation.
# You can read more about this option on https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Serving_a_different_domain.md
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gem 'browser'
gem 'charlock_holmes', '~> 0.7.5'
gem 'iso-639'
gem 'cld3', '~> 3.2.0'
gem 'devise', '~> 4.2'
gem 'devise', '~> 4.3'
gem 'devise-two-factor', '~> 3.0'
gem 'doorkeeper', '~> 4.2'
gem 'fast_blank', '~> 1.0'
Expand Down Expand Up @@ -58,6 +58,7 @@ gem 'redis', '~> 3.3', require: ['redis', 'redis/connection/hiredis']
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
gem 'rqrcode', '~> 0.10'
gem 'ruby-oembed', '~> 0.12', require: 'oembed'
gem 'ruby-progressbar', '~> 1.4'
gem 'sanitize', '~> 4.4'
gem 'sidekiq', '~> 5.0'
gem 'sidekiq-scheduler', '~> 2.1'
Expand Down
9 changes: 4 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,11 @@ GEM
sidekiq (>= 3.5.0)
statsd-ruby (~> 1.2.0)
oj (3.3.9)
openssl (2.0.6)
orm_adapter (0.5.0)
ostatus2 (2.0.1)
ostatus2 (2.0.2)
addressable (~> 2.4)
http (~> 2.0)
nokogiri (~> 1.6)
openssl (~> 2.0)
ox (2.8.2)
paperclip (5.1.0)
activemodel (>= 4.2.0)
Expand Down Expand Up @@ -561,7 +559,7 @@ DEPENDENCIES
charlock_holmes (~> 0.7.5)
cld3 (~> 3.2.0)
climate_control (~> 0.2)
devise (~> 4.2)
devise (~> 4.3)
devise-two-factor (~> 3.0)
doorkeeper (~> 4.2)
dotenv-rails (~> 2.2)
Expand Down Expand Up @@ -621,6 +619,7 @@ DEPENDENCIES
rspec-sidekiq (~> 3.0)
rubocop
ruby-oembed (~> 0.12)
ruby-progressbar (~> 1.4)
sanitize (~> 4.4)
scss_lint (~> 0.55)
sidekiq (~> 5.0)
Expand All @@ -643,4 +642,4 @@ RUBY VERSION
ruby 2.4.2p198

BUNDLED WITH
1.16.0
1.16.1
12 changes: 7 additions & 5 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

class AccountsController < ApplicationController
include AccountControllerConcern
include SignatureVerification

before_action :set_cache_headers

def show
respond_to do |format|
Expand All @@ -26,10 +27,11 @@ def show
end

format.json do
render json: @account,
serializer: ActivityPub::ActorSerializer,
adapter: ActivityPub::Adapter,
content_type: 'application/activity+json'
skip_session!

render_cached_json(['activitypub', 'actor', @account.cache_key], content_type: 'application/activity+json') do
ActiveModelSerializers::SerializableResource.new(@account, serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter)
end
end
end
end
Expand Down
22 changes: 22 additions & 0 deletions app/controllers/activitypub/follows_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

class ActivityPub::FollowsController < Api::BaseController
include SignatureVerification

def show
render json: follow_request,
serializer: ActivityPub::FollowSerializer,
adapter: ActivityPub::Adapter,
content_type: 'application/activity+json'
end

private

def follow_request
FollowRequest.includes(:account).references(:account).find_by!(
id: params.require(:id),
accounts: { domain: nil, username: params.require(:account_username) },
target_account: signed_request_account
)
end
end
24 changes: 17 additions & 7 deletions app/controllers/admin/custom_emojis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Admin
class CustomEmojisController < BaseController
before_action :set_custom_emoji, except: [:index, :new, :create]
before_action :set_filter_params

def index
authorize :custom_emoji, :index?
Expand Down Expand Up @@ -32,23 +33,26 @@ def update

if @custom_emoji.update(resource_params)
log_action :update, @custom_emoji
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.updated_msg')
flash[:notice] = I18n.t('admin.custom_emojis.updated_msg')
else
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.update_failed_msg')
flash[:alert] = I18n.t('admin.custom_emojis.update_failed_msg')
end
redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params)
end

def destroy
authorize @custom_emoji, :destroy?
@custom_emoji.destroy!
log_action :destroy, @custom_emoji
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.destroyed_msg')
flash[:notice] = I18n.t('admin.custom_emojis.destroyed_msg')
redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params)
end

def copy
authorize @custom_emoji, :copy?

emoji = CustomEmoji.find_or_initialize_by(domain: nil, shortcode: @custom_emoji.shortcode)
emoji = CustomEmoji.find_or_initialize_by(domain: nil,
shortcode: @custom_emoji.shortcode)
emoji.image = @custom_emoji.image

if emoji.save
Expand All @@ -58,21 +62,23 @@ def copy
flash[:alert] = I18n.t('admin.custom_emojis.copy_failed_msg')
end

redirect_to admin_custom_emojis_path(page: params[:page])
redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params)
end

def enable
authorize @custom_emoji, :enable?
@custom_emoji.update!(disabled: false)
log_action :enable, @custom_emoji
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.enabled_msg')
flash[:notice] = I18n.t('admin.custom_emojis.enabled_msg')
redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params)
end

def disable
authorize @custom_emoji, :disable?
@custom_emoji.update!(disabled: true)
log_action :disable, @custom_emoji
redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.disabled_msg')
flash[:notice] = I18n.t('admin.custom_emojis.disabled_msg')
redirect_to admin_custom_emojis_path(page: params[:page], **@filter_params)
end

private
Expand All @@ -81,6 +87,10 @@ def set_custom_emoji
@custom_emoji = CustomEmoji.find(params[:id])
end

def set_filter_params
@filter_params = filter_params.to_hash.symbolize_keys
end

def resource_params
params.require(:custom_emoji).permit(:shortcode, :image, :visible_in_picker)
end
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ class SettingsController < BaseController
bootstrap_timeline_accounts
thumbnail
min_invite_role
activity_api_enabled
peers_api_enabled
).freeze

BOOLEAN_SETTINGS = %w(
open_registrations
open_deletion
timeline_preview
show_staff_badge
activity_api_enabled
peers_api_enabled
).freeze

UPLOAD_SETTINGS = %w(
Expand Down
36 changes: 36 additions & 0 deletions app/controllers/api/v1/instances/activity_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

class Api::V1::Instances::ActivityController < Api::BaseController
before_action :require_enabled_api!

respond_to :json

def show
render_cached_json('api:v1:instances:activity:show', expires_in: 1.day) { activity }
end

private

def activity
weeks = []

12.times do |i|
day = i.weeks.ago.to_date
week_id = day.cweek
week = Date.commercial(day.cwyear, week_id)

weeks << {
week: week.to_time.to_i.to_s,
statuses: Redis.current.get("activity:statuses:local:#{week_id}") || '0',
logins: Redis.current.pfcount("activity:logins:#{week_id}").to_s,
registrations: Redis.current.get("activity:accounts:local:#{week_id}") || '0',
}
end

weeks
end

def require_enabled_api!
head 404 unless Setting.activity_api_enabled
end
end
17 changes: 17 additions & 0 deletions app/controllers/api/v1/instances/peers_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

class Api::V1::Instances::PeersController < Api::BaseController
before_action :require_enabled_api!

respond_to :json

def index
render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains }
end

private

def require_enabled_api!
head 404 unless Setting.peers_api_enabled
end
end
22 changes: 22 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,26 @@ def respond_with_error(code)
end
end
end

def render_cached_json(cache_key, **options)
options[:expires_in] ||= 3.minutes
options[:public] ||= true
cache_key = cache_key.join(':') if cache_key.is_a?(Enumerable)
content_type = options.delete(:content_type) || 'application/json'

data = Rails.cache.fetch(cache_key, { raw: true }.merge(options)) do
yield.to_json
end

expires_in options[:expires_in], public: options[:public]
render json: data, content_type: content_type
end

def set_cache_headers
response.headers['Vary'] = 'Accept'
end

def skip_session!
request.session_options[:skip] = true
end
end
6 changes: 0 additions & 6 deletions app/controllers/auth/confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

class Auth::ConfirmationsController < Devise::ConfirmationsController
layout 'auth'

def show
super do |user|
BootstrapTimelineWorker.perform_async(user.account_id) if user.errors.empty?
end
end
end
4 changes: 4 additions & 0 deletions app/controllers/auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ def after_inactive_sign_up_path_for(_resource)
new_user_session_path
end

def after_update_path_for(_resource)
edit_user_registration_path
end

def check_enabled_registrations
redirect_to root_path if single_user_mode? || !allowed_registrations?
end
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/authorize_follows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class AuthorizeFollowsController < ApplicationController
layout 'modal'

before_action :authenticate_user!
before_action :set_body_classes

def show
@account = located_account || render(:error)
Expand Down Expand Up @@ -58,4 +59,8 @@ def acct_without_prefix
def acct_params
params.fetch(:acct, '')
end

def set_body_classes
@body_classes = 'modal-layout'
end
end
1 change: 1 addition & 0 deletions app/controllers/concerns/user_tracking_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def set_user_activity

# Mark as signed-in today
current_user.update_tracked_fields!(request)
ActivityTracker.record('activity:logins', current_user.id)

# Regenerate feed if needed
regenerate_feed! if user_needs_feed_update?
Expand Down
10 changes: 6 additions & 4 deletions app/controllers/emojis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

class EmojisController < ApplicationController
before_action :set_emoji
before_action :set_cache_headers

def show
respond_to do |format|
format.json do
render json: @emoji,
serializer: ActivityPub::EmojiSerializer,
adapter: ActivityPub::Adapter,
content_type: 'application/activity+json'
skip_session!

render_cached_json(['activitypub', 'emoji', @emoji.cache_key], content_type: 'application/activity+json') do
ActiveModelSerializers::SerializableResource.new(@emoji, serializer: ActivityPub::EmojiSerializer, adapter: ActivityPub::Adapter)
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/remote_follow_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ def set_account
def suspended_account?
@account.suspended?
end

def set_body_classes
@body_classes = 'modal-layout'
end
end
2 changes: 1 addition & 1 deletion app/controllers/shares_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def initial_state_params
end

def set_body_classes
@body_classes = 'compose-standalone'
@body_classes = 'modal-layout compose-standalone'
end
end
Loading