capdrupal 3.0.1 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c44d744004a0b49a0e7034222558aba3899026837f5b1dfcf6e994f9262e08eb
4
- data.tar.gz: 95957676e7e161041ed66fd5f56af9ce7aa071077f289e3a7864273996e5e4d7
3
+ metadata.gz: 9c0b198fb0b3a8dae0c743741c57a47722a29b2677096c290e2da2e381e6d6ed
4
+ data.tar.gz: 34da2b54176946f505b3e18426b110597b453db249fd57ee5b8725c7599b45ed
5
5
  SHA512:
6
- metadata.gz: 73243af2f5674c4f7b9b9a4421e3f377222d00630f43586c6f4d9690e9175d645821af8caa9c94d9512fd2a7aa9fc318bf9b00c629046290a4cd1457b6d0d45c
7
- data.tar.gz: '08f3121798682e048c27a75cb6f0242ebcd4d4516aeed292ccaa5f1a2612a636c501bd757984d82b18c7073c2af8c726d2712fbdf38003bfbaf61bf579db95a3'
6
+ metadata.gz: 4f21885265080d37aa365fcead9db26d28692e533017fb01b12d480330908bc212de65b8a368beb82482676e2db342421e489b5201082103ecf17cd704527217
7
+ data.tar.gz: 3a54f1fea98a00427ecd8d51909d10d24abdd4d174de0370aeb66b80e6c1156b3afbc5574fec72c4cfe1968f6adce25b76e23c5f1dfa3f1547e1b02f6da515c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Capdrupal Changelog
2
2
 
3
+ ## NEXT RELEASE
4
+
5
+ ## 3.0.3 (2023-03-14)
6
+ - Only files directory must have permissions fixed to be writable, not all shared files.
7
+
8
+ ## 3.0.2 (2022-12-22)
9
+ - Allow Site directory to be configured
10
+ - Optimize permissions related tasks
11
+
3
12
  ## 3.0.1 (2020-08-07)
4
13
  - Update the command `drupal:cache:clear` to be re-runnable after invoke
5
14
 
data/README.md CHANGED
@@ -12,6 +12,7 @@ Capdrupal Gem Version | Branch | Capistrano Version | Drupal Version
12
12
  0.11.0 | d7 | 2 | 7.x
13
13
  3.x | main | 3.x | 8.x
14
14
  3.x | main | 3.x | 9.x
15
+ 3.x | main | 3.x | 10.x
15
16
 
16
17
  ## Prerequisites
17
18
 
data/capdrupal.gemspec CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'capdrupal'
6
- spec.version = '3.0.1'
6
+ spec.version = '3.0.3'
7
7
  spec.authors = ['Kevin Wenger', 'Yann Lugrin', 'Gilles Doge', 'Toni Fisler', 'Simon Perdrisat', 'Robert Wohleb', 'Kim Pepper']
8
8
  spec.email = ['hello@antistatique.net']
9
9
 
data/lib/capdrupal.rb CHANGED
@@ -2,6 +2,7 @@ namespace :load do
2
2
  task :defaults do
3
3
  set :app_path, 'web'
4
4
  set :config_path, 'config/sync'
5
+ set :site_path, 'default'
5
6
  set :backup_path, 'backups'
6
7
  set :keep_backups, 5
7
8
  set :enable_modules, []
@@ -210,11 +211,9 @@ namespace :drupal do
210
211
  task :recommended do
211
212
  on roles(:app) do
212
213
  within release_path.join(fetch(:app_path)) do
213
- execute :chmod, '-R', '555', '.'
214
-
215
214
  # Remove execution for files, keep execution on folder.
216
- execute 'find', './ -type f -executable -exec chmod -x {} \;'
217
- execute 'find', './ -type d -exec chmod +x {} \;'
215
+ execute :find, './', '-type f ! -perm 444 -exec chmod 444 {} \;'
216
+ execute :find, './', '-type d ! -perm 555 -exec chmod 555 {} \;'
218
217
  end
219
218
  end
220
219
  end
@@ -248,12 +247,10 @@ namespace :drupal do
248
247
  task :writable_shared do
249
248
  on roles(:app) do
250
249
  within shared_path do
251
- # "web/sites/default/files" is a shared dir and should be writable.
252
- execute :chmod, '-R', '775', "#{fetch(:app_path)}/sites/default/files"
253
-
254
250
  # Remove execution for files, keep execution on folder.
255
- execute 'find', "#{fetch(:app_path)}/sites/default/files", '-type f -executable -exec chmod -x {} \;'
256
- execute 'find', "#{fetch(:app_path)}/sites/default/files", '-type d -exec chmod +sx {} \;'
251
+ # "web/sites/defaults/files" is a shared dir and should be writable.
252
+ execute :find, "#{fetch(:app_path)}/sites/#{fetch(:site_path)}/files", '-type f ! -perm 664 -exec chmod 664 {} \;'
253
+ execute :find, "#{fetch(:app_path)}/sites/#{fetch(:site_path)}/files", '-type d ! -perm 2775 -exec chmod 2775 {} \;'
257
254
  end
258
255
  end
259
256
  end
@@ -266,8 +263,8 @@ namespace :drupal do
266
263
  on release_roles :app do |server|
267
264
  ask(:answer, "Do you really want to download the files on the server to your local files? Nothings will be deleted but files can be ovewrite. (y/N)");
268
265
  if fetch(:answer) == 'y' then
269
- remote_files_dir = "#{shared_path}/#{(fetch(:app_path))}/sites/default/files/"
270
- local_files_dir = "#{(fetch(:app_path))}/sites/default/files/"
266
+ remote_files_dir = "#{shared_path}/#{(fetch(:app_path))}/sites/#{fetch(:site_path)}/files/"
267
+ local_files_dir = "#{(fetch(:app_path))}/sites/#{fetch(:site_path)}/files/"
271
268
  system("rsync --recursive --times --rsh=ssh --human-readable --progress --exclude='.*' --exclude='css' --exclude='js' #{server.user}@#{server.hostname}:#{remote_files_dir} #{local_files_dir}")
272
269
  end
273
270
  end
@@ -279,8 +276,8 @@ namespace :drupal do
279
276
  on release_roles :app do |server|
280
277
  ask(:answer, "Do you really want to upload your local files to the server? Nothings will be deleted but files can be ovewrite. (y/N)");
281
278
  if fetch(:answer) == 'y' then
282
- remote_files_dir = "#{shared_path}/#{(fetch(:app_path))}/sites/default/files/"
283
- local_files_dir = "#{(fetch(:app_path))}/sites/default/files/"
279
+ remote_files_dir = "#{shared_path}/#{(fetch(:app_path))}/sites/#{fetch(:site_path)}/files/"
280
+ local_files_dir = "#{(fetch(:app_path))}/sites/#{fetch(:site_path)}/files/"
284
281
  system("rsync --recursive --times --rsh=ssh --human-readable --progress --exclude='.*' --exclude='css' --exclude='js' #{local_files_dir} #{server.user}@#{server.hostname}:#{remote_files_dir}")
285
282
  end
286
283
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capdrupal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Wenger
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2021-09-09 00:00:00.000000000 Z
17
+ date: 2023-03-14 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: capistrano
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.1.2
113
+ rubygems_version: 3.1.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: A set of tasks for deploying and managing Drupal projects with Capistrano