#!/bin/bash # # Dashboard Service PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin get_appvars config_dashboard() { echo -ne "* Configuring dashboard container.." if [ ! -d "/federated/apps/dashboard" ]; then mkdir -p /federated/apps/dashboard/data fi cat > /federated/apps/dashboard/docker-compose.yml < /federated/apps/dashboard/.env < /root/.docker/config.json < /dev/null" "7" docker exec pdns pdnsutil add-record $DOMAIN dashboard A 86400 $EXTERNALIP &> /dev/null [ $? -ne 0 ] && fail "Couldn't add dns record for dashboard" echo -ne "done." } uninstall_dashboard() { echo -ne "* Uninstalling dashboard container.." # First stop the service cd /federated/apps/dashboard && docker compose -f docker-compose.yml -p dashboard down &> /dev/null # Delete the app directory rm -rf /federated/apps/dashboard # Delete the image docker image rm federatedcomputer/dashboard:$IMAGE_VERSION &> /dev/null # Delete the DNS record docker exec pdns pdnsutil delete-rrset $DOMAIN dashboard A echo -ne "done.\n" } email_dashboard() { echo -ne "* Sending email to customer.." cat > /federated/apps/mail/data/root/certs/mailfile <

Dashboard is now installed on $DOMAIN

Dear Customer,

We'd like to introduce you to "Dashboard", a simple application listing all the applications installed on your Federated Core. You can find "Dashboard" at https://dashboard.$DOMAIN

This is the first step in a number of big changes you'll be seeing from Federated Computer in the coming months to improve and enhance your Federated Core. Thank you for being a customer!

Best,
Federated Computer

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 echo -ne "done.\n" }