Commit Graph

12892 Commits

Author SHA1 Message Date
Sharang Dashputre 51171413bb Reword test names in credentials_test.rb 2019-03-25 12:44:51 +05:30
Vipul A M 6a5c8b9199
Cleanup guide for configuring config.disable_sandbox and related changelog [ci skip] (#35733) 2019-03-25 03:14:51 +05:30
Guillermo Iguaran df51b75f12
Merge pull request #35732 from rails/webdrivers
Replace chromedriver-helper with webdrivers
2019-03-24 16:33:24 -05:00
Guillermo Iguaran b4ca05ea43
Merge pull request #35723 from sikachu/disable-sandbox-flag
Add config.disable_sandbox option to Rails console
2019-03-24 16:22:21 -05:00
Guillermo Iguaran 895edbcf40 Use webdrivers instead of chromedriver-helper in new apps 2019-03-24 16:08:09 -05:00
Yuji Yaginuma 122853dc54
Merge pull request #35718 from y-yagi/add_secret_key_base_when_creating_new_credentials
Add `secret_key_base` when creating new credential file
2019-03-24 09:44:13 +09:00
Prem Sichanugrist b27105252b Add config.disable_sandbox option to Rails console
A long-running `rails console --sandbox` could cause a database server
to become out-of-memory as it's holding on to changes that happen on the
database.

Given that it's common for Ruby on Rails application with huge
traffic to have separate write database and read database, we should
allow the developers to disable this sandbox option to prevent someone
from accidentally causing the Denial-of-Service on their server.
2019-03-23 19:31:03 +09:00
John Hawthorn d0334b8f01 Update comment for how secret key is calculated
This updates the comment to reflect how the secret key is generated
since 4c743587ad

Fixes #35717
2019-03-22 17:59:41 -07:00
yuuji.yaginuma 0e9e59953f Add `secret_key_base` when creating new credential file
Since `secret_key_base` is expected to be included in credential file,
`secret_key_base` should be included even if re-create the file. This is
the same behavior as creating a new app.
When env is specified, it may be unnecessary, so I added it only when not
specifying env.
2019-03-23 09:07:57 +09:00
John Hawthorn 5c2d695993 Update CHANGELOGs for 6.0.0.beta3 release 2019-03-22 13:13:01 -07:00
yuuji.yaginuma efb706daad Fix server restart test on Puma 3.12.1
Since https://github.com/puma/puma/pull/1700, the default host is
correctly used. So `localhost` is used instead of `0.0.0.0`.

As a result, the log output on restart is changed, and the restart test
fails on Puma 3.12.1.
https://travis-ci.org/rails/rails/jobs/509239592#L2303-L2305

Specify binding explicitly to avoid being affected by Puma changes.
2019-03-22 07:49:38 +09:00
Eileen M. Uchitelle d369911478
Merge pull request #35661 from jhawthorn/lookup_context_validation
Validate types assigned to LookupContext#formats=
2019-03-20 11:52:55 -04:00
yuuji.yaginuma e5d7b98fbd Make aliases of `database` option in generators work
Thor automatically adds `-` if aliases do not start with `-`.
0879c1773d/lib/thor/parser/options.rb (L53)

But Thor follows a convention of one-dash-one-letter options.
So, even if `-` is added to `db`, it does not work.
0879c1773d/lib/thor/parser/options.rb (L4)

Follow up #34021.
2019-03-20 14:52:01 +09:00
Nicholas La Roux 49f4625b70
Revert "Revert "Remove `javascripts` and `javascript_engine` options for generators"" 2019-03-20 09:48:51 +09:00
Rafael França f88ea5fd74
Merge pull request #35656 from larouxn/revert-34277-remove-javascripts-javascripts_engine-options-for-generators
Revert "Remove `javascripts` and `javascript_engine` options for generators"
2019-03-19 16:37:14 -04:00
Nicholas La Roux d82839b0ee
Revert "Remove `javascripts` and `javascript_engine` options for generators" 2019-03-19 08:22:07 +09:00
John Hawthorn 663548845b Use symbol for mail preview format, not string 2019-03-18 16:06:31 -07:00
eileencodes 8f3066fccc Fix database configuration when adding another config level
This is kind of hard to explain but if you have a database config with
another level like this:

```
development:
  primary:
    database: "my db"
    variables:
      statement_timeout: 1000
```

the database configurations code would chooke on the `variables` level
because it didn't know what to do with it.

We'd see the following error:

```
lib/active_record/database_configurations.rb:72:in
`block in find_db_config': undefined method `env_name' for [nil]:Array
(NoMethodError)
```

The problem here is that Rails does correctly identify this as not a
real configuration but returns `[nil]` along with the others. We need to
make sure to flatten the array and remove all the `nil`'s before
returning the `configurations` objects.

Fixes #35646
2019-03-18 16:23:00 -04:00
प्रथमेश Sonpatki 0e94a513fe
Added release notes for changes in Railties [ci skip] (#35622)
[Alex Kitchens, Prathamesh Sonpatki]
2019-03-18 22:41:53 +05:30
yuuji.yaginuma 6f94260ac6 Add -e/--environment option to `rails initializers`
This allows specifying the environment as would any other rails commands.
2019-03-16 10:02:06 +09:00
Xavier Noria a47c84d584 Engines are reloaded in Zeitwerk mode [closes #35618] 2019-03-15 22:59:03 +01:00
yuuji.yaginuma c801b232bc Properly expand the environment's name in all commands
Since 3777701f13, the environment's name is
automatically expanded in console and dbconsole commands.
In order to match the behavior between the commands, fixes it to have the
same behavior of all the commands.

This behavior is defined in `EnvironmentArgument`. Since
`EnvironmentArgument` also defines the environment option, it is reused.

However, since desc was not content that can be used in all comments,
fixed desc to be defined for each command.
2019-03-15 07:43:10 +09:00
yuuji.yaginuma 0187053109 Make application work without tmp directory
The tmp directory is added to version control in the newly created
application. This was added in Rails 5.0.0(f06ce4c12a).

However, applications created before that are not guaranteed to have the
tmp directory. If the tmp directory does not exist, writing to the key file
raise error.

This is a bit incompatible. So I fixed that create the directory before
writing a key.
2019-03-14 16:14:15 +09:00
eileencodes e0c6bce203 Fix secret_key_base for Railties
This was missed in the security fix for local dev. CI doesn't have a tmp
directory in the apps built for testing so these end up failing. This
adds the secret_key_base so we don't need to generate one.
2019-03-13 16:41:29 -04:00
eileencodes a2bd669ed2 v6.0.0.beta3 release
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEEvJkGf0BARV+D0L2ulxXUSC76N8FAlyJN4cACgkQulxXUSC7
 6N9ZXAf/Wx7edIct8kZzcC6irlROx4DzpNbrrH792sO1OAcnoFDE7DPkokllTEP/
 4kzC42lca/XG27MCl7E0dtVD8hIyAl89nxid6cwKFVZVTPIRVc1wjXkoiWy/cvd7
 6+9IjxhlgrzxGnw3aWZJG7H3iqz69yr55aoSDU/TbMqq5kQrqNF95vr2nc8LEUco
 SLQj0pO/tfJdHquSeX0JiXn3VSEHT+5TdLGQ3J/w0wFU6mkecH4MJMJvMwLFx/v4
 llnvF6HyfSLASWbrpdD3h6MQHpImDoee5vILXAHzPdSaEVcVa1cDFtMcPMYiu8Dw
 AGdCAaHQhZFFGoYK472+o6pur0dxEA==
 =5dET
 -----END PGP SIGNATURE-----

Merge tag 'v6.0.0.beta3'

v6.0.0.beta3 release
2019-03-13 13:11:10 -04:00
Akira Matsuda 9f02a8f89b Indentation >> 2019-03-13 19:34:50 +09:00
yuuji.yaginuma 12ddee0ce8 Fix rubocop violations 2019-03-13 17:51:46 +09:00
yuuji.yaginuma 5ab0c1a8cc Add test for runner command with `environment` option 2019-03-13 10:09:41 +09:00
Cliff Pruitt 44f3530274 Add additional ERB DummyCompiler tests
This adds a few additional tests to the commits by eileencodes (https://github.com/rails/rails/pull/35497) and rafaelfranca (cfa22f1a4b). The additional tests cover several more ERB tag formatting cases such as multiline tags, conditional statements that result in duplicate keys, and multiple erb statements on a single line.
2019-03-12 10:23:29 -04:00
Sharang Dashputre ad5ca97acc overriden -> overridden [ci skip] 2019-03-12 04:08:51 +05:30
Rafael Mendonça França cfa22f1a4b
Do not generate dummy string when the tag used is not the <%= 2019-03-11 17:49:27 -04:00
Kasper Timm Hansen 3a42c2305e
Merge pull request #34955 from bogdanvlviv/follow-up-33962
Add `config.credentials.content_path` and `config.credentials.key_path` to the guide
2019-03-11 21:08:20 +01:00
Kasper Timm Hansen f55306f098
[ci skip] Improve `encrypted` commands USAGE
This streamlines the lovely foundation Bogdan added. Mainly to add
guidance around encryption keys and remove some backticks.

Finally it adds some mention of how to access these files from Ruby
in apps.

[ Kasper Timm Hansen & bogdanvlviv ]
2019-03-11 21:00:00 +01:00
Kasper Timm Hansen 7874257afd
Merge pull request #34965 from bogdanvlviv/improve-rails-encrypted--help
Improve output of `rails encrypted(:edit/:show) --help`
2019-03-11 20:42:36 +01:00
eileencodes 7c87fd5635 Prep release
* Update RAILS_VERSION
* Bundle
* rake update_versions
* rake changelog:header
2019-03-11 11:58:15 -04:00
Ryuta Kamizono c41269ebc8
Merge pull request #35568 from prathamesh-sonpatki/server_squish
Squish the deprecation messages across the codebase
2019-03-11 23:16:47 +09:00
Prathamesh Sonpatki 538a459a3b
Squish the deprecation messages across the codebase
Sample example ->

Before:

prathamesh@Prathameshs-MacBook-Pro-2 blog *$ rails server thin
DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated
and will be removed in the next Rails version. Please, use the -u
option instead.

After:

prathamesh@Prathameshs-MacBook-Pro-2 squish_app *$ rails server thin
DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead.
2019-03-11 19:22:37 +05:30
Kasper Timm Hansen 2259b486f1
Merge pull request #35569 from prathamesh-sonpatki/env-vars
Mention `environment variable` instead of just `environment`
2019-03-11 14:42:15 +01:00
Prathamesh Sonpatki 4cdc93a1e4
Mention `environment variable` instead of just `environment` 2019-03-11 18:54:13 +05:30
Prathamesh Sonpatki bcc1207a8e
Use the -u switch for the `rails server` banner
- Because just passing the server argument to this command is
  deprecated in https://github.com/rails/rails/pull/32058
2019-03-11 18:26:49 +05:30
Aaron Patterson 4c743587ad Fix possible dev mode RCE
If the secret_key_base is nil in dev or test generate a key from random
bytes and store it in a tmp file. This prevents the app developers from
having to share / checkin the secret key for dev / test but also
maintains a key between app restarts in dev/test.

[CVE-2019-5420]

Co-Authored-By: eileencodes <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2019-03-10 21:30:03 -07:00
Kasper Timm Hansen c87f6841b7
Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_block
Ruby 2.7 warning: creating a Proc without a block
2019-03-10 16:31:15 +01:00
Abhay Nikam 027e492b6f Fix links in gemspec and docs from http to https. 2019-03-09 19:42:35 +05:30
Ryuta Kamizono b7fa01bb2f
Merge pull request #35529 from abhaynikam/35492-follow-up-to-updates-links-to-https
Updated links from http to https in guides, docs, etc
2019-03-09 20:49:27 +09:00
Abhay Nikam 476abd403b Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
Shailesh Kalamkar 70192cec42 [ci skip] Minor documentation fixes for consistency 2019-03-09 12:15:00 +05:30
Sharang Dashputre c2de1f79ab Don't lock the webpacker gem by its patch version 2019-03-09 05:29:36 +05:30
yuuji.yaginuma 788272231c Fix "DEPRECATION WARNING: ActionView::Template#initialize requires a locals parameter"
Ref: #35411
2019-03-09 07:54:37 +09:00
Guillermo Iguaran cd89082fa9
Merge pull request #35538 from sharang-d/use-latest-webpacker
Use the latest stable release of webpacker
2019-03-08 17:36:54 -05:00
Sharang Dashputre b2b29b06fa Minor text changes to the db:seed:replant tests 2019-03-09 02:17:59 +05:30