]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Thu, 2 Apr 2020 18:32:00 +0000 (20:32 +0200)
committerThibaut Girka <thib@sitedethib.com>
Thu, 2 Apr 2020 18:32:00 +0000 (20:32 +0200)
Conflicts:
- `app/javascript/mastodon/features/compose/components/poll_form.js`:
  Upstream bumped poll option character limit, but we already had
  a higher one, kept ours.
- `app/validators/poll_validator.rb`:
  Upstream bumped poll option character limit, but we already had
  a higher one, kept ours.
- `config/initializers/content_security_policy.rb`:
  Upstream added a rule, the way we compute ours is different, but
  that added rule has been ported.
- `package.json`:
  No real conflict, dependency update. Performed the same update.
- `yarn.lock`:
  No real conflict, dependency update. Performed the same update.

12 files changed:
1  2 
Gemfile
Gemfile.lock
app/controllers/api/v1/statuses_controller.rb
app/javascript/mastodon/features/compose/components/poll_form.js
app/javascript/styles/mastodon/components.scss
app/workers/activitypub/distribute_poll_update_worker.rb
app/workers/scheduler/feed_cleanup_scheduler.rb
config/initializers/content_security_policy.rb
config/locales/en.yml
config/routes.rb
package.json
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
index 269a7d1c9adf3baa82596c2bc239a85b23b60bef,654e2e8cdefc0cc6ae5f0688acc716490ec1183e..d1e6701e23c7e59b76682164432b4a0932673e9a
@@@ -2,44 -2,43 +2,45 @@@
  # For further information see the following documentation
  # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  
 -def host_to_url(str)
 -  "http#{Rails.configuration.x.use_https ? 's' : ''}://#{str}" unless str.blank?
 -end
 -
 -base_host = Rails.configuration.x.web_domain
 -
 -assets_host   = Rails.configuration.action_controller.asset_host
 -assets_host ||= host_to_url(base_host)
 -
 -media_host   = host_to_url(ENV['S3_ALIAS_HOST'])
 -media_host ||= host_to_url(ENV['S3_CLOUDFRONT_HOST'])
 -media_host ||= host_to_url(ENV['S3_HOSTNAME']) if ENV['S3_ENABLED'] == 'true'
 -media_host ||= assets_host
 -
 -Rails.application.config.content_security_policy do |p|
 -  p.base_uri        :none
 -  p.default_src     :none
 -  p.frame_ancestors :none
 -  p.font_src        :self, assets_host
 -  p.img_src         :self, :https, :data, :blob, assets_host
 -  p.style_src       :self, :unsafe_inline, assets_host
 -  p.media_src       :self, :https, :data, assets_host
 -  p.frame_src       :self, :https
 -  p.manifest_src    :self, assets_host
 -
 -  if Rails.env.development?
 -    webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{Webpacker.dev_server.host_with_port}" }
 -
 -    p.connect_src :self, :data, :blob, assets_host, media_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls
 -    p.script_src  :self, :unsafe_inline, :unsafe_eval, assets_host
 -    p.child_src   :self, :blob, assets_host
 -    p.worker_src  :self, :blob, assets_host
 +if Rails.env.production?
 +  assets_host = Rails.configuration.action_controller.asset_host || "https://#{ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN']}"
 +  data_hosts = [assets_host]
 +
 +  if ENV['S3_ENABLED'] == 'true'
 +    attachments_host = "https://#{ENV['S3_ALIAS_HOST'] || ENV['S3_CLOUDFRONT_HOST'] || ENV['S3_HOSTNAME'] || "s3-#{ENV['S3_REGION'] || 'us-east-1'}.amazonaws.com"}"
 +    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
 +  elsif ENV['SWIFT_ENABLED'] == 'true'
 +    attachments_host = ENV['SWIFT_OBJECT_URL']
 +    attachments_host = "https://#{Addressable::URI.parse(attachments_host).host}"
    else
 -    p.connect_src :self, :data, :blob, assets_host, media_host, Rails.configuration.x.streaming_api_base_url
 -    p.script_src  :self, assets_host
 -    p.child_src   :self, :blob, assets_host
 -    p.worker_src  :self, :blob, assets_host
 +    attachments_host = nil
 +  end
 +
 +  data_hosts << attachments_host unless attachments_host.nil?
 +
 +  if ENV['PAPERCLIP_ROOT_URL']
 +    url = Addressable::URI.parse(assets_host) + ENV['PAPERCLIP_ROOT_URL']
 +    data_hosts << "https://#{url.host}"
 +  end
 +
 +  data_hosts.concat(ENV['EXTRA_DATA_HOSTS'].split('|')) if ENV['EXTRA_DATA_HOSTS']
 +
 +  data_hosts.uniq!
 +
 +  Rails.application.config.content_security_policy do |p|
 +    p.base_uri        :none
 +    p.default_src     :none
 +    p.frame_ancestors :none
 +    p.script_src      :self, assets_host
 +    p.font_src        :self, assets_host
 +    p.img_src         :self, :data, :blob, *data_hosts
 +    p.style_src       :self, :unsafe_inline, assets_host
 +    p.media_src       :self, :data, *data_hosts
 +    p.frame_src       :self, :https
++    p.child_src       :self, :blob, assets_host
 +    p.worker_src      :self, :blob, assets_host
 +    p.connect_src     :self, :blob, :data, Rails.configuration.x.streaming_api_base_url, *data_hosts
 +    p.manifest_src    :self, assets_host
    end
  end
  
Simple merge
Simple merge
diff --cc package.json
index b1c0ff8d1d264539bdd93fbcd5f374119f7ca5c7,f5a3adf99564733808f665d4f3f5d5bfcb1b234f..0edb4a2fae34c938e104b518ab5ab656e0dd1799
      "@gamestdio/websocket": "^0.3.2",
      "array-includes": "^3.1.1",
      "arrow-key-navigation": "^1.1.0",
-     "autoprefixer": "^9.7.4",
 +    "atrament": "0.2.4",
+     "autoprefixer": "^9.7.5",
      "axios": "^0.19.2",
-     "babel-loader": "^8.0.6",
+     "babel-loader": "^8.1.0",
      "babel-plugin-lodash": "^3.3.4",
      "babel-plugin-preval": "^5.0.0",
      "babel-plugin-react-intl": "^3.4.1",
diff --cc yarn.lock
index 53012d929ddb1ed001ff2176fe5c025812d79767,bf1861914bf95bd8632df768b0a05a64b100901f..55c70ba756d4436ff45994cd7f3164956e6e7e72
+++ b/yarn.lock
@@@ -1884,18 -1942,13 +1942,18 @@@ atob@^2.1.1
    resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
    integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
  
- autoprefixer@^9.7.4:
-   version "9.7.4"
-   resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.4.tgz#f8bf3e06707d047f0641d87aee8cfb174b2a5378"
-   integrity sha512-g0Ya30YrMBAEZk60lp+qfX5YQllG+S5W3GYCFvyHTvhOki0AEQJLPEcIuGRsqVwLi8FvXPVtwTGhfr38hVpm0g==
 +atrament@0.2.4:
 +  version "0.2.4"
 +  resolved "https://registry.yarnpkg.com/atrament/-/atrament-0.2.4.tgz#6f78196edfcd194e568b7c0b9c88201ec371ac66"
 +  integrity sha512-hSA9VwW6COMwvRhSEO4uZweZ91YGOdHqwvslNyrJZG+8mzc4qx/qMsDZBuAeXFeWZO/QKtRjIXguOUy1aNMl3A==
 +
+ autoprefixer@^9.7.5:
+   version "9.7.5"
+   resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.5.tgz#8df10b9ff9b5814a8d411a5cfbab9c793c392376"
+   integrity sha512-URo6Zvt7VYifomeAfJlMFnYDhow1rk2bufwkbamPEAtQFcL11moLk4PnR7n9vlu7M+BkXAZkHFA0mIcY7tjQFg==
    dependencies:
-     browserslist "^4.8.3"
-     caniuse-lite "^1.0.30001020"
+     browserslist "^4.11.0"
+     caniuse-lite "^1.0.30001036"
      chalk "^2.4.2"
      normalize-range "^0.1.2"
      num2fraction "^1.2.2"