From b25c8d13533286a21755c6e1e12a612f578c41d1 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 09:16:41 -0600 Subject: [PATCH 1/7] continuing the war with w3c's terrible rss validator --- models/site.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/site.rb b/models/site.rb index b769880b..c636aad6 100644 --- a/models/site.rb +++ b/models/site.rb @@ -1536,6 +1536,7 @@ class Site < Sequel::Model xml.image { xml.url sharing_screenshot_url xml.title title + xml.link uri } site_change_events.each do |event| @@ -1543,7 +1544,7 @@ class Site < Sequel::Model xml.title "#{title} has been updated." xml.link "https://neocities.org/site/#{username}?event_id=#{event.id.to_s}" xml.pubDate event.created_at.rfc822 - xml.guid event.id.to_s + xml.guid(event.id.to_s, isPermaLink: 'false') } end } From 29dfe755faba6de890911469fd7919821c023d98 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 09:19:49 -0600 Subject: [PATCH 2/7] more w3c rss validator madness --- models/site.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/site.rb b/models/site.rb index c636aad6..22cc4a95 100644 --- a/models/site.rb +++ b/models/site.rb @@ -1540,11 +1540,12 @@ class Site < Sequel::Model } site_change_events.each do |event| + event_link = "https://neocities.org/site/#{username}?event_id=#{event.id.to_s}" xml.item { xml.title "#{title} has been updated." - xml.link "https://neocities.org/site/#{username}?event_id=#{event.id.to_s}" + xml.link event_link xml.pubDate event.created_at.rfc822 - xml.guid(event.id.to_s, isPermaLink: 'false') + xml.guid event_link } end } From 5916501e9425068ff879df038a774cac3fa67a01 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 09:32:59 -0600 Subject: [PATCH 3/7] fix for supporter browse with tags --- app/browse.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/browse.rb b/app/browse.rb index d24d686c..1df90e85 100644 --- a/app/browse.rb +++ b/app/browse.rb @@ -62,7 +62,7 @@ def browse_sites_dataset when 'followers' ds = ds.order :follow_count.desc, :updated_at.desc when 'supporters' - ds = ds.where id: Site.supporter_ids + ds = ds.where sites__id: Site.supporter_ids ds = ds.order :follow_count.desc, :views.desc, :site_updated_at.desc when 'featured' ds = ds.exclude featured_at: nil From c70b6cef0f114adfaf3f8d94c59676fe6587a297 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 09:40:54 -0600 Subject: [PATCH 4/7] path limit to 1200 --- models/site_file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/site_file.rb b/models/site_file.rb index eae5f37f..27ae8b51 100644 --- a/models/site_file.rb +++ b/models/site_file.rb @@ -5,7 +5,7 @@ require 'sanitize' class SiteFile < Sequel::Model CLASSIFIER_LIMIT = 1_000_000 CLASSIFIER_WORD_LIMIT = 25 - FILE_PATH_CHARACTER_LIMIT = 600 + FILE_PATH_CHARACTER_LIMIT = 1200 FILE_NAME_CHARACTER_LIMIT = 100 unrestrict_primary_key plugin :update_primary_key From afd5efbebccdf44720f9405efb4c50d1df48599f Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 09:50:56 -0600 Subject: [PATCH 5/7] add new download tool link --- views/contact.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/contact.erb b/views/contact.erb index 79ea393a..182ee01a 100644 --- a/views/contact.erb +++ b/views/contact.erb @@ -209,7 +209,7 @@

- Site downloading issues are almost always related to the internet connectivity issues. If your download is continuing to get cancelled or interrupted, check your WiFi router, or try plugging in directly to the router to see if that resolves it. You could also try downloading from a local library or coffee shop and see if you have the same issue. + Site downloading issues are almost always related to the internet connectivity issues. If your download is continuing to get cancelled or interrupted, check your WiFi router, or try plugging in directly to the router to see if that resolves it. You could also try downloading from a local library or coffee shop and see if you have the same issue. If you're having trouble with the download link, you can also try SAve MY nEOCiTy!, which is a third party downloading tool for Neocities sites.

From 8a398c3028d5465aa3b6757801037085c938aa76 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 11:47:02 -0600 Subject: [PATCH 6/7] integrate airbrake --- Gemfile | 1 + Gemfile.lock | 6 ++++++ config.ru | 3 +++ environment.rb | 13 +++++++++++++ 4 files changed, 23 insertions(+) diff --git a/Gemfile b/Gemfile index d9b88036..e0a68d96 100644 --- a/Gemfile +++ b/Gemfile @@ -62,6 +62,7 @@ gem 'dnsbl-client' gem 'minfraud' gem 'image_optimizer' # apt install optipng jpegoptim pngquant gem 'rubyzip', require: 'zip' +gem 'airbrake' group :development, :test do gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index 2828c3ac..37843b5d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,6 +31,10 @@ GEM adequate_crypto_address (0.1.9) base58 (~> 0.2) keccak (~> 1.3) + airbrake (13.0.4) + airbrake-ruby (~> 6.0) + airbrake-ruby (6.2.2) + rbtree3 (~> 0.6) ansi (1.5.0) base58 (0.2.3) base64 (0.2.0) @@ -240,6 +244,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) + rbtree3 (0.7.1) redis (5.0.8) redis-client (>= 0.17.0) redis-client (0.19.1) @@ -351,6 +356,7 @@ DEPENDENCIES activesupport addressable (>= 2.8.0) adequate_crypto_address + airbrake bcrypt capybara certified diff --git a/config.ru b/config.ru index f07d875b..12906064 100644 --- a/config.ru +++ b/config.ru @@ -1,6 +1,9 @@ require 'rubygems' require './app.rb' require 'sidekiq/web' +require 'airbrake/sidekiq' + +use Airbrake::Rack::Middleware map('/') do use(Rack::Cache, diff --git a/environment.rb b/environment.rb index 2d1db38c..f1185d8e 100644 --- a/environment.rb +++ b/environment.rb @@ -187,3 +187,16 @@ Minfraud.configure do |c| c.license_key = $config['minfraud_license_key'] c.enable_validation = true end + + +Airbrake.configure do |c| + c.project_id = $config['airbrake_project_id'] + c.project_key = $config['airbrake_project_key'] +end + +Airbrake.add_filter do |notice| + if notice[:params][:password] + # Filter out password. + notice[:params][:password] = '[Filtered]' + end +end \ No newline at end of file From 5dafa17e36e4f1f8691c3e3d6229ec102f04f3ce Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 21 Jan 2024 17:57:06 +0000 Subject: [PATCH 7/7] airbrake: ignore 404s --- environment.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/environment.rb b/environment.rb index f1185d8e..e29acd95 100644 --- a/environment.rb +++ b/environment.rb @@ -199,4 +199,6 @@ Airbrake.add_filter do |notice| # Filter out password. notice[:params][:password] = '[Filtered]' end -end \ No newline at end of file + + notice.ignore! if notice.stash[:exception].is_a?(Sinatra::NotFound) +end