diff options
author | Peter Martischka <pita@pitapoison.de> | 2010-04-08 14:20:23 +0200 |
---|---|---|
committer | Peter Martischka <pita@pitapoison.de> | 2010-04-08 14:20:23 +0200 |
commit | 5ff65ce80e04028fc9ff299534f92e2836c3636a (patch) | |
tree | bbe0c73d0bffc64adffecb34a9a745819c864539 | |
parent | 9c1dfc38451a4ee70c99de16bd5799cbe0c69730 (diff) | |
parent | ef71f285a7263c4df76057baf528e943c8870efb (diff) | |
download | etherpad-5ff65ce80e04028fc9ff299534f92e2836c3636a.tar.gz etherpad-5ff65ce80e04028fc9ff299534f92e2836c3636a.tar.xz etherpad-5ff65ce80e04028fc9ff299534f92e2836c3636a.zip |
Merge branch 'jefferai' of git://github.com/jefferai/pad
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | etherpad/bin/run-local.sh | 2 | ||||
-rwxr-xr-x | etherpad/bin/setup-mysql-db.sh | 9 | ||||
-rw-r--r-- | etherpad/etc/etherpad.localdev-default.properties | 9 | ||||
-rw-r--r-- | etherpad/src/etherpad/pro/pro_accounts.js | 14 | ||||
-rw-r--r-- | etherpad/src/etherpad/pro/pro_utils.js | 9 | ||||
-rw-r--r-- | etherpad/src/etherpad/utils.js | 4 | ||||
-rw-r--r-- | etherpad/src/static/css/home-opensource.css | 18 | ||||
-rw-r--r-- | etherpad/src/templates/pro/admin/admin-template.ejs | 2 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/config.scala | 5 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/execution.scala | 5 | ||||
-rw-r--r-- | infrastructure/net.appjet.oui/main.scala | 4 |
12 files changed, 58 insertions, 25 deletions
@@ -1,4 +1,5 @@ *~ +etherpad/etc/etherpad.local.properties etherpad/src/etherpad/collab/ace/contentcollector.js etherpad/src/etherpad/collab/ace/domline.js etherpad/src/etherpad/collab/ace/easysync1.js @@ -12,3 +13,4 @@ etherpad/src/static/js/domline_client.js etherpad/src/static/js/easysync2_client.js etherpad/src/static/js/linestylefilter_client.js etherpad/*.log +infrastructure/lib/cos.jar diff --git a/etherpad/bin/run-local.sh b/etherpad/bin/run-local.sh index 72b0cc1..67a6d57 100755 --- a/etherpad/bin/run-local.sh +++ b/etherpad/bin/run-local.sh @@ -34,7 +34,7 @@ if [ -z "$JAVA" ]; then fi # etherpad properties file -cfg_file=./data/etherpad.local.properties +cfg_file=./etc/etherpad.local.properties if [ ! -f $cfg_file ]; then cfg_file=./etc/etherpad.localdev-default.properties fi diff --git a/etherpad/bin/setup-mysql-db.sh b/etherpad/bin/setup-mysql-db.sh index d823a9e..45901ac 100755 --- a/etherpad/bin/setup-mysql-db.sh +++ b/etherpad/bin/setup-mysql-db.sh @@ -14,17 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [ `whoami` != "root" ]; then - echo "Must run as root, i.e., sudo $0" - exit 1 -fi - db="etherpad" echo "Creating etherpad ${db}..." -echo "create database ${db};" | ${mysql} -u root +echo "create database ${db};" | ${mysql} -u root -p echo "Granting priviliges..." -echo "grant all privileges on ${db}.* to 'etherpad'@'localhost' identified by 'password';" | ${mysql} -u root +echo "grant all privileges on ${db}.* to 'etherpad'@'localhost' identified by 'password';" | ${mysql} -u root -p echo "Success" diff --git a/etherpad/etc/etherpad.localdev-default.properties b/etherpad/etc/etherpad.localdev-default.properties index 1143178..07dce96 100644 --- a/etherpad/etc/etherpad.localdev-default.properties +++ b/etherpad/etc/etherpad.localdev-default.properties @@ -1,19 +1,22 @@ +alwaysHttps = false ajstdlibHome = ../infrastructure/framework-src/modules appjetHome = ./data/appjet devMode = true etherpad.adminPass = password etherpad.fakeProduction = false etherpad.isProduction = false +etherpad.proAccounts = true etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver etherpad.SQL_JDBC_URL = jdbc:mysql://localhost:3306/etherpad etherpad.SQL_PASSWORD = password etherpad.SQL_USERNAME = etherpad -etherpad.proAccounts = true +hidePorts = false listen = 9000 logDir = ./data/logs modulePath = ./src +motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0 +topdomains = localhost transportPrefix = /comet transportUseWildcardSubdomains = true +useHttpsUrls = false useVirtualFileRoot = ./src -motdPage = /ep/pad/view/ro.3PfHCD0ApLc/latest?fullScreen=1&slider=0&sidebar=0 -topdomains = localhost diff --git a/etherpad/src/etherpad/pro/pro_accounts.js b/etherpad/src/etherpad/pro/pro_accounts.js index cdecd0d..54ac50c 100644 --- a/etherpad/src/etherpad/pro/pro_accounts.js +++ b/etherpad/src/etherpad/pro/pro_accounts.js @@ -511,10 +511,16 @@ function getFullNameById(id) { } function getTempSigninUrl(account, tempPass) { - return [ - 'https://', httpsHost(pro_utils.getFullProHost()), '/ep/account/sign-in?', - 'uid=', account.id, '&tp=', tempPass - ].join(''); + if(appjet.config.listenSecurePort != 0 || appjet.config.useHttpsUrls) + return [ + 'https://', httpsHost(pro_utils.getFullProHost()), '/ep/account/sign-in?', + 'uid=', account.id, '&tp=', tempPass + ].join(''); + else + return [ + 'http://', httpHost(pro_utils.getFullProHost()), '/ep/account/sign-in?', + 'uid=', account.id, '&tp=', tempPass + ].join(''); } diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js index 5e8b801..2322262 100644 --- a/etherpad/src/etherpad/pro/pro_utils.js +++ b/etherpad/src/etherpad/pro/pro_utils.js @@ -47,11 +47,14 @@ function getProRequestSubdomain() { function getRequestSuperdomain() { var parts = request.domain.split('.'); - parts.reverse(); - if (parts[0] == ".") { + while (parts.length > 0) { + var domain = parts.join('.'); + if (domainEnabled[domain]) { + return domain; + } parts.shift(); } - return [parts[1], parts[0]].join('.'); + return false; } function isProDomainRequest() { diff --git a/etherpad/src/etherpad/utils.js b/etherpad/src/etherpad/utils.js index 398090c..3e35f00 100644 --- a/etherpad/src/etherpad/utils.js +++ b/etherpad/src/etherpad/utils.js @@ -388,7 +388,7 @@ function isStaticRequest() { function httpsHost(h) { h = h.split(":")[0]; // strip any existing port - if (appjet.config.listenSecurePort != "443") { + if (appjet.config.listenSecurePort != "443" && !appjet.config.hidePorts) { h = (h + ":" + appjet.config.listenSecurePort); } return h; @@ -396,7 +396,7 @@ function httpsHost(h) { function httpHost(h) { h = h.split(":")[0]; // strip any existing port - if (appjet.config.listenPort != "80") { + if (appjet.config.listenPort != "80" && !appjet.config.hidePorts) { h = (h + ":" + appjet.config.listenPort); } return h; diff --git a/etherpad/src/static/css/home-opensource.css b/etherpad/src/static/css/home-opensource.css index 82f15da..bb0201e 100644 --- a/etherpad/src/static/css/home-opensource.css +++ b/etherpad/src/static/css/home-opensource.css @@ -10,7 +10,7 @@ font-size: 3.6em; } -#home a#home-newpad, #home a#home-newteam{ +#home a#home-newpad{ display: block; padding: 1em; margin: 12px 60px; @@ -20,7 +20,21 @@ color: #fff; } -#home a#home-newpad:hover, #home a#home-newteam:hover{ +#home a#home-newpad:hover{ background: #26b; } +#home a#home-newteam { + display: block; + padding: 1em; + margin: 12px 60px; + font-size: 1.6em; + border: 1px solid black; + background: #940; + color: #fff; +} + +#home a#home-newteam:hover { + background: #b26; +} + diff --git a/etherpad/src/templates/pro/admin/admin-template.ejs b/etherpad/src/templates/pro/admin/admin-template.ejs index e1a7736..0964e33 100644 --- a/etherpad/src/templates/pro/admin/admin-template.ejs +++ b/etherpad/src/templates/pro/admin/admin-template.ejs @@ -16,11 +16,9 @@ limitations under the License. */ %><% helpers.setHtmlTitle("Etherpad Administra <div class="fpcontent"> <table id="admin-layout-table"> <tr> - <% if (validLicense) { %> <td width="1%" id="admin-leftnav"> <%= renderAdminLeftNav() %> </td> - <% } %> <td width="99%" id="admin-right"> <%= getAdminContent() %> </td> diff --git a/infrastructure/net.appjet.oui/config.scala b/infrastructure/net.appjet.oui/config.scala index 6201816..2b0e47a 100644 --- a/infrastructure/net.appjet.oui/config.scala +++ b/infrastructure/net.appjet.oui/config.scala @@ -80,6 +80,8 @@ object config { { val argName = "directory" } def appHome = stringOrElse("appHome", ""); + @ConfigParam("Whether to generate https URLs even if running locally behind HTTP (useful for Apache handling HTTPS)") + def useHttpsUrls = boolOrElse("useHttpsUrls", false); @ConfigParam("Search path for modules imported via \"import\". Defaults to current working directory.") { val argName = "dir1:dir2:..." } @@ -114,6 +116,9 @@ object config { else ("", Integer.parseInt(s)) + @ConfigParam("Whether to show the port numbers to the outside world (false: assume ports visible from the outside are the default http/https ports)") + def hidePorts = boolOrElse("hidePorts", false); + @ConfigParam("[host:]port on which to serve the app. Default: 8080.") { val argName = "[host:]port" } def listen = stringOrElse("listen", "8080"); diff --git a/infrastructure/net.appjet.oui/execution.scala b/infrastructure/net.appjet.oui/execution.scala index 63749b1..f4f4d9e 100644 --- a/infrastructure/net.appjet.oui/execution.scala +++ b/infrastructure/net.appjet.oui/execution.scala @@ -34,6 +34,9 @@ import net.appjet.common.util.{HttpServletRequestFactory, BetterFile}; import Util.enumerationToRichEnumeration; +// Removed due to licensing issues; REMOVED_COS_OF_COS +// import com.oreilly.servlet.MultipartFilter; + class RequestWrapper(val req: HttpServletRequest) { req.setCharacterEncoding("UTF-8"); // private lazy val parameterNames = @@ -124,6 +127,8 @@ class RequestWrapper(val req: HttpServletRequest) { else null; } + + // Depends on cos.jar; REMOVED_COS_OF_COS def files(globalScope: Scriptable): Object = { // if (! req.isInstanceOf[com.oreilly.servlet.MultipartWrapper]) { new ScriptableAdapter(); diff --git a/infrastructure/net.appjet.oui/main.scala b/infrastructure/net.appjet.oui/main.scala index 42cd268..67c1f6f 100644 --- a/infrastructure/net.appjet.oui/main.scala +++ b/infrastructure/net.appjet.oui/main.scala @@ -32,7 +32,7 @@ import org.mortbay.jetty.handler.{HandlerCollection, RequestLogHandler, HandlerL import org.mortbay.jetty.{Server, NCSARequestLog, Request, Response}; import org.mortbay.servlet.GzipFilter; -// removed due to license restrictions +// removed due to license restrictions; REMOVED_COS_OF_COS // import com.oreilly.servlet.MultipartFilter; import net.appjet.common.util.{BetterFile, HttpServletRequestFactory}; @@ -220,6 +220,8 @@ object main { val handler = new Context(server, "/", Context.NO_SESSIONS | Context.NO_SECURITY); handler.addServlet(new ServletHolder(new OuiServlet), "/"); +// removed due to license restrictions; REMOVED_COS_OF_COS + // val filterHolder = new FilterHolder(new MultipartFilter()); // filterHolder.setInitParameter("uploadDir", System.getProperty("java.io.tmpdir")); // handler.addFilter(filterHolder, "/*", 1); |