diff --git a/.gitignore b/.gitignore index 2bc8b18c8f0346..d912cd6d97bc71 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,7 @@ yarn-debug.log # Ignore Docker option files docker-compose.override.yml + +# twingyeo.kr +*.woff +*.woff2 diff --git a/app/chewy/statuses_index.rb b/app/chewy/statuses_index.rb index 6dd4fb18b024dc..520b3d4571850c 100644 --- a/app/chewy/statuses_index.rb +++ b/app/chewy/statuses_index.rb @@ -4,6 +4,12 @@ class StatusesIndex < Chewy::Index include FormattingHelper settings index: { refresh_interval: '30s' }, analysis: { + tokenizer: { + nori_mixed: { + type: 'nori_tokenizer', + decompound_mode: 'mixed', + }, + }, filter: { english_stop: { type: 'stop', @@ -20,7 +26,7 @@ class StatusesIndex < Chewy::Index }, analyzer: { content: { - tokenizer: 'uax_url_email', + tokenizer: 'nori_mixed', filter: %w( english_possessive_stemmer lowercase diff --git a/app/javascript/styles/bigemoji.scss b/app/javascript/styles/bigemoji.scss new file mode 100644 index 00000000000000..14b27cb6c7c326 --- /dev/null +++ b/app/javascript/styles/bigemoji.scss @@ -0,0 +1,3 @@ +@import 'bigemoji/variables'; +@import 'application'; +@import 'bigemoji/diff'; diff --git a/app/javascript/styles/bigemoji/diff.scss b/app/javascript/styles/bigemoji/diff.scss new file mode 100644 index 00000000000000..970d8b9650d795 --- /dev/null +++ b/app/javascript/styles/bigemoji/diff.scss @@ -0,0 +1,58 @@ +$emoji-enlarge-time: 40ms; + +// bigger emojis +.status__content, +.detailed-status .status__content, +.account__header__bio { + .emojione { + --emoji-size: 1.5em; + width: var(--emoji-size, 36px); + height: var(--emoji-size, 36px); + font-size: var(--emoji-size, 36px); + transition: transform $emoji-enlarge-time ease; + + &:hover { + transform: scale(2); + } + } +} + + +// enlarge only (names) +.display-name, +.notification__display-name, +.account__header__tabs__name { + .emojione { + transition: transform $emoji-enlarge-time linear; + vertical-align: center; + + &:hover { + transform: scale(2); + } + } + +} + + +// don't crop enlarged emojis as possible +.status__info { + .status__display-name, .display-name { + overflow-x: hidden; + overflow-y: visible; + } +} + + +// special case: collapsed article +.status__content { + overflow: visible; + &.status__content--collapsed { + overflow-y: hidden; // poor man's solution + } +} + + +// visual modifications +.status__info { + align-items: flex-start; // align time info to top (visual satisfaction) +} diff --git a/app/javascript/styles/bigemoji/variables.scss b/app/javascript/styles/bigemoji/variables.scss new file mode 100644 index 00000000000000..d11c69f812a8df --- /dev/null +++ b/app/javascript/styles/bigemoji/variables.scss @@ -0,0 +1 @@ +// intentionally empty diff --git a/app/javascript/styles/twvariant-wide-extra.scss b/app/javascript/styles/twvariant-wide-extra.scss new file mode 100644 index 00000000000000..4b0074d9a2024a --- /dev/null +++ b/app/javascript/styles/twvariant-wide-extra.scss @@ -0,0 +1,5 @@ +@import 'application'; + +.column { + width: 560px; +} diff --git a/app/javascript/styles/twvariant-wide.scss b/app/javascript/styles/twvariant-wide.scss new file mode 100644 index 00000000000000..a8c53ed82af372 --- /dev/null +++ b/app/javascript/styles/twvariant-wide.scss @@ -0,0 +1,5 @@ +@import 'application'; + +.column { + width: 480px; +} diff --git a/app/models/email_domain_block.rb b/app/models/email_domain_block.rb index 10a0e51020e628..16d14248246522 100644 --- a/app/models/email_domain_block.rb +++ b/app/models/email_domain_block.rb @@ -3,11 +3,13 @@ # # Table name: email_domain_blocks # -# id :bigint(8) not null, primary key -# domain :string default(""), not null -# created_at :datetime not null -# updated_at :datetime not null -# parent_id :bigint(8) +# id :bigint(8) not null, primary key +# domain :string default(""), not null +# created_at :datetime not null +# updated_at :datetime not null +# parent_id :bigint(8) +# ips :inet is an Array +# last_refresh_at :datetime # class EmailDomainBlock < ApplicationRecord diff --git a/app/services/activitypub/fetch_featured_collection_service.rb b/app/services/activitypub/fetch_featured_collection_service.rb index 1208820df224d6..9b0b6137f8bf78 100644 --- a/app/services/activitypub/fetch_featured_collection_service.rb +++ b/app/services/activitypub/fetch_featured_collection_service.rb @@ -100,4 +100,8 @@ def local_follower @local_follower = @account.followers.local.without_suspended.first end + + def local_follower + @local_follower ||= @account.followers.local.without_suspended.first + end end diff --git a/app/workers/scheduler/email_domain_block_refresh_scheduler.rb b/app/workers/scheduler/email_domain_block_refresh_scheduler.rb new file mode 100644 index 00000000000000..e0ad89866b6fb0 --- /dev/null +++ b/app/workers/scheduler/email_domain_block_refresh_scheduler.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class Scheduler::EmailDomainBlockRefreshScheduler + include Sidekiq::Worker + include Redisable + + sidekiq_options retry: 0 + + def perform + Resolv::DNS.open do |dns| + dns.timeouts = 5 + + EmailDomainBlock.find_each do |email_domain_block| + ips = begin + if ip?(email_domain_block.domain) + [email_domain_block.domain] + else + resources = dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::A).to_a + dns.getresources(email_domain_block.domain, Resolv::DNS::Resource::IN::AAAA).to_a + resources.map { |resource| resource.address.to_s } + end + end + + email_domain_block.update(ips: ips, last_refresh_at: Time.now.utc) + end + end + end + + def ip?(str) + str =~ Regexp.union([Resolv::IPv4::Regex, Resolv::IPv6::Regex]) + end +end diff --git a/config/themes.yml b/config/themes.yml index 9c21c9459f3bcf..b46fdf68d1422c 100644 --- a/config/themes.yml +++ b/config/themes.yml @@ -1,3 +1,8 @@ default: styles/application.scss contrast: styles/contrast.scss mastodon-light: styles/mastodon-light.scss + +twvariant-wide: styles/twvariant-wide.scss +twvariant-wide-extra: styles/twvariant-wide-extra.scss + +bigemoji: styles/bigemoji.scss diff --git a/db/schema.rb b/db/schema.rb index 704cef1228b63e..d6eb67f634c3fe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -408,6 +408,8 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.bigint "parent_id" + t.inet "ips", array: true + t.datetime "last_refresh_at" t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true end @@ -1322,5 +1324,4 @@ ORDER BY (sum(t0.rank)) DESC; SQL add_index "follow_recommendations", ["account_id"], name: "index_follow_recommendations_on_account_id", unique: true - end diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 8101e61dd28c1f..bee24f24809470 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -21,7 +21,7 @@ def flags end def suffix - '' + '+twvariant' end def to_a @@ -33,7 +33,7 @@ def to_s end def repository - ENV.fetch('GITHUB_REPOSITORY', 'mastodon/mastodon') + ENV.fetch('GITHUB_REPOSITORY', 'twingyeo-kr/mastodon') end def source_base_url diff --git a/package.json b/package.json index 96f1e7b0e66a35..2b656e2e694568 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "mark-loader": "^0.1.6", "marky": "^1.2.5", "mini-css-extract-plugin": "^1.6.2", - "mkdirp": "^2.1.3", + "mkdirp": "^2.1.5", "npmlog": "^7.0.1", "object-assign": "^4.1.1", "object.values": "^1.1.6", diff --git a/yarn.lock b/yarn.lock index cd14ee89a8852e..bc169834628aa9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1030,7 +1030,7 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.8", "@babel/runtime@^7.15.4", "@babel/runtime@^7.2.0", "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.7", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.8", "@babel/runtime@^7.15.4", "@babel/runtime@^7.2.0", "@babel/runtime@^7.20.13", "@babel/runtime@^7.20.7", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.20.13" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== @@ -2616,9 +2616,9 @@ babel-plugin-macros@^2.6.1: resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== dependencies: - "@babel/runtime" "^7.7.2" - cosmiconfig "^6.0.0" - resolve "^1.12.0" + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" babel-plugin-macros@^3.0.1: version "3.1.0" @@ -3551,17 +3551,6 @@ cosmiconfig@^5.0.0: js-yaml "^3.13.1" parse-json "^4.0.0" -cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.7.2" - cosmiconfig@^7.0.0, cosmiconfig@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" @@ -5759,7 +5748,7 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" -import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -7576,10 +7565,10 @@ mkdirp@^1.0, mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.3.tgz#b083ff37be046fd3d6552468c1f0ff44c1545d1f" - integrity sha512-sjAkg21peAG9HS+Dkx7hlG9Ztx7HLeKnvB3NQRcu/mltCVmvkF0pisbiTSfDVYTT86XEfZrTUosLdZLStquZUw== +mkdirp@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.5.tgz#78d7eaf15e069ba7b6b47d76dd94cfadf7a4062f" + integrity sha512-jbjfql+shJtAPrFoKxHOXip4xS+kul9W3OzfzzrqueWK2QMGon2bFH2opl6W9EagBThjEz+iysyi/swOoVfB/w== mousetrap@^1.5.2: version "1.6.5" @@ -9553,7 +9542,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== -resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1: +resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -11846,7 +11835,7 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yaml@^1.10.0, yaml@^1.7.2: +yaml@^1.10.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==