Commit graph

9 commits

Author SHA1 Message Date
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Ben Halpern
d822d8d7d9
Fall back to configured social image instead of hardcoded (#9747)
* Fall back to configured social image instead of hardcoded

* Move from constant to method for config inclusion

* Fix spec

* Fix test
2020-10-27 08:54:45 -04:00
rhymes
f1ec04a0c9
Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Mike Coutermarsh
9f983e271c Increase cache TTL for social preview images (#5471) [deploy]
* Increase cache TTL for social preview images

These are expensive to generate + don't change often. We can have a long cache.

Ideally, they would never expire, and get auto evicted by redis when space fills up. But I don't think a `nil` ttl is possible when a default
is set in the Rails config (see production.rb).

So I set it to a real long value. + test to guard against it accidently being changed.

* Try a cache expiration of 6.weeks as suggested by @mstruve in PR
2020-01-17 17:06:06 -05:00
Molly Struve
7c650dcb1c
Remove RedisRailsCache and replace with Rails.cache (#5059) [deploy] 2019-12-10 13:11:08 -06:00
jeffin sam
f023a00d9f add html_css_to_image to RedisRailsCache (#4753) [deploy] 2019-11-28 09:44:31 -05:00
rhymes
0ef4ce4250 Adjust type tags for RSpec (#4864) 2019-11-20 13:01:30 -05:00
Mike Coutermarsh
dd84051ce4 Social Card upgrade - Part 1 (#2090)
* Add HtmlCssToImage for generating images

This will be used by social_previews to convert the templates into images.

Setup a fallback image primarily for local dev, so that this won't cause
errors if authentication is missing.

Caching is setup to use contents of the html/css. So it with
autobust/generate a new image whenever the markup changes.

* Update Article social preview template to not be random

+ Being random breaks caching (since we generate cachekey by a SHA of html content)
+ Use Roboto for when generating via HTML/CSS to Image

* Update Tag social preview template to not be random

+ Make rand deterministic so it doesn't break caching

* Update user social preview template for html/csstoimage

* Update shecoded template to work with both url2png and htmlcsstoimage

* Add ability to respond to .png for social previews controller

When adding .png to the url, these routes will now generate an image and
redirect to it.

This leaves the existing pages as they were, so we're backwards
compatible with all the existing links out in the world.

* Fix merge conflicts

* Remove some duplication

* Improve spec descriptions/read better

* clean up setting template with a ternary
2019-03-22 16:28:02 -04:00