camaleon_cms 2.4.3.13 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60220e65572eba3df3e3307a97c423dda3a5c88b
4
- data.tar.gz: 8fbafdb15258a5aec532b99f1f361f3f76a65d83
3
+ metadata.gz: c5662dad21ed6c8a702ccc39bb3a40fc16b2f671
4
+ data.tar.gz: 92695b22b00c34babc4fc4f3209a24883fed4f0a
5
5
  SHA512:
6
- metadata.gz: 3f392f06e049b9fc300785f955cbca6e57efda0e30719e2cfa7f1271673578579a2e328b040ae27b977247a9a2b0633464a27af960dbf0fceadaa51642d9f7dc
7
- data.tar.gz: 6bef7a0c8e4c174456cbf5b9daec32377199a69f6e4d3238b887e615964a35c8fa529a616a2cfd12c0cfe9c5f971b5521702ff8f41b13d34039848cd68b4c57c
6
+ metadata.gz: 93e0cc72c5d2afa6ea1bf24b987fe7207e364bcd361425a9c5a9441c14cee9fac28ea977d8d88914b18bbb9be6800033edb092a5e9babce07a0015eb9c927a98
7
+ data.tar.gz: db417f6d56f22fa86a692b9de0a1b8ae002b269231fc6c821169b28efd0b6b1a6743ece3f41216243b4f410642f50ef449d71140d9895e55dd8fa2cf16171770
data/README.md CHANGED
@@ -62,16 +62,21 @@
62
62
  ```
63
63
  bundle install
64
64
  ```
65
- * Install the CMS (before this, you can change defaut configuration in config/system.json)
65
+ * Camaleon CMS Installation
66
66
 
67
67
  ```
68
68
  rails generate camaleon_cms:install
69
69
  ```
70
+ In config/system.json you can customize your cms settings. [Here](config/system.json) you can see the full settings.
71
+ * (Optional) If you want to manage CMS migrations manually, change config/system.json -> auto_include_migrations=false and generate it with:
72
+ ```
73
+ rake camaleon_cms:generate_migrations
74
+ ```
70
75
  * Create database structure
71
-
72
76
  ```
73
77
  rake db:migrate
74
78
  ```
79
+
75
80
  * Start your server
76
81
 
77
82
  ```
@@ -154,6 +159,8 @@ If you need support, need some extra functionality or need plugins, please conta
154
159
  * Site: http://camaleon.tuzitio.com/
155
160
  * Email: owenperedo@gmail.com
156
161
  * Skype: owen-2345
162
+ * Slack: camaleoncms.slack.com
163
+
157
164
 
158
165
  ## Author
159
166
  Owen Peredo Diaz
@@ -13,7 +13,7 @@ module Plugins::Attack::AttackHelper
13
13
  def attack_on_active(plugin)
14
14
  current_site.set_meta("attack_config", {get: {sec: 20, max: 10},
15
15
  post: {sec: 20, max: 5},
16
- msg: "#{t('plugin.attack.form.request_limit_exceeded')}",
16
+ msg: "#{I18n.t('plugin.attack.form.request_limit_exceeded')}",
17
17
  ban: 5,
18
18
  cleared: Time.now
19
19
  })
@@ -99,21 +99,29 @@ class CamaleonCms::CamaleonController < ApplicationController
99
99
  elsif (cama_current_user.present? && !cama_current_user.admin?) || !cama_current_user.present?
100
100
  # inactive page control
101
101
  if current_site.is_inactive?
102
- p = current_site.posts.find(current_site.get_option('page_inactive')).decorate
103
102
  if request.original_url.to_s.match /\A#{current_site.the_url}admin(\/|\z)/
104
103
  if cama_current_user.present?
105
104
  cama_logout_user
106
105
  flash[:error] = ('Site is Inactive')
107
106
  end
108
107
  else
109
- redirect_to(p.the_url) unless params == {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
108
+ p = current_site.posts.find_by_id(current_site.get_option('page_inactive')).try(:decorate)
109
+ if p
110
+ redirect_to(p.the_url) unless params == {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
111
+ else
112
+ render html: 'This site was inactivated. Please contact to administrator.'
113
+ end
110
114
  end
111
115
  end
112
116
 
113
117
  # maintenance page and IP's control
114
118
  if current_site.is_maintenance? && !current_site.get_option('maintenance_ips', '').split(',').include?(request.remote_ip)
115
- p = current_site.posts.find(current_site.get_option('page_maintenance')).decorate
116
- redirect_to(p.the_url) if params != {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
119
+ p = current_site.posts.find_by_id(current_site.get_option('page_maintenance')).try(:decorate)
120
+ if p
121
+ redirect_to(p.the_url) if params != {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
122
+ else
123
+ render html: 'This site is in maintenance mode. Please contact to administrator.'
124
+ end
117
125
  end
118
126
  end
119
127
  end
@@ -74,6 +74,8 @@ module CamaleonCms::UploaderHelper
74
74
  cama_uploader_generate_thumbnail(uploaded_io.path, res['key'], settings[:thumb_size]) if settings[:generate_thumb] && res['thumb'].present?
75
75
 
76
76
  FileUtils.rm_f(uploaded_io.path) if settings[:remove_source]
77
+
78
+ hooks_run('after_upload', settings)
77
79
  res
78
80
  end
79
81
 
@@ -93,6 +93,8 @@ class CamaleonCmsAwsUploader < CamaleonCmsUploader
93
93
  def delete_file(key)
94
94
  key = "#{@aws_settings["inner_folder"]}/#{key}" if @aws_settings["inner_folder"].present?
95
95
  bucket.object(key.split('/').clean_empty.join('/')).delete rescue ''
96
+ @instance.hooks_run('after_delete', key)
97
+
96
98
  reload
97
99
  end
98
100
 
@@ -96,6 +96,8 @@ class CamaleonCmsLocalUploader < CamaleonCmsUploader
96
96
  def delete_file(key)
97
97
  file = File.join(@root_folder, key)
98
98
  FileUtils.rm(file) if File.exist? file
99
+ @instance.hooks_run('after_delete', key)
100
+
99
101
  reload
100
102
  end
101
103
 
@@ -11,7 +11,8 @@
11
11
  "relative_url_root": "", // URL prefix, for example to get http://localhost:3000/blog/, this should be "blog"
12
12
  "admin_path_name": "admin", // URL prefix for admin panel, for example to get http://localhost:3000/sekret/, this should be "sekret"
13
13
  "user_model": "", // class name for users (Permit to use custom logins by custom user models like devise)
14
- "media_slug_folder": false // permit to use site slug for upload media folder instead of site-id
14
+ "media_slug_folder": false, // permit to use site slug for upload media folder instead of site-id
15
+ "auto_include_migrations": true // permit to auto include all migrations of camaleon cms and its related plugins, if false you can generate manually with: rake camaleon_cms:generate_migrations
15
16
  }
16
17
 
17
18
  // Note: after any change in this file, you need to restart your server to apply changes.
@@ -58,18 +58,22 @@ module CamaleonCms
58
58
 
59
59
  # extra configuration for plugins
60
60
  app.config.eager_load_paths += %W(#{app.config.root}/app/apps/**/)
61
- PluginRoutes.all_plugins.each{ |plugin|
62
- app.config.paths["db/migrate"] << File.join(plugin["path"], "migrate") if Dir.exist?(File.join(plugin["path"], "migrate"));
63
- app.config.paths["db/migrate"] << File.join(plugin["path"], "db", "migrate") if Dir.exist?(File.join(plugin["path"], "db", "migrate"));
64
- }
61
+ if PluginRoutes.static_system_info['auto_include_migrations']
62
+ PluginRoutes.all_plugins.each{ |plugin|
63
+ app.config.paths["db/migrate"] << File.join(plugin["path"], "migrate") if Dir.exist?(File.join(plugin["path"], "migrate"));
64
+ app.config.paths["db/migrate"] << File.join(plugin["path"], "db", "migrate") if Dir.exist?(File.join(plugin["path"], "db", "migrate"));
65
+ }
66
+ end
65
67
 
66
68
  # Static files
67
69
  app.middleware.use ::ActionDispatch::Static, "#{root}/public"
68
70
 
69
71
  # migrations checking
70
- unless app.root.to_s.match root.to_s
71
- config.paths["db/migrate"].expanded.each do |expanded_path|
72
- app.config.paths["db/migrate"] << expanded_path
72
+ if PluginRoutes.static_system_info['auto_include_migrations']
73
+ unless app.root.to_s.match root.to_s
74
+ config.paths["db/migrate"].expanded.each do |expanded_path|
75
+ app.config.paths["db/migrate"] << expanded_path
76
+ end
73
77
  end
74
78
  end
75
79
  end
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.4.3.13'
2
+ VERSION = '2.4.4'
3
3
  end
@@ -15,4 +15,16 @@ namespace :camaleon_cms do
15
15
  cama_uploader_generate_thumbnail(file.key, file.key, "")
16
16
  end
17
17
  end
18
+
19
+ desc 'Copy Camaleon CMS and all plugins migrations to migration folder'
20
+ task generate_migrations: :environment do
21
+ PluginRoutes.all_plugins.each do |plugin|
22
+ ENV["FROM"] = plugin['KEY']
23
+ if Rake::Task.task_defined?("railties:install:migrations")
24
+ Rake::Task["railties:install:migrations"].invoke
25
+ else
26
+ Rake::Task["app:railties:install:migrations"].invoke
27
+ end
28
+ end
29
+ end
18
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3.13
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-18 00:00:00.000000000 Z
11
+ date: 2017-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -24,34 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: json
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.0.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 2.0.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: cancancan
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '1.10'
33
+ version: '2.0'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '1.10'
40
+ version: '2.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: draper
57
43
  requirement: !ruby/object:Gem::Requirement