Commit Graph

8 Commits

Author SHA1 Message Date
Vishnu Narayanan
c4b076dbb2 feat: allow setting up only web/worker deployments for linux (#12004)
## cwctl
-  allow setting up only web/worker deployments for linux
- allow upgrades to a custom branch - experimental

```
Usage Examples:
  # Convert existing full deployment to web-only (for web ASG)
  cwctl --convert web

  # Convert existing full deployment to worker-only (for worker ASG)
   cwctl --convert worker

  # Convert specialized deployment back to full
  cwctl --convert full

  # Fresh installs still work as before
    cwctl -i --web-only    # New web-only install
    cwctl -i --worker-only # New worker-only instal
```

- Upgrading to custom branches is risky, as other dependencies like node
or db might have changed

```
  cwctl --upgrade        # Upgrade to master branch - default
  cwctl -U v4.3.0         # Upgrade to specific release branch 
  cwctl --upgrade feat/new-feature  # Upgrade to feature branch
```
2025-07-22 12:54:25 +04:00
Vishnu Narayanan
8c54d7f794 feat: support vite build for linux installations(cwctl) (#10231)
- Switch to `pnpm` from `yarn`

Changelog
----
- add support for `pnpm` `vite` build for chatwoot 4.0
- for new installations, install pnpm and vite
- for existing installations, remove `node_modules` and install `pnpm`

Note: `yarn` is not removed when upgrading existing installations. If
you want to rollback to an older version of Chatwoot(pre 4.0),

```
sudo -i -u chatwoot
cd chatwoot
git checkout <tag> # tag is the version of chatwoot you want to rollback to
rm -rf node_modules # remove deps installed via pnpm

# Update dependencies
bundle
yarn

# Recompile the assets
rake assets:precompile RAILS_ENV=production

# Migrate the database schema
RAILS_ENV=production bundle exec rake db:migrate
exit
```
2024-10-04 16:50:44 +05:30
André J
c23e235cea feat: update cwctl to work with Ubuntu 24.04 LTS (#9586)
The `add user` utility was updated, and the `--disabled-login` behavior changed in Ubuntu 24.04. This set the login shell to `/sbin/nologin,` which broke the `cwctl` installation flow. 

ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=625758

Co-authored-by: Vishnu Narayanan <iamwishnu@gmail.com>
2024-06-05 15:20:57 +05:30
Vishnu Narayanan
c9f8cdb51b fix: switch to nodejs ppa for linux installations (#8337)
Nodesource script-based installation is deprecated. Switch to a different ppa for nodejs.

Fixes: https://linear.app/chatwoot/issue/CW-2686/upgrade-warning
Fixes: #8151
2023-12-18 21:18:42 -08:00
Vishnu Narayanan
2429daa45c feat: cwctl upgrade node for existing installations (#7772)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2023-09-18 23:49:29 +05:30
Vishnu Narayanan
590ce788b9 fix: update linux script(cwctl) to account for rails7 upgrade (#7106)
* chore: modify cwctl to fetch latest redis version on new installations

* fix: add libvips for activestorage imageprocessing support

* chore: update cwctl version

* feat: upgrade redis and install libvps for existing installations
2023-05-18 16:53:47 +05:30
Vishnu Narayanan
5957edc76b feat: abort cwctl upgrade if custom code changes detected (#5329)
* feat: abort cwctl upgrade if custom code changes detected

* fix: cwctl exit handler on upgrade

* chore: update cwctl version
2022-08-23 18:56:39 +05:30
Vishnu Narayanan
f2dd88223f feat: add chatwoot ctl(cwctl) cli tool (#4836)
* 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
2022-06-22 23:39:01 +05:30