Fixed roundcube welcome email and added -n option to installapp

This commit is contained in:
root 2024-09-19 18:30:16 +00:00
parent 275ea6d4ab
commit 17ff666797
2 changed files with 34 additions and 62 deletions

27
bin/installapp Executable file → Normal file
View File

@ -1,4 +1,4 @@
#!/bin/bash -x #!/bin/bash
# #
# Installs app if not already installed # Installs app if not already installed
. /etc/federated . /etc/federated
@ -8,21 +8,36 @@ trap cleanup `seq 1 15`
usage() { usage() {
cat << EOF cat << EOF
Install application Install application
Usage: $0 appname Usage: $0 [-n] appname
Arguments: Arguments:
appname Application to install. bookstack,espocrm,freescout,etc appname Application to install. bookstack,espocrm,freescout,etc
Options
-n Don't send the customer e-mail on install
EOF EOF
exit 2; exit 2;
} }
[ $# != 1 ] && usage while getopts "n" OPTION; do
APP=$1 case $OPTION in
n)
NO_EMAIL="true";
;;
*)
usage;
exit 2;
esac
done
[ $# -gt 2 ] || [ $# -lt 1 ] && usage
[[ "$2" = "-n" ]] && usage
[[ ! "$NO_EMAIL" ]] && APP=$1 || APP=$2
[ ! -f /federated/lib/$APP.sh ] && failcheck "/federated/lib/$APP.sh doesn't exist." [ ! -f /federated/lib/$APP.sh ] && failcheck "/federated/lib/$APP.sh doesn't exist."
[ -d /federated/apps/$APP ] && failcheck "/federated/apps/$APP already exists. $APP is installed?" [ -d /federated/apps/$APP ] && failcheck "/federated/apps/$APP already exists. $APP is installed?"
. /federated/lib/$APP.sh . /federated/lib/$APP.sh
config_$APP config_$APP
start_$APP start_$APP
# Only send email if email function exists # Only send email if email function exists and NO_EMAIL isn't set
[[ $(type -t email_$APP) == function ]] && email_$APP [[ ! "$NO_EMAIL" ]] && [[ $(type -t email_$APP) == function ]] && email_$APP

View File

@ -26,6 +26,7 @@ services:
ipv4_address: 172.99.0.47 ipv4_address: 172.99.0.47
extra_hosts: extra_hosts:
- "authelia.$DOMAIN:$EXTERNALIP" - "authelia.$DOMAIN:$EXTERNALIP"
- "mail.$DOMAIN:$EXTERNALIP"
env_file: env_file:
- ./.env - ./.env
volumes: volumes:
@ -89,63 +90,19 @@ cat > /federated/apps/mail/data/root/certs/mailfile <<EOF
<p> <p>
<h4>Roundcube is now installed on $DOMAIN</h4> <h4>Roundcube is now installed on $DOMAIN</h4>
<p> <p>
Here is your applications chart on how to access this service:<br> Dear Customer,<br>
<br>
We'd like to introduce you to "Roundcube", a free and open source webmail solution with a desktop-like user interface. You can find "Roundcube" at <a href="https://roundcube.$DOMAIN">https://roundcube.$DOMAIN</a>
and also on your Dashboard <a href="https://dashboard.$DOMAIN">https://dashboard.$DOMAIN</a> as a new application.
<br>
<br>
This is only one of 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!
<br>
<br>
Best,
<br>
Federated Computer
<p> <p>
<h4>Applications</h4>
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
overflow:hidden;padding:10px 5px;word-break:normal;}
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
.tg .tg-cul6{border-color:inherit;color:#340096;text-align:left;text-decoration:underline;vertical-align:top}
.tg .tg-acii{background-color:#FFF;border-color:inherit;color:#333;text-align:left;vertical-align:top}
.tg .tg-0hty{background-color:#000000;border-color:inherit;color:#ffffff;font-weight:bold;text-align:left;vertical-align:top}
.tg .tg-kwiq{border-color:inherit;color:#000000;text-align:left;vertical-align:top}
.tg .tg-0pky{border-color:inherit;text-align:left;vertical-align:top}
</style>
<table class="tg" style="undefined;table-layout: fixed; width: 996px">
<colgroup>
<col style="width: 101.333333px">
<col style="width: 203.333333px">
<col style="width: 282.333333px">
<col style="width: 185.33333px">
<col style="width: 78.333333px">
<col style="width: 220.333333px">
</colgroup>
<thead>
<tr>
<th class="tg-0hty">Service</th>
<th class="tg-0hty">Link</th>
<th class="tg-0hty">User / Pass</th>
<th class="tg-0hty">Access</th>
<th class="tg-0hty">Docs</th>
<th class="tg-0hty">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky">Roundcube</td>
<td class="tg-0pky"><a href="https://webmail.$DOMAIN/login" target="_blank" rel="noopener noreferrer"><span style="color:#340096">webmail.$DOMAIN</span></a></td>
<td class="tg-0pky">admin@$DOMAIN<br>Panel password</td>
<td class="tg-0pky">User access using your panel user email and password</td>
<td class="tg-cul6"><a href="https://documentation.federated.computer/docs/getting_started/welcome/" target="_blank" rel="noopener noreferrer"><span style="color:#340096">Click here</span></a></td>
<td class="tg-0pky">Roundcube is a web-based IMAP email client</td>
</tr>
</tbody>
</table>
<h4>Thanks for your support!</h4>
<p>
Thank you for your support of Federated Computer. We really appreciate it and hope you have a very successful
time with Federated Core.
<p>
Again, if we can be of any assistance, please don't hesitate to get in touch.
<p>
Support: https://support.federated.computer<br>
Phone: (970) 722-8715<br>
Email: support@federated.computer<br>
<p>
It's <b>your</b> computer. Let's make it work for you!
</html> </html>
EOF EOF