Commit Graph

93 Commits

Author SHA1 Message Date
Peter Bhat Harkins 1b448d916e
bump rubocop (#690) 2019-06-18 06:54:27 -07:00
Jean-Baptiste Barth 1d9669491c validate SSL certs by default (#692)
Required for integrations (GitHub, Twitter, etc.) but deliberately
disabled when fetching titles.
2019-06-18 06:07:39 -07:00
Thomas Dziedzic c6d27f3914 fix StderrPuts rubocop warnings
```
script/parse_inbound_mail:27:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts "no active user with mailing list token #{parser.user_token}"
  ^^^^^^^^^^^
script/parse_inbound_mail:34:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts "error parsing e-mail"
  ^^^^^^^^^^^
script/parse_inbound_mail:38:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts "no valid comment or story being replied to"
  ^^^^^^^^^^^
script/parse_inbound_mail:42:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts "no valid text/plain body found"
  ^^^^^^^^^^^
script/parse_inbound_mail:61:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts c.errors.inspect
  ^^^^^^^^^^^
script/sync_twitter_users:29:3: C: Style/StderrPuts: Use warn instead of STDERR.puts to allow such output to be disabled.
  STDERR.puts "need to implement paging for list members"
  ^^^^^^^^^^^
```
2019-06-13 09:00:21 -05:00
Peter Bhat Harkins dfb4453275 replace traffic counting with measuring
No parameters that need tuning and a single select for most hits.
Logo intensity is based on traffic in the last 15m compared to the last 90
days, and that calculation is cached for 5m. Deliberately does not use
transactions: we don't need the correctness, and it's cheaper to overwrite
a couple times than lock Keystore. Addresses #536; will know in a week if it
closes.
2019-04-21 18:53:39 -05:00
Brian Kung bedb54b0fc Q-encode characters as multiple encoded words 2019-04-17 13:06:00 +00:00
Abdullah Samman 8f46f991f3 Fix quoted-printable subject question-mark not being encoded
Fix #396
2018-12-05 09:11:09 -06:00
Peter Bhat Harkins ec2062f132 don't run if file's required 2018-11-28 09:20:45 -06:00
Peter Bhat Harkins 0724c706fc name exceptions so we can ignore most of them
Now that we've had this in prod a while I've collected a few transient DNS
issues. Because webmentions are a nice-to-have, we can just drop the mention
if someone's DNS is flaking on us. We let BadIPsError hit logs because it
might be someone attempting to use this to enumerate our internal network
(tho it's most likely misconfiguration).
2018-11-20 08:18:10 -06:00
Peter Bhat Harkins 087df3bb6b bugfix empty string urls
Empty string URLs (any story with text and no link) passed this nil check but
threw an exception out of extras/sponge when it tried to get the host.
2018-11-20 08:07:12 -06:00
Andreza Medeiros 7e056d07b8 Fix invalid URI on script/send_new_webmentions
Fix #586
2018-11-07 12:17:56 -06:00
Jason Schweier b43a5999b4 Fix Rubocop violation 2018-10-08 17:01:41 -05:00
Peter Bhat Harkins 5e6f1e6455 send webmentions
Merge #535
2018-10-03 10:16:50 -05:00
Thomas Dziedzic 998a721d72 bump rubocop 2018-08-15 14:44:11 +00:00
Peter Bhat Harkins b835c25c61 fix bounds on whitespace reduction
The story_cache for Story i9u0aw has a line with 72 spaces. Subtracting that
from the line length of 72, that's 0, so the gsub regexp becomes /(.{1,0})/
and throws an exception.
2018-08-06 10:18:18 -05:00
Peter Bhat Harkins 32c9900dc3 fix spacing of tags on twitter
Fix #520
2018-06-28 15:33:08 -05:00
Peter Bhat Harkins 7dfbbea3b5 fix 1 + n query loading tags 2018-06-22 23:56:01 -05:00
Peter Bhat Harkins f278565e09 cache full pages for logged-out visitors without tag filters 2018-05-17 09:46:28 -05:00
Peter Bhat Harkins f07b9cb302 ignore Twitter's transient timeouts 2018-05-12 09:11:33 -05:00
Peter Bhat Harkins 8200831c3f Remove post_to_twitter's dependence on StoryRepository
Pushes work into MySQL. Uses created_at (generous in case we have trouble
posting to Twitter for a bit) to avoid digging deep into old stories.
2018-04-26 11:21:43 -05:00
Peter Bhat Harkins e916cf73eb rubocop: Layout/FirstParameterIndentation, 98 2018-03-19 14:26:14 -05:00
Peter Bhat Harkins f6c564e2d3 rubocop: Layout/LeadingCommentSpace, 112
No option for "no space if code is valid Ruby". Removed some long-dead code.
2018-03-19 14:11:00 -05:00
Peter Bhat Harkins 21e12dcd89 rubocop: Layout/MultilineMethodCallBraceLayout, 119 2018-03-19 13:57:21 -05:00
Peter Bhat Harkins deab0e7967 rubocop: Layout/ExtraSpacing, 142 2018-03-19 10:00:27 -05:00
Peter Bhat Harkins 56d8f1a9bf rubocop: Layout/MultilineBlockLayout, 166
Except in user.rb, these were all oddities of 80-char line length.
2018-03-19 10:00:27 -05:00
Peter Bhat Harkins 5b3478dee9 rubocop: Layout/SpaceAfterComma, 189
We had a space after comma in block args the same number of times as not (11),
and having this on enforces where we're consistent in args, arrays, and hashes.
2018-03-19 10:00:27 -05:00
Peter Bhat Harkins c004ffd6a0 rubocop: Rails/TimeZone, 339
Pretty strictly-worded warning about preventing bugs. I guess it doens't hurt
to have timestamps saved as UTC instead of US/Central.
2018-03-18 19:08:54 -05:00
Peter Bhat Harkins bf1885d87c rubocop: Style/SymbolProc, 374
There were 18 &:foo and 19 {|x| x.foo}, so I updated to the new idiom.
2018-03-18 01:07:08 -05:00
Peter Bhat Harkins a896094b85 rubocop: Style/MutableConstant, 513
We didn't do this anywhere, but it's a cheap way to prevent some bugs.
2018-03-17 19:37:50 -05:00
Peter Bhat Harkins 1dabae1d0f rubocop: Style/BracesAroundHashParameters, 527 2018-03-17 19:31:06 -05:00
Peter Bhat Harkins 8b08484a3e rubocop: Style/StringLiteralsInInterpolation, 576
Tidied up with pluralize and adding a helper.
2018-03-17 19:00:47 -05:00
Peter Bhat Harkins fb0a4424e5 rubocop: Lint/AssignmentInCondition, 669 2018-03-17 14:07:35 -05:00
Peter Bhat Harkins 5ac4c48223 rubocop: Lint/UselessAssignment, 685 2018-03-17 14:07:26 -05:00
Peter Bhat Harkins bf4327de49 rubocop: Layout/AlignParameters, 708
Seriously considered renaming vote_thusly_on_story_or_comment_for_user_because
just becaues of how many weird linewraps it causes.
2018-03-17 14:06:21 -05:00
Peter Bhat Harkins a15c5d540e rubocop: Metrics/*, 655
Turned off everything but LineLength, which I bumped to 100 and manually
tidied.
2018-03-17 14:05:46 -05:00
Peter Bhat Harkins 113bb5e9cc rubocop: Layout/MultilineOperationIndentation, 1208 2018-03-17 14:05:32 -05:00
Peter Bhat Harkins 8138d9e7a4 rubocop: Style/FrozenStringLiteralComment, 1396
It's a transitional thing, let future me suffer with Ruby 3.0.
2018-03-17 14:04:59 -05:00
Peter Bhat Harkins 7a4a4a738f rubocop: Style/Documentation, 2270 2018-03-17 14:04:07 -05:00
Peter Bhat Harkins b1f83f545f rubocop: Layout/SpaceBeforeBlockBraces and SpaceInsideBlockBraces, 2977 2018-03-16 16:41:09 -06:00
Peter Bhat Harkins 98adf81867 rubocop: Lint/Unused*, 3365 2018-03-02 07:19:50 -06:00
Peter Bhat Harkins fda61bb676 rubocop: Layout/DotPosition, 4750 2018-03-01 23:01:39 -06:00
Peter Bhat Harkins bb65fddd2a ignore an intermittent twitter bug
Related to #459
2018-02-26 13:34:30 -06:00
Peter Bhat Harkins 1c8d675209 comment out debugging 2017-10-19 14:33:42 -04:00
joshua stein 9693da5d82 sync_twitter_users: add script to sync twitter list 2017-09-29 18:28:42 -05:00
joshua stein 56fc1522a4 post_to_twitter: cope with code 186
This happens when the tweet is too long because a URL of a story is
not a valid URL, causing it to be interpreted as text, and going
over 140 chars.
2017-08-31 08:59:05 -05:00
joshua stein e4052198a4 post_to_twitter: require at least an upvote 2017-06-11 17:03:54 -05:00
joshua stein 28ad788854 post_to_twitter: put the lobste.rs url first, actual url second
This makes Twitter show a card for the actual story url instead of
the lobste.rs one all the time, though it will fall back to that if
the story url isn't setup for Twitter cards
2017-06-08 11:58:30 -05:00
joshua stein 32875589c2 post_to_twitter: post what's actually on the front page
use StoryRepository#hottest instead of approximating what might be
on the front page
2017-06-07 17:07:08 -05:00
joshua stein 8c0fbf94f1 if a user has a linked twitter account, give them attribution 2017-04-13 15:32:33 -05:00
joshua stein 091f711999 post_to_twitter: clarify MIN_STORY_SCORE is a minimum
the sql query used >, so the minimum of 2 was actually 3
2017-04-13 15:32:33 -05:00
joshua stein c8d2582fcd mail_new_activity: use updated_at, to give time after initial edits 2016-11-29 09:49:54 -06:00