-
+
Upgrade now
diff --git a/config/app.yml b/config/app.yml
index 93e0bcbed..1e8d30423 100644
--- a/config/app.yml
+++ b/config/app.yml
@@ -1,5 +1,5 @@
shared: &shared
- version: '3.3.1'
+ version: '3.4.0'
development:
<<: *shared
diff --git a/config/installation_config.yml b/config/installation_config.yml
index fae7051b7..a53bb1ed5 100644
--- a/config/installation_config.yml
+++ b/config/installation_config.yml
@@ -76,6 +76,8 @@
value: '/brand-assets/logo_dark.svg'
- name: INSTALLATION_PRICING_PLAN
value: 'community'
+- name: INSTALLATION_PRICING_PLAN_QUANTITY
+ value: 0
- name: CHATWOOT_SUPPORT_WEBSITE_TOKEN
value:
- name: CHATWOOT_SUPPORT_SCRIPT_URL
diff --git a/db/migrate/20231211010807_add_cached_labels_list.rb b/db/migrate/20231211010807_add_cached_labels_list.rb
index 02f01a7ea..026bcf7d1 100644
--- a/db/migrate/20231211010807_add_cached_labels_list.rb
+++ b/db/migrate/20231211010807_add_cached_labels_list.rb
@@ -3,17 +3,5 @@ class AddCachedLabelsList < ActiveRecord::Migration[7.0]
add_column :conversations, :cached_label_list, :string
Conversation.reset_column_information
ActsAsTaggableOn::Taggable::Cache.included(Conversation)
-
- update_exisiting_conversations
- end
-
- private
-
- def update_exisiting_conversations
- ::Account.find_in_batches do |account_batch|
- account_batch.each do |account|
- Migration::ConversationCacheLabelJob.perform_later(account)
- end
- end
end
end
diff --git a/db/migrate/20231219000743_re_run_cache_label_job.rb b/db/migrate/20231219000743_re_run_cache_label_job.rb
new file mode 100644
index 000000000..ebe553f1c
--- /dev/null
+++ b/db/migrate/20231219000743_re_run_cache_label_job.rb
@@ -0,0 +1,16 @@
+class ReRunCacheLabelJob < ActiveRecord::Migration[7.0]
+ def change
+ update_exisiting_conversations
+ end
+
+ private
+
+ def update_exisiting_conversations
+ # Run label migrations on the accounts that are not suspended
+ ::Account.active.find_in_batches do |account_batch|
+ account_batch.each do |account|
+ Migration::ConversationCacheLabelJob.perform_later(account)
+ end
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 61fd7e0d3..373d81918 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2023_12_11_010807) do
+ActiveRecord::Schema[7.0].define(version: 2023_12_19_000743) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh
index 411e43e85..c5060f869 100644
--- a/deployment/setup_20.04.sh
+++ b/deployment/setup_20.04.sh
@@ -2,7 +2,7 @@
# Description: Install and manage a Chatwoot installation.
# OS: Ubuntu 20.04 LTS
-# Script Version: 2.6.0
+# Script Version: 2.7.0
# Run this script as root
set -eu -o errexit -o pipefail -o noclobber -o nounset
@@ -19,7 +19,7 @@ fi
# option --output/-o requires 1 argument
LONGOPTS=console,debug,help,install,Install:,logs:,restart,ssl,upgrade,webserver,version
OPTIONS=cdhiI:l:rsuwv
-CWCTL_VERSION="2.6.0"
+CWCTL_VERSION="2.7.0"
pg_pass=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 15 ; echo '')
CHATWOOT_HUB_URL="https://hub.2.chatwoot.com/events"
@@ -173,15 +173,19 @@ EOF
function install_dependencies() {
apt update && apt upgrade -y
apt install -y curl
- curl -sL https://deb.nodesource.com/setup_20.x | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
+ mkdir -p /etc/apt/keyrings
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+ NODE_MAJOR=20
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
+
apt update
apt install -y \
- git software-properties-common imagemagick libpq-dev \
+ git software-properties-common ca-certificates imagemagick libpq-dev \
libxml2-dev libxslt1-dev file g++ gcc autoconf build-essential \
libssl-dev libyaml-dev libreadline-dev gnupg2 \
postgresql-client redis-tools \
@@ -779,8 +783,14 @@ function upgrade_node() {
fi
echo "Upgrading Node.js version to v20.x"
- curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
- apt install -y nodejs
+ mkdir -p /etc/apt/keyrings
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
+ NODE_MAJOR=20
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
+
+ apt update
+ apt install nodejs -y
+
}
##############################################################################
diff --git a/enterprise/app/helpers/super_admin/features_helper.rb b/enterprise/app/helpers/super_admin/features_helper.rb
index 365a93291..2fbcd1715 100644
--- a/enterprise/app/helpers/super_admin/features_helper.rb
+++ b/enterprise/app/helpers/super_admin/features_helper.rb
@@ -2,4 +2,15 @@ module SuperAdmin::FeaturesHelper
def self.available_features
YAML.load(ERB.new(Rails.root.join('enterprise/app/helpers/super_admin/features.yml').read).result).with_indifferent_access
end
+
+ def self.plan_details
+ plan = ChatwootHub.pricing_plan
+ quantity = ChatwootHub.pricing_plan_quantity
+
+ if plan == 'premium'
+ "You are currently on the
#{plan} plan with
#{quantity} agents."
+ else
+ "You are currently on the
#{plan} edition plan."
+ end
+ end
end
diff --git a/lib/chatwoot_hub.rb b/lib/chatwoot_hub.rb
index 44038145c..6d28b10fa 100644
--- a/lib/chatwoot_hub.rb
+++ b/lib/chatwoot_hub.rb
@@ -4,6 +4,7 @@ class ChatwootHub
REGISTRATION_URL = "#{BASE_URL}/instances".freeze
PUSH_NOTIFICATION_URL = "#{BASE_URL}/send_push".freeze
EVENTS_URL = "#{BASE_URL}/events".freeze
+ BILLING_URL = "#{BASE_URL}/billing".freeze
def self.installation_identifier
identifier = InstallationConfig.find_by(name: 'INSTALLATION_IDENTIFIER')&.value
@@ -11,10 +12,18 @@ class ChatwootHub
identifier
end
+ def self.billing_url
+ "#{BILLING_URL}?installation_identifier=#{installation_identifier}"
+ end
+
def self.pricing_plan
InstallationConfig.find_by(name: 'INSTALLATION_PRICING_PLAN')&.value || 'community'
end
+ def self.pricing_plan_quantity
+ InstallationConfig.find_by(name: 'INSTALLATION_PRICING_PLAN_QUANTITY')&.value || 0
+ end
+
def self.support_config
{
support_website_token: InstallationConfig.find_by(name: 'CHATWOOT_SUPPORT_WEBSITE_TOKEN')&.value,
diff --git a/package.json b/package.json
index 337f579fa..602d1e383 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@chatwoot/chatwoot",
- "version": "3.3.1",
+ "version": "3.4.0",
"license": "MIT",
"scripts": {
"eslint": "eslint app/**/*.{js,vue}",