Commit Graph

38 Commits

Author SHA1 Message Date
taitus
d54a5c2ae0 Allow define maximum_attemps and unlock_in 2023-10-24 20:21:03 +02:00
taitus
873ec84b52 Allow disable devise lockable through secrets 2023-10-24 20:20:29 +02:00
taitus
7c771b28b5 Add password complexity 2023-10-24 19:00:43 +02:00
taitus
87fc3c572b Add security secret "last_sign_in"
In order to comply with the security measure for the
ENS: "[op.acc.5.r5.2] The user shall be informed of
the last access made with his identity".

We have added a new secret to display the last
access made to the user on the "My account" page.
2023-10-20 08:03:24 +02:00
Eduardo Vilar
0ea61b9b61 Allow different omniauth settings per tenant
Co-Authored-By: Javi Martín <javim@elretirao.net>
2022-11-11 01:39:30 +01:00
Javi Martín
a3be1e174b Allow different HTTP basic auth settings per tenant 2022-11-11 01:39:30 +01:00
Javi Martín
18f1d5c1a3 Allow different remote translation keys per tenant
Note we don't need to update the tests; the tests themselves help us
confirm that `Rails.application.secrets` and `Tenant.current_secrets`
return the same object on single-tenant applications.
2022-11-11 01:39:29 +01:00
Javi Martín
338f4929ca Allow different manager auth settings per tenant 2022-11-11 01:39:29 +01:00
Javi Martín
eb2cf00ddf Allow different SMS settings for different tenants 2022-11-11 01:39:29 +01:00
Javi Martín
06d0c26126 Allow having different SMTP settings per tenant
Right now this is configured using the `secrets.yml` file, which is the
file we've used in the past to configure SMTP settings.

Note that, in the `current_secrets` method, the `if default?` condition
is there so in single-tenant applications it returns the exact same
object as `Rails.application.secrets`, and it makes it immediately clear
for developers reading the code. We're also caching the tenant secrets
(using `||=`) so they behave the same way as Rails secrets; for this to
work properly 100% of the time (for example, in tests) we need to expire
these cached secrets whenever the Rails secrets change.

A similar `unless Tenant.default?` condition is present in the
ApplicationMailer because there's a chance some CONSUL installations
might not be using secrets to define the SMTP settings(they might be
using environment variables, for example) and so in this case we don't
want to force settings based on the secrets.yml file because it would
break the application.

The structure of the SMTP settings in the secrets file should be:

```
production:
  tenants:
    name_of_the_tenant_subdomain:
      smtp_settings:
        address:
        (...)
```
2022-11-11 01:39:29 +01:00
Javi Martín
5983006657 Use a custom method to detect the current tenant
The subdomain elevator we were using, which is included in apartment,
didn't work on hosts already including a subdomain (like
demo.consul.dev, for instance). In those cases, we would manually add
the subdomain to the list of excluded subdomains. Since these subdomains
will be different for different CONSUL installations, it meant each
installation had to customize the code. Furthermore, existing
installations using subdomains would stop working.

So we're using a custom method to find the current tenant, based on the
host defined in `default_url_options`.

In order to avoid any side-effects on single-tenant applications, we're
adding a new configuration option to enable multitenancy

We're enabling two ways to handle this configuration option:

a) Change the application_custom.rb file, which is under version control
b) Change the secrets.yml file, which is not under version control

This way people prefering to handle configuration options through
version control can do so, while people who prefer handling
configuration options through te secrets.yml file can do so as well.

We're also disabling the super-annoying warnings mentioning there are no
tenants which we got every time we run migrations on single-tenant
applications. These messages will only be enabled when the multitenancy
feature is enabled too. For this reason, we're also disabling the
multitenancy feature in the development environment by default.
2022-11-09 18:19:20 +01:00
Javi Martín
b544ec8988 Remove rollbar gem dependency
We already support Errbit and Airbrake as error monitoring services.
Since some people might not want to setup Errbit and might prefer
Rollbar over Airbrake, we're referencing it in the custom gemfile.
2021-12-08 15:56:17 +01:00
Javi Martín
c161d7b5f6 Comment secret key base on production enviroments
Although our installer automatically generates a secret key base, we
want to avoid any chance of installations who don't use the installer
having an empty secret key base or using the default secret key base we
provide to use on development and test environments.
2021-03-22 20:33:18 +01:00
Javi Martín
f658126780 Support exception management with Airbrake+Errbit
With Errbit, you can set up your own server and host the information
regarding your exceptions there. You can also hire Airbrake's hosting
services or easily setup Errbit on Heroku.

We're still including the rollbar gem so we don't harm CONSUL users who
are using rollbar.

Note Errbit requires an old version of Airbrake which forced users to
configure the gem. So we're adding the current environtment to
`ignore_environments` when the project id isn't defined; this way the
application won't crash in this case.
2020-08-27 16:22:01 +02:00
Julian Herrero
193e51d42f Enable Wordpress Oauth login and registration 2020-02-07 12:23:41 +07:00
Javi Martín
1910115469 Use symbols instead of strings for SMTP settings
ActionMailer does differenciate between symbols and strings, and the
code stringifying keys comes from an early version which we forgot to
remove.
2019-12-01 20:30:45 +01:00
taitus
0025fcb43e Update secrets.yml.example
Add smtp settings for staging environment
2019-11-26 16:52:46 +01:00
Javi Martín
a08d42d3f8 Enable/disable delayed jobs in the secrets file
While this is not a secret and in theory should be in a file under
version control, currently the CONSUL installer disables delayed jobs by
default, meaning we were keeping two versions of the delayed jobs
configuration file, and some existing configurations have their settings
defined in a file in capistrano's `shared` folder.

So we're moving existing settings to the secrets file.
2019-11-12 14:58:35 +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
taitus
fa80d96249 Add new key to api's secrets group 2019-06-27 09:19:36 +02:00
Ziyan Junaideen
73b49adcc4 Secret yml update + checking for presence of recipients 2019-01-31 10:50:59 +01:00
Alberto Calderón Queimadelos
0e1d5d95a7 Revert "Make config.time_zone configurable at secrets.yml" 2018-03-08 17:12:00 +01:00
Bertocq
f9909573a3 Make config.time_zone configurable at secrets.yml 2018-03-05 11:17:25 +01:00
Bertocq
32e746ddb3 Add maps config variables to secrets example file 2018-01-16 12:46:15 +01:00
Bertocq
bc92b8d2cd Update secrets.yml.example file 2017-10-02 17:52:13 +02:00
Senén Rodero Rodríguez
5a09b79da4 Move map tiles provider server and map tiles attribution to secrets. 2017-09-27 14:50:03 +02:00
Bertocq
8b2b21c6d7 Remove Tolk, Crowdin substituted it
Why:

* Crowdin now hosts all consul translations publicly so anyone can contribute https://crowdin.com/project/consul/invite
* Crowdin makes easy for non-tech people to contribute, once we have a demo site we'll be able to offer "on site" translation
* If you still use Tolk, we recommend removing this commit (but adding tolk gem to ./Gemfile_custom file to avoid future merge conflicts)

How:

* Reverting changes introduced with 9610a6a933
2017-07-09 00:56:14 +02:00
Antonio Tapiador del Dujo
9610a6a933 Adds Tolk gem for i18n web interface
Closes #793
2016-01-14 14:57:06 +01:00
rgarcia
41dc30f41a adds server_name to secrets.yml.example 2015-09-01 21:22:45 +02:00
rgarcia
362c9b9e33 updates secrets.yml.example 2015-09-01 20:06:09 +02:00
David Gil
59aede5b00 adds Google OAuth2 support 2015-08-25 14:15:24 +02:00
David Gil
86dccac9c6 adds support for Facebook OAuth 2015-08-24 20:24:54 +02:00
David Gil
88eb8a6cc4 adds omniauth and omniauth-twitter gems and initializer with references to secrets 2015-08-24 20:22:21 +02:00
rgarcia
4839081ad2 uses simple_captcha instead of recaptcha [#51] 2015-08-10 20:24:56 +02:00
Juanjo Bazán
b436331ce5 fixes key name 2015-07-27 18:48:30 +02:00
rgarcia
ef2cd18028 configures recaptcha 2015-07-27 18:44:33 +02:00
rgarcia
723b0584ce removes secrets.yml from version control 2015-07-25 18:19:03 +02:00