#!/bin/bash # # EspoCRM Service PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin get_appvars config_espocrm() { echo -ne "\n* Configuring espocrm container.." if [ ! -d "/federated/apps/espocrm" ]; then mkdir -p /federated/apps/espocrm/data/var/www/html fi cat > /federated/apps/espocrm/docker-compose.yml < /federated/apps/espocrm/.env < /dev/null" "15" docker exec pdns pdnsutil add-record $DOMAIN espocrm A 86400 $EXTERNALIP &> /dev/null [ $? -ne 0 ] && fail "Couldn't add dns record for espocrm" # Install cronjob (crontab -l 2>/dev/null; echo "* * * * * /usr/bin/docker exec espocrm /usr/local/bin/php -f /var/www/html/cron.php > /dev/null 2>&1") | sort -u | crontab - echo -ne "done.\n" } email_espocrm() { echo -ne "* Sending email to customer.." spin & SPINPID=$! cat > /federated/apps/mail/data/root/certs/mailfile <

EspoCRM is now installed on $DOMAIN

Here is your applications chart on how to access this service:

Applications

Service Link User / Pass Access Docs Description
EspoCRM espocrm.$DOMAIN admin@$DOMAIN
your admin password
All users in panel can access EspoCRM using user@$DOMAIN Click here EspoCRM is an Open Source CRM (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships

Thanks for your support!

Thank you for your support of Federated Computer. We really appreciate it and hope you have a very successful time with Federated Core.

Again, if we can be of any assistance, please don't hesitate to get in touch.

Support: https://support.federated.computer
Phone: (970) 722-8715
Email: support@federated.computer

It's your computer. Let's make it work for you! EOF # Send out e-mail from mail container with details docker exec mail bash -c "mail -r admin@$DOMAIN -a \"Content-type: text/html\" -s \"Application installed on $DOMAIN\" $EMAIL < /root/certs/mailfile" rm /federated/apps/mail/data/root/certs/mailfile kill -9 $SPINPID &> /dev/null echo -ne "done.\n" } uninstall_espocrm() { echo -ne "* Uninstalling espocrm container.." spin & SPINPID=$! # First stop the service cd /federated/apps/espocrm && docker-compose -f docker-compose.yml -p espocrm down &> /dev/null # Delete database and user docker exec pdnsmysql bash -c "mysql -uroot -p$MYSQL_ROOTPASSWORD -e 'drop database espocrm;'" &> /dev/null docker exec pdnsmysql bash -c "mysql -uroot -p$MYSQL_ROOTPASSWORD -e 'drop user espocrm;'" &> /dev/null # Delete the app directory rm -rf /federated/apps/espocrm # Delete the image docker image rm espocrm/espocrm:${IMAGE_VERSION} &> /dev/null # Delete the DNS record docker exec pdns pdnsutil delete-rrset $DOMAIN espocrm A # Remove cronjob crontab -l | grep -v 'espocrm /usr/local/bin/php -f /var/www/html/cron.php' | crontab - # Uninstall the SSO configuration if it exists in authelia (authelia must exist too) if [[ $(grep "### Espocrm" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]]; then sed -i '/### Espocrm/,/### /{/### PowerDNS/!{/### /!d}}' /federated/apps/authelia/data/config/idproviders.yml sed -i '/### Espocrm/d' /federated/apps/authelia/data/config/idproviders.yml /federated/bin/stop authelia /federated/bin/start authelia fi kill -9 $SPINPID &> /dev/null echo -ne "done.\n" } configsso_espocrm() { [ ! -d "/federated/apps/authelia" ] && failcheck "Authelia is not installed. You need this first before continuing." [ ! -f "/federated/apps/authelia/data/config/idproviders.yml" ] && failcheck "Authelia idproviders.yml is missing." [[ $(grep "### Espocrm" /federated/apps/authelia/data/config/idproviders.yml 2>/dev/null) ]] && failcheck "Authelia already has a Espocrm configuration." ESPOCRM_CLIENT_SECRET=$(create_password); ESPOCRM_CLIENT_SECRET_HASH=$(docker run -it --rm authelia/authelia:latest authelia crypto hash generate pbkdf2 --password $ESPOCRM_CLIENT_SECRET | awk '{ print $2 }') cat >> /federated/apps/authelia/data/config/idproviders.yml <> /federated/apps/espocrm/.env < [\n\ 0 => 'profile',\n\ 1 => 'email',\n\ 2 => 'groups',\n\ 3 => 'openid'\n\ ]," /federated/apps/espocrm/data/var/www/html/data/config.php # Add in extra_hosts to docker-compose add_authelia_config_to_dockercompose "$APP" # Set auth method to Oidc only sed -i "s/ESPOCRM_CONFIG_AUTHENTICATION_METHOD=LDAP/#ESPOCRM_CONFIG_AUTHENTICATION_METHOD=LDAP/g" /federated/apps/espocrm/.env /federated/bin/stop espocrm /federated/bin/start espocrm }