Commit Graph

5066 Commits

Author SHA1 Message Date
Javi Martín
334b57501b Simplify uses of polymorphic admin nested routes 2020-06-11 18:39:57 +02:00
Javi Martín
bedd879025 Remove redundant show/hide screen reader texts
These texts are redundant since we added the same texts for everyone in
commit 6b85ed87.
2020-05-12 23:23:01 +02:00
Senén Rodero Rodríguez
1bd4915fbb Apply fixes suggested by Crowdin translators
Some Crowdin translators noticed about some errors at source language
strings (English).
2020-04-27 14:27:01 +02:00
Javi Martín
3526aef1e4 Remove callback terminator initializer
We no longer need it since this is the default behavior in Rails 5.1.
2020-04-23 18:49:43 +02:00
Senén Rodero Rodríguez
103726f24a Add ckeditor tabletools plugin
This plugin provides more control over tables and solves a JS error thrown
when user clicks on "Cell properties" ckeditor feature.

https://ckeditor.com/cke4/addon/tabletools
2020-04-23 18:18:26 +02:00
Senén Rodero Rodríguez
9fd9ef8a54 Explicitly disable not used ckeditor plugins
All of these plugins are not used anywhere.

Change introduced at ckeditor initializer will ommit unneeded
precompilation of plugins assets on production environments.

Change introduced at ckeditor config file adresses the problem with assets
pipeline fallback on testing environments described here: #2711. Now plugins
that are explicitly disabled will not be precomiled when running ckeditor
javascript enabled feature specs.
2020-04-23 10:37:26 +02:00
Senén Rodero Rodríguez
58645d0146 Enable pastefromword plugin 2020-04-20 22:12:28 +02:00
Javier Martín
06bc72cc66 Merge pull request #3959 from consul/i18n-custom-translations
Fix custom translations with options
2020-04-10 12:51:23 +02:00
decabeza
af1e11838c Fix custom translations with options 2020-04-10 12:17:27 +02:00
Javier Martín
b5682362b7 Merge pull request #3966 from consul/remove_unused_filter
Remove unused tag filter
2020-04-09 21:08:42 +02:00
Andrew Sims
95c82d8777 Changes following PR review
* Internationalisation for admin fields
* Correct typos
* Additional tests
* Replace ternary with if-then statement
2020-04-09 07:11:53 +10:00
Javi Martín
b483d50d30 Remove unused tag filter
This filter was added in commit 4285ba4b, it was changed in commit
002d8688, and most of the code from the original commit has disappeared
without a trace (maybe due to a merge conflict?).

This filter could actually be useful if we started using it when users
click on a tag. Since we don't, I'm removing it. We might add it back if
we decide to actually use it.
2020-04-08 13:49:48 +02:00
Javi Martín
03c135e5fd Apply escape_javascript security patch
This patch was included in the Rails 5.2.x series, but since we haven't
upgraded yet, we need to apply it manually.
2020-04-06 16:19:44 +02:00
Andy Sims
74fbde09f1 Support creates follow (Merge pull request #3895)
* Supporting a proposal will create a follow relationship
* Only followers receive notifications
2020-04-06 15:26:47 +02:00
Javier Martín
e68316fc85 Merge pull request #3942 from rockandror/i18n_crowdin
Update translations from Crowdin
2020-03-10 18:44:24 +01:00
Senén Rodero Rodríguez
37dbe1ca42 Update translations from Crowdin 2020-03-10 16:50:52 +01:00
Senén Rodero Rodríguez
11f778b09f Change translation language 2020-03-10 15:48:45 +01:00
Julian Herrero
1b683ad0da Allow deploying a specific branch to production
We could also use the deploy-secrets file; here we use `ENV["branch"]`
for consistency with other environments.
2020-03-09 13:16:47 +01:00
Javi Martín
e1e2329189 Specify which bundler version to install
We're now using the same version we used to generate our Gemfile.lock.

Using the latest bundler we got a deprecation warning, which might turn
into an error in the future:

[DEPRECATED] The `--deployment` flag is deprecated because it relies on
being remembered across bundler invocations, which bundler will no
longer do in future versions.

We could also upgrade to bundler 2.x, but since we're using Ruby 2.4 and
Ruby 2.6 comes with bundler 1.17, we've decided to keep this version.
2020-02-27 17:33:21 +01:00
Javier Martín
9d750dd399 Merge pull request #3917 from rockandror/improve-remote-translations
Improve remote translations
2020-02-26 17:29:14 +01:00
taitus
d853366d38 Add RemoteTranslation validations
- Validate that locale is a valid locale for RemoteTranslation Client.
- RemoteTranslation can only be created for resources that do not have the requested
language translated
2020-02-26 16:47:13 +01:00
Pierre Mesure
40ecbe0348 Remove fallbacks = true from staging, preprod and prod 2020-02-20 11:09:55 +01:00
Javier Martín
14b1f1b4d3 Merge pull request #3911 from rockandror/dashboard-email
Improve Dashboard emails
2020-02-19 19:06:53 +01:00
taitus
45aec05b93 Update and rename Setting as feature type
The old Setting["dashboard.emails"] is a Feature Setting, but appeared as
Configuration Setting without button for enable/disable.
In this commit, we update the old setting to behave like a Feature Setting.
Too we rename setting to clarify what emails are blocked with this feature.
2020-02-17 16:30:38 +01:00
Julian Herrero
193e51d42f Enable Wordpress Oauth login and registration 2020-02-07 12:23:41 +07:00
Julian Nicolas Herrero
00d023a18d Merge pull request #3891 from consul/sitemap_skip_disabled_processes
Don't include disabled processes in sitemap
2019-12-24 11:48:16 +07:00
Javier Martín
309c86bed7 Merge pull request #3883 from rockandror/i18n_crowdin
Update translations from Crowdin
2019-12-19 14:29:19 +01:00
Julian Herrero
6e00842b0e Don't include disabled processes in sitemap 2019-12-19 13:26:29 +07:00
Senén Rodero Rodríguez
7ceb42e858 Update translations from Crowdin 2019-12-18 16:50:48 +01:00
Javier Martín
fcd6b07c55 Merge pull request #3887 from rockandror/remove-comments-from-translations-files
Remove comments from `en/rails.yml` files
2019-12-17 21:49:31 +01:00
Senén Rodero Rodríguez
30b3309f0b Remove comments from en/rails.yml files
These comments are not updated with current consul locale files
configuration and Crowdin is adding those comments to all other
existing locales.
2019-12-17 15:35:48 +01:00
Javier Martín
3bbd63e549 Merge pull request #3871 from consul/smtp_symbols
Use symbols instead of strings for SMTP settings
2019-12-11 18:33:55 +01:00
Senén Rodero Rodríguez
a18d9108de Remove translations accidentally added
Remove them from repo so Crowdin stops to automatically re-adding
2019-12-09 17:40:06 +01: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
69be13f7a7 Keep default puma settings in the test environment
The test environment was using the file in `config/puma.rb`, meaning it
wouldn't work with Rails 5.1, which uses a different setup for Puma.

I've decided to create a new file called `defaults.rb`, which will be
used in every environment but development and test. We could also add an
empty file in `config/puma/test.rb`; I think that's less intuitive, but
it's a subjective opinion.
2019-11-19 21:33:22 +01:00
Javi Martín
755bc8e88a Restart the application on deploy:restart
The task `deploy:restart` was doing nothing since we moved from unicorn
to puma.

Now we're also restarting delayed jobs on `deploy:restart`, which is
probably what's expected in most cases.
2019-11-17 22:55:42 +01:00
Javi Martín
69b4740ec8 Remove redundant cleanup task
Capistrano automatically runs `deploy:cleanup` after finishing.
2019-11-17 22:55:27 +01:00
Javi Martín
dd07a863cb Allow restarting puma with rails restart
So now the way to restart the application does not depend on whether we
use puma or passenger.

What this plugin actually does is restarting puma when we touch the
`tmp/restart.txt` file, which is what `rails restart` does.
2019-11-17 22:55:27 +01:00
Javi Martín
b0f9287000 Restart the application on every reboot
This way we don't have to start it manually every time the server is
restarted.

Note if we start the application with `bin/rails s start -e production`,
as we'd probably want to do so this task doesn't depend on the server we
use, the application will crash when we restart it because it will be
restarted in the development environment. Maybe this issue will be fixed
in future versions of Rails and/or Puma.

Also note we're passing `2` workers to delayed job, and this number must
be the same number we use for the `delayed_job_workers` variable in
capistrano. I haven't found a way to share this variable between
whenever and capistrano.
2019-11-17 22:55:23 +01:00
Javi Martín
1ff20921d3 Daemonize puma on production
We're already doing this thanks to capistrano3-puma, but it's easy to
forget this option when starting puma manually.
2019-11-17 22:11:47 +01:00
Javi Martín
6b5d25b28e Update Ruby after deploy:updating
We need to download the most recent CONSUL and check its `.ruby-version`
file before installing Ruby.

The `rvm1-capistrano` gem knows it and was invoking the `updating` task
before installing Ruby. So we were getting a warning in Capistrano about
the `updating` task being executed twice.
2019-11-17 17:17:17 +01:00
Javier Martín
6c80da71ad Merge pull request #3853 from consul/fix_first_deployment
Fix secrets task on first deployments
2019-11-14 13:32:32 +01:00
Javi Martín
0c33c4061d Fix secrets task on first deployments
New CONSUL instances who didn't use the newest installer and haven't
done any deployments with capistrano would get an exception because the
`current` capistrano folder doesn't exist yet.
2019-11-14 00:15:19 +01:00
Javi Martín
1e32455cd9 Add puma configuration to version control
We were using Capistrano's shared folder because it was the default
folder used by the capistrano-puma gem. However, it's easier to manage
it if it's under version control.

So we're moving the old `puma.rb` to `puma/development.rb`, and we use
the new `puma.rb` file for all environments except development. Anyone
installing CONSUL can change these files at will or change the specific
files for preproduction, production and staging environments.
2019-11-13 13:28:27 +01:00
Javi Martín
82e96edf1f Remove duplication in deploy environment files
Deploy environment files were loaded after config/deploy.rb was loaded,
meaning if we used settings like `deploy_to` or `current_path` to set
variables inside the config/deploy.rb file, we'd be using the default
settings instead of the ones dictated by the deploy environment files.
2019-11-12 20:20:45 +01:00
Javi Martín
1f4f70b4a9 Remove redundant stage settings
These files are only loaded when the stage already has the value set
inside them, so we don't need to set it again.

On the other hand, the `rails_env` setting is configured in the
`config/deploy.rb` file.
2019-11-12 20:20:45 +01:00
Javi Martín
c4a97a3cf7 Clarify our puma.rb file is only used locally 2019-11-12 16:05:43 +01:00
Javi Martín
95d395343b Use two puma workers
This is the same configuration we had with unicorn.

With several workers, we've got two basic configuration options:

* Preload the application and use a hot restart
* Don't preload the application and use a phased restart

I've decided to preload the application because using a hot restart
changes are available immediately, while with a phased restart there are
a few seconds when both workers for the old code and workers for the new
code exist.

Using a phased restart also has advantages, so some forks might want to
disable the `puma_preload_app` setting in order to use it.
2019-11-12 15:32:04 +01:00
Javi Martín
d17b2523cf Make puma restarts work with systemd
Just like mentioned in puma's documentation:

https://github.com/puma/puma/blob/master/docs/systemd.md#socket-activation
2019-11-12 15:32:04 +01:00