From 8078ebffaaf5744ae8f747cd9024ffbf20512a70 Mon Sep 17 00:00:00 2001 From: Timothy Prepscius Date: Mon, 19 Aug 2013 14:50:08 -0400 Subject: [PATCH] moves the hosts from the java into resource files, could be improved upon, web stuff not done --- deploy/config.hosts | 2 ++ deploy/config/hosts/.gitignore | 4 ++++ deploy/config/hosts/make-dev | 14 ++++++++++++++ deploy/config/hosts/make-prod | 14 ++++++++++++++ deploy/host.config | 2 -- deploy/james/resources/hosts/auth_dev | 1 + deploy/james/resources/hosts/auth_prod | 1 + deploy/james/resources/hosts/local_db_dev | 1 + deploy/james/resources/hosts/local_db_prod | 1 + deploy/james/resources/hosts/local_key_dev | 1 + deploy/james/resources/hosts/local_key_prod | 1 + deploy/james/resources/hosts/local_mail_dev | 1 + deploy/james/resources/hosts/local_mail_prod | 1 + deploy/james/resources/hosts/local_smtp_dev | 1 + deploy/james/resources/hosts/local_smtp_prod | 1 + deploy/james/resources/hosts/primary_dev | 1 + deploy/james/resources/hosts/primary_prod | 1 + deploy/james/resources/hosts/tomcat_dev | 1 + deploy/james/resources/hosts/tomcat_prod | 1 + deploy/james/resources/hosts/web_dev | 1 + deploy/james/resources/hosts/web_prod | 1 + deploy/mail-key/resources/hosts/auth_dev | 1 + deploy/mail-key/resources/hosts/auth_prod | 1 + deploy/mail-key/resources/hosts/local_db_dev | 1 + deploy/mail-key/resources/hosts/local_db_prod | 1 + deploy/mail-key/resources/hosts/local_key_dev | 1 + deploy/mail-key/resources/hosts/local_key_prod | 1 + deploy/mail-key/resources/hosts/local_mail_dev | 1 + .../mail-key/resources/hosts/local_mail_prod | 1 + deploy/mail-key/resources/hosts/local_smtp_dev | 1 + .../mail-key/resources/hosts/local_smtp_prod | 1 + deploy/mail-key/resources/hosts/primary_dev | 1 + deploy/mail-key/resources/hosts/primary_prod | 1 + deploy/mail-key/resources/hosts/tomcat_dev | 1 + deploy/mail-key/resources/hosts/tomcat_prod | 1 + deploy/mail-key/resources/hosts/web_dev | 1 + deploy/mail-key/resources/hosts/web_prod | 1 + deploy/mail-user/resources/hosts/auth_dev | 1 + deploy/mail-user/resources/hosts/auth_prod | 1 + deploy/mail-user/resources/hosts/local_db_dev | 1 + deploy/mail-user/resources/hosts/local_db_prod | 1 + deploy/mail-user/resources/hosts/local_key_dev | 1 + .../mail-user/resources/hosts/local_key_prod | 1 + .../mail-user/resources/hosts/local_mail_dev | 1 + .../mail-user/resources/hosts/local_mail_prod | 1 + .../mail-user/resources/hosts/local_smtp_dev | 1 + .../mail-user/resources/hosts/local_smtp_prod | 1 + deploy/mail-user/resources/hosts/primary_dev | 1 + deploy/mail-user/resources/hosts/primary_prod | 1 + deploy/mail-user/resources/hosts/tomcat_dev | 1 + deploy/mail-user/resources/hosts/tomcat_prod | 1 + deploy/mail-user/resources/hosts/web_dev | 1 + deploy/mail-user/resources/hosts/web_prod | 1 + deploy/tomcat/resources/hosts/auth_dev | 1 + deploy/tomcat/resources/hosts/auth_prod | 1 + deploy/tomcat/resources/hosts/local_db_dev | 1 + deploy/tomcat/resources/hosts/local_db_prod | 1 + deploy/tomcat/resources/hosts/local_key_dev | 1 + deploy/tomcat/resources/hosts/local_key_prod | 1 + deploy/tomcat/resources/hosts/local_mail_dev | 1 + deploy/tomcat/resources/hosts/local_mail_prod | 1 + deploy/tomcat/resources/hosts/local_smtp_dev | 1 + deploy/tomcat/resources/hosts/local_smtp_prod | 1 + deploy/tomcat/resources/hosts/primary_dev | 1 + deploy/tomcat/resources/hosts/primary_prod | 1 + deploy/tomcat/resources/hosts/tomcat_dev | 1 + deploy/tomcat/resources/hosts/tomcat_prod | 1 + deploy/tomcat/resources/hosts/web_dev | 1 + deploy/tomcat/resources/hosts/web_prod | 1 + deploy/tools/resources/hosts/auth_dev | 1 + deploy/tools/resources/hosts/auth_prod | 1 + deploy/tools/resources/hosts/local_db_dev | 1 + deploy/tools/resources/hosts/local_db_prod | 1 + deploy/tools/resources/hosts/local_key_dev | 1 + deploy/tools/resources/hosts/local_key_prod | 1 + deploy/tools/resources/hosts/local_mail_dev | 1 + deploy/tools/resources/hosts/local_mail_prod | 1 + deploy/tools/resources/hosts/local_smtp_dev | 1 + deploy/tools/resources/hosts/local_smtp_prod | 1 + deploy/tools/resources/hosts/primary_dev | 1 + deploy/tools/resources/hosts/primary_prod | 1 + deploy/tools/resources/hosts/tomcat_dev | 1 + deploy/tools/resources/hosts/tomcat_prod | 1 + deploy/tools/resources/hosts/web_dev | 1 + deploy/tools/resources/hosts/web_prod | 1 + install/.gitignore | 1 + install/setup-mysql.sql.template | 14 +++++++------- .../constants/ConstantsClientPlatform.java | 18 ++++++++++-------- .../src/core/constants/ConstantsServer.java | 18 +++++++++++------- java/core/src/core/util/Hosts.java | 17 +++++++++++++++++ .../core/src/core/util/ProxySelectorRegex.java | 6 ++---- 91 files changed, 162 insertions(+), 28 deletions(-) create mode 100644 deploy/config.hosts create mode 100644 deploy/config/hosts/.gitignore create mode 100755 deploy/config/hosts/make-dev create mode 100755 deploy/config/hosts/make-prod delete mode 100644 deploy/host.config create mode 120000 deploy/james/resources/hosts/auth_dev create mode 120000 deploy/james/resources/hosts/auth_prod create mode 120000 deploy/james/resources/hosts/local_db_dev create mode 120000 deploy/james/resources/hosts/local_db_prod create mode 120000 deploy/james/resources/hosts/local_key_dev create mode 120000 deploy/james/resources/hosts/local_key_prod create mode 120000 deploy/james/resources/hosts/local_mail_dev create mode 120000 deploy/james/resources/hosts/local_mail_prod create mode 120000 deploy/james/resources/hosts/local_smtp_dev create mode 120000 deploy/james/resources/hosts/local_smtp_prod create mode 120000 deploy/james/resources/hosts/primary_dev create mode 120000 deploy/james/resources/hosts/primary_prod create mode 120000 deploy/james/resources/hosts/tomcat_dev create mode 120000 deploy/james/resources/hosts/tomcat_prod create mode 120000 deploy/james/resources/hosts/web_dev create mode 120000 deploy/james/resources/hosts/web_prod create mode 120000 deploy/mail-key/resources/hosts/auth_dev create mode 120000 deploy/mail-key/resources/hosts/auth_prod create mode 120000 deploy/mail-key/resources/hosts/local_db_dev create mode 120000 deploy/mail-key/resources/hosts/local_db_prod create mode 120000 deploy/mail-key/resources/hosts/local_key_dev create mode 120000 deploy/mail-key/resources/hosts/local_key_prod create mode 120000 deploy/mail-key/resources/hosts/local_mail_dev create mode 120000 deploy/mail-key/resources/hosts/local_mail_prod create mode 120000 deploy/mail-key/resources/hosts/local_smtp_dev create mode 120000 deploy/mail-key/resources/hosts/local_smtp_prod create mode 120000 deploy/mail-key/resources/hosts/primary_dev create mode 120000 deploy/mail-key/resources/hosts/primary_prod create mode 120000 deploy/mail-key/resources/hosts/tomcat_dev create mode 120000 deploy/mail-key/resources/hosts/tomcat_prod create mode 120000 deploy/mail-key/resources/hosts/web_dev create mode 120000 deploy/mail-key/resources/hosts/web_prod create mode 120000 deploy/mail-user/resources/hosts/auth_dev create mode 120000 deploy/mail-user/resources/hosts/auth_prod create mode 120000 deploy/mail-user/resources/hosts/local_db_dev create mode 120000 deploy/mail-user/resources/hosts/local_db_prod create mode 120000 deploy/mail-user/resources/hosts/local_key_dev create mode 120000 deploy/mail-user/resources/hosts/local_key_prod create mode 120000 deploy/mail-user/resources/hosts/local_mail_dev create mode 120000 deploy/mail-user/resources/hosts/local_mail_prod create mode 120000 deploy/mail-user/resources/hosts/local_smtp_dev create mode 120000 deploy/mail-user/resources/hosts/local_smtp_prod create mode 120000 deploy/mail-user/resources/hosts/primary_dev create mode 120000 deploy/mail-user/resources/hosts/primary_prod create mode 120000 deploy/mail-user/resources/hosts/tomcat_dev create mode 120000 deploy/mail-user/resources/hosts/tomcat_prod create mode 120000 deploy/mail-user/resources/hosts/web_dev create mode 120000 deploy/mail-user/resources/hosts/web_prod create mode 120000 deploy/tomcat/resources/hosts/auth_dev create mode 120000 deploy/tomcat/resources/hosts/auth_prod create mode 120000 deploy/tomcat/resources/hosts/local_db_dev create mode 120000 deploy/tomcat/resources/hosts/local_db_prod create mode 120000 deploy/tomcat/resources/hosts/local_key_dev create mode 120000 deploy/tomcat/resources/hosts/local_key_prod create mode 120000 deploy/tomcat/resources/hosts/local_mail_dev create mode 120000 deploy/tomcat/resources/hosts/local_mail_prod create mode 120000 deploy/tomcat/resources/hosts/local_smtp_dev create mode 120000 deploy/tomcat/resources/hosts/local_smtp_prod create mode 120000 deploy/tomcat/resources/hosts/primary_dev create mode 120000 deploy/tomcat/resources/hosts/primary_prod create mode 120000 deploy/tomcat/resources/hosts/tomcat_dev create mode 120000 deploy/tomcat/resources/hosts/tomcat_prod create mode 120000 deploy/tomcat/resources/hosts/web_dev create mode 120000 deploy/tomcat/resources/hosts/web_prod create mode 120000 deploy/tools/resources/hosts/auth_dev create mode 120000 deploy/tools/resources/hosts/auth_prod create mode 120000 deploy/tools/resources/hosts/local_db_dev create mode 120000 deploy/tools/resources/hosts/local_db_prod create mode 120000 deploy/tools/resources/hosts/local_key_dev create mode 120000 deploy/tools/resources/hosts/local_key_prod create mode 120000 deploy/tools/resources/hosts/local_mail_dev create mode 120000 deploy/tools/resources/hosts/local_mail_prod create mode 120000 deploy/tools/resources/hosts/local_smtp_dev create mode 120000 deploy/tools/resources/hosts/local_smtp_prod create mode 120000 deploy/tools/resources/hosts/primary_dev create mode 120000 deploy/tools/resources/hosts/primary_prod create mode 120000 deploy/tools/resources/hosts/tomcat_dev create mode 120000 deploy/tools/resources/hosts/tomcat_prod create mode 120000 deploy/tools/resources/hosts/web_dev create mode 120000 deploy/tools/resources/hosts/web_prod create mode 100644 install/.gitignore create mode 100644 java/core/src/core/util/Hosts.java diff --git a/deploy/config.hosts b/deploy/config.hosts new file mode 100644 index 0000000..dd72722 --- /dev/null +++ b/deploy/config.hosts @@ -0,0 +1,2 @@ +M_HOST_PROD=`cat config/hosts/prod` +M_HOST_DEV=`cat config/hosts/dev` diff --git a/deploy/config/hosts/.gitignore b/deploy/config/hosts/.gitignore new file mode 100644 index 0000000..1791bbd --- /dev/null +++ b/deploy/config/hosts/.gitignore @@ -0,0 +1,4 @@ +dev +prod +*_dev +*_prod diff --git a/deploy/config/hosts/make-dev b/deploy/config/hosts/make-dev new file mode 100755 index 0000000..76d2c14 --- /dev/null +++ b/deploy/config/hosts/make-dev @@ -0,0 +1,14 @@ +if [ -z "$1" ]; then echo "Must supply server name as argument"; exit 0; fi + +dev=$1 + +echo $dev > primary_dev +echo $dev:8080 > tomcat_dev +echo $dev:8000 > web_dev +echo $dev > auth_dev +echo $dev > dev + +echo "127.0.0.1" > local_db_dev +echo "127.0.0.1" > local_key_dev +echo "127.0.0.1" > local_mail_dev +echo "127.0.0.1" > local_smtp_dev diff --git a/deploy/config/hosts/make-prod b/deploy/config/hosts/make-prod new file mode 100755 index 0000000..2154b68 --- /dev/null +++ b/deploy/config/hosts/make-prod @@ -0,0 +1,14 @@ +if [ -z "$1" ]; then echo "Must supply server name (mailiverse.com) as argument"; exit 0; fi + +prod=$1 + +echo $prod > prod +echo $prod > primary_prod +echo $prod > web_prod +echo mail.$prod > tomcat_prod +echo mail.$prod > auth_prod +echo mail.$prod > local_mail_prod + +echo "127.0.0.1" > local_db_prod +echo "127.0.0.1" > local_key_prod +echo "127.0.0.1" > local_smtp_prod diff --git a/deploy/host.config b/deploy/host.config deleted file mode 100644 index 6574649..0000000 --- a/deploy/host.config +++ /dev/null @@ -1,2 +0,0 @@ -M_HOST_PROD="your-prod" -M_HOST_DEV="ec2-54-234-177-43.compute-1.amazonaws.com" diff --git a/deploy/james/resources/hosts/auth_dev b/deploy/james/resources/hosts/auth_dev new file mode 120000 index 0000000..66fc587 --- /dev/null +++ b/deploy/james/resources/hosts/auth_dev @@ -0,0 +1 @@ +../../../config/hosts/auth_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/auth_prod b/deploy/james/resources/hosts/auth_prod new file mode 120000 index 0000000..ec6e042 --- /dev/null +++ b/deploy/james/resources/hosts/auth_prod @@ -0,0 +1 @@ +../../../config/hosts/auth_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_db_dev b/deploy/james/resources/hosts/local_db_dev new file mode 120000 index 0000000..ef5bd81 --- /dev/null +++ b/deploy/james/resources/hosts/local_db_dev @@ -0,0 +1 @@ +../../../config/hosts/local_db_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_db_prod b/deploy/james/resources/hosts/local_db_prod new file mode 120000 index 0000000..58d3085 --- /dev/null +++ b/deploy/james/resources/hosts/local_db_prod @@ -0,0 +1 @@ +../../../config/hosts/local_db_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_key_dev b/deploy/james/resources/hosts/local_key_dev new file mode 120000 index 0000000..942989b --- /dev/null +++ b/deploy/james/resources/hosts/local_key_dev @@ -0,0 +1 @@ +../../../config/hosts/local_key_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_key_prod b/deploy/james/resources/hosts/local_key_prod new file mode 120000 index 0000000..78ceb66 --- /dev/null +++ b/deploy/james/resources/hosts/local_key_prod @@ -0,0 +1 @@ +../../../config/hosts/local_key_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_mail_dev b/deploy/james/resources/hosts/local_mail_dev new file mode 120000 index 0000000..75f1282 --- /dev/null +++ b/deploy/james/resources/hosts/local_mail_dev @@ -0,0 +1 @@ +../../../config/hosts/local_mail_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_mail_prod b/deploy/james/resources/hosts/local_mail_prod new file mode 120000 index 0000000..445ec54 --- /dev/null +++ b/deploy/james/resources/hosts/local_mail_prod @@ -0,0 +1 @@ +../../../config/hosts/local_mail_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_smtp_dev b/deploy/james/resources/hosts/local_smtp_dev new file mode 120000 index 0000000..6efcea5 --- /dev/null +++ b/deploy/james/resources/hosts/local_smtp_dev @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/local_smtp_prod b/deploy/james/resources/hosts/local_smtp_prod new file mode 120000 index 0000000..e87faad --- /dev/null +++ b/deploy/james/resources/hosts/local_smtp_prod @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/primary_dev b/deploy/james/resources/hosts/primary_dev new file mode 120000 index 0000000..9a97052 --- /dev/null +++ b/deploy/james/resources/hosts/primary_dev @@ -0,0 +1 @@ +../../../config/hosts/primary_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/primary_prod b/deploy/james/resources/hosts/primary_prod new file mode 120000 index 0000000..c033d47 --- /dev/null +++ b/deploy/james/resources/hosts/primary_prod @@ -0,0 +1 @@ +../../../config/hosts/primary_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/tomcat_dev b/deploy/james/resources/hosts/tomcat_dev new file mode 120000 index 0000000..7dd1f55 --- /dev/null +++ b/deploy/james/resources/hosts/tomcat_dev @@ -0,0 +1 @@ +../../../config/hosts/tomcat_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/tomcat_prod b/deploy/james/resources/hosts/tomcat_prod new file mode 120000 index 0000000..0b9acd9 --- /dev/null +++ b/deploy/james/resources/hosts/tomcat_prod @@ -0,0 +1 @@ +../../../config/hosts/tomcat_prod \ No newline at end of file diff --git a/deploy/james/resources/hosts/web_dev b/deploy/james/resources/hosts/web_dev new file mode 120000 index 0000000..60eb301 --- /dev/null +++ b/deploy/james/resources/hosts/web_dev @@ -0,0 +1 @@ +../../../config/hosts/web_dev \ No newline at end of file diff --git a/deploy/james/resources/hosts/web_prod b/deploy/james/resources/hosts/web_prod new file mode 120000 index 0000000..d9aed43 --- /dev/null +++ b/deploy/james/resources/hosts/web_prod @@ -0,0 +1 @@ +../../../config/hosts/web_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/auth_dev b/deploy/mail-key/resources/hosts/auth_dev new file mode 120000 index 0000000..66fc587 --- /dev/null +++ b/deploy/mail-key/resources/hosts/auth_dev @@ -0,0 +1 @@ +../../../config/hosts/auth_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/auth_prod b/deploy/mail-key/resources/hosts/auth_prod new file mode 120000 index 0000000..ec6e042 --- /dev/null +++ b/deploy/mail-key/resources/hosts/auth_prod @@ -0,0 +1 @@ +../../../config/hosts/auth_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_db_dev b/deploy/mail-key/resources/hosts/local_db_dev new file mode 120000 index 0000000..ef5bd81 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_db_dev @@ -0,0 +1 @@ +../../../config/hosts/local_db_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_db_prod b/deploy/mail-key/resources/hosts/local_db_prod new file mode 120000 index 0000000..58d3085 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_db_prod @@ -0,0 +1 @@ +../../../config/hosts/local_db_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_key_dev b/deploy/mail-key/resources/hosts/local_key_dev new file mode 120000 index 0000000..942989b --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_key_dev @@ -0,0 +1 @@ +../../../config/hosts/local_key_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_key_prod b/deploy/mail-key/resources/hosts/local_key_prod new file mode 120000 index 0000000..78ceb66 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_key_prod @@ -0,0 +1 @@ +../../../config/hosts/local_key_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_mail_dev b/deploy/mail-key/resources/hosts/local_mail_dev new file mode 120000 index 0000000..75f1282 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_mail_dev @@ -0,0 +1 @@ +../../../config/hosts/local_mail_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_mail_prod b/deploy/mail-key/resources/hosts/local_mail_prod new file mode 120000 index 0000000..445ec54 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_mail_prod @@ -0,0 +1 @@ +../../../config/hosts/local_mail_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_smtp_dev b/deploy/mail-key/resources/hosts/local_smtp_dev new file mode 120000 index 0000000..6efcea5 --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_smtp_dev @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/local_smtp_prod b/deploy/mail-key/resources/hosts/local_smtp_prod new file mode 120000 index 0000000..e87faad --- /dev/null +++ b/deploy/mail-key/resources/hosts/local_smtp_prod @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/primary_dev b/deploy/mail-key/resources/hosts/primary_dev new file mode 120000 index 0000000..9a97052 --- /dev/null +++ b/deploy/mail-key/resources/hosts/primary_dev @@ -0,0 +1 @@ +../../../config/hosts/primary_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/primary_prod b/deploy/mail-key/resources/hosts/primary_prod new file mode 120000 index 0000000..c033d47 --- /dev/null +++ b/deploy/mail-key/resources/hosts/primary_prod @@ -0,0 +1 @@ +../../../config/hosts/primary_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/tomcat_dev b/deploy/mail-key/resources/hosts/tomcat_dev new file mode 120000 index 0000000..7dd1f55 --- /dev/null +++ b/deploy/mail-key/resources/hosts/tomcat_dev @@ -0,0 +1 @@ +../../../config/hosts/tomcat_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/tomcat_prod b/deploy/mail-key/resources/hosts/tomcat_prod new file mode 120000 index 0000000..0b9acd9 --- /dev/null +++ b/deploy/mail-key/resources/hosts/tomcat_prod @@ -0,0 +1 @@ +../../../config/hosts/tomcat_prod \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/web_dev b/deploy/mail-key/resources/hosts/web_dev new file mode 120000 index 0000000..60eb301 --- /dev/null +++ b/deploy/mail-key/resources/hosts/web_dev @@ -0,0 +1 @@ +../../../config/hosts/web_dev \ No newline at end of file diff --git a/deploy/mail-key/resources/hosts/web_prod b/deploy/mail-key/resources/hosts/web_prod new file mode 120000 index 0000000..d9aed43 --- /dev/null +++ b/deploy/mail-key/resources/hosts/web_prod @@ -0,0 +1 @@ +../../../config/hosts/web_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/auth_dev b/deploy/mail-user/resources/hosts/auth_dev new file mode 120000 index 0000000..66fc587 --- /dev/null +++ b/deploy/mail-user/resources/hosts/auth_dev @@ -0,0 +1 @@ +../../../config/hosts/auth_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/auth_prod b/deploy/mail-user/resources/hosts/auth_prod new file mode 120000 index 0000000..ec6e042 --- /dev/null +++ b/deploy/mail-user/resources/hosts/auth_prod @@ -0,0 +1 @@ +../../../config/hosts/auth_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_db_dev b/deploy/mail-user/resources/hosts/local_db_dev new file mode 120000 index 0000000..ef5bd81 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_db_dev @@ -0,0 +1 @@ +../../../config/hosts/local_db_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_db_prod b/deploy/mail-user/resources/hosts/local_db_prod new file mode 120000 index 0000000..58d3085 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_db_prod @@ -0,0 +1 @@ +../../../config/hosts/local_db_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_key_dev b/deploy/mail-user/resources/hosts/local_key_dev new file mode 120000 index 0000000..942989b --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_key_dev @@ -0,0 +1 @@ +../../../config/hosts/local_key_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_key_prod b/deploy/mail-user/resources/hosts/local_key_prod new file mode 120000 index 0000000..78ceb66 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_key_prod @@ -0,0 +1 @@ +../../../config/hosts/local_key_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_mail_dev b/deploy/mail-user/resources/hosts/local_mail_dev new file mode 120000 index 0000000..75f1282 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_mail_dev @@ -0,0 +1 @@ +../../../config/hosts/local_mail_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_mail_prod b/deploy/mail-user/resources/hosts/local_mail_prod new file mode 120000 index 0000000..445ec54 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_mail_prod @@ -0,0 +1 @@ +../../../config/hosts/local_mail_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_smtp_dev b/deploy/mail-user/resources/hosts/local_smtp_dev new file mode 120000 index 0000000..6efcea5 --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_smtp_dev @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/local_smtp_prod b/deploy/mail-user/resources/hosts/local_smtp_prod new file mode 120000 index 0000000..e87faad --- /dev/null +++ b/deploy/mail-user/resources/hosts/local_smtp_prod @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/primary_dev b/deploy/mail-user/resources/hosts/primary_dev new file mode 120000 index 0000000..9a97052 --- /dev/null +++ b/deploy/mail-user/resources/hosts/primary_dev @@ -0,0 +1 @@ +../../../config/hosts/primary_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/primary_prod b/deploy/mail-user/resources/hosts/primary_prod new file mode 120000 index 0000000..c033d47 --- /dev/null +++ b/deploy/mail-user/resources/hosts/primary_prod @@ -0,0 +1 @@ +../../../config/hosts/primary_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/tomcat_dev b/deploy/mail-user/resources/hosts/tomcat_dev new file mode 120000 index 0000000..7dd1f55 --- /dev/null +++ b/deploy/mail-user/resources/hosts/tomcat_dev @@ -0,0 +1 @@ +../../../config/hosts/tomcat_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/tomcat_prod b/deploy/mail-user/resources/hosts/tomcat_prod new file mode 120000 index 0000000..0b9acd9 --- /dev/null +++ b/deploy/mail-user/resources/hosts/tomcat_prod @@ -0,0 +1 @@ +../../../config/hosts/tomcat_prod \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/web_dev b/deploy/mail-user/resources/hosts/web_dev new file mode 120000 index 0000000..60eb301 --- /dev/null +++ b/deploy/mail-user/resources/hosts/web_dev @@ -0,0 +1 @@ +../../../config/hosts/web_dev \ No newline at end of file diff --git a/deploy/mail-user/resources/hosts/web_prod b/deploy/mail-user/resources/hosts/web_prod new file mode 120000 index 0000000..d9aed43 --- /dev/null +++ b/deploy/mail-user/resources/hosts/web_prod @@ -0,0 +1 @@ +../../../config/hosts/web_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/auth_dev b/deploy/tomcat/resources/hosts/auth_dev new file mode 120000 index 0000000..66fc587 --- /dev/null +++ b/deploy/tomcat/resources/hosts/auth_dev @@ -0,0 +1 @@ +../../../config/hosts/auth_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/auth_prod b/deploy/tomcat/resources/hosts/auth_prod new file mode 120000 index 0000000..ec6e042 --- /dev/null +++ b/deploy/tomcat/resources/hosts/auth_prod @@ -0,0 +1 @@ +../../../config/hosts/auth_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_db_dev b/deploy/tomcat/resources/hosts/local_db_dev new file mode 120000 index 0000000..ef5bd81 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_db_dev @@ -0,0 +1 @@ +../../../config/hosts/local_db_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_db_prod b/deploy/tomcat/resources/hosts/local_db_prod new file mode 120000 index 0000000..58d3085 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_db_prod @@ -0,0 +1 @@ +../../../config/hosts/local_db_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_key_dev b/deploy/tomcat/resources/hosts/local_key_dev new file mode 120000 index 0000000..942989b --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_key_dev @@ -0,0 +1 @@ +../../../config/hosts/local_key_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_key_prod b/deploy/tomcat/resources/hosts/local_key_prod new file mode 120000 index 0000000..78ceb66 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_key_prod @@ -0,0 +1 @@ +../../../config/hosts/local_key_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_mail_dev b/deploy/tomcat/resources/hosts/local_mail_dev new file mode 120000 index 0000000..75f1282 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_mail_dev @@ -0,0 +1 @@ +../../../config/hosts/local_mail_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_mail_prod b/deploy/tomcat/resources/hosts/local_mail_prod new file mode 120000 index 0000000..445ec54 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_mail_prod @@ -0,0 +1 @@ +../../../config/hosts/local_mail_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_smtp_dev b/deploy/tomcat/resources/hosts/local_smtp_dev new file mode 120000 index 0000000..6efcea5 --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_smtp_dev @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/local_smtp_prod b/deploy/tomcat/resources/hosts/local_smtp_prod new file mode 120000 index 0000000..e87faad --- /dev/null +++ b/deploy/tomcat/resources/hosts/local_smtp_prod @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/primary_dev b/deploy/tomcat/resources/hosts/primary_dev new file mode 120000 index 0000000..9a97052 --- /dev/null +++ b/deploy/tomcat/resources/hosts/primary_dev @@ -0,0 +1 @@ +../../../config/hosts/primary_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/primary_prod b/deploy/tomcat/resources/hosts/primary_prod new file mode 120000 index 0000000..c033d47 --- /dev/null +++ b/deploy/tomcat/resources/hosts/primary_prod @@ -0,0 +1 @@ +../../../config/hosts/primary_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/tomcat_dev b/deploy/tomcat/resources/hosts/tomcat_dev new file mode 120000 index 0000000..7dd1f55 --- /dev/null +++ b/deploy/tomcat/resources/hosts/tomcat_dev @@ -0,0 +1 @@ +../../../config/hosts/tomcat_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/tomcat_prod b/deploy/tomcat/resources/hosts/tomcat_prod new file mode 120000 index 0000000..0b9acd9 --- /dev/null +++ b/deploy/tomcat/resources/hosts/tomcat_prod @@ -0,0 +1 @@ +../../../config/hosts/tomcat_prod \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/web_dev b/deploy/tomcat/resources/hosts/web_dev new file mode 120000 index 0000000..60eb301 --- /dev/null +++ b/deploy/tomcat/resources/hosts/web_dev @@ -0,0 +1 @@ +../../../config/hosts/web_dev \ No newline at end of file diff --git a/deploy/tomcat/resources/hosts/web_prod b/deploy/tomcat/resources/hosts/web_prod new file mode 120000 index 0000000..d9aed43 --- /dev/null +++ b/deploy/tomcat/resources/hosts/web_prod @@ -0,0 +1 @@ +../../../config/hosts/web_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/auth_dev b/deploy/tools/resources/hosts/auth_dev new file mode 120000 index 0000000..66fc587 --- /dev/null +++ b/deploy/tools/resources/hosts/auth_dev @@ -0,0 +1 @@ +../../../config/hosts/auth_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/auth_prod b/deploy/tools/resources/hosts/auth_prod new file mode 120000 index 0000000..ec6e042 --- /dev/null +++ b/deploy/tools/resources/hosts/auth_prod @@ -0,0 +1 @@ +../../../config/hosts/auth_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_db_dev b/deploy/tools/resources/hosts/local_db_dev new file mode 120000 index 0000000..ef5bd81 --- /dev/null +++ b/deploy/tools/resources/hosts/local_db_dev @@ -0,0 +1 @@ +../../../config/hosts/local_db_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_db_prod b/deploy/tools/resources/hosts/local_db_prod new file mode 120000 index 0000000..58d3085 --- /dev/null +++ b/deploy/tools/resources/hosts/local_db_prod @@ -0,0 +1 @@ +../../../config/hosts/local_db_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_key_dev b/deploy/tools/resources/hosts/local_key_dev new file mode 120000 index 0000000..942989b --- /dev/null +++ b/deploy/tools/resources/hosts/local_key_dev @@ -0,0 +1 @@ +../../../config/hosts/local_key_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_key_prod b/deploy/tools/resources/hosts/local_key_prod new file mode 120000 index 0000000..78ceb66 --- /dev/null +++ b/deploy/tools/resources/hosts/local_key_prod @@ -0,0 +1 @@ +../../../config/hosts/local_key_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_mail_dev b/deploy/tools/resources/hosts/local_mail_dev new file mode 120000 index 0000000..75f1282 --- /dev/null +++ b/deploy/tools/resources/hosts/local_mail_dev @@ -0,0 +1 @@ +../../../config/hosts/local_mail_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_mail_prod b/deploy/tools/resources/hosts/local_mail_prod new file mode 120000 index 0000000..445ec54 --- /dev/null +++ b/deploy/tools/resources/hosts/local_mail_prod @@ -0,0 +1 @@ +../../../config/hosts/local_mail_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_smtp_dev b/deploy/tools/resources/hosts/local_smtp_dev new file mode 120000 index 0000000..6efcea5 --- /dev/null +++ b/deploy/tools/resources/hosts/local_smtp_dev @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/local_smtp_prod b/deploy/tools/resources/hosts/local_smtp_prod new file mode 120000 index 0000000..e87faad --- /dev/null +++ b/deploy/tools/resources/hosts/local_smtp_prod @@ -0,0 +1 @@ +../../../config/hosts/local_smtp_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/primary_dev b/deploy/tools/resources/hosts/primary_dev new file mode 120000 index 0000000..9a97052 --- /dev/null +++ b/deploy/tools/resources/hosts/primary_dev @@ -0,0 +1 @@ +../../../config/hosts/primary_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/primary_prod b/deploy/tools/resources/hosts/primary_prod new file mode 120000 index 0000000..c033d47 --- /dev/null +++ b/deploy/tools/resources/hosts/primary_prod @@ -0,0 +1 @@ +../../../config/hosts/primary_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/tomcat_dev b/deploy/tools/resources/hosts/tomcat_dev new file mode 120000 index 0000000..7dd1f55 --- /dev/null +++ b/deploy/tools/resources/hosts/tomcat_dev @@ -0,0 +1 @@ +../../../config/hosts/tomcat_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/tomcat_prod b/deploy/tools/resources/hosts/tomcat_prod new file mode 120000 index 0000000..0b9acd9 --- /dev/null +++ b/deploy/tools/resources/hosts/tomcat_prod @@ -0,0 +1 @@ +../../../config/hosts/tomcat_prod \ No newline at end of file diff --git a/deploy/tools/resources/hosts/web_dev b/deploy/tools/resources/hosts/web_dev new file mode 120000 index 0000000..60eb301 --- /dev/null +++ b/deploy/tools/resources/hosts/web_dev @@ -0,0 +1 @@ +../../../config/hosts/web_dev \ No newline at end of file diff --git a/deploy/tools/resources/hosts/web_prod b/deploy/tools/resources/hosts/web_prod new file mode 120000 index 0000000..d9aed43 --- /dev/null +++ b/deploy/tools/resources/hosts/web_prod @@ -0,0 +1 @@ +../../../config/hosts/web_prod \ No newline at end of file diff --git a/install/.gitignore b/install/.gitignore new file mode 100644 index 0000000..0c33cfb --- /dev/null +++ b/install/.gitignore @@ -0,0 +1 @@ +setup-mysql.sql diff --git a/install/setup-mysql.sql.template b/install/setup-mysql.sql.template index 263caff..365b91b 100644 --- a/install/setup-mysql.sql.template +++ b/install/setup-mysql.sql.template @@ -1,6 +1,6 @@ -CREATE DATABASE mail CHARACTER SET utf8; -CREATE DATABASE mail_extra CHARACTER SET utf8; -CREATE DATABASE captcha CHARACTER SET utf8; +CREATE DATABASE mail DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; +CREATE DATABASE mail_extra DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; +CREATE DATABASE captcha DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; CREATE DATABASE james CHARACTER SET utf8; CREATE USER 'mail'@'localhost' IDENTIFIED BY 'MAIL_PASSWORD'; @@ -8,7 +8,7 @@ CREATE USER 'mail_extra'@'localhost' IDENTIFIED BY 'MAIL_EXTRA_PASSWORD'; CREATE USER 'captcha'@'localhost' IDENTIFIED BY 'CAPTCHA_PASSWORD'; CREATE USER 'james'@'localhost' IDENTIFIED BY 'JAMES_PASSWORD'; -GRANT ALL PRIVILEGES ON *.mail TO 'mail'@'localhost'; -GRANT ALL PRIVILEGES ON *.mail_extra TO 'mail_extra'@'localhost'; -GRANT ALL PRIVILEGES ON *.captcha TO 'captcha'@'localhost'; -GRANT ALL PRIVILEGES ON *.james TO 'james'@'localhost'; +GRANT ALL PRIVILEGES ON mail.* TO 'mail'@'localhost'; +GRANT ALL PRIVILEGES ON mail_extra.* TO 'mail_extra'@'localhost'; +GRANT ALL PRIVILEGES ON captcha.* TO 'captcha'@'localhost'; +GRANT ALL PRIVILEGES ON james.* TO 'james'@'localhost'; diff --git a/java/core/src/core/constants/ConstantsClientPlatform.java b/java/core/src/core/constants/ConstantsClientPlatform.java index fc8df98..57d86b8 100644 --- a/java/core/src/core/constants/ConstantsClientPlatform.java +++ b/java/core/src/core/constants/ConstantsClientPlatform.java @@ -1,5 +1,7 @@ package core.constants; +import core.util.Hosts; + public class ConstantsClientPlatform { public static final boolean DEBUG = false; @@ -10,17 +12,17 @@ public class ConstantsClientPlatform { if (DEBUG) { - HOST = "mailiverse.com"; - AUTH_HOST = "red"; - TOMCAT_HOST = "YOUR_DEV_TOMCAT:8080"; - WEB_HOST = "YOUR_DEV_WEB:8000"; + HOST = Hosts.getHostFor("primary_dev"); + AUTH_HOST = Hosts.getHostFor("auth_dev"); + TOMCAT_HOST = Hosts.getHostFor("tomcat_dev"); + WEB_HOST = Hosts.getHostFor("web_dev"); } else { - HOST = "mailiverse.com"; - AUTH_HOST = "mail.mailiverse.com"; - TOMCAT_HOST = "mail.mailiverse.com"; - WEB_HOST = "www.mailiverse.com"; + HOST = Hosts.getHostFor("primary_prod"); + AUTH_HOST = Hosts.getHostFor("auth_prod"); + TOMCAT_HOST = Hosts.getHostFor("tomcat_prod"); + WEB_HOST = Hosts.getHostFor("web_prod"); } } } diff --git a/java/core/src/core/constants/ConstantsServer.java b/java/core/src/core/constants/ConstantsServer.java index e4ffc7f..aa69d5d 100644 --- a/java/core/src/core/constants/ConstantsServer.java +++ b/java/core/src/core/constants/ConstantsServer.java @@ -1,11 +1,14 @@ package core.constants; +import core.util.Hosts; + public class ConstantsServer { public static final boolean DEBUG = System.getenv("PRODUCTION")==null; public static final String LOCAL_MAIL_SERVER, DBCONNECTION_PREFIX; public static final String KEY_SERVER; + public static final String LOCAL_SMTP_HOST; static { @@ -13,26 +16,27 @@ public class ConstantsServer { System.out.println("Running DEBUG Mode"); - LOCAL_MAIL_SERVER = "red"; - DBCONNECTION_PREFIX = "jdbc:mysql://red/"; - KEY_SERVER = "red"; + LOCAL_MAIL_SERVER = Hosts.getHostFor("local_mail_dev"); + DBCONNECTION_PREFIX = "jdbc:mysql://" + Hosts.getHostFor("local_db_dev") + "/"; + KEY_SERVER = Hosts.getHostFor("local_key_dev"); + LOCAL_SMTP_HOST = Hosts.getHostFor("local_smtp_dev"); } else { System.out.println("Running PRODUCTION Mode"); - KEY_SERVER = "localhost"; + KEY_SERVER = Hosts.getHostFor("local_key_prod"); // the mail server has to be the full name, or else the SSL certificate fails - LOCAL_MAIL_SERVER = "mail.mailiverse.com"; - DBCONNECTION_PREFIX = "jdbc:mysql://localhost/"; + LOCAL_MAIL_SERVER = Hosts.getHostFor("local_mail_prod"); + DBCONNECTION_PREFIX = "jdbc:mysql://" + Hosts.getHostFor("local_db_prod") + "/"; + LOCAL_SMTP_HOST = Hosts.getHostFor("local_smtp_prod"); } } public static final String SMTP_HOST = LOCAL_MAIL_SERVER; public static final int SMTP_PORT = 25; - public static final String LOCAL_SMTP_HOST = "YOUR_LOCAL_SMTP_HOST"; public static final String LOCAL_SMTP_PORT = "10025"; public static final String KEY_AUTH_HOST = KEY_SERVER; diff --git a/java/core/src/core/util/Hosts.java b/java/core/src/core/util/Hosts.java new file mode 100644 index 0000000..3342d3e --- /dev/null +++ b/java/core/src/core/util/Hosts.java @@ -0,0 +1,17 @@ +package core.util; + +public class Hosts +{ + public static String getHostFor (String key) + { + try + { + return ExternalResource.getTrimmedString("hosts/" + key); + } + catch (Exception e) + { + throw new RuntimeException("Internal error. #9204 " + key); + } + } + +} diff --git a/java/core/src/core/util/ProxySelectorRegex.java b/java/core/src/core/util/ProxySelectorRegex.java index 8327416..b38581a 100644 --- a/java/core/src/core/util/ProxySelectorRegex.java +++ b/java/core/src/core/util/ProxySelectorRegex.java @@ -25,15 +25,13 @@ public class ProxySelectorRegex extends ProxySelector "localhost", "127\\.0.*", "192\\.168\\.1\\..*", - ".*piratemail\\.se", - "blue", - ".*mailiverse\\.com", ".*\\.dropbox\\.com", "s3\\.amazonaws\\.com", "s3\\.amazonaws\\.com\\.", ".*\\.s3\\.amazonaws\\.com", ".*\\.s3\\.amazonaws\\.com\\.", - ".*\\.push\\.apple\\.com" + ".*\\.push\\.apple\\.com", + ".*" + (Hosts.getHostFor("primary_prod").replace(".", "\\.")) } ; List NoProxy = Arrays.asList(new Proxy[] { Proxy.NO_PROXY });