Commit Graph

15 Commits

Author SHA1 Message Date
Javi Martín
b7e116b53f Allow adding per-environment custom settings
Until now, when editing a specific environment, other CONSUL
installations had to edit the original file, which made it harder to
upgrade.

Now it's possible to change the default CONSUL settings using custom
files, making it easier to upgrade to versions of CONSUL which change
the original environment files (which is very common when upgrading
versions of Rails).
2022-10-05 17:25:47 +02:00
Javi Martín
7b91adb16f Use the same config for staging and preproduction
We were already doing so by duplicating the code; now we're doing it
explicitly.

This is going to help because we're going to do a few changes in the
environment files, and this way we don't have to do everything twice.

Note that, after we're finished with these changes, the staging and
production environments will be mostly identical and we could simply
require the production environment configuration in the `staging.rb`
file. We aren't doing so because some Consul installations might have
customized these files and it'd be hard for them to deal with all these
changes at once. So, for now, they'll only have to deal with the
possible differences between their staging and preproduction
environments.

Changes to the preproduction environment that won't be applied to the
staging environment can be added like this:

require Rails.root.join("config", "environments", "staging")

Rails.application.configure do
  config.log_level = :warn
end
2022-07-19 23:13:08 +02:00
Javi Martín
e01a94d7bd Use mem_cache_store instead of dalli_store
`dalli_store` is deprecated since dalli 2.7.11.

We can now enable cache_versioning. We didn't enable it when upgrading
to Rails 5.2 because of possible incompatibility with `dalli_store` [1],
even though apparently some the issues were fixed in dalli 2.7.9 and
dalli 2.7.10 [2].

Since using cache versioning makes cache expiration more efficient, and
I'm not sure whether the options we were passing to the dalli store are
valid with memcache store (documentation here is a bit lacking), I'm
just removing the option we used to double the default cache size on
production.

[1] https://www.schneems.com/2018/10/17/cache-invalidation-complexity-rails-52-and-dalli-cache-store
[2] https://github.com/petergoldstein/dalli/blob/master/History.md
2021-08-15 19:42:22 +02:00
Javi Martín
5442ca7c54 Remove redundant configuration option
This option was added by Rails 4 new application generator. However, the
`assets.digest` option is set to true by default, and recent Rails
versions don't even add this option to the environment files.
2020-10-04 15:47:20 +02:00
Javi Martín
4bb1b3a6c3 Use Harmony mode in uglifier for ES2015+ support
Recent versions of graphql-rails updated React to a version which
requires this mode so it can be compiled on production.

So we enable this mode is described in the Uglifier README [2].

[1] https://github.com/lautis/uglifier/tree/v4.2.0#es6--es2015--harmony-mode
2020-10-02 14:07:05 +02:00
Pierre Mesure
40ecbe0348 Remove fallbacks = true from staging, preprod and prod 2020-02-20 11:09:55 +01:00
Julian Herrero
df4f8810c5 Define force_ssl configuration in secrets file
this is usually configured in the production.rb file (which is under
version control), the natural place to configure it is the secrets.yml
file.

Until now we were using the capistrano shared folder, but that's a bit
inconvenient since changes we've done to the production.rb file (like
changing eager_load_paths when we upgraded to Rails 5) won't take effect
after a deployment.
2019-11-12 14:47:28 +01:00
Javi Martín
bc9471b49e Define SMTP configuration in the secrets file
Since SMTP passwords should not be in a file under version control, and
they're usually configured in the production.rb file (which is under
version control), the natural place to configure it is the secrets.yml
file.

Until now we were using the capistrano shared folder, but that's a bit
inconvenient since changes we've done to the production.rb file (like
changing eager_load_paths when we upgraded to Rails 5) won't take effect
after a deployment.
2019-11-11 12:11:20 +01:00
Julian Herrero
2ba7355b00 Add lib folder path to eager_load_paths
Because autoloading is disabled in production with Rails 5,
using autoload_paths will not load needed classes from
specified paths. The solution to this, is to ask Rails
to eager load classes.

https://sipsandbits.com/2017/02/14/upgrading-a-ruby-on-rails-application/
2019-04-29 17:45:58 -05:00
Julian Herrero
b36fdb5604 Add lib folder path to eager_load_paths
Because autoloading is disabled in production with Rails 5,
using autoload_paths will not load needed classes from
specified paths. The solution to this, is to ask Rails
to eager load classes.

https://sipsandbits.com/2017/02/14/upgrading-a-ruby-on-rails-application/
2019-04-17 17:40:56 +02:00
Juanjo Bazán
eb36b7e2e5 updates config files 2019-04-16 17:28:06 +02:00
Julian Herrero
c9cdc72537 Use double quotes in config/ 2019-03-15 10:29:07 +01:00
voodoorai2000
2892d0e1d5 Add placeholder configuration for SMTP 2018-09-13 20:38:42 +02:00
rgarcia
2995734762 Increase max cache size to 2MB
We have lots of votes in this edition of participatory budgets and the
default cache size (1MB) is not enough to hold certain cache fragments
2018-07-27 12:08:20 +02:00
rgarcia
7af1bc526a adds preproduction environment 2015-09-01 19:54:21 +02:00