#!/bin/bash # # Vaultwarden Service PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin get_appvars config_vaultwarden() { echo -ne "\n* Configuring /federated/apps/vaultwarden container.." if [ ! -d "/federated/apps/vaultwarden" ]; then mkdir -p /federated/apps/vaultwarden/data/data fi VAULTWARDEN_SECRET=$(create_password) cat > /federated/apps/vaultwarden/docker-compose.yml < /federated/apps/vaultwarden/.env < /dev/null docker exec postgresql psql -U postgres -c "CREATE USER vaultwarden WITH PASSWORD '$VAULTWARDEN_SECRET'" &> /dev/null docker exec postgresql psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE vaultwarden TO vaultwarden" &> /dev/null echo -ne "done." } start_vaultwarden() { # Start service with command to make sure it's up before proceeding start_service "vaultwarden" "nc -z 192.168.0.22 80 &> /dev/null" "8" docker exec pdns pdnsutil add-record $DOMAIN vaultwarden A 86400 $EXTERNALIP &> /dev/null [ $? -ne 0 ] && fail "Couldn't add dns record" 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

Service Link User / Pass Access Docs Description
Vaultwarden vaultwarden.$DOMAIN Create your own user User access is separate from panel. Create your own initial user Click here Vaultwarden 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" }