From 39a83b65c0419509c02f8b67610b4dad1e8b9704 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Mar 2024 16:59:07 +0000 Subject: [PATCH] Added castopod installapp and uninstallapp support --- lib/castopod.sh | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/lib/castopod.sh b/lib/castopod.sh index f2e7a0c..d1f6637 100644 --- a/lib/castopod.sh +++ b/lib/castopod.sh @@ -13,6 +13,7 @@ config_castopod() { mkdir -p /federated/apps/castopod/data/var/www/castopod/public/media chown -R 33 /federated/apps/castopod/data/var fi + get_appvars cat > /federated/apps/castopod/docker-compose.yml < /dev/null echo -ne "done." } +email_castopod() { + echo -ne "* Sending email to customer.." + spin & + SPINPID=$! + +cat > /federated/apps/mail/data/root/certs/mailfile < +
+

+

Castopod is now installed on $DOMAIN

+

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

+

Applications

+ + ++++++++ + + + + + + + + + + + + + + + + + + + + +
ServiceLinkUser / PassAccessDocsDescription
Castopodcastopod.$DOMAINadmin@$DOMAIN
$ADMINPASS
User access is separate from panelClick hereCastopod is a full platform for hosting and delivering podcasts to your audience
+

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_castopod() { + echo -ne "* Uninstalling castopod container.." + spin & + SPINPID=$! + + # First stop the service + cd /federated/apps/castopod && docker-compose -f docker-compose.yml -p castopod down &> /dev/null + + # Delete database and user + docker exec pdnsmysql bash -c "mysql -uroot -p$MYSQL_ROOTPASSWORD -e 'drop database castopod;'" &> /dev/null + docker exec pdnsmysql bash -c "mysql -uroot -p$MYSQL_ROOTPASSWORD -e 'drop user castopod;'" &> /dev/null + + # Delete the app directory + rm -rf /federated/apps/castopod + + kill -9 $SPINPID &> /dev/null + echo -ne "done.\n" +}