Beginning of webmail
This commit is contained in:
parent
a2a5d39608
commit
3c13cefa51
100
src/freedombone
100
src/freedombone
|
@ -217,6 +217,13 @@ HUBZILLA_ADMIN_PASSWORD=
|
||||||
HUBZILLA_COMMIT='b6ae2bff01f8a4dfc057ef2971b3d988b1028b3e'
|
HUBZILLA_COMMIT='b6ae2bff01f8a4dfc057ef2971b3d988b1028b3e'
|
||||||
HUBZILLA_ADDONS_COMMIT='48725235777e2088fe109b722a5fc9141b6840ec'
|
HUBZILLA_ADDONS_COMMIT='48725235777e2088fe109b722a5fc9141b6840ec'
|
||||||
|
|
||||||
|
# roundcube webmail
|
||||||
|
WEBMAIL_REPO="https://github.com/roundcube/roundcubemail"
|
||||||
|
WEBMAIL_COMMIT='78cf9c2e5cff2d78cd8beb647d60570f195a2a9c'
|
||||||
|
WEBMAIL_ONION_HOSTNAME=
|
||||||
|
WEBMAIL_ONION_PORT=8097
|
||||||
|
WEBMAIL_ADMIN_PASSWORD=
|
||||||
|
|
||||||
# Domain name for git hosting installation
|
# Domain name for git hosting installation
|
||||||
GIT_DOMAIN_NAME=
|
GIT_DOMAIN_NAME=
|
||||||
GIT_CODE=
|
GIT_CODE=
|
||||||
|
@ -1066,6 +1073,12 @@ function read_configuration {
|
||||||
if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then
|
if [[ $CONFIGURATION_FILE != "/root/${PROJECT_NAME}.cfg" ]]; then
|
||||||
cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg
|
cp $CONFIGURATION_FILE /root/${PROJECT_NAME}.cfg
|
||||||
fi
|
fi
|
||||||
|
if grep -q "WEBMAIL_REPO" $CONFIGURATION_FILE; then
|
||||||
|
WEBMAIL_REPO=$(grep "WEBMAIL_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
|
fi
|
||||||
|
if grep -q "WEBMAIL_COMMIT" $CONFIGURATION_FILE; then
|
||||||
|
WEBMAIL_COMMIT=$(grep "WEBMAIL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
|
fi
|
||||||
if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then
|
if grep -q "WIFI_INTERFACE" $CONFIGURATION_FILE; then
|
||||||
WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
WIFI_INTERFACE=$(grep "WIFI_INTERFACE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
@ -4450,7 +4463,6 @@ function install_command_line_browser {
|
||||||
echo 'install_command_line_browser' >> $COMPLETION_FILE
|
echo 'install_command_line_browser' >> $COMPLETION_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function configure_email {
|
function configure_email {
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||||
return
|
return
|
||||||
|
@ -7287,6 +7299,12 @@ function install_wiki {
|
||||||
nginx_disable_sniffing $WIKI_DOMAIN_NAME
|
nginx_disable_sniffing $WIKI_DOMAIN_NAME
|
||||||
echo ' add_header Strict-Transport-Security "max-age=0;";' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
echo ' add_header Strict-Transport-Security "max-age=0;";' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
echo '' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
echo '' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo ' # webmail' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo ' location /webmail {' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo ' rewrite ^/(.*) /webmail/index.php last;' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo ' rewrite ^/(.*) /webmail/installer/index.php last;' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo ' }' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
echo '' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
echo ' # rewrite to front controller as default rule' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
echo ' # rewrite to front controller as default rule' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
echo ' location / {' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
echo ' location / {' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
echo ' rewrite ^/(.*) /index.php?q=$uri&$args last;' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
echo ' rewrite ^/(.*) /index.php?q=$uri&$args last;' >> /etc/nginx/sites-available/$WIKI_DOMAIN_NAME
|
||||||
|
@ -8815,6 +8833,85 @@ function install_search_engine {
|
||||||
echo 'install_search_engine' >> $COMPLETION_FILE
|
echo 'install_search_engine' >> $COMPLETION_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_webmail {
|
||||||
|
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
WEBMAIL_PATH=/var/www/webmail
|
||||||
|
|
||||||
|
# update to a new commit if needed
|
||||||
|
set_repo_commit $WEBMAIL_PATH "Webmail commit" "$WEBMAIL_COMMIT" $WEBMAIL_REPO
|
||||||
|
|
||||||
|
if grep -Fxq "install_webmail" $COMPLETION_FILE; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [ -d /etc/apache2 ]; then
|
||||||
|
rm -rf /etc/apache2
|
||||||
|
echo $'Removed Apache installation after Dokuwiki install'
|
||||||
|
fi
|
||||||
|
|
||||||
|
install_mariadb
|
||||||
|
get_mariadb_password
|
||||||
|
repair_databases_script
|
||||||
|
|
||||||
|
apt-get -y install php5-common php5-cli php5-curl php5-gd php5-mysql php5-mcrypt git
|
||||||
|
apt-get -y install php5-dev imagemagick php5-imagick
|
||||||
|
|
||||||
|
if [ ! -f $WEBMAIL_PATH/index.php ]; then
|
||||||
|
git_clone $WEBMAIL_REPO webmail
|
||||||
|
git checkout $WEBMAIL_COMMIT -b $WEBMAIL_COMMIT
|
||||||
|
if ! grep -q "Webmail commit" $COMPLETION_FILE; then
|
||||||
|
echo "Webmail commit:$WEBMAIL_COMMIT" >> $COMPLETION_FILE
|
||||||
|
else
|
||||||
|
sed -i "s/Webmail commit.*/Webmail commit:$WEBMAIL_COMMIT/g" $COMPLETION_FILE
|
||||||
|
fi
|
||||||
|
chown -R www-data:www-data $WEBMAIL_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
WEBMAIL_ONION_HOSTNAME=
|
||||||
|
if [[ $ONION_ONLY != "no" ]]; then
|
||||||
|
WEBMAIL_ONION_HOSTNAME=$(add_onion_service webmail 80 ${WEBMAIL_ONION_PORT})
|
||||||
|
echo "Webmail onion domain:${WEBMAIL_ONION_HOSTNAME}" >> $COMPLETION_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
get_mariadb_webmail_admin_password
|
||||||
|
if [ ! $WEBMAIL_ADMIN_PASSWORD ]; then
|
||||||
|
if [ -f $IMAGE_PASSWORD_FILE ]; then
|
||||||
|
WEBMAIL_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
|
||||||
|
else
|
||||||
|
WEBMAIL_ADMIN_PASSWORD="$(openssl rand -base64 32 | cut -c1-30)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
create_database webmail "$WEBMAIL_ADMIN_PASSWORD"
|
||||||
|
|
||||||
|
if [ ! -d /var/www/$DEFAULT_DOMAIN_NAME/htdocs ]; then
|
||||||
|
mkdir -p /var/www/$DEFAULT_DOMAIN_NAME/htdocs
|
||||||
|
fi
|
||||||
|
ln -s $WEBMAIL_PATH /var/www/$DEFAULT_DOMAIN_NAME/htdocs/webmail
|
||||||
|
|
||||||
|
if ! grep -q "Webmail" /home/$MY_USERNAME/README; then
|
||||||
|
echo '' >> /home/$MY_USERNAME/README
|
||||||
|
echo '' >> /home/$MY_USERNAME/README
|
||||||
|
echo 'Webmail' >> /home/$MY_USERNAME/README
|
||||||
|
echo '=======' >> /home/$MY_USERNAME/README
|
||||||
|
if [[ $ONION_ONLY == 'no' ]]; then
|
||||||
|
echo $"Open https://$DEFAULT_DOMAIN_NAME/webmail/installer/index.php" >> /home/$MY_USERNAME/README
|
||||||
|
else
|
||||||
|
echo $"Open http://$WEBMAIL_ONION_HOSTNAME/installer/index.php" >> /home/$MY_USERNAME/README
|
||||||
|
fi
|
||||||
|
echo $"Database Type: MySQL" >> /home/$MY_USERNAME/README
|
||||||
|
echo $"Database name: webmail" >> /home/$MY_USERNAME/README
|
||||||
|
echo $"Database user name: webmailadmin" >> /home/$MY_USERNAME/README
|
||||||
|
echo $"Database password: $WEBMAIL_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
|
||||||
|
echo $"Enable the Enigma PGP plugin" >> /home/$MY_USERNAME/README
|
||||||
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
|
||||||
|
chmod 600 /home/$MY_USERNAME/README
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'install_webmail' >> $COMPLETION_FILE
|
||||||
|
}
|
||||||
|
|
||||||
function install_hubzilla {
|
function install_hubzilla {
|
||||||
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
if [[ $SYSTEM_TYPE == "$VARIANT_CLOUD" || $SYSTEM_TYPE == "$VARIANT_MAILBOX" || $SYSTEM_TYPE == "$VARIANT_CHAT" || $SYSTEM_TYPE == "$VARIANT_WRITER" || $SYSTEM_TYPE == "$VARIANT_MEDIA" || $SYSTEM_TYPE == "$VARIANT_DEVELOPER" || $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
|
||||||
return
|
return
|
||||||
|
@ -10530,6 +10627,7 @@ install_rss_reader
|
||||||
install_rss_reader_gnusocial
|
install_rss_reader_gnusocial
|
||||||
install_rss_mobile_reader
|
install_rss_mobile_reader
|
||||||
install_hubzilla
|
install_hubzilla
|
||||||
|
#install_webmail
|
||||||
#install_search_engine
|
#install_search_engine
|
||||||
install_dlna_server
|
install_dlna_server
|
||||||
configure_firewall_for_dlna
|
configure_firewall_for_dlna
|
||||||
|
|
|
@ -395,7 +395,15 @@ function show_domains {
|
||||||
echo ''
|
echo ''
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if grep -q "Webmail onion domain" $COMPLETION_FILE; then
|
||||||
|
echo -n -e "$(pad_string 'Webmail')"
|
||||||
|
WEBMAILDOM='-'
|
||||||
|
echo -n -e "$(pad_string ${WEBMAILDOM})"
|
||||||
|
if [ -d /var/lib/tor/hidden_service_webmail ]; then
|
||||||
|
echo -n "$(cat /var/lib/tor/hidden_service_webmail/hostname)"
|
||||||
|
fi
|
||||||
|
echo ''
|
||||||
|
fi
|
||||||
if grep -q "Search engine onion domain" $COMPLETION_FILE; then
|
if grep -q "Search engine onion domain" $COMPLETION_FILE; then
|
||||||
echo -n -e "$(pad_string 'Search engine')"
|
echo -n -e "$(pad_string 'Search engine')"
|
||||||
SEARCHDOM='-'
|
SEARCHDOM='-'
|
||||||
|
|
Loading…
Reference in New Issue