Permanently unlock Chatwoot Enterprise features using PostgreSQL triggers and configuration patches for Docker/Portainer deployments
Unlock Chatwoot Enterprise features using permanent PostgreSQL triggers and configuration modifications designed for Docker/Portainer deployments.
This skill helps you deploy and manage a solution that unlocks Chatwoot Enterprise features through:
1. **PostgreSQL Trigger Creation** - Creates permanent database triggers that intercept configuration changes
2. **Configuration Updates** - Sets enterprise pricing plan values in the database
3. **Fallback Value Patching** - Modifies hardcoded fallback values in Chatwoot source files
The solution ensures configurations persist across container restarts and application updates.
The Dchat project contains these key files:
Ask the user which deployment method they're using:
1. **Docker/Portainer (Recommended)** - Use `docker-unlock.sh`
2. **Manual Docker Execution** - Use direct `docker exec` commands
3. **Native Installation** - Use Ruby script directly
For Docker/Portainer environments, execute:
```bash
curl -sL https://raw.githubusercontent.com/LuizBranco-ClickHype/Dchat/main/docker-unlock.sh | bash
```
The script will:
If auto-detection fails, manually execute:
```bash
docker exec -it <container_name> bash -c "wget -qO- https://raw.githubusercontent.com/LuizBranco-ClickHype/Dchat/main/unlock_permanent.rb | bundle exec rails runner -"
```
Replace `<container_name>` with the actual Chatwoot container name.
The unlock script creates a PostgreSQL trigger that permanently enforces enterprise values:
```sql
CREATE TRIGGER trg_force_enterprise_configs
BEFORE INSERT OR UPDATE ON installation_configs
FOR EACH ROW
EXECUTE FUNCTION force_enterprise_installation_configs();
```
This trigger intercepts any configuration changes and forces:
The script searches for `lib/chatwoot_hub.rb` in these locations:
It creates a timestamped backup before modifying fallback values:
After execution, restart the Chatwoot container:
```bash
docker restart <container_name>
```
Or use Portainer UI to restart the container.
After restart, verify that:
Check trigger existence:
```sql
SELECT tgname FROM pg_trigger WHERE tgname = 'trg_force_enterprise_configs';
```
This tool modifies commercial licensing restrictions. Ensure usage complies with Chatwoot's license terms and applicable laws.
The script uses defensive error handling - if database updates fail, file patching continues. If file patching fails, database configurations remain applied.
If auto-detection fails:
1. List containers: `docker ps | grep chatwoot`
2. Use manual execution method with correct container name
Verify trigger function exists:
```sql
SELECT proname FROM pg_proc WHERE proname = 'force_enterprise_installation_configs';
```
Check file locations manually:
```bash
docker exec -it <container> find / -name "chatwoot_hub.rb" 2>/dev/null
```
This indicates the trigger was removed. Re-run the unlock script after major Chatwoot updates that include database migrations.
```bash
curl -sL https://raw.githubusercontent.com/LuizBranco-ClickHype/Dchat/main/docker-unlock.sh | bash
docker restart chatwoot
```
```bash
docker exec -it chatwoot psql -U postgres -d chatwoot_production -c "SELECT tgname FROM pg_trigger WHERE tgname = 'trg_force_enterprise_configs';"
docker exec -it chatwoot psql -U postgres -d chatwoot_production -c "SELECT name, value FROM installation_configs WHERE name LIKE 'INSTALLATION_PRICING%';"
```
```bash
docker exec -it chatwoot psql -U postgres -d chatwoot_production -c "DROP TRIGGER IF EXISTS trg_force_enterprise_configs ON installation_configs;"
docker exec -it chatwoot psql -U postgres -d chatwoot_production -c "DROP FUNCTION IF EXISTS force_enterprise_installation_configs();"
docker exec -it chatwoot bash -c "cd /app/lib && ls -t chatwoot_hub.rb.backup.* | head -1 | xargs -I {} cp {} chatwoot_hub.rb"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/chatwoot-enterprise-unlocker/raw