#!/bin/bash # # Listmonk Service PATH=$HOME/.docker/cli-plugins:/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin . /etc/federated get_appvars config_listmonk() { echo -ne "* Configuring listmonk container.." if [ ! -d "/federated/apps/listmonk" ]; then mkdir -p /federated/apps/listmonk/data/listmonk/static /federated/apps/listmonk/data/listmonk/uploads fi LISTMONK_SECRET=$(create_password) cat > /federated/apps/listmonk/docker-compose.yml < /federated/apps/listmonk/.env < /federated/apps/listmonk/data/listmonk/config.toml < /federated/apps/listmonk/data/listmonk/config.toml < /dev/null docker exec postgresql psql -U postgres -c "CREATE DATABASE listmonk" &> /dev/null docker exec postgresql psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE listmonk TO listmonk" &> /dev/null echo -ne "done.\n" } start_listmonk() { # Install the database scheme first docker compose -f /federated/apps/listmonk/docker-compose.yml run --rm listmonk ./listmonk --install --yes &> /dev/null # Change app.root_url and other settings to our domain docker exec postgresql psql -U listmonk -c "update settings set value='\"http://listmonk.$DOMAIN\"' where key='app.root_url'" &> /dev/null docker exec postgresql psql -U listmonk -c "update settings set value='\"listmonk \"' where key='app.from_email'" &> /dev/null docker exec postgresql psql -U listmonk -c "update settings set value='[{\"host\": \"mail.$DOMAIN\", \"port\": 587, \"enabled\": true, \"password\": \"$ADMINPASS\", \"tls_type\": \"STARTTLS\", \"username\": \"fcore\", \"max_conns\": 10, \"idle_timeout\": \"15s\", \"wait_timeout\": \"5s\", \"auth_protocol\": \"login\", \"email_headers\": [], \"hello_hostname\": \"\", \"max_msg_retries\": 2, \"tls_skip_verify\": false}, {\"host\": \"smtp.gmail.com\", \"port\": 465, \"enabled\": false, \"password\": \"password\", \"tls_type\": \"TLS\", \"username\": \"username@gmail.com\", \"max_conns\": 10, \"idle_timeout\": \"15s\", \"wait_timeout\": \"5s\", \"auth_protocol\": \"login\", \"email_headers\": [], \"hello_hostname\": \"\", \"max_msg_retries\": 2, \"tls_skip_verify\": false}]' where key='smtp';" &> /dev/null # Start service with command to make sure it's up before proceeding start_service "listmonk" "nc -z 192.168.0.21 9000 &> /dev/null" "8" [[ "${PLUS}" = "false" ]] && docker exec pdns pdnsutil add-record $DOMAIN listmonk A 86400 $EXTERNALIP &> /dev/null echo -ne "done." } email_listmonk() { echo -ne "* Sending email to customer.." cat > /federated/apps/mail/data/root/certs/mailfile <

Listmonk 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
Listmonk listmonk.$DOMAIN admin@$DOMAIN
$ADMINPASS
User access is separate from panel Click here Listmonk is (a replacement for Mailchimp) is used to create e-mail subscription lists

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 echo -ne "done.\n" } uninstall_listmonk() { echo -ne "* Uninstalling listmonk container.." # First stop the service cd /federated/apps/listmonk && docker compose -f docker-compose.yml -p listmonk down &> /dev/null # Delete database and user in postgresql docker exec postgresql psql -U postgres -c "DROP DATABASE listmonk" &> /dev/null docker exec postgresql psql -U postgres -c "DROP USER listmonk" &> /dev/null # Delete the app directory rm -rf /federated/apps/listmonk echo -ne "done.\n" }