Commit Graph

7801 Commits

Author SHA1 Message Date
e5da2d24e5 FIX: Add attachment content-disposition for all non-image files (#10058)
This will make it so the original filename is used when downloading all non-image files, bringing S3Store into line with the to_s3 migration and local storage. Video and audio files will still stream correctly in HTML players as well.

See https://meta.discourse.org/t/cannot-download-non-image-media-files-original-filenames-lost-when-uploaded-to-s3/152797 for a lot of extra context.
2020-06-17 11:16:37 +10:00
dcb816b548 FIX: add table name to topic view query (#10052)
When plugin is hooking into TopicView joining other tables, it may fail because `created_at` is potentially available on 2 tables. Therefore we should explicitly define which `created_at` we want.
2020-06-17 10:40:01 +10:00
7f8c5cf70b FIX: Allow plugins to provide test directories with transpiled .js 2020-06-16 14:31:01 -04:00
669c940ec3 Revert "DEV: Remove the remaining ENV["TRAVIS"] usage (#10041)"
This reverts commit 78aff841e3215c875e79692fbeaf8d18c4514006.

See https://review.discourse.org/t/dev-remove-the-remaining-env-travis-usage-10041/12737/4?u=cvx
2020-06-16 19:42:00 +02:00
78aff841e3 DEV: Remove the remaining ENV["TRAVIS"] usage (#10041) 2020-06-16 17:41:15 +02:00
859d9b75a7 FIX: Restoring backup from PG12 could fail on PG10
The `EXECUTE FUNCTION` syntax for `CREATE TRIGGER` statements was introduced in PostgreSQL 11. We need to replace `EXECUTE FUNCTION` with `EXECUTE PROCEDURE` in order to be able to restore backups created with PG12 on PG10.
2020-06-16 16:04:14 +02:00
4cff4892e8 Locale checks were disabled by mistake 2020-06-16 16:04:14 +02:00
84dfaad137 FIX: Fill acting_user field instead of target_user in history 2020-06-16 13:30:58 +03:00
a2713578dd DEV: Allow plugins to exclude seed data
This allows plugins to specify if they would like to filter out any seed
data files from running during migrations.
2020-06-15 15:30:25 -06:00
58e52c0e4f DEV: Use rails_failover gem for ActiveRecord and Redis failover handling 2020-06-15 15:47:07 +08:00
d8cd912769 DEV: Switch to db config to disable advisory locks. 2020-06-15 14:33:41 +08:00
0ff86b00cb DEV: Upgrade Redis to 4.2.1. 2020-06-15 10:05:22 +08:00
36a3675e0a Update translations 2020-06-14 23:39:33 +02:00
4b793a1072 FIX: allows PM owner to remove any user if >= TL2 (#10036) 2020-06-12 12:54:28 +02:00
b2c94cc8ea FIX: do not migrate backups in the new prefix 2020-06-12 02:56:07 +00:00
78b5ab746c DEV: No longer need to clear anon cache when toggling readonly mode. 2020-06-12 09:58:17 +08:00
a4bfa35420 DEV: Pass the is_image flag when triggering the before_upload_creation event (#10031) 2020-06-11 11:06:48 -03:00
3d55f2e3b7 FIX: Improvements and fixes to the image downsizing script (#9950)
Fixed bugs, added specs, extracted the upload downsizing code to a class, added support for non-S3 setups, changed it so that images aren't downloaded twice.

This code has been tested on production and successfully resized ~180k uploads.

Includes:

* DEV: Extract upload downsizing logic
* DEV: Add support for non-S3 uploads
* DEV: Process only images uploaded by users
* FIX: Incorrect usage of `count` and `exist?` typo
* DEV: Spec S3 image downsizing
* DEV: Avoid downloading images twice
* DEV: Update filesizes earlier in the process
* DEV: Return false on invalid upload
* FIX: Download images that currently above the limit (If the image size limit is decreased, then there was no way to resize those images that now fall outside the allowed size range)
* Update script/downsize_uploads.rb (Co-authored-by: Régis Hanol <regis@hanol.fr>)
2020-06-11 14:47:59 +02:00
b7e70850e4 FIX: Allow users to add emails which were deleted before 2020-06-11 14:54:11 +03:00
2e8075bac3 FIX: Ignore Redis readonly errors in RateLimiter#rollback!.
This is similar to what we're doing in `RateLimiter#performed!`.
2020-06-11 15:13:11 +08:00
90dc6c8ce5 DEV: Fix deprecation warning when using Redis#close with redis namespace. 2020-06-11 14:09:19 +08:00
531eca985e DEV: Log error backtrace in Discourse.warn_exception without logster. 2020-06-11 10:49:46 +08:00
5f3fd23fa8 DEV: Add stub flush_sw task to prevent rebuild errors (#10021) 2020-06-10 13:07:37 -07:00
ac555610d9 DEV: Trigger an event before creating an upload 2020-06-10 16:30:53 -03:00
81a265cecd Version bump to v2.5.0.beta7 2020-06-10 13:38:18 -04:00
5bfe1ee4f1 FEATURE: Improve UX support for multiple email addresses (#9691) 2020-06-10 19:11:49 +03:00
a3dfd553a1 Revert "Bump redis to 4.2.0."
This reverts commit 98bc28cea259b823552e1b953506bcf2f76347a9.
2020-06-10 14:52:05 +08:00
98bc28cea2 Bump redis to 4.2.0. 2020-06-10 14:28:56 +08:00
70a88111dd FIX: prevent re-flagging when we have reviewed flags before (#10010)
FIX: prevent re-flagging when we have reviewed flags before

Fixes an edge case where a review can be reflagged when:
User flags as inappropriate.
Moderator rejects the flag.
Another user re-flags the post as spam.

Before, anyone was able to re-flag as inappropriate despite it being flagged
previously. With this, users are unable to re-flag for the same reason
regardless of reviewable status.
2020-06-09 15:26:10 -07:00
3094459cd9 FEATURE: multiple use invite links (#9813) 2020-06-09 20:49:32 +05:30
c35649ccf1 DEV: Remove Redis noop logging.
When Redis drops into readonly mode, it floods the log. The log isn't
actionable and we have other means of knowing that an app is in readonly
mode.
2020-06-09 16:45:34 +08:00
a1c13eb3c6 DEV: Redis failover should only clear redis recently readonly. 2020-06-09 16:36:31 +08:00
4065cd198a DEV: Print backtrace of error when plugin fails to initialize. 2020-06-09 10:25:43 +08:00
d4caf69ed7 DEV: makes SKIP_INSTALL_PLUGINS called last and global (#9990) 2020-06-05 17:59:23 +02:00
1c48853ede DEV: allow skipping of a single plugin when installing
SKIP_INSTALL_PLUGINS can be used to tell plugin:install_all_official
to skip a plugin.

Comma seperated list
2020-06-05 18:26:25 +10:00
e82d4d8a75 DEV: Update rails_failover to avoid monkey patching Rails config. 2020-06-05 09:05:19 +08:00
36841210fb Move UploadSecurity public types into PUBLIC_TYPES constant
* this is so plugins can extend the public types if required
2020-06-05 10:56:57 +10:00
2d880b42a3 UX: Add simple-list setting type (#9970) 2020-06-04 10:44:54 -04:00
76af25f753 FEATURE: Support append when bulk tagging via rake (#9978)
New argument option for the `tags:bulk_tag_category` rake task.
Backwards compatible - defaults to false (no append) if no argument given.
2020-06-04 09:33:48 -04:00
248db310d3 DEV: Fix lint. 2020-06-04 17:25:00 +08:00
aaece34e8b DEV: Update rails_failover so that we can move middleware up the stack. 2020-06-04 17:14:13 +08:00
8e1681d356 Bump rails_failover. 2020-06-04 15:22:35 +08:00
07774894a6 DEV: notify when the rake ask is completed 2020-06-04 12:00:06 +05:30
a93d24501c FIX: base import script was not updating first_post_created_at column
FEATURE: new rake task to update first_post_created_at column

The not-equal operator (`<>`) in PostgreSQL does not compare values
with NULL. We should instead use `IS DISTINCT FROM` when comparing
values with NULL.
2020-06-04 11:26:40 +05:30
2188ccccd5 DEV: Remove initiating_user keyword arg from EmailUpdater.
The guardian contains the acting user.
2020-06-04 13:21:56 +08:00
d3c972c30c FIX: Rescue from readonly errors when looking up auth tokens.
Since this is rare, we don't want to check for
`Discourse.pg_readonly_mode?` on every request since we have to reach
for Redis. Instead, just rescue the error here.
2020-06-04 09:12:49 +08:00
81e6bc7a0f FEATURE: Add uploads:batch_migrate_from_s3 task to limit total posts migrated at once (#9933)
Allow limiting the number of migrations to do at once, both to do migrations that
have impact limited to multiple off-peak usage hours to reduce user impact from
a migration, and to allow tests that do only a very small number for test
purposes. ("Give me a ping, Vasili. One ping only, please.")
2020-06-04 09:48:11 +10:00
a89574ccb9 FIX: Inline error when converting html to markdown
Looks like some html elements like `aside` and `section` will throw an error
when checking if they are inline or not. The commit simply handles

```
Job exception: undefined method `inline?' for nil:NilClass
```

and adds a test for it.
2020-06-03 15:59:19 -06:00
f683c5d0e0 DEV: Check English locale for errors in CI
Moves the most important checks into a linter. It gets executed by Lefthook as well as the docker rake task and Github actions. Doing those checks in rspec takes too long and it produces errors when the discourse:test Docker image contains old, invalid locale files.
2020-06-03 21:54:58 +02:00
ba00cc8ec4 DEV: Move Discourse.getURL and related functions to a module (#9966)
* DEV: Move `Discourse.getURL` and related functions to a module

* DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN`

* FIX: `get-url` is required for server side code

* DEV: Deprecate `BaseUri` too.
2020-06-03 12:45:26 -04:00