Skip to content

Commit

Permalink
feat: add chatwoot ctl(cwctl) cli tool (#4836)
Browse files Browse the repository at this point in the history
* chore: Add log messages for stages skipped during installation

* feat: allow chatwoot user to start/stop/restart chatwoot service

* feat: init options support

* feat: add option support to linux install script [c|h|i|l|s|u|wi]

Install/Update/Configure/Manage your Chatwoot installation
Example: cwctl -i master
Example: cwctl -l web
Example: cwctl --logs worker
Example: cwctl --upgrade
Example: cwctl -c

Installation/Upgrade:
  -i, --install             install Chatwoot with the git branch
specified
  -u, --upgrade             upgrade Chatwoot to latest version
  -s, --ssl                 fetch and install ssl certificates using
LetsEncrypt
  -w, --webserver           install and configure Nginx webserver

Management:
  -c, --console             open ruby console
  -l, --logs                tail logs from Chatwoot. Supported values
include web/worker.

Miscellaneous:
  -h, --help                display this help text and exit

* feat: add cwctl to PATH

* feat: add -v to cwctl

* chore: switch db migration to db:chatwoot_prepare

* fix: reload systemd files after update

* fix: improve -s -w cwctl options

* chore: throw error if run without options

Signed-off-by: Vishnu Narayanan <vishnu@chatwoot.com>

* feat: add -d/--debug option to cwctl

* fix: remove hardcoded ruby version in cwctl --upgrade

* chore: improve cwctl -v function

* fix: disable cwctl selfupdate

* chore: cleanup

* feat: allow chatwoot user to run cwctl

* chore: cwctl improve formatting for log messages

* fix: variable expansion inside heredoc

* feat: save pg_pass to file to support idempotency

One of the things preventing idempotency was the postgres
password generated at run-time to setup postgres initally.

This commit saves the password to the file if postgres setup function
is executed and reloads on future re-runs if needed.

* chore: formatting

* chore: add cwctl promotion message at the end of installation

* feat: add comments

* chore: add chatwoot and cwctl version files

* feat: add func to get latest chatwoot version

* chore: formatting

* feat: add --restart option to cwctl

* chore: update --help with restart option details

* chore: minor improvements to --restart
  • Loading branch information
vishnu-narayanan committed Jun 22, 2022
1 parent ffd102c commit f2dd882
Show file tree
Hide file tree
Showing 4 changed files with 631 additions and 82 deletions.
1 change: 1 addition & 0 deletions VERSION_CW
@@ -0,0 +1 @@
2.6.0
1 change: 1 addition & 0 deletions VERSION_CWCTL
@@ -0,0 +1 @@
2.0.7
6 changes: 6 additions & 0 deletions deployment/chatwoot
@@ -0,0 +1,6 @@
# give chatwoot user permission to start/stop/restart chatwoot systemd service

%chatwoot ALL=NOPASSWD: /bin/systemctl start chatwoot.target
%chatwoot ALL=NOPASSWD: /bin/systemctl stop chatwoot.target
%chatwoot ALL=NOPASSWD: /bin/systemctl restart chatwoot.target
%chatwoot ALL=NOPASSWD: /usr/local/bin/cwctl

0 comments on commit f2dd882

Please sign in to comment.