Commit Graph
100 Commits
Author SHA1 Message Date
Rafael dos Santos Silva 06bba76719 DEV: Update emojis constants (#15506)
Follow up to d1cfabd so the new emojis are usable by the app
2022-01-10 14:53:52 -03:00
Rafael dos Santos Silva 0a0e06fcf8 FEATURE: Update emojis (#15468)
* FEATURE: Update emojis

* Add extra aliases for backwards compatibility
2022-01-07 15:49:56 -03:00
Rafael dos Santos Silva 435562cc70 FIX: Uploads were broken in old Safari (#15391)
Blob.prototype.arrayBuffer is Safari 14 onwards, so we can check to see if this exists and just skip the checksumming if not.
2021-12-23 08:16:51 +10:00
Rafael dos Santos Silva 754c2ec6c1 Build(deps): Bump mini_suffix from 0.3.2 to 0.3.3 (#15151) 2021-12-01 13:53:20 -03:00
Rafael dos Santos Silva 4ef11e786b DEV: Add aarch64 platform (#15143) 2021-11-30 16:31:11 -03:00
Rafael dos Santos SilvaandDavid Taylor 5647819de4 FEATURE: Send a 'noindex' header in non-canonical responses (#15026)
* FEATURE: Optionally send a 'noindex' header in non-canonical responses

This will be used in a SEO experiment.

Co-authored-by: David Taylor <david@taylorhq.com>
2021-11-25 16:58:39 -03:00
Rafael dos Santos Silva c891c44775 UX: Lower digest suppress period from a year to 6 months (#15023) 2021-11-22 14:37:32 -03:00
Rafael dos Santos Silva 6645243a26 SECURITY: Disallow caching of MIME/Content-Type errors (#14907)
This will sign intermediary proxies and/or misconfigured CDNs to not
cache those error responses.
2021-11-12 15:52:25 -03:00
Rafael dos Santos Silva d4e35f50c2 PERF: Update like count in visible posts without an extra GET per like (#14869)
PERF: Update like count in visible posts without an extra GET per like

Currently when a user is reading a topic and some post in it receive a
like from another user, the Ember app will be notified via MessageBus
and issue a GET to `/posts/{id}` to get the new like count. This worked
fine for us until today, but it can easily create a self-inflicted DDoS
when a topic with a large number of visitors gets a large number of
likes, since we will issue `visitors * likes` GET requests requests.

This patch optimizes this flow, by sending the new like count down in
the MessageBus notification, removing any need for the extra request.

It shouldn't cause any drift on the count because we send down the full
count instead of the difference too.

Possible follow-ups could include handling like removal.
2021-11-10 13:22:26 -03:00
Rafael dos Santos Silva 6ad76520b8 FEATURE: Cache CORS preflight for MessageBus (#14616)
* FEATURE: Cache CORS preflight for MessageBus

Followup for b301a6b for MessageBus
2021-10-15 00:23:53 -03:00
Rafael dos Santos Silva b301a6b3db FEATURE: Cache CORS preflight requests for 2h (#14614)
* FEATURE: Cache CORS preflight requests for 2h

Browsers will cache this for 5 seconds by default. If using MessageBus
in a different domain, Discourse will issue a new long polling, by
default, every 30s or so. This means we would be issuing a new preflight
request **every time**. This can be incredibly wasteful, so let's cache
the authorization in the client for 2h, which is the maximum Chromium
allows us as of today.

* fix tests
2021-10-14 22:37:53 -03:00
Rafael dos Santos Silva 3eb737c014 FIX: Correct password change path for password managers (#14561) 2021-10-08 14:53:14 -03:00
Rafael dos Santos Silva 1c73b97d50 FIX: Workaround Safari 15 createImageBitmap bug (#14448) 2021-09-27 15:02:17 -03:00
Rafael dos Santos Silva 38b8eb5971 FIX: Don't try to boot the ember app on old browsers (#14423) 2021-09-22 16:54:57 -03:00
Rafael dos Santos Silva a4cef67e14 FIX: Feature detect globalThis (#14410)
* FIX: Feature detect globalThis

So browsers without support will receive a warning and browse our JS-less view.
2021-09-22 11:39:41 -03:00
Rafael dos Santos Silva a4096da550 DEV: Add dedicated job for Ember CLI tests with plugin (#14393) 2021-09-21 11:44:12 -03:00
Rafael dos Santos Silva 2e0992c757 DEV: Allow TopicEmbed.import to optionally receive a list of tags (#14301)
This will be used by the rss-polling plugin
2021-09-13 17:01:59 -03:00
Rafael dos Santos Silva 6584982531 DEV: Use actions matrix to parallelize ember cli tests (#14323) 2021-09-13 14:59:56 -03:00
Rafael dos Santos Silva 48b01f2246 DEV: Fix github event type name for cron runs (#14306) 2021-09-10 15:29:38 -03:00
Rafael dos Santos Silva 789613fe51 DEV: Run Ember CLI tests in Firefox evergreen too (#14283)
Increases timeout and removes parallelism to make it stable.
2021-09-09 16:32:56 -03:00
Rafael dos Santos Silva 3469f7b74f DEV: Work around HTMLElement.innerText differences between browsers (#14297) 2021-09-09 14:01:22 -03:00
Rafael dos Santos Silva a71b7df0a0 DEV: Run Ember tests daily with plugins (#14261) 2021-09-07 14:17:04 -03:00
Rafael dos Santos Silva 9b30fbdbbd DEV: Run tests in Firefox ESR (#14094) 2021-09-03 15:17:11 -03:00
Rafael dos Santos Silva ef0471d7ae DEV: Allow passing cook_method to TopicEmbed.import to override default (#14209)
DEV: Allow passing cook_method to TopicEmbed.import to override default

This will be used in the rss-polling plugin when we want to have
oneboxes on feed content, like youtube for example.
2021-09-01 15:46:39 -03:00
Rafael dos Santos Silva 560c13211a DEV: Allow passing a category parameter when importing a topic (#14069)
This will be used in the rss pooling plugin to address the feature
request at https://meta.discourse.org/t/-/200644?u=falco
2021-08-17 18:17:07 -03:00
Rafael dos Santos Silva b136375582 FEATURE: Rate limit exceptions via ENV (#14033)
Allow admins to configure exceptions to our Rails rate limiter.

Configuration happens in the environment variables, and work with both
IPs and CIDR blocks.

Example:

```
env:
  DISCOURSE_MAX_REQS_PER_IP_EXCEPTIONS: >-
    14.15.16.32/27
    216.148.1.2
```
2021-08-13 12:00:23 -03:00
Rafael dos Santos Silva b2e4c91818 DEV: Allow removing local assets after s3 sync (#14013) 2021-08-12 14:20:05 -03:00
Rafael dos Santos Silva 8e45fdfbb1 DEV: Log duration of ember-cli asset build (#13980) 2021-08-10 23:43:08 -03:00
Rafael dos Santos Silva e92163367d FIX: Upload placeholder was missing line break (#13917) 2021-08-02 16:33:51 -03:00
Rafael dos Santos Silva d2ab5ab53f FIX: Better composer placeholder handling during media optimization (#13907) 2021-07-30 18:46:55 -03:00
Rafael dos Santos Silva e12b00eab7 FEATURE: Stop checking referer for embeds (#13756)
Flips content_security_policy_frame_ancestors default to enabled, and
removes HTTP_REFERER checks on embed requests, as the new referer
privacy options made the check fragile.
2021-07-16 15:25:49 -03:00
Rafael dos Santos Silva 2fc0a3fd93 FEATURE: Enable client-side image optimization by default (#13724) 2021-07-16 15:23:04 -03:00
Rafael dos Santos Silva 216dc99f18 FIX: Media optimization setting was misnamed (#13766) 2021-07-16 15:13:16 -03:00
Rafael dos Santos Silva 366238bb81 FIX: Disable the post submit button during image processing properly (#13765)
There was a UI bug when submitting multiple files in the same batch. We
would remove the disabled status of the submit button after the previous
file was sucesfully uploaded and the next one was still mid
optimization.

Reported at https://meta.discourse.org/t/-/194841/15?u=falco
2021-07-16 14:19:59 -03:00
Rafael dos Santos Silva 4a2b173188 FEATURE: Reencoding is safe, trigger it on files > 500Kb (#13606) 2021-07-01 13:44:01 -03:00
Rafael dos Santos SilvaandJarek Radosz fae68455b7 FIX: Detect decode failures earlier in image optimization pipeline (#13595)
* FIX: Detect decode failures earlier in image optimization pipeline

Follow up to 9b51b9b but also detects the bug earlier and backs off.

What iOS 15 is doing is returning all zeroes to `ctx.getImageData`,
so we don't have to wait until resize to detect the problem.

* Update app/assets/javascripts/discourse/app/lib/media-optimization-utils.js

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-06-30 19:03:34 -03:00
Rafael dos Santos Silva 9b51b9bf4e FIX: Detect resize failures in the client size image optimization (#13589)
On iOS 15 beta, if you select the camera app when uploading an image
and try to upload a freshly taken picture, from the second picture
onwards the resize WASM operation will return an array filled with
zeroes.

Since every 4th byte is alpha, and at this step we are only dealing with
non-transparent images this a O(1) way to detect that the bug was hit.
(On normal images, all 4th bytes are 255 at this point)

Also adds a "catch-all" when the original image became too small to try
to accomodate other bugs of the same type. By default we only trigger
this whole operation on images over 1MB, so if the end result is <20KB
something weird did happen. Throwing here will let the upload continue
using the original file, so nothing is lost and the user can continue.
2021-06-30 16:01:17 -03:00
Rafael dos Santos Silva d860e2717b UX: Adds 'Processing Upload' to the composer status area during upload optimization (#13556) 2021-06-28 18:22:22 -03:00
Rafael dos Santos Silva 99da221034 FIX: Handle image decoding failure in composer image optimization (#13555)
There are some hard limits in browser Canvas implementations, that will
throw a runtime exception when crossed. Since those limits are platform
dependent, the best we can do is catch it and back off from trying to
optimize a problematic file.

For example, a 60MB PNG can be processed fine by Chrome but Firefox will
fail trying to extract the ImageData from the CanvasRenderingContext2D
with NS_ERROR_FAILURE.

Also cleans up the media-optimization-utils and add post-resize size logs
2021-06-28 18:21:39 -03:00
Rafael dos Santos Silva fa4a462517 FEATURE: Optimize images before upload (#13432)
Integrates [mozJPEG](https://github.com/mozilla/mozjpeg) and [Resize](https://github.com/PistonDevelopers/resize) using WebAssembly to optimize user uploads in the composer on the client-side.

NPM libraries are sourced from our [Squoosh fork](https://github.com/discourse/squoosh/tree/discourse), which was needed because we have an older asset pipeline.
2021-06-23 12:31:12 -03:00
Rafael dos Santos Silva f36ecf86f8 FEATURE: Add type=website OpenGraph meta tag (#13376) 2021-06-14 15:13:55 -03:00
Rafael dos Santos Silva ee6ff9f1d7 FIX: Use newly created PushSubscription object for push test message (#13293) 2021-06-04 16:05:46 -03:00
Rafael dos Santos SilvaandJeff Wong 9118bb2076 FEATURE: Normalize the service worker route (#12343)
Re-lands the change initially proposed on #8359 but without a new nginx
location block, so it has less change surface.

Co-authored-by: Jeff Wong <awole20@gmail.com>

Co-authored-by: Jeff Wong <awole20@gmail.com>
2021-05-25 19:39:31 -03:00
Rafael dos Santos Silva 63ca9e0650 DEV: Add cleanup methods for composer extension hooks that tests can use (#13034) 2021-05-11 17:29:24 -03:00
Rafael dos Santos Silva 2f60309b13 FEATURE: New API hook to allow for client side upload transforms (#12990) 2021-05-11 12:20:28 -03:00
Rafael dos Santos Silva e2154b3d59 FEATURE: Small improvements to the topic list embed (#12881)
* FEATURE: Small improvements to the topic list embed

- Ability to wrap the list in a custom class so you can styles different
lists using specific CSS

- Adds a topic link to the thumbnail when using the complete template

* FIX: Be more strict about allowed chars in class name
2021-04-29 12:12:00 -03:00
Rafael dos Santos Silva a74783d157 FEATURE: Allow using 'top' view for topic list embed (#12825) 2021-04-26 18:10:04 -03:00
Rafael dos Santos Silva a872df87f6 DEV: Add .tool-versions file for package managers (#12808) 2021-04-26 17:45:49 -03:00
Rafael dos Santos Silva b5fba751a0 DEV: Do not install service workers in development (#12708) 2021-04-14 18:21:28 -03:00
Rafael dos Santos Silva fb4486d5f1 FEATURE: Add CSP frame-ancestors support (#12404) 2021-03-22 16:00:25 -03:00
Rafael dos Santos Silva f8d9f09370 FEATURE: Fallback to system users when creating new TopicEmbed (#12386)
Previosly, if the topic embed request had a missing username parameter,
and SiteSetting.embed_by_username was empty we would fail to create the
new topic and not show any errors.

Now we will fallback using the priority:

1. Username parameter
2. SiteSetting.embed_by_username
3. SiteSetting.site_contact_username
4. system user
2021-03-15 11:58:53 -03:00
Rafael dos Santos Silva 7fecf1b885 FIX: Move PWA App shortcut for bookmarks to new path (#12388) 2021-03-15 15:36:50 +11:00
Rafael dos Santos Silva 9737ce8c5f FEATURE: New DiscourseEvent trigger for likes (#12374) 2021-03-11 21:07:29 -03:00
Rafael dos Santos Silva 52810713d3 FEATURE: Enable contact picker on new invite modal (#12364) 2021-03-11 17:10:18 -03:00
Rafael dos Santos Silva 4af3c42904 FEATURE: Add opt-in screenshots to the web app manifest (#12288)
This will be used by Chrome on Android on the install prompt,
as show in https://twitter.com/alexey_rodionov/status/1349612958754762753

Follows the spec at https://www.w3.org/TR/manifest-app-info/
2021-03-04 18:39:58 -03:00
Rafael dos Santos Silva e06076268a FIX: Missing quote in emoji cdn setting caused by 83f332b (#12280) 2021-03-03 17:39:00 -03:00
Rafael dos Santos Silva 42a440f5f9 FIX: Typo in emoji path caused by 83f332b (#12279) 2021-03-03 16:18:49 -03:00
Rafael dos Santos Silva 83f332b5a5 FEATURE: Add a site setting to allow emojis to come from an external URL (#12180) 2021-03-02 16:04:16 -03:00
Rafael dos Santos Silva 6569449ea4 FEATURE: Add site description for the webmanifest (#12217) 2021-02-25 18:23:19 -03:00
Rafael dos Santos SilvaandJay Pfaffman 01584c5b22 FIX: emails.rake-use domain when sending mail test (#12188)
`rake emails:test` task was always sending `localhost` as the domain name rather than using `smtp[:domain]` (aka `DISCOURSE_SMTP_DOMAIN`. `discourse-setup` has recently been modified to always set `DISCOURSE_SMTP_DOMAIN`, so it's important that this test rake task actually use the value.

I tested this change on a standard production install, and it's working as expected. Hopefully I managed not to bungle the copy/paste of the single line here in the github edit window.

Co-authored-by: Jay Pfaffman <jay@literatecomputing.com>
2021-02-23 14:16:51 -03:00
Rafael dos Santos Silva 5117f0a3e8 FIX: Subfolder replace should only affect URL prefix (#12135)
* FIX: Subfolder replace should only affect URL prefix

Issue was reported in https://meta.discourse.org/t/-/179504

* DEV: Test subfolder handling in get-url when called twice on the same path
2021-02-19 16:06:18 -03:00
Rafael dos Santos Silva d86cb7d1c3 FIX: Use the S3 CDN for the Group flair (#12130) 2021-02-18 17:24:44 -03:00
Rafael dos Santos Silva ceab1c9fdf FEATURE: Handle user agent push subscription change events (#11994)
A user browser may rotate a user subscription endpoint/keys
anytime.

Currently, Discourse will receive a 4XX response while trying to
deliver a push notification and silently unsubscribe the device.

With this change, we will gracefully handle desativating the old
subscription and the replacement creation with the need for the user
to resubscribe manually every time it breaks.

https://meta.discourse.org/t/-/125179?u=falco
2021-02-08 12:09:52 -03:00
Rafael dos Santos Silva d518b302a0 FIX: Composer upload icon regression because of WEBP (#11959)
Similar to
https://github.com/discourse/discourse/commit/ba9fbb3443d6f258b928676cb8fd794bcf86284b

Reported on
https://meta.discourse.org/t/image-icon-has-changed-to-upload-icon/178247?u=falco
2021-02-04 14:41:07 +11:00
Rafael dos Santos Silva 78c775c39e UX: Remove border from certificate due to iframe (#11935) 2021-02-02 20:05:26 -03:00
Rafael dos Santos Silva bf5611f7eb FIX: Make discobot certificate faster/non blocking (#11344)
This moves the way we add the user avatar and site logo
to the discobot certificates from embeded base64 png to
just using the files urls in the href to the image tag.

This will make generation faster and the certificate
smaller overall, but it can't be used in a  `img` tag
anymore, since SVGs in `img` tags don't load the external images

In order to work around that we will move the certificate
in posts to an iframe, which works fine without any user
visible changes. For this to be possible the plugin automatically
adds the site current domain to the list of allowed iframe origins.
2021-02-01 20:49:32 -03:00
Rafael dos Santos Silva afbaedef7d DEV: Add png packages to GitHub CI (#11871) 2021-01-27 19:15:02 -03:00
Rafael dos Santos Silva 4f72830eb0 Update minimum required software versions (#11617)
This matches what we are using in the bundled image
2021-01-05 00:00:14 -03:00
Rafael dos Santos Silva 8da0b4979b FIX: S3 CDN warning was showing wrong warning message (#11603) 2020-12-29 14:09:55 -03:00
Rafael dos Santos Silva 330ef3700f FEATURE: Add dash warning for using S3 without CDN (#11561)
Over the years we had some admins complaining that most of their costs
running Discourse is on S3 uploads.

That only happens when they are using S3 without a CDN, which is widely
considered a bad pratice for public websites, as egress bandwidth can
get expensive quite fast.

Related:

https://meta.discourse.org/t/download-avatars-locally-from-s3-shutting-down-s3-in-my-site/174001/3?u=falco

https://meta.discourse.org/t/use-webtorrent-to-load-media-objects/155873/2?u=falco
2020-12-28 12:43:48 -03:00
Rafael dos Santos Silva 32e7ee4867 FEATURE: Adds support for the WEBP image format (#11532)
Adds support for both still and animated webp images.
Animated images won't be optimized or get thumbnails.

Depends on https://github.com/discourse/discourse_docker/pull/506
and https://github.com/discourse/discourse_docker/pull/507
2020-12-21 20:09:00 -03:00
Rafael dos Santos SilvaandDavid Taylor c4552e9c10 FIX: Autoplay videos must always be muted (#11533)
This automatically adds the muted attribute if it's missing in a video
tag.

Co-authored-by: David Taylor <david@taylorhq.com>
2020-12-21 14:55:00 -03:00
Rafael dos Santos Silva e50676caff FEATURE: Support for GitHub Codespaces development (#11440)
This has a basic config to use the new Codespaces feature in GitHub.

If you have access to the feature all you need to do is:

1. Visit https://github.com/discourse/discourse
2. Click on Code > Open with Codespaces > New codespace
3. Wait it to prepare the environment
4. Click on File > Run > Run without Debug or press
   <kbd>CTRL</kbd>+<kbd>F5</kbd>
5. When prompted click on the green pop-up on the lower left to open the
   running Discourse app in a new tab
2020-12-08 21:35:15 -03:00
Rafael dos Santos Silva a6613d15f4 Adds discourse-gifs to suggested components (#11339) 2020-11-24 14:58:45 -03:00
Rafael dos Santos Silva cdb7ddc258 DEV: Update MomentJS and highlightJS
We updated version of moment and moment-timezone as our current versions are outdated making Discourse Dates broken on places where timezone had updates, like here in Brazil.

This also update highlightJS to the latest version and corrected a test that relied on a no longer supported locale in
moment.
2020-11-11 12:34:26 +11:00
Rafael dos Santos Silva b70b3e867c FIX: Safely skip secure_media steps when it's not enabled (#11110)
* FIX: Safely skip secure_media steps when it's not enabled

* DEV: Secure media tests should enable secure media
2020-11-03 13:53:15 -03:00
Rafael dos Santos Silva ec35b353a7 FEATURE: Add a CSS class to the HTML element on background connection error (#10991)
This is a way to detect that Discourse isn't able to receive online updates from
the server, and will be used to trigger an UI warning to the user that the session
is working on offline mode.

Meta request https://meta.discourse.org/t/offline-indicator/123000?u=falco
2020-10-30 11:59:02 +11:00
Rafael dos Santos Silva 5157e3b6e3 FIX: Favicon count was not updated when window focus returned (#10875)
This misses a test because Favcount doesn't exposes a get to the counter.

Also, since this code deals with all possible notifications configs we support:

- favicon notification
- favicon new content
- title notification
- title new content

the code is a bit complicated to follow. We may look into refactoring it when a
good opportunity arises, like if https://w3c.github.io/badging/ setClientBadge() method
gives us a cleaner way to notify users.
2020-10-09 10:51:39 +11:00
Rafael dos Santos Silva 58cdf87674 PERF: Add partial index on reviewables for topic view (#10492)
On the topic view route we query for reviewables of each post in the stream,
using a query that filters on two unindexed columns. This results in a Parallel Seq Scan
over all rows, which can take quite some time (~20ms was seen) on forums with lots of flags

After index is added PostgreSQL planner opts for a simple Index Scan and runs in sub 1ms.

Before:

```
                                     QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Finalize GroupAggregate  (cost=11401.08..11404.87 rows=20 width=28) (actual time=19.209..19.209 rows=1 loops=1)
   Group Key: r.target_id
   ->  Gather Merge  (cost=11401.08..11404.41 rows=26 width=28) (actual time=19.202..20.419 rows=1 loops=1)
         Workers Planned: 2
         Workers Launched: 2
         ->  Partial GroupAggregate  (cost=10401.06..10401.38 rows=13 width=28) (actual time=16.958..16.958 rows=0 loops=3)
               Group Key: r.target_id
               ->  Sort  (cost=10401.06..10401.09 rows=13 width=16) (actual time=16.956..16.956 rows=0 loops=3)
                     Sort Key: r.target_id
                     Sort Method: quicksort  Memory: 25kB
                     Worker 0:  Sort Method: quicksort  Memory: 25kB
                     Worker 1:  Sort Method: quicksort  Memory: 25kB
                     ->  Nested Loop  (cost=0.42..10400.82 rows=13 width=16) (actual time=15.894..16.938 rows=0 loops=3)
                           ->  Parallel Seq Scan on reviewables r  (cost=0.00..10302.47 rows=8 width=12) (actual time=15.882..16.927 rows=0 loops=3)
                                 Filter: (((target_type)::text = 'Post'::text) AND (target_id = ANY ('{7565483,7565563,7565566,7565567,7565568,7565569,7565579,7565580,7565583,7565586,7565588,7565589,7565601,7565602,7565603,7565613,7565620,7565623,7565624,7565626}'::integer[])))
                                 Rows Removed by Filter: 49183
                           ->  Index Scan using index_reviewable_scores_on_reviewable_id on reviewable_scores s  (cost=0.42..12.27 rows=2 width=8) (actual time=0.029..0.030 rows=1 loops=1)
                                 Index Cond: (reviewable_id = r.id)
 Planning Time: 0.318 ms
 Execution Time: 20.470 ms
```

After:
```
                                                                                                          QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 GroupAggregate  (cost=0.84..342.54 rows=20 width=28) (actual time=0.038..0.038 rows=1 loops=1)
   Group Key: r.target_id
   ->  Nested Loop  (cost=0.84..341.95 rows=31 width=16) (actual time=0.020..0.033 rows=1 loops=1)
         ->  Index Scan using index_reviewables_on_target_id on reviewables r  (cost=0.42..96.07 rows=20 width=12) (actual time=0.013..0.026 rows=1 loops=1)
               Index Cond: (target_id = ANY ('{7565483,7565563,7565566,7565567,7565568,7565569,7565579,7565580,7565583,7565586,7565588,7565589,7565601,7565602,7565603,7565613,7565620,7565623,7565624,7565626}'::integer[]))
         ->  Index Scan using index_reviewable_scores_on_reviewable_id on reviewable_scores s  (cost=0.42..12.27 rows=2 width=8) (actual time=0.005..0.005 rows=1 loops=1)
               Index Cond: (reviewable_id = r.id)
 Planning Time: 0.253 ms
 Execution Time: 0.067 ms
```
2020-08-28 11:47:11 -03:00
Rafael dos Santos Silva 28669dfeb2 PERF: Faster TL3 promotion replies needed calculation (#10416)
Removing the LIMIT makes PostgreSQL use index_posts_on_user_id_and_created_at
which is much faster overall.

Before: 22 seconds
After: 100 ms
2020-08-12 11:28:34 -03:00
Rafael dos Santos Silva a97e36cfda FEATURE: Block vibration in Firefox Android (#10389)
Legacy Firefox Android has some quirks around vibration where it:

- asks for permission
- doesn't persist the permission

This makes the default like vibration popup a permission on Firefox
Android <= 68.

This isn't the case (yet?) on their new Firefox which is rolling out
worldwide right now.

I'd say we merge this now and revert in 3 months or so when
https://arewefenixyet.com/ shows a full rollout.
2020-08-07 15:38:53 -03:00
Rafael dos Santos Silva 32f6c5c07e DEV: Use explicit ordering so spec is realiable 2020-08-07 15:15:39 -03:00
Rafael dos Santos Silva 2ea17c06dd FEATURE: Allow picture HTML element in posts 2020-07-28 20:26:32 -03:00
Rafael dos Santos Silva c65c3407f8 FIX: Allow playsinline for videos in posts
This is used in webkit browsers mostly.
2020-07-28 19:03:54 -03:00
Rafael dos Santos Silva 72534223f3 FEATURE: Allow video tag attributes for video gifs 2020-07-14 13:46:45 -03:00
Rafael dos Santos Silva e0f97c707e PERF: Cache user summary data 2020-07-13 15:26:56 -03:00
Rafael dos Santos Silva a4d5d1f51d PERF: Add user_id condition so we can use another index in the query 2020-07-13 15:26:56 -03:00
Rafael dos Santos Silva 73a3e2ccbc DEV: Add spec for summary links 2020-07-13 15:26:56 -03:00
Rafael dos Santos Silva 831f3cab56 DEV: Fix search rate limit tests 2020-07-09 20:44:17 -03:00
Rafael dos Santos Silva e866e3d609 FEATURE: Add global rate limit for anon searches (#10208) 2020-07-10 09:08:34 +10:00
Rafael dos Santos Silva d58360f72e DEV: Add a basic licensed config (#10128)
This means a dev can run https://github.com/github/licensed
in order to obtain license information easily
2020-06-25 18:01:36 -03:00
Rafael dos Santos Silva 4c543b4a49 UX: Make youtube embeds full width by default (#10106)
* UX: Make youtube embeds full width by default

* UX: Make youtube embeds fluid by default actually

* Remove double sizes in yt-lazy
2020-06-23 17:21:36 -03:00
Rafael dos Santos Silva f00e5515e4 FIX: Service Worker URL was broken
Behavior was changed in #9966, which made the URL be relative.

If the user landed in a topic, for example, the browser was given a
service worker URL under that specific topic URL, which was a 404.

Fixes broken PWA install and broken push notifications
2020-06-04 14:49:39 -03:00
Rafael dos Santos Silva b48299f81c FEATURE: Add setting to disable automatic CORS rule install in S3 buckets (#9872) 2020-05-25 17:09:34 -03:00
Rafael dos Santos Silva 11cd149122 FIX: WebAPK minting was broken due to shortcut icons
SVG support is very flaky, but this way at least minting works again
2020-05-14 21:56:35 -03:00
Rafael dos Santos Silva 675c9c38c8 Revert "FIX: Workaround WebAPK server bug with images without sizes"
This reverts commit bb7fca832f.
2020-05-14 19:33:54 -03:00
Rafael dos Santos Silva bb7fca832f FIX: Workaround WebAPK server bug with images without sizes
Google WebAPK server was returning 500 with `any` sized svgs,
which is a spec violation.

Workaround for now setting a static size.

See https://bugs.chromium.org/p/chromium/issues/detail?id=1061911
2020-05-14 18:08:51 -03:00
Rafael dos Santos Silva 4595560537 FIX: Use proper icons for App shortcut menu
Follow up to 3b0fa9b using the new icon URL introduced in e618efe

Will automatically use icons of the primary color of the active theme
 for the user during install.
2020-05-14 16:32:53 -03:00
Rafael dos Santos Silva 1c0c425f38 DEV: Detect correct data dir using ENV 2020-05-12 13:10:57 -03:00
Rafael dos Santos Silva 2298e14d38 FEATURE: Support for App Shortcuts Menu (#9749)
* FEATURE: Support for App Shortcuts Menu

This adds a list of shortcuts to a installed Discourse instance.

It can be accessed by right clicks or long press on the app icon.

See https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/Shortcuts/explainer.md

List of possible follow ups include:

- Making it admin customizable
- Making it user customizable
- Using SVG icons from the site icon sprite
- Picking an accent color for icons

* FIX: Add type to shortcut menu icons
2020-05-12 12:24:33 -03:00