Commit Graph

3531 Commits

Author SHA1 Message Date
eabc8f7fbd Merge pull request #6023 from misaka4e21/only-staff-can-create-tag
FEATURE: Support disabling tag creation for non-staff users.
2018-07-05 11:12:44 -04:00
28dd7fb562 FEATURE: Create hidden posts for received spam emails (#6010)
* Add possibility to add hidden posts with PostCreator

* FEATURE: Create hidden posts for received spam emails

Spamchecker usually have 3 results: HAM, SPAM and PROBABLY_SPAM
SPAM gets usually directly rejected and needs no further handling.
HAM is good message and usually gets passed unmodified.
PROBABLY_SPAM gets an additional header to allow further processing.
This change addes processing capabilities for such headers and marks
new posts created as hidden when received via email.
2018-07-05 11:07:46 +02:00
Sam
7b26f5086b PERF: we have no use for topic percent rank
Prepare to remove this column
2018-07-05 15:10:19 +10:00
cb89797e9a FEATURE: shows remaining backup codes in user preferences 2018-07-04 10:45:42 +02:00
c3129444ea FIX: allow multiple secondary emails 2018-07-03 18:21:35 +08:00
7550e9ff95 FIX: purge unactivated users with a message from non-human users 2018-06-29 13:03:04 +05:30
25cfc98b67 Fix 'asscoiated' typo
I know that **Naming is CRITICAL** and that **Refactoring only NOT welcome**.

But since I spotted this (consistent) typo and the change does not affect any
functionality -- I checked the presence of "asscoiated" in the code base, I
guess the first rule trumps the second one.

It also gave me a false pretext to bypass my reluctance to use Google forms and
sign de CLA. Typos hurt the eye.
2018-06-29 11:10:05 +10:00
Sam
e0bc6590fd minor cleanup 2018-06-29 10:30:22 +10:00
5d1d7e0e7d PERF: Scanning the id for this is signficantly slower in production 2018-06-28 11:04:40 -04:00
Sam
db14e10943 SECURITY: category badges should HTML escape names 2018-06-28 18:15:07 +10:00
ec3e6a81a4 FEATURE: Second factor backup 2018-06-28 10:12:32 +02:00
47cb46671a FEATURE: Support disabling tag creation for non-staff users. 2018-06-27 07:15:02 +08:00
4644d777bd FEATURE: add website field to SSO 2018-06-25 16:09:39 +10:00
41f76a74f8 FEATURE: send message when a user reaches tl1 2018-06-22 13:20:00 -07:00
bc52bdfa12 Feature: unconditionally consider TL0 users as "first day" users 2018-06-21 10:53:08 -07:00
f7d22bad90 FEATURE: Forced summary mode for megalodon topics.
This is mainly done for performance reasons and megalodon
topics are usually a byproduct of imports where site setting
limits are not respected.
2018-06-21 14:00:20 +08:00
ac80360bea PERF: Help postgres make use of index in Post.summary. 2018-06-21 13:29:16 +08:00
6ddd214476 FIX: Post#summary returning posts from other topics. 2018-06-21 12:00:54 +08:00
50d11fd582 FIX: improves durability display check 2018-06-20 23:15:11 +02:00
0365806b93 FIX: Properly display error when post action fails to create. 2018-06-20 21:20:23 +08:00
fa43969fe2 FIX: crashes with date conversion in reports 2018-06-20 14:42:15 +02:00
Sam
35e0ccfc84 make linter happy 2018-06-20 18:03:27 +10:00
Sam
cb824a6b33 DEV: remove all calls to SqlBuilder use DB.build instead
This is part of the migration to mini_sql, SqlBuilder.new is being
deprecated and replaced with DB.build
2018-06-20 17:53:49 +10:00
7f37ee9152 SearchLog: fix specs 2018-06-20 10:44:11 +10:00
38a8e52ca4 FIX: Add time retention limit to search logs
3 years is a very conservative limit that allows for a very wide buffer
for year-over-year analysis. The max is set to 5 years because that is
the policy listed for logging in hosted Discourse.
2018-06-20 10:44:11 +10:00
1de0ef137e FIX: SearchLog: Do not store IP of logged in users 2018-06-20 10:44:11 +10:00
2ff226e509 FIX: consider staged users mature (no spam checks) after 1 day 2018-06-19 09:41:10 -07:00
Sam
5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
68e4e6a575 FIX: staged users are still tl0 but do not trigger spam if 1 week old. 2018-06-18 17:20:04 -07:00
9e55767f6a FIX: don't punish a user for being previously staged for spam flags. 2018-06-15 12:25:25 -07:00
ff06ce4cce fix the build 2018-06-13 23:05:23 +02:00
051d1a3c36 PERF: faster Screened IP Address roll up 2018-06-13 22:47:23 +02:00
fd54c92a52 FEATURE: New site setting, whitelisted_link_domains
If provided, users who normally couldn't post links (say, due to a
low trust level), can post links to those specific hosts.
2018-06-13 16:11:22 -04:00
6c9190357c fix get from url for external uploads without CDN 2018-06-13 16:21:28 +10:00
94f70c7b5c FIX: TopicViewItem: do not store IP of logged in users 2018-06-12 12:43:56 +10:00
4b2e2ea8ef Change TopicViewItem to allow null IP address 2018-06-12 12:43:56 +10:00
150ae21489 FEATURE: Log user merge in staff logs 2018-06-11 18:43:56 +02:00
a6303073a0 Strip images from cooked for topic excerpt 2018-06-11 14:43:53 +05:30
ad5082d969 Make rubocop happy again. 2018-06-07 13:28:18 +08:00
Sam
89ad2b5900 DEV: Rails 5.2 upgrade and global gem upgrade
This updates tests to use latest rails 5 practice
and updates ALL dependencies that could be updated

Performance testing shows that performance has not regressed
if anything it is marginally faster now.
2018-06-07 14:21:33 +10:00
d600e71b3d FIX: Clean up stale UserExport records daily.
* Add tests for `UserExport.remove_old_exports`
2018-06-05 09:43:40 +08:00
fab59c66f0 FIX: Protection against dangling category group records 2018-06-04 15:43:26 -04:00
89eca87f16 FEATURE: add staff action log for post rejections 2018-06-01 21:48:27 +05:30
9ef61e0af5 PERF: Prefer exists? instead of loading AR object. 2018-06-01 09:44:14 +08:00
e26a14dc29 FIX: error when flagging to notify moderators because message title is too long 2018-05-29 12:21:47 -04:00
Sam
df815d6c0e DEV: prefer using ordering in relation over default scope 2018-05-29 09:34:12 +10:00
8d9c77e113 optimize group invitation code 2018-05-28 17:59:14 +05:30
c8bc942333 FIX: do not add invited user to automatic groups 2018-05-28 17:17:48 +05:30
ed2ae3cb0a FIX: Load post revisions in correct order 2018-05-28 11:25:24 +02:00
754458e6a2 PERF: Minor but we can just pass a hash to where.
```
Warming up --------------------------------------
          4 x .where     1.040k i/100ms
          1 x .where     1.677k i/100ms
Calculating -------------------------------------
          4 x .where     10.321k (± 5.2%) i/s -     52.000k in
5.053803s
          1 x .where     17.117k (± 3.8%) i/s -     85.527k in
5.004107s

Comparison:
          1 x .where:    17117.1 i/s
          4 x .where:    10321.3 i/s - 1.66x  slower
```
2018-05-28 16:41:38 +08:00