403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/apps/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/apps/chatwoot-latest-offirepo
#!/bin/bash

if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

appDir="/opt/chatwoot"

echo "Downloading docker-compose and .env files" | log
curlDownload https://raw.githubusercontent.com/chatwoot/chatwoot/develop/.env.example .env
curlDownload https://raw.githubusercontent.com/chatwoot/chatwoot/develop/docker-compose.production.yaml docker-compose.yaml
waitOrStop 0 "Failed to download chatwoot files" 
mkdir -p $appDir
mv .env $appDir
mv docker-compose.yaml $appDir

echo "Tweaking the downloaded files" | log
sed -i "s/^ENABLE_ACCOUNT_SIGNUP=.*/ENABLE_ACCOUNT_SIGNUP=true/" $appDir/.env
sed -i "s/^FRONTEND_URL=.*/FRONTEND_URL=https://${CWM_DOMAIN}:3000/" $appDir/.env
sed -i "s/^REDIS_PASSWORD=.*/REDIS_PASSWORD=${ADMINPASSWORD}/" $appDir/.env
sed -i "s/^POSTGRES_PASSWORD=.*/POSTGRES_PASSWORD=${ADMINPASSWORD}/" $appDir/.env
sed -i "s|POSTGRES_PASSWORD=.*|POSTGRES_PASSWORD=${ADMINPASSWORD}|" $appDir/docker-compose.yaml
cp /opt/installer/tweaks/extras/chatwoot/chatwoot.conf /etc/nginx/sites-enabled/
sed -i "s/ServerDomain/${CWM_DOMAIN}/g" /etc/nginx/sites-enabled/chatwoot.conf 

if [[ -f /etc/letsencrypt/live/${CWM_DISPLAYED_ADDRESS}/cert.pem ]]; then
	sed -i 's/fullchain.pem/cert.pem/g' /etc/nginx/sites-enabled/chatwoot.conf
fi

echo "Reloading Nginx" | log
systemctl reload nginx
waitOrStop 0 "Failed to reload nginx"
echo "Prepare the database by running the migrations" | log
cd $appDir
docker compose run --rm rails bundle exec rails db:chatwoot_prepare
waitOrStop 0 "Failed to prepare database"
echo "Getting the services up and running"
docker compose up -d
waitOrStop 0 "Failed to run docker compose"
sleep 10

descriptionAppend "ChatWoot Web UI:https://${CWM_DISPLAYED_ADDRESS}"
descriptionAppend "ChatWoot directory: $appDir"
descriptionAppend "To configure the settings for the app, edit the .env file in the chatwoot directory"
descriptionAppend "After changes is made, run this command inside the chatwoot directory: docker compose up -d"



tagScript success

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit