aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rwxr-xr-xetherpad/bin/run-local.sh2
-rwxr-xr-xetherpad/bin/setup-mysql-db.sh9
-rw-r--r--etherpad/etc/etherpad.localdev-default.properties9
-rw-r--r--etherpad/src/etherpad/pro/pro_accounts.js14
-rw-r--r--etherpad/src/etherpad/pro/pro_utils.js9
-rw-r--r--etherpad/src/etherpad/utils.js4
-rw-r--r--etherpad/src/static/css/home-opensource.css18
-rw-r--r--etherpad/src/templates/pro/admin/admin-template.ejs2
-rw-r--r--infrastructure/net.appjet.oui/config.scala5
-rw-r--r--infrastructure/net.appjet.oui/execution.scala5
-rw-r--r--infrastructure/net.appjet.oui/main.scala4
12 files changed, 58 insertions, 25 deletions
diff --git a/.gitignore b/.gitignore
index d0995e3..c99c9f1 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
@@ -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);