Commit Graph

51 Commits

Author SHA1 Message Date
Luis Ramos
acb7e9751b Move debug assets flag to another env var so we go back to having both profile and debug assets disabled by default 2020-05-02 10:42:49 +01:00
Pau Perez
2d9b41729e Use memory cache-store when profiling
Or you want see any change when playing fragment-caching or other caching
strategies.
2020-04-22 17:56:56 +02:00
Pau Perez
de8d8e658c Add PROFILE var to set production-like settings
I took this from a recent newsletter I read. Sometimes replication
performance issues locally is actually slower than production due to dev
mode settings (code reloading, etc.), heavy de-only gems and the asset
pipeline.

The PROFILE env var switches these settings all at the same time,
giving us an environment closer to production, essential for reliable
profiling. Then, rack-mini-profiler is going to be more accurate.

Apparently it's something
[RubyGems](b026df86ae/config/environments/development.rb (L72-L92))
and
[CodeTriage](a3c957647d)
both use.
2020-04-22 17:53:17 +02:00
Matt-Yorkley
e24d858af9 Ensure log level is the default :info for staging and production
The default was being ignored in our new logging configuration, and the actual log output was way too high. This was causing serious disk space issues.
2020-03-17 12:25:25 +01:00
Matt-Yorkley
d2cacf5330 Add comments for unusable log_level setting 2020-03-17 12:22:58 +01:00
Maikel Linke
bec73adc89 Restore file logging for custom format logger
The new custom logger was directed to stdout instead of a file.
2020-01-08 15:06:19 +11:00
luisramos0
23ec66e338 Add timestamp to Rails logger in staging and prod so that info in logs can be accurately compared with data in the DB 2020-01-08 15:05:55 +11:00
Kristina Lim
cf05369ca9 Configure dalli store value max bytes from env variable 2019-10-08 17:58:43 +08:00
Pau Perez
fede58289b Move Cache::Store config to new initializer
I don't know why but `Rails.logger` is still nil when evaluated from
`configure` block in `config/environments/development.rb`. The only way
I found to make ActiveSupport's cache to use the default logger is from
an initializer.

Note that `ActiveSupport::Cache::Store` uses `debug` level and so we
need to set the dev logger in that same level to see its messages. If
you want to debug in staging as well, you'll need to modify the log
level manually.
2019-03-13 19:08:46 +01:00
Pau Perez
15a95a3bf5 Use :file_store cache store in development
:memory_store uses the process' memory and therefore, what the
background job writes is not reachable for the rails server process when
it reads from the cache. See
https://github.com/openfoodfoundation/openfoodnetwork/wiki/Products-cache#development.
2019-03-13 19:08:46 +01:00
Pau Perez
10a79d5a65 Decouple CachedProductsRenderer from the Rails env
This way we don't need to touch the class implementation to enable the
products cache in development. Just change the default value in
`app/models/spree/app_configuration_decorator.rb`.
2019-03-13 19:08:46 +01:00
Pau Pérez Fabregat
8ee193dbcf Merge pull request #2984 from Matt-Yorkley/email_https_links2
Specify only email link protocol setting
2018-11-14 11:26:14 +01:00
Pau Pérez Fabregat
ecc69c2c58 Merge pull request #2948 from pfac/pfac-config-time-zone
Fix default time zone config
2018-11-07 18:39:25 +00:00
Matt-Yorkley
5b16353938 Specify only link protocol setting 2018-11-07 11:22:24 +00:00
Pedro Costa
1ddbc24a8b Fix default time zone config
Why:

* Starting the environment, even with just `bundle exec rake`, results
  in the following error:
  ```sh
  Value assigned to config.time_zone not recognized.Run "rake -D time"
  for a list of tasks for finding appropriate time zone names.
  ```

This change addresses the issue by:

* Adding the time zone setting to environment specific configurations,
  defaulting to UTC in development, and using Melbourne in tests.
2018-10-30 23:50:23 +00:00
Pau Perez
2e2c7c56cb Move default_url_options set up to an initializer
For some reason running `bundle exec rake db:migrate RAILS_ENV=staging`
fails with:

```
rake aborted!
NameError: uninitialized constant Spree::Config
```

Running `bundle exec rails server` for instance, does not. There must be
a difference on the way a rake task and the rails commands load the app.

Moving this configuration to an initializer, at the end of the
initialization process, fixes it. The constant `Spree::Config` is
already loaded.

**This is preventing the release v1.22.0 from being staged and tested**
2018-10-30 19:45:04 +01:00
Matt-Yorkley
f3124e5472 Explicitly add :host to actionmailer config 2018-10-26 22:42:47 +01:00
Matt-Yorkley
c3cef699ca Use https on all links in emails in production 2018-10-19 17:03:51 +01:00
Maikel Linke
de5124f90c Remove Heroku references since nobody is using it 2018-05-01 10:20:21 +10:00
Saimon Moore
a9c4d27d5e Undo i18n_fallbacks change to production.rb 2017-11-10 12:30:24 +11:00
Saimon Moore
610c2f9519 Ensure en is an I18n fallback in all environments
Since `en` is considered as the main fallback for all locales
ensure that it is present in all environments.

Note: Setting `config.i18n.fallbacks` to `true` means use the default locale
which means that if a particular instance is not using an `en` based locale
(the parent `en` locale is automatically derived as a fallback) then `en` will
not be available as a fallback.
2017-11-10 12:30:24 +11:00
Pau Perez
e64fd1d308 Lower log level in prod to :info so we can debug
Otherwise, there are no log lines for any request, which makes it
impossible to find out anything about the app in production.

Obviously this increases the size of the log files but this has to be
  dealt with log rotation. The data is our most important asset.
2017-11-09 11:13:32 +11:00
Rob Harrington
dd56e03be1 Stop setting host for url helpers in specs 2017-09-23 14:58:34 +10:00
Julius Pabrinkis
ec6a365227 Add test coverage for switching language in darkswarm and admin 2017-08-02 09:57:33 +10:00
Em-AK
78ffdec693 Force english locale in test environment 2017-04-28 11:28:24 +10:00
Pierre de Lacroix
6f59751582 change i18n fallbacks parameter to EN in production settings 2017-03-15 15:03:18 +11:00
Paul Mackay
b718cf729a Set production log level to warn 2016-06-01 20:51:31 +01:00
Maikel Linke
5aa3ebde9c Set the locale to "en" in test environment. 2015-10-07 14:05:50 +11:00
Maikel Linke
2488411b94 JS feature specs completing before cleaning db
Some specs ran into a deadlock when the Database::Cleaner tried to do
its job while AJAX requests were still triggering other actions.
2015-09-16 15:38:09 +10:00
Rohan Mitchell
bc11140a40 Make config reset for all tests more robust. Add cache isolation for parallel specs. 2015-06-24 14:02:45 +10:00
Maikel Linke
bf935623dc changing default mailer url in development from test.com to 0.0.0.0:3000 2015-05-29 15:24:17 +10:00
Rohan Mitchell
f8572db683 Install and configure dalli for staging and production environments 2014-07-04 14:39:27 +10:00
Will Marshall
8b439c4e69 Temporary/demonstration caching behaviour, INCOMPLETE 2014-07-04 14:38:27 +10:00
Will Marshall
234d4de7ed Forcing everything to be SSL 2014-05-14 15:55:19 +10:00
Will Marshall
9903e42811 Adding reset password stuff 2014-05-09 14:26:07 +10:00
Will Marshall
e48a25983a Starting a working forgot password system 2014-03-27 15:11:11 +11:00
Will Marshall
df435c0a38 Adding Paypal plumbing 2014-03-07 15:10:20 +11:00
Rohan Mitchell
1ebfea9c76 Require uglifier, should fix asset precompilation 2014-01-16 14:16:45 +11:00
Rohan Mitchell
7d224fb5ac Update js compressor for staging as well as production 2014-01-16 12:06:00 +11:00
Rohan Mitchell
38a20e4a8c Turn off name mangling to make DI more natural in angular - https://shellycloud.com/blog/2013/10/how-to-integrate-angularjs-with-rails-4 2014-01-16 12:05:43 +11:00
Will Marshall
578651ddae forcing SSL in staging 2013-12-04 14:26:22 +11:00
Will Marshall
ff003d8931 disabling SSL :/ 2013-12-04 13:42:35 +11:00
Will Marshall
c2d3e8bcec Forcing staging to SSL 2013-12-04 13:08:28 +11:00
Rohan Mitchell
e47fa0edfd Rename application from Openfoodweb to Openfoodnetwork 2013-10-18 17:32:22 +11:00
alexs
82df7cddeb Added staging environment. 2013-08-15 17:43:21 +10:00
alexs
94cab872a5 Temporarily removing ssl enforcing. 2013-08-11 17:53:53 +10:00
alexs
834cec48bf Forcing site-wide SSL for production and staging environments. 2013-08-09 13:28:58 +10:00
David Cook
98be44b301 Disable asset debug logging 2013-06-20 11:50:34 +10:00
Rob H
9c9431ca7f Install Letter Opener for development environment 2012-12-07 14:31:23 +11:00
Rohan Mitchell
4fc7295b97 Use S3 configuration from environment vars instead of s3.yml 2012-10-19 16:40:18 +11:00