From 2cbc8b55729ccf17fc7b733f36547f1a6ccf71b7 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:09:43 -0400 Subject: Look for the etherpad.local.properties file in the logical location (same directory as the default file) instead of the nonexistent data directory. Also update the .gitignore to ignore this file. --- .gitignore | 1 + etherpad/bin/run-local.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d0995e3..850962b 100644 --- a/.gitignore +++ b/.gitignore @@ -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 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 -- cgit v1.2.3 From 34548937f88041cb1eef6aefe378543cb051102e Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:15:32 -0400 Subject: You need to have the root mysql password -- so there is really no need to also be the root user. --- etherpad/bin/setup-mysql-db.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/etherpad/bin/setup-mysql-db.sh b/etherpad/bin/setup-mysql-db.sh index d823a9e..754e089 100755 --- a/etherpad/bin/setup-mysql-db.sh +++ b/etherpad/bin/setup-mysql-db.sh @@ -14,11 +14,6 @@ # 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}..." -- cgit v1.2.3 From a8a2dae29ecd1f1ec2a334df980e49ea04ee61b8 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:23:49 -0400 Subject: Forgot the -p on the end of the mysql lines...this fixes my previous commit properly --- etherpad/bin/setup-mysql-db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etherpad/bin/setup-mysql-db.sh b/etherpad/bin/setup-mysql-db.sh index 754e089..45901ac 100755 --- a/etherpad/bin/setup-mysql-db.sh +++ b/etherpad/bin/setup-mysql-db.sh @@ -17,9 +17,9 @@ 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" -- cgit v1.2.3 From cc79f0e2c6b9452b2f0a8224d12421745c7ab134 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:33:31 -0400 Subject: Fix up getTempSigninUrl option so that it uses https when appropriate and http otherwise. --- etherpad/src/etherpad/pro/pro_accounts.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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(''); } -- cgit v1.2.3 From 6dbb148634b9cde9581708b652a49b195b58e484 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:39:11 -0400 Subject: Instead of only working with superdomains that have two parts, consume each part of the request and compare against valid superdomains. This lets you run a site with arbitrary lengths for the domains, e.g. mypads.etherpad.mysite.com. --- etherpad/src/etherpad/pro/pro_utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js index 5e8b801..3c5a7c9 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 (SUPERDOMAINS[domain]) { + return domain; + } parts.shift(); } - return [parts[1], parts[0]].join('.'); + return false; } function isProDomainRequest() { -- cgit v1.2.3 From 25e821ece450b366990c7c353ec00261d9bbc5a5 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:42:31 -0400 Subject: If hidePorts is enabled, don't show port numbers in e.g. emails. Useful when you're running behind a proxy but EP doesn't know it, so that it doesn't tack on :9000 in links in emails. --- etherpad/src/etherpad/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- cgit v1.2.3 From 184e0325bee6cad58b00f40193ec584e5988b107 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:47:02 -0400 Subject: Put in CSS to show the new teamsite link in a different color. I think the color chosen goes together pretty well, but more importantly it makes it immediately obvious that they are two buttons that do two different things. Plus, variety is the spice of life :-) --- etherpad/src/static/css/home-opensource.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/etherpad/src/static/css/home-opensource.css b/etherpad/src/static/css/home-opensource.css index 82f15da..26387de 100644 --- a/etherpad/src/static/css/home-opensource.css +++ b/etherpad/src/static/css/home-opensource.css @@ -24,3 +24,17 @@ background: #26b; } +#home a#home-newteamsite { + display: block; + padding: 1em; + margin: 12px 60px; + font-size: 1.6em; + border: 1px solid black; + background: #940; + color: #fff; +} + +#home a#home-newteamsite:hover { + background: #b26; +} + -- cgit v1.2.3 From f3a00dbd3c67a11487186b846e3243bd3d7738ea Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:50:46 -0400 Subject: Always render the navigation menu in the administration page; there aren't licenses anymore after all. --- etherpad/src/templates/pro/admin/admin-template.ejs | 2 -- 1 file changed, 2 deletions(-) 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
- <% if (validLicense) { %> - <% } %> -- cgit v1.2.3 From 4f3e0789c45056a5fa2ab76c006d4357f1cac0fc Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 18:56:02 -0400 Subject: Many users may add the cos.jar file for import/export; place in .gitignore so those users don't constantly have git whining at them. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 850962b..c99c9f1 100644 --- a/.gitignore +++ b/.gitignore @@ -13,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 -- cgit v1.2.3 From 387dea459220cb13e3710af298d7829223917376 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 19:00:23 -0400 Subject: Add useHttpsUrls and hidePorts config options --- infrastructure/net.appjet.oui/config.scala | 5 +++++ 1 file changed, 5 insertions(+) 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"); -- cgit v1.2.3 From 674d560a2fdbedbda0a3fc3328be102e884b345b Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 19:04:22 -0400 Subject: Add REMOVED_COS_OF_COS markers so those that want to enable support provided by cos.jar can easily find what to uncomment. --- infrastructure/net.appjet.oui/execution.scala | 5 +++++ infrastructure/net.appjet.oui/main.scala | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3 From 487168379a5a16598286997f1e1110eeb0c0a197 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 19:46:29 -0400 Subject: Modify to add some templates for the added parameters, plus rearrange into alphabetical order --- etherpad/etc/etherpad.localdev-default.properties | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- cgit v1.2.3 From be608cc598f55ae7d72811fc4f26b38afca1795e Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 19:52:12 -0400 Subject: I didn't realize someone had gotten rid of SUPERDOMAINS. Use domainEnabled instead. --- etherpad/src/etherpad/pro/pro_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etherpad/src/etherpad/pro/pro_utils.js b/etherpad/src/etherpad/pro/pro_utils.js index 3c5a7c9..2322262 100644 --- a/etherpad/src/etherpad/pro/pro_utils.js +++ b/etherpad/src/etherpad/pro/pro_utils.js @@ -49,7 +49,7 @@ function getRequestSuperdomain() { var parts = request.domain.split('.'); while (parts.length > 0) { var domain = parts.join('.'); - if (SUPERDOMAINS[domain]) { + if (domainEnabled[domain]) { return domain; } parts.shift(); -- cgit v1.2.3 From ef71f285a7263c4df76057baf528e943c8870efb Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 7 Apr 2010 20:13:14 -0400 Subject: Actually use the new teamsite color. --- etherpad/src/static/css/home-opensource.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etherpad/src/static/css/home-opensource.css b/etherpad/src/static/css/home-opensource.css index 26387de..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,11 +20,11 @@ color: #fff; } -#home a#home-newpad:hover, #home a#home-newteam:hover{ +#home a#home-newpad:hover{ background: #26b; } -#home a#home-newteamsite { +#home a#home-newteam { display: block; padding: 1em; margin: 12px 60px; @@ -34,7 +34,7 @@ color: #fff; } -#home a#home-newteamsite:hover { +#home a#home-newteam:hover { background: #b26; } -- cgit v1.2.3
<%= renderAdminLeftNav() %> <%= getAdminContent() %>