From f1f2ac3fa6be5f4d2af4a6666a2db4e9b08329ab Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 26 May 2020 15:05:05 +0200 Subject: [PATCH 01/27] Sleep 60 seconds more when deploying beta This is because there are only 2 servers in beta, and starting a container currently takes over 30s. --- script/update_containers.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/update_containers.sh b/script/update_containers.sh index fa649abd43b..9aaeda4a7dc 100755 --- a/script/update_containers.sh +++ b/script/update_containers.sh @@ -76,6 +76,13 @@ else HOSTS="$*" fi +if [[ $DEPLOY_ENV == beta ]] +then + pause=90 +else + pause=30 +fi + for host in $HOSTS do echo "$host: Updating containers..." @@ -83,7 +90,7 @@ do sudo -H -S -- \ /root/docker-server-configs/scripts/update_services.sh \ $DEPLOY_ENV $SERVICES - sleep 30 + sleep $pause done # vi: set et sts=2 sw=2 ts=2 : From b5bd89142fc8198e91d7c556a39b02925af2c871 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 26 May 2020 10:41:04 +0200 Subject: [PATCH 02/27] Restore distinguishing banner for the beta website Since Redis beta store havs been merged with production in deployment, alert banners were stored using the same cache keys, and so merged too. This patch restores having a distinct banner for the beta website, by storing beta alert banner and modification time under the namespace `MB:beta:` in place of the usual `MB:`. There is no change client-side as dismissed time is stored in cookies. --- lib/MusicBrainz/Server/Controller/Admin.pm | 6 ++++-- lib/MusicBrainz/Server/Controller/Root.pm | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/MusicBrainz/Server/Controller/Admin.pm b/lib/MusicBrainz/Server/Controller/Admin.pm index f8fcc9e2fba..3591472f093 100644 --- a/lib/MusicBrainz/Server/Controller/Admin.pm +++ b/lib/MusicBrainz/Server/Controller/Admin.pm @@ -145,9 +145,11 @@ sub edit_banner : Path('/admin/banner/edit') Args(0) RequireAuth(banner_editor) if ($c->form_posted_and_valid($form)) { my $store = $c->model('MB')->context->store; + my $alert_cache_key = DBDefs->IS_BETA ? 'beta:alert' : 'alert'; + my $alert_mtime_cache_key = DBDefs->IS_BETA ? 'beta:alert_time' : 'alert_mtime'; - $store->set('alert', $form->values->{message}); - $store->set('alert_mtime', time()); + $store->set($alert_cache_key, $form->values->{message}); + $store->set($alert_mtime_cache_key, time()); $c->flash->{message} = l('Banner updated. Remember that each server has its own, independent banner.'); $c->response->redirect($c->uri_for('/')); diff --git a/lib/MusicBrainz/Server/Controller/Root.pm b/lib/MusicBrainz/Server/Controller/Root.pm index 5d9848c2782..04883978dbd 100644 --- a/lib/MusicBrainz/Server/Controller/Root.pm +++ b/lib/MusicBrainz/Server/Controller/Root.pm @@ -221,7 +221,9 @@ sub begin : Private try { my $store = $c->model('MB')->context->store; - my @alert_cache_keys = qw( alert alert_mtime ); + my @alert_cache_keys = DBDefs->IS_BETA + ? qw( beta:alert beta:alert_mtime ); + : qw( alert alert_mtime ); if ($c->user_exists) { my $ip_md5 = md5_hex($c->req->address); From df79b7a5395515f41e7ee304e3c0d5c9b9477276 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 26 May 2020 11:45:17 +0200 Subject: [PATCH 03/27] Fix defining alert cache keys for the beta website --- lib/MusicBrainz/Server/Controller/Root.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/MusicBrainz/Server/Controller/Root.pm b/lib/MusicBrainz/Server/Controller/Root.pm index 04883978dbd..b7127b4311e 100644 --- a/lib/MusicBrainz/Server/Controller/Root.pm +++ b/lib/MusicBrainz/Server/Controller/Root.pm @@ -217,14 +217,14 @@ sub begin : Private my $alert = ''; my $alert_mtime; + my @alert_cache_keys = DBDefs->IS_BETA + ? qw( beta:alert beta:alert_mtime ) + : qw( alert alert_mtime ); + my ($new_edit_notes, $new_edit_notes_mtime); try { my $store = $c->model('MB')->context->store; - my @alert_cache_keys = DBDefs->IS_BETA - ? qw( beta:alert beta:alert_mtime ); - : qw( alert alert_mtime ); - if ($c->user_exists) { my $ip_md5 = md5_hex($c->req->address); my $user_id = $c->user->id; From 34246c080a77a8141b3deee845cf42ea54895f20 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 26 May 2020 15:11:13 +0200 Subject: [PATCH 04/27] Do not sleep after updating the last host --- script/update_containers.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/update_containers.sh b/script/update_containers.sh index 9aaeda4a7dc..b119bd29ed3 100755 --- a/script/update_containers.sh +++ b/script/update_containers.sh @@ -83,6 +83,8 @@ else pause=30 fi +last_host=${HOSTS/* } + for host in $HOSTS do echo "$host: Updating containers..." @@ -90,7 +92,10 @@ do sudo -H -S -- \ /root/docker-server-configs/scripts/update_services.sh \ $DEPLOY_ENV $SERVICES - sleep $pause + if [[ $host != "$last_host" ]] + then + sleep $pause + fi done # vi: set et sts=2 sw=2 ts=2 : From 91755e947683c1bb0b3f4b6e76d6e83138c42aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Mon, 27 Apr 2020 18:44:21 +0300 Subject: [PATCH 05/27] MBS-9963: Update Genius link format Genius defaults to HTTPS now, and they no longer use the genre subdomains. --- root/static/scripts/edit/URLCleanup.js | 2 +- root/static/scripts/tests/Control/URLCleanup.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index 4b97ab7e5f9..1f8d4095825 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -1288,7 +1288,7 @@ const CLEANUPS = { match: [new RegExp('^(https?://)?([^/]+\\.)?genius\\.com', 'i')], type: LINK_TYPES.lyrics, clean: function (url) { - return url.replace(/^https?:\/\/([^/]+\.)?genius\.com/, 'http://$1genius.com'); + return url.replace(/^https?:\/\/([^/]+\.)?genius\.com/, 'https://genius.com'); }, }, 'geonames': { diff --git a/root/static/scripts/tests/Control/URLCleanup.js b/root/static/scripts/tests/Control/URLCleanup.js index a241127d81c..4fd6738d26e 100644 --- a/root/static/scripts/tests/Control/URLCleanup.js +++ b/root/static/scripts/tests/Control/URLCleanup.js @@ -1486,19 +1486,19 @@ const testData = [ input_url: 'http://genius.com/artists/Dramatik', input_entity_type: 'artist', expected_relationship_type: 'lyrics', - expected_clean_url: 'http://genius.com/artists/Dramatik', + expected_clean_url: 'https://genius.com/artists/Dramatik', }, { input_url: 'http://genius.com/albums/The-dream/Terius-nash-1977', input_entity_type: 'release_group', expected_relationship_type: 'lyrics', - expected_clean_url: 'http://genius.com/albums/The-dream/Terius-nash-1977', + expected_clean_url: 'https://genius.com/albums/The-dream/Terius-nash-1977', }, { input_url: 'http://rock.genius.com/The-beatles-she-loves-you-lyrics', input_entity_type: 'work', expected_relationship_type: 'lyrics', - expected_clean_url: 'http://rock.genius.com/The-beatles-she-loves-you-lyrics', + expected_clean_url: 'https://genius.com/The-beatles-she-loves-you-lyrics', }, // GeoNames { From 3a135f76ee22eaa9638cf3951a1df07aa6a05dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Mon, 27 Apr 2020 19:17:30 +0300 Subject: [PATCH 06/27] MBS-9963: Update Genius logo --- root/static/images/favicons/genius-16.png | Bin 666 -> 0 bytes root/static/images/favicons/genius-32.png | Bin 0 -> 565 bytes root/static/styles/favicons.less | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 root/static/images/favicons/genius-16.png create mode 100644 root/static/images/favicons/genius-32.png diff --git a/root/static/images/favicons/genius-16.png b/root/static/images/favicons/genius-16.png deleted file mode 100644 index b713797a2237f8be24290811a97c5437e795c85b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 666 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5lz156 z6XFV_(Ev9mlOQjX01p!v2jj<`a{mr1Ovo3yw_4`set91&t|(XTAN%EF+;}`KIDZ{b zxW8J)(TL;M0eKS*_U2TF)?iI7C$yal8u!yz?RF` zn(O6eS#~zY+bd+I77H(_6Yb9vTGk+{r_A~=ES4#=41>Eakt!RUI>(979T#NlGKaXwe?S@zh*y(|asDgEx#7T8kG%C*vE z%FoYF7JfJ{*nHN5H^eK==uOKf^d#xYu>e zjsE{PWuIWd!n(MXy25WZ?7lv|Ior;kBcZJJ!bIT((;siTuYWx5&6MNe@8)SZ9&Da` zC@;Xz+JDN`X}!MB^sUz!$-mh$`61ASswJ)wB`Jv|saDBFsX&Us$iUD<*T7uY&?Lmr z%*xon%D_b1z{twL;HZ5`5sHS~{FKbJN`wZZ5Ca1%Lj#~5h=w0q88-kmFnGH9xvXk4UEa{HEjtmSN`?>!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{-G$+Qd;gjJKpuOE zr>`sf6BcQ1J+TAw*S;|@Fxq;$IEHu}e>>%DVT%Dz>;5-S{ztLr~*oMo-oY2lLp^CGvX6G0y&Ncm9L&67`oS+1^da_)uZfy1~+B-r@~ULdte1 z9|`4J-M=kHfMu%FjO`pziP91$mQ8owGr#QC6ZC4RlUp>&g*4}QeD*BQ_N#NIdnHmUaFD#B7w!W z|Lkit@83A}`^58)k&ExTYHnh$oRfe0Zr6i^{{d>pwO;O8qXa}E>rW&_y3m|`gPLt6<<&2&wsSw{=^6Tmc<7ym6~_!0mD|c z#5JNMC9x#cD!C{XNHG{07#ZjqnCKdrhZq`KnV4A_83DOg1_pcIMRlQQ$jwj5OsmAL U;mqboWzopr0PA_z2LJ#7 literal 0 HcmV?d00001 diff --git a/root/static/styles/favicons.less b/root/static/styles/favicons.less index 0e39d8dee66..67fd139f2d5 100644 --- a/root/static/styles/favicons.less +++ b/root/static/styles/favicons.less @@ -55,7 +55,7 @@ .favicon("fortyfivecat"); .favicon("fortyfiveworlds", 32); .favicon("generasia", 32); -.favicon("genius"); +.favicon("genius", 32); .favicon("googleplay", 32); .favicon("gutenberg", 32); .favicon("hmikuwiki", 32); From d6ca2cd14eb72298a0fedf1022a64e31de1df915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Mon, 27 Apr 2020 19:17:45 +0300 Subject: [PATCH 07/27] MBS-10789: Add validation for Genius links --- root/static/scripts/edit/URLCleanup.js | 11 +++++++++++ root/static/scripts/tests/Control/URLCleanup.js | 3 +++ 2 files changed, 14 insertions(+) diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index 1f8d4095825..b1afdc13287 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -1290,6 +1290,17 @@ const CLEANUPS = { clean: function (url) { return url.replace(/^https?:\/\/([^/]+\.)?genius\.com/, 'https://genius.com'); }, + validate: function (url, id) { + switch (id) { + case LINK_TYPES.lyrics.artist: + return {result: /^https:\/\/genius\.com\/artists\/[\w-]+$/.test(url)}; + case LINK_TYPES.lyrics.release_group: + return {result: /^https:\/\/genius\.com\/albums\/[\w-]+\/[\w-]+$/.test(url)}; + case LINK_TYPES.lyrics.work: + return {result: /^https:\/\/genius\.com\/(?!(?:artists|albums)\/)[\w-]+-lyrics$/.test(url)}; + } + return false; + }, }, 'geonames': { match: [new RegExp('^https?:\/\/([a-z]+\.)?geonames.org\/([0-9]+)\/.*$', 'i')], diff --git a/root/static/scripts/tests/Control/URLCleanup.js b/root/static/scripts/tests/Control/URLCleanup.js index 4fd6738d26e..a11486ad19c 100644 --- a/root/static/scripts/tests/Control/URLCleanup.js +++ b/root/static/scripts/tests/Control/URLCleanup.js @@ -1487,18 +1487,21 @@ const testData = [ input_entity_type: 'artist', expected_relationship_type: 'lyrics', expected_clean_url: 'https://genius.com/artists/Dramatik', + only_valid_entity_types: ['artist'], }, { input_url: 'http://genius.com/albums/The-dream/Terius-nash-1977', input_entity_type: 'release_group', expected_relationship_type: 'lyrics', expected_clean_url: 'https://genius.com/albums/The-dream/Terius-nash-1977', + only_valid_entity_types: ['release_group'], }, { input_url: 'http://rock.genius.com/The-beatles-she-loves-you-lyrics', input_entity_type: 'work', expected_relationship_type: 'lyrics', expected_clean_url: 'https://genius.com/The-beatles-she-loves-you-lyrics', + only_valid_entity_types: ['work'], }, // GeoNames { From 80d4d020a8dd34500e839c80a8ae564ae29c0e4d Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Thu, 20 Dec 2018 12:01:24 -0600 Subject: [PATCH 08/27] MBH-502: SOLR access via search.mb.org/ws/2 We want people with MBS mirrors to continue to be able to use our production search servers, as they've always been able to do. But allowing public access to our SOLR cluster is problematic from a security standpoint. We could set up a proxy [1] in front of SOLR to block bad requests, but a better option is to just use the /ws/2 compatibility layer already in place in our openresty config. This layer rewrites "old" API requests understood by our Lucene-based search server into a format expected by SOLR, and performs an internal redirect. There's nothing outdated or impractical about this API, so no reason it needs to be "old." To allow this, the code for communicating with the old Lucene-based search is used when SEARCH_ENGINE is 'SOLR' and SEARCH_SERVER is set to the default public search server (search.musicbrainz.org). Setting SEARCH_ENGINE to 'LUCENE' is now only necessary when an actual, old Lucene-based server is configured as SEARCH_SERVER. [1] https://github.com/dergachev/solr-security-proxy --- lib/DBDefs.pm.sample | 2 +- lib/DBDefs/Default.pm | 2 +- lib/MusicBrainz/Server/Data/Search.pm | 2 +- lib/MusicBrainz/Server/Data/WebService.pm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DBDefs.pm.sample b/lib/DBDefs.pm.sample index 8aeaf5ddf5d..b4a3e2167d3 100644 --- a/lib/DBDefs.pm.sample +++ b/lib/DBDefs.pm.sample @@ -170,7 +170,7 @@ sub WEB_SERVER { "www.musicbrainz.example.com" } # Relevant only if SSL redirects are enabled # sub WEB_SERVER_SSL { "localhost" } # sub SEARCH_SERVER { "search.musicbrainz.org" } -# sub SEARCH_ENGINE { "LUCENE" } +# sub SEARCH_ENGINE { "SOLR" } # Used, for example, to have emails sent from the beta server list the # main server # sub WEB_SERVER_USED_IN_EMAIL { my $self = shift; $self->WEB_SERVER } diff --git a/lib/DBDefs/Default.pm b/lib/DBDefs/Default.pm index 7d2c749b062..3ae69127594 100644 --- a/lib/DBDefs/Default.pm +++ b/lib/DBDefs/Default.pm @@ -103,7 +103,7 @@ sub WEB_SERVER { "localhost:5000" } # Relevant only if SSL redirects are enabled sub WEB_SERVER_SSL { "localhost" } sub SEARCH_SERVER { "search.musicbrainz.org" } -sub SEARCH_ENGINE { "LUCENE" } +sub SEARCH_ENGINE { "SOLR" } # Whether to use x-accel-redirect for webservice searches, # using /internal/search as the internal redirect sub SEARCH_X_ACCEL_REDIRECT { 0 } diff --git a/lib/MusicBrainz/Server/Data/Search.pm b/lib/MusicBrainz/Server/Data/Search.pm index 4c2d1c3f1c3..f0982a109c2 100644 --- a/lib/MusicBrainz/Server/Data/Search.pm +++ b/lib/MusicBrainz/Server/Data/Search.pm @@ -794,7 +794,7 @@ sub external_search $type =~ s/release_group/release-group/; my $search_url_string; - if (DBDefs->SEARCH_ENGINE eq 'LUCENE') { + if (DBDefs->SEARCH_ENGINE eq 'LUCENE' || DBDefs->SEARCH_SERVER eq DBDefs::Default->SEARCH_SERVER) { my $dismax = $adv ? 'false' : 'true'; $search_url_string = "http://%s/ws/2/%s/?query=%s&offset=%s&max=%s&fmt=jsonnew&dismax=$dismax&web=1"; } else { diff --git a/lib/MusicBrainz/Server/Data/WebService.pm b/lib/MusicBrainz/Server/Data/WebService.pm index d11ceaae86f..67e976ebe8c 100644 --- a/lib/MusicBrainz/Server/Data/WebService.pm +++ b/lib/MusicBrainz/Server/Data/WebService.pm @@ -211,7 +211,7 @@ sub xml_search } my $url_ext; - if (DBDefs->SEARCH_ENGINE eq 'LUCENE') { + if (DBDefs->SEARCH_ENGINE eq 'LUCENE' || DBDefs->SEARCH_SERVER eq DBDefs::Default->SEARCH_SERVER) { my $format = ($args->{fmt} // "") eq "json" ? "jsonnew" : "xml"; $url_ext = "/ws/2/$resource/?" . "max=$limit&type=$resource&fmt=$format&offset=$offset" . From aa0caa5ba2ff78148e43cb3c4a33e149f2b35bc9 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Wed, 27 May 2020 14:13:14 +0200 Subject: [PATCH 09/27] Reference MB Solr and SIR in install doc --- INSTALL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 8257a4fb2e9..a5798adde39 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -345,7 +345,8 @@ The server by itself doesn't rate limit any request it handles. If you're receiving 503s, then you're likely performing [search queries](https://musicbrainz.org/doc/Search_Server) without having set up a local instance of the -[search server](https://github.com/metabrainz/search-server). By default, +[search server](https://github.com/metabrainz/mb-solr) along with the +[search index rebuilder](https://github.com/metabrainz/sir). By default, search queries are sent to search.musicbrainz.org and are rate limited. Once you set up your own instance, change `SEARCH_SERVER` in lib/DBDefs.pm to From f832e3557f4d01da0c39d74fcb177888548ef755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 21:37:45 +0300 Subject: [PATCH 10/27] MBS-10732: Add collaborator validation to collection form (#1496) Up until now a user could type in an editor name in the collaborators field for a collection and try to submit without selecting a result, leading to an ISE. The error field is special-cased to remove the margin because otherwise a margin of over 160px makes it look absurd. Also, inputName for the autocomplete was incorrect, so this fixes that. --- lib/MusicBrainz/Server/Form/Collection.pm | 28 +++++++++++++++++++ .../components/CollectionEditForm.js | 8 ++++-- root/static/styles/forms.less | 2 ++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/lib/MusicBrainz/Server/Form/Collection.pm b/lib/MusicBrainz/Server/Form/Collection.pm index 067a2c2ae5c..96f00773d4f 100644 --- a/lib/MusicBrainz/Server/Form/Collection.pm +++ b/lib/MusicBrainz/Server/Form/Collection.pm @@ -78,4 +78,32 @@ sub validate_type_id { } } +sub validate_collaborators { + my $self = shift; + + my @collaborators = $self->field('collaborators')->fields; + my $is_valid = 1; + for my $collaborator (@collaborators) { + my $id_field = $collaborator->field('id'); + my $name_field = $collaborator->field('name'); + if (defined $name_field->value && !(defined $id_field->value)) { + my $editor = $self->ctx->model('Editor')->get_by_name($name_field->value); + if (defined $editor) { + $id_field->add_error( + l('To add “{editor}” as a collaborator, please select them from the dropdown.', + {editor => $name_field->value}) + ); + } else { + $id_field->add_error( + l('Editor “{editor}” does not exist.', + {editor => $name_field->value}) + ); + } + $is_valid = 0; + } + } + + return $is_valid; +} + 1; diff --git a/root/static/scripts/collection/components/CollectionEditForm.js b/root/static/scripts/collection/components/CollectionEditForm.js index 182c10cc9e1..b5ba5d40b17 100644 --- a/root/static/scripts/collection/components/CollectionEditForm.js +++ b/root/static/scripts/collection/components/CollectionEditForm.js @@ -100,7 +100,11 @@ const CollectionEditForm = ({collectionTypes, form}: Props) => { />
{collaborators.field.map((collaborator, index) => ( -
+
{ }} entity="editor" inputID={'id-' + collaborator.html_name} - inputName={collaborator.html_name} + inputName={collaborator.field.name.html_name} onChange={(c) => handleCollaboratorChange(c, index)} > Date: Thu, 28 May 2020 22:27:24 +0300 Subject: [PATCH 11/27] MBS-10727: Drop kasi-time.com from lyrics whitelist (#1537) The site has been closed, so there's no point allowing it anymore. --- lib/MusicBrainz/Server/Data/URL.pm | 1 - lib/MusicBrainz/Server/Entity/URL/KasiTime.pm | 23 ------------------ root/static/images/favicons/kasitime-16.png | Bin 136 -> 0 bytes root/static/scripts/common/constants.js | 1 - root/static/scripts/edit/URLCleanup.js | 1 - root/static/styles/favicons.less | 1 - 6 files changed, 27 deletions(-) delete mode 100644 lib/MusicBrainz/Server/Entity/URL/KasiTime.pm delete mode 100644 root/static/images/favicons/kasitime-16.png diff --git a/lib/MusicBrainz/Server/Data/URL.pm b/lib/MusicBrainz/Server/Data/URL.pm index 7161ef39b5a..44795d8d4cd 100644 --- a/lib/MusicBrainz/Server/Data/URL.pm +++ b/lib/MusicBrainz/Server/Data/URL.pm @@ -88,7 +88,6 @@ my %URL_SPECIALIZATIONS = ( 'Joysound' => qr{^https?://(?:www\.)?joysound\.com/}i, 'JunoDownload' => qr{^https?://(?:www\.)?junodownload\.com/}i, 'Kashinavi' => qr{^https?://(?:www\.)?kashinavi\.com/}i, - 'KasiTime' => qr{^https?://(?:www\.)?kasi-time\.com/}i, 'Kget' => qr{^https?://(?:www\.)?kget\.jp/}i, 'Kickstarter' => qr{^https?://(?:www\.)?kickstarter\.com/}i, 'Kofi' => qr{^https?://(?:www\.)?ko-fi\.com/}i, diff --git a/lib/MusicBrainz/Server/Entity/URL/KasiTime.pm b/lib/MusicBrainz/Server/Entity/URL/KasiTime.pm deleted file mode 100644 index 231efd71da2..00000000000 --- a/lib/MusicBrainz/Server/Entity/URL/KasiTime.pm +++ /dev/null @@ -1,23 +0,0 @@ -package MusicBrainz::Server::Entity::URL::KasiTime; - -use Moose; -use utf8; - -extends 'MusicBrainz::Server::Entity::URL'; -with 'MusicBrainz::Server::Entity::URL::Sidebar'; - -sub sidebar_name { '歌詞タイム' } - -__PACKAGE__->meta->make_immutable; -no Moose; -1; - -=head1 COPYRIGHT AND LICENSE - -Copyright (C) 2019 MetaBrainz Foundation - -This file is part of MusicBrainz, the open internet music database, -and is licensed under the GPL version 2, or (at your option) any -later version: http://www.gnu.org/licenses/gpl-2.0.txt - -=cut diff --git a/root/static/images/favicons/kasitime-16.png b/root/static/images/favicons/kasitime-16.png deleted file mode 100644 index b48f106f020d25f22334b6c98d0e2abb0b429c18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|t{e;#{{R2~W-3Fs1j9L? zpp~bKV@L&KG6S=tSQsOlqa!0Do1mkZg7*}`Bcg%{4h^9W42sLn%@IAiAt&vLmV%)% hmkUFrgW(1phBFKzX?})$3xK9Dc)I$ztaD0e0st*kA=m%_ diff --git a/root/static/scripts/common/constants.js b/root/static/scripts/common/constants.js index f96135f9a78..7c4a004b59a 100644 --- a/root/static/scripts/common/constants.js +++ b/root/static/scripts/common/constants.js @@ -95,7 +95,6 @@ export const FAVICON_CLASSES = { 'joysound.com': 'joysound', 'junodownload.com': 'junodownload', 'kashinavi.com': 'kashinavi', - 'kasi-time.com': 'kasitime', 'kget.jp': 'kget', 'kickstarter.com': 'kickstarter', 'ko-fi.com': 'kofi', diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index b1afdc13287..48643a93b5e 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -1734,7 +1734,6 @@ const CLEANUPS = { match: [ new RegExp('^(https?://)?([^/]+\\.)?directlyrics\\.com', 'i'), new RegExp('^(https?://)?([^/]+\\.)?decoda\\.com', 'i'), - new RegExp('^(https?://)?([^/]+\\.)?kasi-time\\.com', 'i'), new RegExp('^(https?://)?([^/]+\\.)?lieder\\.net', 'i'), new RegExp('^(https?://)?([^/]+\\.)?utamap\\.com', 'i'), new RegExp('^(https?://)?([^/]+\\.)?j-lyric\\.net', 'i'), diff --git a/root/static/styles/favicons.less b/root/static/styles/favicons.less index 67fd139f2d5..f0c185fe1bf 100644 --- a/root/static/styles/favicons.less +++ b/root/static/styles/favicons.less @@ -73,7 +73,6 @@ .favicon("joysound", 32); .favicon("junodownload", 32); .favicon("kashinavi", 32); -.favicon("kasitime", 16); .favicon("kget", 32); .favicon("kickstarter", 32); .favicon("kofi", 32); From ea0b29632e3f93f2b23100566de8b6d3f5d015a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 22:51:09 +0300 Subject: [PATCH 12/27] MBS-10853: Include link to subbed users' open edits in sub email (#1533) We already have the link for the entities, so there's no reason not to also give the equivalent link for subscribed editors. --- lib/MusicBrainz/Server/Email/Subscriptions.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/MusicBrainz/Server/Email/Subscriptions.pm b/lib/MusicBrainz/Server/Email/Subscriptions.pm index 265e7edb298..bc02b5ff5bf 100644 --- a/lib/MusicBrainz/Server/Email/Subscriptions.pm +++ b/lib/MusicBrainz/Server/Email/Subscriptions.pm @@ -105,6 +105,9 @@ To view or edit your subscription list, please use the following link: To see all open edits for your subscribed entities, see this link: [% self.server %]/edit/subscribed?open=1 + +To see all open edits by your subscribed editors, see this link: +[% self.server %]/edit/subscribed_editors?open=1 }; } From d0b04f081749780ca769457a422dff654a588061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 22:51:21 +0300 Subject: [PATCH 13/27] MBS-10613: Only show git info on staging servers (#1510) For some reason we were showing git branch info on production. This information was meant for staging servers, so this adds a check to ensure we only display it in those. --- root/layout/components/Footer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/layout/components/Footer.js b/root/layout/components/Footer.js index b8d434843f8..3a1dd3c1986 100644 --- a/root/layout/components/Footer.js +++ b/root/layout/components/Footer.js @@ -44,7 +44,7 @@ const Footer = ({$c}) => { ) : null} - {DBDefs.GIT_BRANCH ? ( + {DBDefs.DB_STAGING_SERVER && DBDefs.GIT_BRANCH ? ( <>
{exp.l('Running: {git_details}', { From c138191428c5de77121557419d6fb949c0f1967a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 22:51:38 +0300 Subject: [PATCH 14/27] MBS-10855: Show [removed] recording in historic EditTrack (#1532) We were showing nothing at all for the recording in historic Edit Track (ChangeTrackArtist) edits if the recording ID didn't resolve to an existing recording. That's kinda confusing, so this ensures we at least show Recording: [removed] there to clarify the situation. --- lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm b/lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm index ca1b5215f7e..9032276b160 100644 --- a/lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm +++ b/lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm @@ -8,6 +8,7 @@ use MusicBrainz::Server::Translation qw( N_l ); use MusicBrainz::Server::Edit::Historic::Base; use aliased 'MusicBrainz::Server::Entity::Artist'; +use aliased 'MusicBrainz::Server::Entity::Recording'; sub edit_name { N_l('Edit track (historic)') } sub edit_kind { 'edit' } @@ -36,7 +37,10 @@ sub build_display_data { my ($self, $loaded) = @_; return { - recording => $loaded->{Recording}->{ $self->data->{recording_id} }, + recording => $loaded->{Recording}->{ $self->data->{recording_id} } || + Recording->new( + id => $self->data->{recording_id}, + ), artist => { old => $loaded->{Artist}->{ $self->data->{old_artist_id} } || Artist->new( From 06ccf597d789d8b61470137c9cec99c83ca41bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 22:52:21 +0300 Subject: [PATCH 15/27] MBS-8412: Standardize pagination limits (#1467) We have different pagination limits for different edit pages, which leads to situations like artist/mbid/edits showing 100 edits but the edit search reached when clicking "Refine this search" (which a user would no doubt expect to be equivalent, until they refine it) only showing the first 25 of them. This standardises all of those lists to 100, which is our default pagination limit anyway. --- lib/MusicBrainz/Server/Controller/Edit.pm | 4 ---- lib/MusicBrainz/Server/Controller/User.pm | 4 ---- lib/MusicBrainz/Server/Controller/User/Edits.pm | 4 ---- 3 files changed, 12 deletions(-) diff --git a/lib/MusicBrainz/Server/Controller/Edit.pm b/lib/MusicBrainz/Server/Controller/Edit.pm index 5eab81784f2..83548109798 100644 --- a/lib/MusicBrainz/Server/Controller/Edit.pm +++ b/lib/MusicBrainz/Server/Controller/Edit.pm @@ -23,10 +23,6 @@ with 'MusicBrainz::Server::Controller::Role::Load' => { entity_name => 'edit', }; -__PACKAGE__->config( - paging_limit => 25, -); - =head1 NAME MusicBrainz::Server::Controller::Moderation - handle user interaction diff --git a/lib/MusicBrainz/Server/Controller/User.pm b/lib/MusicBrainz/Server/Controller/User.pm index 66e0bd64d03..0d72f792cc0 100644 --- a/lib/MusicBrainz/Server/Controller/User.pm +++ b/lib/MusicBrainz/Server/Controller/User.pm @@ -34,10 +34,6 @@ with 'MusicBrainz::Server::Controller::Role::Load' => { model => 'Editor' }; -__PACKAGE__->config( - paging_limit => 25, -); - use Try::Tiny; =head1 NAME diff --git a/lib/MusicBrainz/Server/Controller/User/Edits.pm b/lib/MusicBrainz/Server/Controller/User/Edits.pm index 461beaef573..204ef7561fb 100644 --- a/lib/MusicBrainz/Server/Controller/User/Edits.pm +++ b/lib/MusicBrainz/Server/Controller/User/Edits.pm @@ -6,10 +6,6 @@ BEGIN { extends 'MusicBrainz::Server::Controller' }; use MusicBrainz::Server::Data::Utils qw( load_everything_for_edits ); use MusicBrainz::Server::Constants ':edit_status'; -__PACKAGE__->config( - paging_limit => 25, -); - sub _edits { my ($self, $c, $loader) = @_; From 2a9dfadc22d5fc24789898cb20a240ab91f814e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 23:06:43 +0300 Subject: [PATCH 16/27] MBS-10863: Use new_barcode instead of undef barcode (#1535) While in the edit data the field that is used here is "barcode", the display data maps it to "new_barcode", so no barcode was shown when the edit just added a new barcode to releases that had none. --- root/edit/details/edit_barcodes.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/edit/details/edit_barcodes.tt b/root/edit/details/edit_barcodes.tt index 426d836d947..05fde58b363 100644 --- a/root/edit/details/edit_barcodes.tt +++ b/root/edit/details/edit_barcodes.tt @@ -15,7 +15,7 @@ [% IF !submission.exists('old_barcode') %] [% l('Barcode:') %] - [% submission.barcode | html %] + [% submission.new_barcode.format | html %] [% ELSE %] [% display_diff(l('Barcode:'), submission.old_barcode.format, submission.new_barcode.format) %] From 95ddb4bab07a13ef5aa97bdbc19a5574692a49ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 23:07:29 +0300 Subject: [PATCH 17/27] MBS-10850: Update BadAmazonURLs report to avoid false positives (#1534) Two big issues here: first, we currently support quite a few more subdomains than this accepted even for proper Amazon store products, and second, this was catching every Amazon Music link as a false positive. Added comments to URLCleanup to help us avoid this in the future. --- lib/MusicBrainz/Server/Report/BadAmazonURLs.pm | 3 ++- root/static/scripts/edit/URLCleanup.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/MusicBrainz/Server/Report/BadAmazonURLs.pm b/lib/MusicBrainz/Server/Report/BadAmazonURLs.pm index 73566983cb4..aa39849ac5b 100644 --- a/lib/MusicBrainz/Server/Report/BadAmazonURLs.pm +++ b/lib/MusicBrainz/Server/Report/BadAmazonURLs.pm @@ -20,7 +20,8 @@ sub query JOIN release r ON lru.entity0 = r.id WHERE url ~ 'amazon\.' AND - url !~ '^https?://www\.amazon\.(com|ca|cn|de|es|fr|it|co\.(jp|uk)|in|com\.(br|mx))/gp/product/[0-9A-Z]{10}$' + url !~ '^https?://www\.amazon\.(com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)/gp/product/[0-9A-Z]{10}$' AND + url !~ '^https?://music\.amazon\.(com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)' }; } diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index 48643a93b5e..97d91eb0436 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -477,6 +477,7 @@ const CLEANUPS = { return null; }, validate: function (url) { + // If you change this, please update the BadAmazonURLs report. return {result: /^https:\/\/www\.amazon\.(com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)\//.test(url)}; }, }, @@ -507,6 +508,7 @@ const CLEANUPS = { return url; }, validate: function (url, id) { + // If you change this, please update the BadAmazonURLs report. const m = /^https:\/\/music\.amazon\.(?:com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)\/(albums|artists)/.exec(url); if (m) { const prefix = m[1]; From 20cb5c09166c8b5200ffeb580074987226205ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Thu, 28 May 2020 23:10:00 +0300 Subject: [PATCH 18/27] MBS-10849: Check for allowNew on AddReleaseGroup (#1530) On the release editor preview, new RGs were being shown as removed. WS::js::preview is already passing allowNew here for previews, we just weren't using it. --- root/edit/details/AddReleaseGroup.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/root/edit/details/AddReleaseGroup.js b/root/edit/details/AddReleaseGroup.js index b4cbb77cb89..98e22af7a77 100644 --- a/root/edit/details/AddReleaseGroup.js +++ b/root/edit/details/AddReleaseGroup.js @@ -14,7 +14,7 @@ import DescriptiveLink from import ExpandedArtistCredit from '../../static/scripts/common/components/ExpandedArtistCredit'; -type AddReleaseGroupProps = { +type AddReleaseGroupEditT = { ...EditT, +display_data: { +artist_credit: ArtistCreditT, @@ -26,7 +26,12 @@ type AddReleaseGroupProps = { }, }; -const AddReleaseGroup = ({edit}: {+edit: AddReleaseGroupProps}) => { +type Props = { + +allowNew?: boolean, + +edit: AddReleaseGroupEditT, +}; + +const AddReleaseGroup = ({allowNew, edit}: Props) => { const display = edit.display_data; const type = display.type; const secondaryType = display.secondary_types; @@ -37,7 +42,10 @@ const AddReleaseGroup = ({edit}: {+edit: AddReleaseGroupProps}) => { {addColonText(l('Release Group'))} - + From 0896d961c152d659ed253fe9517474d93045ca38 Mon Sep 17 00:00:00 2001 From: yvanzo Date: Tue, 26 May 2020 21:55:52 +0200 Subject: [PATCH 19/27] Use bracketedText to reuse localizable message --- root/user/UserProfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/user/UserProfile.js b/root/user/UserProfile.js index 27f8dc2b0ca..ab850aaf9f5 100644 --- a/root/user/UserProfile.js +++ b/root/user/UserProfile.js @@ -331,7 +331,7 @@ const UserProfileInformation = withCatalystContext(({ ) : null} {$c.user?.is_account_admin && ipHashes.length ? ( - +