Skip to content
Permalink
Browse files

Merge branch 'master' of git:tootsuite/mastodon

  • Loading branch information
nesosuke committed Mar 4, 2020
2 parents ba2de77 + 86c932f commit 5d77c6b22ae8e0e33e98f9bd8ff4cc45b9541219
Showing with 86 additions and 62 deletions.
  1. +1 −1 Gemfile
  2. +12 −12 Gemfile.lock
  3. +10 −1 app/models/account.rb
  4. +3 −1 lib/mastodon/redis_config.rb
  5. +14 −1 lib/tasks/mastodon.rake
  6. +3 −3 package.json
  7. +43 −43 yarn.lock
@@ -92,7 +92,7 @@ gem 'simple-navigation', '~> 4.1'
gem 'simple_form', '~> 5.0'
gem 'sprockets-rails', '~> 3.2', require: 'sprockets/railtie'
gem 'stoplight', '~> 2.2.0'
gem 'strong_migrations', '~> 0.5'
gem 'strong_migrations', '~> 0.6'
gem 'tty-command', '~> 0.9', require: false
gem 'tty-prompt', '~> 0.20', require: false
gem 'twitter-text', '~> 1.14'
@@ -202,14 +202,14 @@ GEM
dotenv (= 2.7.5)
railties (>= 3.2, < 6.1)
e2mmap (0.1.0)
elasticsearch (7.3.0)
elasticsearch-api (= 7.3.0)
elasticsearch-transport (= 7.3.0)
elasticsearch-api (7.3.0)
elasticsearch (7.5.0)
elasticsearch-api (= 7.5.0)
elasticsearch-transport (= 7.5.0)
elasticsearch-api (7.5.0)
multi_json
elasticsearch-dsl (0.1.8)
elasticsearch-transport (7.3.0)
faraday
elasticsearch-transport (7.5.0)
faraday (>= 0.14, < 1)
multi_json
encryptor (3.0.0)
equatable (0.6.1)
@@ -220,7 +220,7 @@ GEM
fabrication (2.21.0)
faker (2.10.1)
i18n (>= 1.6, < 2)
faraday (1.0.0)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
fast_blank (1.0.0)
fastimage (2.1.7)
@@ -311,7 +311,7 @@ GEM
multi_json (~> 1.14)
rack (~> 2.0)
rdf (~> 3.1)
json-ld-preloaded (3.1.0)
json-ld-preloaded (3.1.1)
json-ld (~> 3.1)
rdf (~> 3.1)
jsonapi-renderer (0.2.2)
@@ -383,7 +383,7 @@ GEM
concurrent-ruby (~> 1.0, >= 1.0.2)
sidekiq (>= 3.5)
statsd-ruby (~> 1.4, >= 1.4.0)
oj (3.10.1)
oj (3.10.3)
omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0)
rack (>= 1.6.2, < 3)
@@ -435,7 +435,7 @@ GEM
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.3)
puma (4.3.1)
puma (4.3.3)
nio4r (~> 2.0)
pundit (2.1.0)
activesupport (>= 3.0.0)
@@ -602,7 +602,7 @@ GEM
stoplight (2.2.0)
streamio-ffmpeg (3.0.2)
multi_json (~> 1.8)
strong_migrations (0.5.1)
strong_migrations (0.6.2)
activerecord (>= 5)
temple (0.8.2)
terminal-table (1.8.0)
@@ -777,7 +777,7 @@ DEPENDENCIES
stackprof
stoplight (~> 2.2.0)
streamio-ffmpeg (~> 3.0)
strong_migrations (~> 0.5)
strong_migrations (~> 0.6)
thor (~> 0.20)
thwait (~> 0.1.0)
tty-command (~> 0.9)
@@ -478,7 +478,16 @@ def advanced_search_for(terms, account, limit = 10, following = false, offset =
def from_text(text)
return [] if text.blank?

text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map { |(username, domain)| EntityCache.instance.mention(username, domain) }
text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map do |(username, domain)|
domain = begin
if TagManager.instance.local_domain?(domain)
nil
else
TagManager.instance.normalize_domain(domain)
end
end
EntityCache.instance.mention(username, domain)
end.compact
end

private
@@ -14,7 +14,9 @@ def setup_redis_env_url(prefix = nil, defaults = true)
ENV[prefix + 'REDIS_URL'] = if [password, host, port, db].all?(&:nil?)
ENV['REDIS_URL']
else
"redis://#{password.blank? ? '' : ":#{password}@"}#{host}:#{port}/#{db}"
Addressable::URI.parse("redis://#{host}:#{port}/#{db}").tap do |uri|
uri.password = password if password.present?
end.normalize.to_str
end
end

@@ -336,7 +336,20 @@ namespace :mastodon do
if prompt.yes?('Save configuration?')
cmd = TTY::Command.new(printer: :quiet)

File.write(Rails.root.join('.env.production'), "# Generated with mastodon:setup on #{Time.now.utc}\n\n" + env.each_pair.map { |key, value| "#{key}=#{value}" }.join("\n") + "\n")
env_contents = env.each_pair.map do |key, value|
if value.is_a?(String) && value =~ /[\s\#\\"]/
if value =~ /[']/
value = value.to_s.gsub(/[\\"\$]/) { |x| "\\#{x}" }
"#{key}=\"#{value}\""
else
"#{key}='#{value}'"
end
else
"#{key}=#{value}"
end
end.join("\n")

File.write(Rails.root.join('.env.production'), "# Generated with mastodon:setup on #{Time.now.utc}\n\n" + env_contents + "\n")

if using_docker
prompt.ok 'Below is your configuration, save it to an .env.production file outside Docker:'
@@ -59,14 +59,14 @@
},
"private": true,
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/core": "^7.8.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-transform-react-inline-elements": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"@babel/runtime": "^7.8.3",
"@babel/runtime": "^7.8.4",
"@clusterws/cws": "^0.17.3",
"@gamestdio/websocket": "^0.3.2",
"array-includes": "^3.1.1",
@@ -184,7 +184,7 @@
"react-intl-translations-manager": "^5.0.3",
"react-test-renderer": "^16.12.0",
"sass-lint": "^1.13.1",
"webpack-dev-server": "^3.10.1",
"webpack-dev-server": "^3.10.3",
"yargs": "^15.1.0"
}
}
@@ -18,18 +18,18 @@
invariant "^2.2.4"
semver "^5.5.0"

"@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.8.4":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.4.tgz#d496799e5c12195b3602d0fddd77294e3e38e80e"
integrity sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==
"@babel/core@^7.1.0", "@babel/core@^7.4.5", "@babel/core@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.6.tgz#27d7df9258a45c2e686b6f18b6c659e563aa4636"
integrity sha512-Sheg7yEJD51YHAvLEV/7Uvw95AeWqYPL3Vk3zGujJKIhJ+8oLw2ALaf3hbucILhKsgSoADOvtKRJuNVdcJkOrg==
dependencies:
"@babel/code-frame" "^7.8.3"
"@babel/generator" "^7.8.4"
"@babel/generator" "^7.8.6"
"@babel/helpers" "^7.8.4"
"@babel/parser" "^7.8.4"
"@babel/template" "^7.8.3"
"@babel/traverse" "^7.8.4"
"@babel/types" "^7.8.3"
"@babel/parser" "^7.8.6"
"@babel/template" "^7.8.6"
"@babel/traverse" "^7.8.6"
"@babel/types" "^7.8.6"
convert-source-map "^1.7.0"
debug "^4.1.0"
gensync "^1.0.0-beta.1"
@@ -39,12 +39,12 @@
semver "^5.4.1"
source-map "^0.5.0"

"@babel/generator@^7.0.0", "@babel/generator@^7.8.4":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e"
integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA==
"@babel/generator@^7.0.0", "@babel/generator@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.6.tgz#57adf96d370c9a63c241cd719f9111468578537a"
integrity sha512-4bpOR5ZBz+wWcMeVtcf7FbjcFzCp+817z2/gHNncIRcM9MmKzUhtWCYAq27RAfUrAFwb+OCG1s9WEaVxfi6cjg==
dependencies:
"@babel/types" "^7.8.3"
"@babel/types" "^7.8.6"
jsesc "^2.5.1"
lodash "^4.17.13"
source-map "^0.5.0"
@@ -261,10 +261,10 @@
esutils "^2.0.2"
js-tokens "^4.0.0"

"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8"
integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw==
"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.6.tgz#ba5c9910cddb77685a008e3c587af8d27b67962c"
integrity sha512-trGNYSfwq5s0SgM1BMEB8hX3NDmO7EP2wsDGDexiaKMB92BaRpS+qZfpkMqUBhcsOTBwNy9B/jieo4ad/t/z2g==

"@babel/plugin-proposal-async-generator-functions@^7.8.3":
version "7.8.3"
@@ -801,41 +801,41 @@
dependencies:
regenerator-runtime "^0.12.0"

"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.3.tgz#0811944f73a6c926bb2ad35e918dcc1bfab279f1"
integrity sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==
"@babel/runtime@^7.1.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308"
integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ==
dependencies:
regenerator-runtime "^0.13.2"

"@babel/template@^7.0.0", "@babel/template@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.3.tgz#e02ad04fe262a657809327f578056ca15fd4d1b8"
integrity sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ==
"@babel/template@^7.0.0", "@babel/template@^7.8.3", "@babel/template@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b"
integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==
dependencies:
"@babel/code-frame" "^7.8.3"
"@babel/parser" "^7.8.3"
"@babel/types" "^7.8.3"
"@babel/parser" "^7.8.6"
"@babel/types" "^7.8.6"

"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.4":
version "7.8.4"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c"
integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg==
"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.4", "@babel/traverse@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff"
integrity sha512-2B8l0db/DPi8iinITKuo7cbPznLCEk0kCxDoB9/N6gGNg/gxOXiR/IcymAFPiBwk5w6TtQ27w4wpElgp9btR9A==
dependencies:
"@babel/code-frame" "^7.8.3"
"@babel/generator" "^7.8.4"
"@babel/generator" "^7.8.6"
"@babel/helper-function-name" "^7.8.3"
"@babel/helper-split-export-declaration" "^7.8.3"
"@babel/parser" "^7.8.4"
"@babel/types" "^7.8.3"
"@babel/parser" "^7.8.6"
"@babel/types" "^7.8.6"
debug "^4.1.0"
globals "^11.1.0"
lodash "^4.17.13"

"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.3.0", "@babel/types@^7.8.3":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c"
integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg==
"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.3.0", "@babel/types@^7.8.3", "@babel/types@^7.8.6":
version "7.8.6"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.6.tgz#629ecc33c2557fcde7126e58053127afdb3e6d01"
integrity sha512-wqz7pgWMIrht3gquyEFPVXeXCti72Rm8ep9b5tQKz9Yg9LzJA3HxosF1SB3Kc81KD1A3XBkkVYtJvCKS2Z/QrA==
dependencies:
esutils "^2.0.2"
lodash "^4.17.13"
@@ -10860,10 +10860,10 @@ webpack-dev-middleware@^3.7.2:
range-parser "^1.2.1"
webpack-log "^2.0.0"

webpack-dev-server@^3.10.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.10.1.tgz#1ff3e5cccf8e0897aa3f5909c654e623f69b1c0e"
integrity sha512-AGG4+XrrXn4rbZUueyNrQgO4KGnol+0wm3MPdqGLmmA+NofZl3blZQKxZ9BND6RDNuvAK9OMYClhjOSnxpWRoA==
webpack-dev-server@^3.10.3:
version "3.10.3"
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.10.3.tgz#f35945036813e57ef582c2420ef7b470e14d3af0"
integrity sha512-e4nWev8YzEVNdOMcNzNeCN947sWJNd43E5XvsJzbAL08kGc2frm1tQ32hTJslRS+H65LCb/AaUCYU7fjHCpDeQ==
dependencies:
ansi-html "0.0.7"
bonjour "^3.5.0"

0 comments on commit 5d77c6b

Please sign in to comment.
You can’t perform that action at this time.