Mercurial Hosting > nabble
diff src/nabble/view/web/help/DNSConfiguration.java @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 36b0e32246d0 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/view/web/help/DNSConfiguration.java Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,52 @@ + +package nabble.view.web.help; + +import fschmidt.util.servlet.JtpContext; +import nabble.view.lib.Cache; +import nabble.view.lib.Jtp; +import nabble.view.lib.Shared; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.net.InetAddress; + + +public final class DNSConfiguration extends HttpServlet { + + protected void service(HttpServletRequest request,HttpServletResponse response) + throws ServletException, IOException + { + JtpContext jtpContext = (JtpContext)getServletContext().getAttribute(JtpContext.attrName); + jtpContext.setEtag(request,response); + PrintWriter out = response.getWriter(); + + String nabbleHost = Jtp.getDefaultHost(); + + out.print( "\n<html>\n <head>\n " ); + Shared.head(request,response); + out.print( "\n <title>Configure a Domain Already Registered</title>\n <style type=\"text/css\">\n div.field-title {\n margin: 0 0 .5em 0;\n }\n td.number {\n width: 3em;\n padding-bottom: .2em;\n }\n span.number {\n font-size: 200%;\n padding: 0 .3em .03em;\n border-width:1px;\n border-style:solid;\n }\n table.dns-table {\n margin:.5em 0 1em;\n border-width:1px;\n border-style:solid;\n width:80%;\n }\n td.dns-addr {\n width:20%;\n }\n </style>\n </head>\n <body>\n " ); + Shared.minHeaderGlobal(request,response); + out.print( "\n\n <h1>Configure a Domain Already Registered</h1>\n\n <p>\n The custom domain name feature allows you to setup your Nabble application with a domain name\n you've already registered through another registrar, such as GoDaddy.\n </p>\n\n <h2>Follow these steps to setup a custom domain name</h2>\n\n <table style=\"margin-left:1.3em\">\n <tr valign=\"top\">\n <td class=\"number\"><span class=\"number shaded-bg-color medium-border-color\">1</span></td>\n <td>\n <div class=\"second-font field-title\">Login to your Domain Registrar account</div>\n Please go to your registrar's website (e.g., GoDaddy, Register.com, 1and1.com, etc.) and login.\n </td>\n </tr>\n </table>\n\n <table style=\"margin:1em 0 0 1.3em\">\n <tr valign=\"top\">\n <td class=\"number\"><span class=\"number shaded-bg-color medium-border-color\">2</span></td>\n <td>\n <div class=\"second-font field-title\">Navigate to the domain's DNS Management page</div>\n You are looking to modify the CNAME-Record of your domain, NOT the name servers -- You need to leave your name servers configured with your existing registrar.\n </td>\n </tr>\n </table>\n\n <table style=\"margin:1em 0 0 1.3em\">\n <tr valign=\"top\">\n <td class=\"number\"><span class=\"number shaded-bg-color medium-border-color\">3</span></td>\n <td>\n <div class=\"second-font field-title\">Setup CNAME-Record</div>\n If you are trying to setup a domain like www.mydomain.com, then you should set the CNAME-Record as follows:\n <table class=\"medium-border-color dns-table\">\n <tr class=\"shaded-bg-color\" style=\"font-weight:bold\">\n <td>HOST</td>\n <td class=\"dns-addr\">POINTS TO</td>\n </tr>\n <tr>\n <td>www</td>\n <td>" ); + out.print( (nabbleHost) ); + out.print( "</td>\n </tr> \n </table>\n If you are trying to setup just a sub-domain of your domain (e.g., myforum.mydomain.com), then you should set the CNAME-Record just for this sub-domain.\n <table class=\"medium-border-color dns-table\">\n <tr class=\"shaded-bg-color\" style=\"font-weight:bold\">\n <td>HOST</td>\n <td class=\"dns-addr\">POINTS TO</td>\n </tr>\n <tr>\n <td>myforum</td>\n <td>" ); + out.print( (nabbleHost) ); + out.print( "</td>\n </tr>\n </table>\n" ); + /* + out.print( "\n If you are trying to setup a domain without host (e.g., http://mydomain.com), then you should create the A-Record for the domain root.\n <table class=\"medium-border-color dns-table\">\n <tr class=\"shaded-bg-color\" style=\"font-weight:bold\">\n <td>HOST</td>\n <td class=\"dns-addr\">POINTS TO</td>\n </tr>\n <tr>\n <td>domain root (usually identified by a * or @ symbol)</td>\n <td>" ); + out.print( (nabbleIP) ); + out.print( "</td>\n </tr>\n </table>\n" ); + */ + out.print( "\n </td>\n </tr>\n </table>\n\n <p>\n <b>Note</b>: It can take up to 48 hours (although usually less) for these DNS changes propagate through the internet.\n </p>\n\n " ); + Shared.footer(request,response); + out.print( "\n " ); + Shared.analytics(request,response); + out.print( "\n </body>\n</html>\n" ); + + } + +} +