From 4a1628916f17fa2e4be2b075197db316c8a92bb5 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Jun 2024 19:47:56 +0000 Subject: [PATCH] Added installapp and uninstallapp support to Vaultwarden --- lib/vaultwarden.sh | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/lib/vaultwarden.sh b/lib/vaultwarden.sh index 34f6ebf..39907dd 100644 --- a/lib/vaultwarden.sh +++ b/lib/vaultwarden.sh @@ -76,3 +76,99 @@ start_vaultwarden() { echo -ne "done." } +uninstall_vaultwarden() { + echo -ne "* Uninstalling vaultwarden container.." + spin & + SPINPID=$! + + # First stop the service + cd /federated/apps/vaultwarden && docker-compose -f docker-compose.yml -p vaultwarden down &> /dev/null + + # Delete database and user in postgresql + docker exec postgresql psql -U postgres -c "DROP DATABASE vaultwarden" &> /dev/null + docker exec postgresql psql -U postgres -c "DROP USER vaultwarden" &> /dev/null + + # Delete the app directory + rm -rf /federated/apps/vaultwarden + + kill -9 $SPINPID &> /dev/null + echo -ne "done.\n" +} +email_vaultwarden() { + echo -ne "* Sending email to customer.." + spin & + SPINPID=$! + +cat > /federated/apps/mail/data/root/certs/mailfile < +
+

+

Vaultwarden is now installed on $DOMAIN

+

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

+

Applications

+ + ++++++++ + + + + + + + + + + + + + + + + + + + + +
ServiceLinkUser / PassAccessDocsDescription
Vaultwardenvaultwarden.$DOMAINCreate your own userUser access is separate from panel. Create your own initial userClick hereVaultwarden is a password manager
+

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" +}