Commit Graph
100 Commits
Author SHA1 Message Date
riking 728e8a262c FIX: Admin panel referral stats not counting topics correctly
Due to what seems to be a bug in ActiveRecord, the distinct: true option
is not recognized on counts with string column names. This commit fixes
that by moving the DISTINCT into the count string.

For robustness, the integration spec for IncomingLinksReport was
rewritten to be an actual integration spec, running the actual interface
on actual fake data.
2014-11-24 12:16:52 -08:00
riking d7a4e39e1d FEATURE: ?include_raw parameter for /t/id/posts.json
include_raw is not added for the wordpress view because it uses the
BasicPostSerializer, and is not a one-line change.

This is the only use of the TopicViewPostsSerializer class, and the
previous change covered the only use of the TopicViewSerializer class.
No other locations include the PostStreamSerializerMixin. Therefore,
this feature is most likely complete.
2014-11-07 07:28:07 -08:00
riking 37dbc4b5e6 Add archive.org to crawler list to serve no-js to 2014-11-02 16:51:23 -08:00
riking 6a946712b3 Add ?include_raw parameter to topic views 2014-11-01 14:32:18 -07:00
riking ef36a619c3 Update Markdown tests 2014-10-05 17:30:29 -07:00
Kane York b79c835c07 Fix data-* behavior (failure to understand own docs) 2014-10-05 15:11:26 -07:00
riking 0532468499 Fix JSHint 2014-10-05 14:58:48 -07:00
riking 1436f75a9f FEATURE: Allow explicit rel="nofollow" on links 2014-10-05 14:58:48 -07:00
riking 0586b3dd25 Clean up validateAttribute() function
Remove code duplication
2014-10-05 14:58:47 -07:00
riking 32cc31319f FIX: Use lang- prefixes for HLJS; add nohighlight for ...
text; use a proper whiteListTag() call.

Old posts are not affected - no global rebake is necessary.
2014-10-05 14:58:47 -07:00
riking 22a4ceceee Auto-anchor attribute regexes, document _validTags 2014-10-05 12:17:56 -07:00
riking e665bfd72a Fix test failure 2014-09-30 13:16:34 +10:00
riking bff95a6a97 Rename 'leader' -> 'tl3' 2014-09-30 13:16:34 +10:00
riking fa50723807 Fix wrong variable name 2014-09-30 13:15:14 +10:00
riking 760465959f Also skip locked users in the job query 2014-09-30 13:15:14 +10:00
riking 4aabc44264 Display grace period note even if not below requirements 2014-09-30 13:15:14 +10:00
riking 36b5f73e57 Change 24 hours to soon (it runs every 4 hours) 2014-09-30 13:15:14 +10:00
riking c8111ada6e FEATURE: Allow admins to lock users from TL3 promotion/demotion
Also, update the display logic for the leader promotion screen to
account for the demotion grace period.
2014-09-30 13:15:13 +10:00
riking 41d53c7222 FIX: Leader requirements weren't loading when visited directly 2014-09-30 13:15:13 +10:00
riking e69d084c88 Add trust_level_locked column 2014-09-30 13:15:13 +10:00
riking 34db30396c FIX: Bracked category link in no-JS view 2014-09-14 21:55:30 -07:00
riking 2c6d03f87f SECURITY: Limit passwords to 200 characters
Prevents layer 8 attack.
2014-09-12 12:07:11 -04:00
riking 056249cc93 PERF: Tame eager-loading of category definition topic URL
With this change, the EXPLAIN on the topic query is reduced in cost, and
script/bench.rb results are improved.

Explain topic query, cost at root level:

cost=641.84..641.92 --> cost=570.03..570.11

script/bench.rb result, 50th percentile:

BEFORE
---

categories_admin: 95
home_admin: 80
topic_admin: 33
categories: 71
home: 51
topic: 15

AFTER
---

categories_admin: 78
home_admin: 58
topic_admin: 49
categories: 40
home: 34
topic: 30
2014-09-10 19:55:10 -07:00
riking b62699707d FIX: Unknown /posts/id.json should 404 2014-09-10 18:10:27 -07:00
riking 637371e60a Switch to count of all notifications 2014-09-09 20:13:36 -07:00
riking bf06878601 FIX: Broken notification history 2014-09-09 17:25:25 -07:00
riking 5994b630b7 Final dirty diff cleanup 2014-09-09 16:29:08 -07:00
riking 69bc552054 FEATURE: Actually show more notifications
The "Show more notifications..." link in the notifications dropdown now
links to /my/notifications, which is a historical view of all
notifications you have recieved.

Notification history is loaded in blocks of 60 at a time.

Admins can see others' notification history. (This was requested for
'debugging purposes', though that's what impersonation is for, IMO.)
2014-09-09 16:29:08 -07:00
riking c1df25e856 Add test for "on day, name wrote" quote trigger 2014-09-09 16:27:06 -07:00
riking a0dccf7bc0 FIX: Add "On day, name wrote:" quote trigger for emails 2014-09-09 16:27:06 -07:00
riking 7bb1b8bc97 Handlebars structure tweaks to post.handlebars
- Combine bind-attrs on the <article> (seriously that made no sense)
 - Hoist a bind-attr class to the view, allowing more fancy styling
 - Hoist a <div> outside a conditional
 - Change href='#' to unvalued hrefs
2014-09-09 11:20:25 -07:00
riking 54484ca18a "FIX": Add error reporting to NotifyMailingListSubscribers
Also skip unactivated users, which may actually fix this
2014-09-03 14:53:05 -07:00
riking 824dadbc1b FIX: Add .cooked class to composer preview
This should make any custom styling apply to both the rendered posts and
the composer equally, as long as a .topic-body parent or a #wmd-preview
parent is not specified.
2014-09-03 13:18:48 -07:00
riking 71b7c80257 UX: CSS tweaks for badge query previews 2014-09-02 19:09:51 -07:00
riking 3cf493eb4f FIX: Apply contract checks when first creating a badge 2014-09-02 19:09:51 -07:00
riking 8979020b9d Clean up unused translations 2014-09-02 15:40:23 -07:00
riking 3413228e89 UX: Change Impersonate to btn-danger 2014-09-02 15:33:54 -07:00
riking ee812eb447 FIX: Do not perform grants if badges are disabled 2014-09-02 13:12:27 -07:00
riking 808460a28f Fix magic numbers, extra param references 2014-08-31 19:36:31 -07:00
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
riking 085b18577c Remove unnecessary user/topic load in PostCreator 2014-08-28 22:07:40 -07:00
riking 24ba7ccfbb FEATURE: Add a plugin callback when editing a post
FIX: Wrap PostRevisor database work in a transaction
2014-08-28 21:27:40 -07:00
riking 3396e6fea3 Centralize MessageBus post updates
After this change, only two files directly publish to MessageBus with a
topic interpolated in the channel: Post and TopicUser.
2014-08-28 20:40:36 -07:00
riking 0a7a4eae99 Publish lightboxing on the message bus
With this change, images appear to lightbox instantly on my development
machine.
2014-08-28 20:16:33 -07:00
riking 8ddd90daa4 Have parse_body() recover from ASCII-8BIT encoding
Added a test to make sure that the result can be passed into TextCleaner
(which expects UTF-8)
2014-08-28 14:38:19 -07:00
riking 1c9f6159cd Update the Receiver and PollMailbox specs for the changes
Tests are both added, moved, and deleted.

Add test for topic not being created

Move html_only.eml to parse_body testing section
2014-08-28 14:38:19 -07:00
riking 0a09593f3b FIX: Prefer HTML in incoming emails, heavily refactor email receiver
This commit heavily refactors Email::Receiver to both better handle
different emails and improve testability.

A primary focus of the refactor is reducing the usage of class
variables, in favor of actually passing parameters - making it possible
for multiple tests to use the same Receiver instance.

The EmailLog reported when a topic is created is reflected to put the
user's email in the to_address field, instead of the system address.

The discourse_email_parser function is renamed to
discourse_email_trimmer, and additional stopping conditions are added to
make up for EmailReplyParser's inability to deal with html at the start
of a line.

The force_encoding calls are refactored out to a 'fix_charset' method.

parse_body is renamed to select_body, and the scrub_html method is
dropped in favor of the new HtmlCleaner class.

A new parse_body method is added, which performs the job of the removed
lines of code in the 'process' method.

EmailUnparsableError is redefined again, to be encoding errors (when the
declared encoding is not what was delivered).
2014-08-28 14:36:10 -07:00
riking cb55ef4702 Add Email::HtmlCleaner for email processing
This class is in charge of stripping out most of the crap from the HTML
portion of emails that email clients generate, so that it can be sanely
post-processed for signatures and quoting boundaries.
2014-08-28 14:36:10 -07:00
riking 0d0225133c FIX: Failed incoming emails could create empty topics
A failure condition is eliminated where a topic would be created, but post
creation would fail, leaving the forum with a topic without any posts.
By asking PostCreator to create the topic instead, inside of its
transaction, this failure condition is eliminated.

Additionally, attachments are restored to working status. Previously,
the attachment code would build up the post raw, but then drop it and
not do anything with the result (creating orphaned uploads). By actually
placing the raw value back in the options hash, it is included in the
created post.
2014-08-28 14:35:43 -07:00
riking 9090df63ba Fix pop3 settings in locale file 2014-08-28 10:45:40 -07:00
riking e28ef099a4 Fix pop3 SSL state leaking over multisite 2014-08-26 17:03:58 -07:00
riking 6d357c9c23 Rename pop3s settings to pop3, remove 'insecure' 2014-08-26 17:03:58 -07:00
riking 5261f2e751 Fix "Server Error: [missing {{code}} value]" page
The translation was expecting a non-existent parameter.
2014-08-25 17:20:48 -07:00
riking 41dadcc349 Fix local onebox subcategory urls 2014-08-25 16:47:54 -07:00
riking 4db5c8d617 Add data-auto-route=true to Logster link 2014-08-25 15:59:48 -07:00
riking 7317c6ed6a Fix tests for new route 2014-08-25 13:07:22 -07:00
riking 234956234b Fix badge type ordering 2014-08-25 12:48:31 -07:00
riking 99c11e2184 Sort the badges on the user profile page
Also clean up UserBadgesController so it isn't doing two things in one
method
2014-08-25 12:40:51 -07:00
riking 2e62cb7825 Add dash and plus signs to Twitter key allowed chars 2014-08-24 17:05:30 -07:00
riking 277b7dc831 Update LazyYT for new onebox version
Much simpler code!
2014-08-22 12:21:02 -07:00
riking 5ae0b9ba42 Remove debugging prints 2014-08-21 17:29:33 -07:00
riking 50d4e283dc Add link to Logster in "Logs" tab of admin panel 2014-08-20 14:40:16 -07:00
riking 903c760a9b Use progress bar indices in jump control, too 2014-08-14 17:52:21 -07:00
riking 8539c08d35 Fix assignment of post number to progress position 2014-08-14 17:31:34 -07:00
riking 62ed597faa Also put the shaded background on desktop 2014-08-13 12:43:27 -07:00
riking 6b22776160 Style & structure fixes for mobile user page 2014-08-13 12:38:55 -07:00
riking b4dc8e7115 Add error reply for new error 2014-08-13 11:47:21 -07:00
riking 90091972b9 Use same reply-to format in all email fixtures 2014-08-13 11:43:49 -07:00
riking cce8b4720a Have reciever handle multiple To addresses 2014-08-13 11:43:49 -07:00
riking 4a75065b62 FIX: Topic progress bar was not updating after expanding gaps 2014-08-01 13:23:53 -07:00
riking de27c6b4b9 Revert bad diff 2014-08-01 12:48:08 -07:00
riking 63cdde3d96 Add more tests, undo some changes to fixture files
Was causing Email::Reciever tests to fail
2014-08-01 12:40:28 -07:00
riking 0faea8ee0b Attempt at checking throws.... 2014-08-01 11:38:44 -07:00
riking c0b2b9b341 Refactor out handle_failure method in PollMailbox 2014-08-01 11:12:06 -07:00
riking d7df4e5979 Start making better-written tests for the email job 2014-08-01 11:03:16 -07:00
riking d87edce6c3 Pass rejection message along in rejection mail if present 2014-08-01 09:56:15 -07:00
riking f9ef715357 Improve email-in category settings UI 2014-07-30 09:58:41 -07:00
riking f80502ea0e Disable logster error reporting during tests 2014-07-28 13:41:45 -07:00
riking 8af4ab2a63 Use settingName in settings_list like the others 2014-07-25 13:19:43 -07:00
riking 5841e10b59 Extra test for spanning italics 2014-07-25 13:15:14 -07:00
riking 400bbb57fe Suppress trackback CSRF errors from Logster 2014-07-25 12:43:57 -07:00
riking 349003ee5e Don't show Try Again for access errors on topics 2014-07-17 17:50:37 -07:00
riking d90404e830 Change 'code' to 'message' 2014-07-17 15:19:58 -07:00
riking a69efada85 Realign method comment 2014-07-17 15:07:25 -07:00
riking 12cb682548 Start passing more context to Discourse.handle_exception 2014-07-17 14:11:56 -07:00
riking 2b5a955c18 Pass more context from Sidekiq jobs to Logster 2014-07-17 11:19:59 -07:00
riking de3633235b Add JS tests for deleted post hiding (fix the build) 2014-07-17 11:13:42 -07:00
riking 19b757b058 FEATURE: Hide deleted posts by default for staff 2014-07-17 10:40:15 -07:00
riking c8d322d1be Include the email subject line in rejection messages
This change has a tradeoff.
It increases our backscatter vulnerability - the subject could have spammy content - but it's extremely valuable to the user to know exactly which message was rejected.
If you sent two at the same time, and only one was rejected, you would have no way of knowing which worked and which to resend without going to the website (which is what email-in is trying to avoid, kinda).
2014-07-17 10:25:53 -07:00
riking 1682f5d584 Fix message, and add test, for EmailUnparseableError 2014-07-17 10:25:53 -07:00
riking 73ceeda1f9 Stop unnecessarily suppressing settings for uncategorized
Fix migration for emailing into uncategorized
2014-07-17 10:25:52 -07:00
riking 17db265b41 Remove use of email_in_address and email_in_category 2014-07-17 10:25:13 -07:00
riking 3df3a908ac Remove email_in_address and email_in_category site settings
The functionality is entirely covered by per-category email in addresses, and the category being a number was confusing people.
2014-07-17 10:22:33 -07:00
riking 915f60b0fc Don't redirect to login when activating account... 2014-07-15 10:50:28 -07:00
riking 2ad2dee0e9 Pretend to allow full path to backup files 2014-07-15 10:23:24 -07:00
riking 783454ebe1 Fix /p/post/user route not saving referrals
Make user id optional for /p/id/uid
Add /posts/id/raw route for debugging failed post processing
2014-07-11 14:44:07 -07:00
riking 07d8d5ed75 Change default email_in minimum trust to 2
Also, rename MinTrustToCreateTopicSetting to TrustLevelSetting, and apply it to more settings
2014-07-11 12:35:59 -07:00
riking 4750f4b5b8 Expect the right error in reciever_spec
Makes the tests less likely to silently break
2014-07-11 12:26:52 -07:00
riking 680f057d8b Add notes about invites to SSO and local login settings 2014-07-05 12:55:48 -07:00
riking 043a1db4e1 Pretty sure anons can't open the composer 2014-07-03 23:26:52 -07:00