mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-26 01:40:48 +08:00
97e3b6ed41
I renamed some install scripts to be more clear. SPF: Suggest [MAILDOMAIN], [HOSTNAME] and [IP ADDRESS] Its a better practice to be more inclusive when it comes to dns SPF records. DKIM: Some dns registrars truncate dns TXT records at 255 chars. So 2048bit do not fit (about 390 vs. 230 chars). So 1024bit keys are a good choice, after all it is only a mail verification mechanism, do not encrypt the mail... Show tip how to stop systemd service (03_install_check_running_services.sh) sudo su prefered to become root, sudo su fails with npm permission errors when installing (dunno why). A mini tutorial is shown at the end about SPF, DKIM and how to add/remove/modify DKIM keys. This pull request closes issue 85,86.
56 lines
1.5 KiB
Bash
Executable file
56 lines
1.5 KiB
Bash
Executable file
#! /bin/bash
|
|
|
|
# make sure the install script is started here
|
|
OURNAME=install.sh
|
|
INSTALLDIR=`pwd`
|
|
PUBLIC_IP=`curl -s https://api.ipify.org`
|
|
source "$INSTALLDIR/00_install_global_functions_variables.sh"
|
|
|
|
args=("$@")
|
|
# echo $# arguments passed
|
|
# echo ${args[0]} ${args[1]} ${args[2]}
|
|
|
|
if [ "$#" -gt "0" ]
|
|
then
|
|
# foo/bar -> bar
|
|
MAILDOMAIN=${args[0]}
|
|
HOSTNAME=${args[1]:-$MAILDOMAIN}
|
|
echo -e "DOMAINNAME: ${GREEN}$MAILDOMAIN${NC}, HOSTNAME: ${GREEN}$HOSTNAME${NC}"
|
|
else
|
|
echo -e "we got ${RED}ZERO${NC} arguments, so here is the manual:"
|
|
fun_print_help
|
|
exit
|
|
fi
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
# redirect stdout(1) to stderr(2)
|
|
# (&2, & means it is a filedescriptor and not a file named "2")
|
|
echo -e "${RED}ERROR:${NC}This script must be run as root" 1>&2
|
|
echo -e "Execute ${GREEN}sudo bash${NC} , ${ORANGE}sudo su${NC} or ${ORANGE}sudo sh${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# source is for executing in the current shell, and not in a subset.
|
|
# defined variables persists across files
|
|
declare -a arr=(
|
|
"01_install_commits.sh"
|
|
"02_install_prerequisites.sh"
|
|
"03_install_check_running_services.sh"
|
|
"04_install_import_keys.sh"
|
|
"05_install_packages.sh"
|
|
"06_install_enable_services.sh"
|
|
"07_install_wildduck.sh"
|
|
"08_install_haraka.sh"
|
|
"09_install_zone_mta.sh"
|
|
"10_install_wildduck_webmail.sh"
|
|
"11_install_nginx.sh"
|
|
"12_install_ufw_rules.sh"
|
|
"13_install_ssl_certs.sh"
|
|
"14_install_start_services.sh"
|
|
"15_install_deploy.sh"
|
|
)
|
|
|
|
for i in "${arr[@]}"
|
|
do
|
|
source "$INSTALLDIR/$i"
|
|
done
|