From d4bf735dc0793b39c1a5fae6da4920db4f2e5990 Mon Sep 17 00:00:00 2001 From: mjjo Date: Sat, 27 May 2017 22:08:32 +0000 Subject: [PATCH] apply modification --- bin/exports.sh | 51 ++--------------- etherpad/etc/etherpad.local.properties.bak | 57 +++++++++++++++++++ etherpad/src/etherpad/control/apicontrol.js | 2 +- .../src/static/js/ace2/linestylefilter.js | 2 +- start.sh | 45 +++++++++++++++ 5 files changed, 109 insertions(+), 48 deletions(-) mode change 100755 => 100644 bin/exports.sh create mode 100644 etherpad/etc/etherpad.local.properties.bak create mode 100755 start.sh diff --git a/bin/exports.sh b/bin/exports.sh old mode 100755 new mode 100644 index 3d88bc8..7b2071c --- a/bin/exports.sh +++ b/bin/exports.sh @@ -1,53 +1,12 @@ #!/bin/bash -################################################################################ -# -# Copyright (c) 2010 penSec.IT UG (haftungsbeschränkt) -# http://www.pensec.it -# mail@pensec.it -# Copyright (c) 2010 Egil Möller -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# -################################################################################ +export SCALA_HOME="/usr/share/scala" +export SCALA="/usr/bin/scala" +export SCALA_LIBRARY_JAR="/usr/share/scala/lib/scala-library.jar" -## Change the following lines to fit your development environment. - -# These lines assume you installed Scala via Homebrew. -export SCALA_HOME="/usr/local/Cellar/scala/2.11.7" -export SCALA="$SCALA_HOME/bin/scala" -export SCALA_LIBRARY_JAR="$SCALA_HOME/libexec/lib/scala-library.jar" - -export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home" +export JAVA_HOME="/usr/share/java" export JAVA="/usr/bin/java" -## The following lines should not need changing. - -export JAVA_OPTS="-Xbootclasspath/p:../infrastructure/lib/rhino-js-1.7r3.jar:$SCALA_LIBRARY_JAR" +export JAVA_OPTS="-Xmx1024M -Xms1024M -Xbootclasspath/p:../infrastructure/lib/rhino-js-1.7r3.jar:$SCALA_LIBRARY_JAR" export MYSQL_CONNECTOR_JAR="$PWD/lib/mysql-connector-java-5.1.34-bin.jar" export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH" - -if ! [ -e "$MYSQL_CONNECTOR_JAR" ]; then - echo "MySql Connector jar '$MYSQL_CONNECTOR_JAR' not found - Download it here: http://dev.mysql.com/downloads/connector/j/3.1.html" - exit 1 -fi - -if ! [ -e "$SCALA_LIBRARY_JAR" ]; then - echo "Scala Library cannot be found '$SCALA_LIBRARY_JAR' not found - Download it here: http://www.scala-lang.org/" - exit 1 -fi - -if ! [ -e "$JAVA" ]; then - echo "Java cannot be found '$JAVA' not found - Download it here: http://openjdk.java.net/" - exit 1 -fi diff --git a/etherpad/etc/etherpad.local.properties.bak b/etherpad/etc/etherpad.local.properties.bak new file mode 100644 index 0000000..1e6d203 --- /dev/null +++ b/etherpad/etc/etherpad.local.properties.bak @@ -0,0 +1,57 @@ +ajstdlibHome = ../infrastructure/framework-src/modules +appjetHome = ./data/appjet +devMode = false +etherpad.fakeProduction = true +etherpad.fakePNE = true +etherpad.isProduction = true +etherpad.proAccounts = true +etherpad.superUserEmailAddresses = mjjo53@gmail.com +etherpad.SQL_JDBC_DRIVER = com.mysql.jdbc.Driver +etherpad.SQL_JDBC_URL = jdbc:mysql://mariadb:3306/hackpad +etherpad.SQL_PASSWORD = whaudwls +etherpad.SQL_USERNAME = hackpad +etherpad.SQL_REQUIRE_SSL = false +etherpad.googleConsumerKey = __google_consumer_key__ +etherpad.googleConsumerSecret = __google_consumer_secret__ +hidePorts = false +listen = 9000 +logDir = /var/log/etherpad +modulePath = ./src +topdomains = localhost,mjjo53.us.to +transportPrefix = /comet +transportUseWildcardSubdomains = true +useHttpsUrls = false +useVirtualFileRoot = ./src +theme = default +etherpad.soffice = /usr/bin/soffice +customBrandingName = Hackpad +customEmailAddress = noreply@example.com +facebookClientId = __fb_id__ +facebookClientSecret = __fb_secret__ +smtpUser = __smtp_user__ +smtpPass = __smtp_password__ +awsUser = __aws_key_id__ +awsPass = __aws_secret__ +s3Bucket = __aws_attachments_bucket__ +s3Region = us-east-1 +solrHostPort = 127.0.0.1:9000 +solrOnly = false +etherpad.syndicateChanges = true +etherpad.processInbox = true +secureCookieKey = __secure_cookie_key__ +requestSigningSecret = __request_signing_secret__ +apnsCert.appStore.certFile = __apns_p12_cert_file__ +apnsCert.appStore.certPass = __apns_p12_cert_password__ +apnsCert.beta.certFile = __apns_p12_cert_file__ +apnsCert.beta.certPass = __apns_p12_cert_password__ +apnsCert.debug.certFile = __apns_p12_cert_file__ +apnsCert.debug.certPass = __apns_p12_cert_password__ +cdnUrl = __cdn_url__ +mixpanelToken = __mixpanel_token__ +googleAnalyticsAccount = __google_analytics_account__ +googleAnalyticsDomainName = __google_analytics_domain_name__ +defaultIdEncryptionKey = 0123456789abcdef +accountIdEncryptionKey = 0123456789abcdef +collectionIdEncryptionKey = 0123456789abcdef +welcomePadSourceId = WELCOMEPAD +featureHelpPadId = FEATUREHELPPAD diff --git a/etherpad/src/etherpad/control/apicontrol.js b/etherpad/src/etherpad/control/apicontrol.js index 14e20d5..b051055 100644 --- a/etherpad/src/etherpad/control/apicontrol.js +++ b/etherpad/src/etherpad/control/apicontrol.js @@ -474,7 +474,7 @@ function render_latex_post() { preamble = preamble.replace(/&/g,"%26"); var body = 'formula=' +formula; - body = body + '&fsize=' +'14px'; + body = body + '&fsize=' +'20px'; body = body + '&fcolor=' +'000000'; body = body + '&mode=0'; body = body + '&out=1'; diff --git a/etherpad/src/static/js/ace2/linestylefilter.js b/etherpad/src/static/js/ace2/linestylefilter.js index 24c1928..451eef6 100644 --- a/etherpad/src/static/js/ace2/linestylefilter.js +++ b/etherpad/src/static/js/ace2/linestylefilter.js @@ -133,7 +133,7 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, } else if (key == 'table') { classes.push('attrtable table:'+encodeURIComponent(value)); } else if (key == 'tex') { - classes.push('attrtex tex:'+encodeURIComponent(value)); + classes.push('tex:'+encodeURIComponent(value)); } else if (key == 'last-col') { classes.push('last-col'); lastCol = true; diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..eb028a6 --- /dev/null +++ b/start.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +cd "$( dirname "${BASH_SOURCE[0]}" )" + +ADMIN_EMAILS=${ADMIN_EMAILS:-admin@localhost.info} +DB_HOST=${DB_HOST:-mysql} +DB_PORT=${DB_PORT:-3306} +DB_NAME=${DB_NAME:-hackpad} +DB_USERNAME=${DB_USERNAME:-hackpad} +DB_PASSWORD=${DB_PASSWORD:-password} +TOP_DOMAINS=${TOP_DOMAINS:-localhost} +USE_HTTPS_URLS=${USE_HTTPS_URLS:-false} +ENC_KEY=0123456789abcdef +PRODUCTION=true + +cp hackpad/etherpad/etc/etherpad.local.properties.tmpl hackpad/etherpad/etc/etherpad.local.properties + +sed -i.bak s/__email_addresses_with_admin_access__/$ADMIN_EMAILS/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__dbc_dbserver__/$DB_HOST/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__dbc_dbport__/$DB_PORT/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__dbc_dbname__/$DB_NAME/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__dbc_dbuser__/$DB_USERNAME/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__dbc_dbpass__/$DB_PASSWORD/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__default_id_encryption_key__/$ENC_KEY/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__account_id_encryption_key__/$ENC_KEY/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__collection_id_encryption_key__/$ENC_KEY/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__welcome_pad_source_id__/WELCOMEPAD/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak s/__feature_help_pad_source_id__/FEATUREHELPPAD/g hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak "s/^\(topdomains = \).*$/\1$TOP_DOMAINS/g" hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak "s/^\(useHttpsUrls = \).*$/\1$USE_HTTPS_URLS/g" hackpad/etherpad/etc/etherpad.local.properties +if [ "$PRODUCTION" == true ] ; then + sed -i.bak "s/^\(devMode = \).*$/\1false/g" hackpad/etherpad/etc/etherpad.local.properties + sed -i.bak "s/^\(etherpad\.isProduction = \).*$/\1true/g" hackpad/etherpad/etc/etherpad.local.properties +else + sed -i.bak "s/^\(devMode = \).*$/\1true/g" hackpad/etherpad/etc/etherpad.local.properties + sed -i.bak "s/^\(etherpad\.isProduction = \).*$/\1false/g" hackpad/etherpad/etc/etherpad.local.properties +fi +sed -i.bak "s/^\(etherpad\.fakeProduction = \).*$/\1true/g" hackpad/etherpad/etc/etherpad.local.properties +sed -i.bak "s/^\(logDir = \).*$/\1.\/data\/logs/g" hackpad/etherpad/etc/etherpad.local.properties +echo 'verbose = true' >> hackpad/etherpad/etc/etherpad.local.properties + +exec hackpad/bin/run.sh +# while true; do echo "I'm alive..."; sleep 1; done