Skip to content

Commit

Permalink
Merge new release into master branch!
Browse files Browse the repository at this point in the history
  • Loading branch information
Gared authored Dec 23, 2016
2 parents d6da6b3 + 6dc808a commit 8992dd6
Show file tree
Hide file tree
Showing 81 changed files with 1,854 additions and 749 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Also, check out the **[FAQ](https://github.com/ether/etherpad-lite/wiki/FAQ)**,

# Installation

Etherpad works with node v0.10+ and io.js.
Etherpad works with node v0.10+ (except 6.0 and 6.1).

## Windows

Expand Down
2 changes: 1 addition & 1 deletion bin/buildForWindows.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

NODE_VERSION="4.4.3"
NODE_VERSION="6.9.2"

#Move to the folder where ep-lite is installed
cd `dirname $0`
Expand Down
176 changes: 176 additions & 0 deletions bin/createRelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#!/bin/bash
#
# This script is used to publish a new release/version of etherpad on github
#
# Work that is done by this script:
# ETHER_REPO:
# - Add text to CHANGELOG.md
# - Replace version of etherpad in src/package.json
# - Create a release branch and push it to github
# - Merges this release branch into master branch
# - Creating the windows build and the docs
# ETHER_WEB_REPO:
# - Creating a new branch with the docs and the windows build
# - Replacing the version numbers in the index.html
# - Push this branch and merge it to master
# ETHER_REPO:
# - Create a new release on github

ETHER_REPO="https://github.com/ether/etherpad-lite.git"
ETHER_WEB_REPO="https://github.com/ether/ether.github.com.git"
TMP_DIR="/tmp/"

echo "WARNING: You can only run this script if your github api token is allowed to create and merge branches on $ETHER_REPO and $ETHER_WEB_REPO."
echo "This script automatically changes the version number in package.json and adds a text to CHANGELOG.md."
echo "When you use this script you should be in the branch that you want to release (develop probably) on latest version. Any changes that are currently not commited will be commited."
echo "-----"

# get the latest version
LATEST_GIT_TAG=$(git tag | tail -n 1)

# current environment
echo "Current environment: "
echo "- branch: $(git branch | grep '* ')"
echo "- last commit date: $(git show --quiet --pretty=format:%ad)"
echo "- current version: $LATEST_GIT_TAG"
echo "- temp dir: $TMP_DIR"

# get new version number
# format: x.x.x
echo -n "Enter new version (x.x.x): "
read VERSION

# get the message for the changelogs
read -p "Enter new changelog entries (press enter): "
tmp=$(mktemp)
"${EDITOR:-vi}" $tmp
changelogText=$(<$tmp)
echo "$changelogText"
rm $tmp

if [ "$changelogText" != "" ]; then
changelogText="# $VERSION\n$changelogText"
fi

# get the token for the github api
echo -n "Enter your github api token: "
read API_TOKEN

function check_api_token {
echo "Checking if github api token is valid..."
CURL_RESPONSE=$(curl --silent -i https://api.github.com/user?access_token=$API_TOKEN | iconv -f utf8)
HTTP_STATUS=$(echo $CURL_RESPONSE | head -1 | sed -r 's/.* ([0-9]{3}) .*/\1/')
[[ $HTTP_STATUS != "200" ]] && echo "Aborting: Invalid github api token" && exit 1
}

function modify_files {
# Add changelog text to first line of CHANGELOG.md
sed -i "1s/^/${changelogText}\n/" CHANGELOG.md
# Replace version number of etherpad in package.json
sed -i -r "s/(\"version\"[ ]*: \").*(\")/\1$VERSION\2/" src/package.json
}

function create_release_branch {
echo "Creating new release branch..."
git rev-parse --verify release/$VERSION 2>/dev/null
if [ $? == 0 ]; then
echo "Aborting: Release branch already present"
exit 1
fi
git checkout -b release/$VERSION
[[ $? != 0 ]] && echo "Aborting: Error creating relase branch" && exit 1

echo "Commiting CHANGELOG.md and package.json"
git add CHANGELOG.md
git add src/package.json
git commit -m "Release version $VERSION"

echo "Pushing release branch to github..."
git push -u $ETHER_REPO release/$VERSION
[[ $? != 0 ]] && echo "Aborting: Error pushing release branch to github" && exit 1
}

function merge_release_branch {
echo "Merging release to master branch on github..."
API_JSON=$(printf '{"base": "master","head": "release/%s","commit_message": "Merge new release into master branch!"}' $VERSION)
CURL_RESPONSE=$(curl --silent -i -N --data "$API_JSON" https://api.github.com/repos/ether/etherpad-lite/merges?access_token=$API_TOKEN | iconv -f utf8)
echo $CURL_RESPONSE
HTTP_STATUS=$(echo $CURL_RESPONSE | head -1 | sed -r 's/.* ([0-9]{3}) .*/\1/')
[[ $HTTP_STATUS != "200" ]] && echo "Aborting: Error merging release branch on github" && exit 1
}

function create_builds {
echo "Cloning etherpad-lite repo and ether.github.com repo..."
cd $TMP_DIR
rm -rf etherpad-lite ether.github.com
git clone $ETHER_REPO --branch master
git clone $ETHER_WEB_REPO
echo "Creating windows build..."
cd etherpad-lite
bin/buildForWindows.sh
[[ $? != 0 ]] && echo "Aborting: Error creating build for windows" && exit 1
echo "Creating docs..."
make docs
[[ $? != 0 ]] && echo "Aborting: Error generating docs" && exit 1
}

function push_builds {
cd $TMP_DIR/etherpad-lite/
echo "Copying windows build and docs to website repo..."
GIT_SHA=$(git rev-parse HEAD | cut -c1-10)
mv etherpad-lite-win.zip $TMP_DIR/ether.github.com/downloads/etherpad-lite-win-$VERSION-$GIT_SHA.zip

mv out/doc $TMP_DIR/ether.github.com/doc/v$VERSION

cd $TMP_DIR/ether.github.com/
sed -i "s/etherpad-lite-win.*\.zip/etherpad-lite-win-$VERSION-$GIT_SHA.zip/" index.html
sed -i "s/$LATEST_GIT_TAG/$VERSION/g" index.html
git checkout -b release_$VERSION
[[ $? != 0 ]] && echo "Aborting: Error creating new release branch" && exit 1
git add doc/
git add downloads/
git commit -a -m "Release version $VERSION"
git push -u $ETHER_WEB_REPO release_$VERSION
[[ $? != 0 ]] && echo "Aborting: Error pushing release branch to github" && exit 1
}

function merge_web_branch {
echo "Merging release to master branch on github..."
API_JSON=$(printf '{"base": "master","head": "release_%s","commit_message": "Release version %s"}' $VERSION $VERSION)
CURL_RESPONSE=$(curl --silent -i -N --data "$API_JSON" https://api.github.com/repos/ether/ether.github.com/merges?access_token=$API_TOKEN | iconv -f utf8)
echo $CURL_RESPONSE
HTTP_STATUS=$(echo $CURL_RESPONSE | head -1 | sed -r 's/.* ([0-9]{3}) .*/\1/')
[[ $HTTP_STATUS != "200" ]] && echo "Aborting: Error merging release branch" && exit 1
}

function publish_release {
echo -n "Do you want to publish a new release on github (y/n)? "
read PUBLISH_RELEASE
if [ $PUBLISH_RELEASE = "y" ]; then
# create a new release on github
API_JSON=$(printf '{"tag_name": "%s","target_commitish": "master","name": "Release %s","body": "%s","draft": false,"prerelease": false}' $VERSION $VERSION $changelogText)
CURL_RESPONSE=$(curl --silent -i -N --data "$API_JSON" https://api.github.com/repos/ether/etherpad-lite/releases?access_token=$API_TOKEN | iconv -f utf8)
HTTP_STATUS=$(echo $CURL_RESPONSE | head -1 | sed -r 's/.* ([0-9]{3}) .*/\1/')
[[ $HTTP_STATUS != "201" ]] && echo "Aborting: Error publishing release on github" && exit 1
else
echo "No release published on github!"
fi
}

function todo_notification {
echo "Release procedure was successful, but you have to do some steps manually:"
echo "- Update the wiki at https://github.com/ether/etherpad-lite/wiki"
echo "- Create a pull request on github to merge the master branch back to develop"
echo "- Announce the new release on the mailing list, blog.etherpad.org and Twitter"
}

# call functions
check_api_token
modify_files
create_release_branch
merge_release_branch
create_builds
push_builds
merge_web_branch
publish_release
todo_notification
4 changes: 2 additions & 2 deletions bin/migrateDirtyDBtoRealDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
// file before using this script, just to be safe.

var settings = require("ep_etherpad-lite/node/utils/Settings");
var dirty = require("dirty")('var/dirty.db');
var ueberDB = require("../src/node_modules/ueberDB");
var dirty = require("../src/node_modules/dirty")('var/dirty.db');
var ueberDB = require("../src/node_modules/ueberdb2");
var log4js = require("../src/node_modules/log4js");
var dbWrapperSettings = {
"cache": "0", // The cache slows things down when you're mostly writing.
Expand Down
2 changes: 1 addition & 1 deletion bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ bin/installDeps.sh $* || exit 1
echo "Started Etherpad..."

SCRIPTPATH=`pwd -P`
exec node $SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js $*
exec node "$SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js" $*

2 changes: 1 addition & 1 deletion doc/api/editbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Shows the dropdown `div.popup` whose `id` equals `dropdown`.
Register a handler for a specific command. Commands are fired if the corresponding button is clicked or the corresponding select is changed.

## registerAceCommand(cmd, callback)
Creates an ace callstack and calls the callback with an ace instance: `callback(cmd, ace)`.
Creates an ace callstack and calls the callback with an ace instance (and a toolbar item, if applicable): `callback(cmd, ace, item)`.

Example:
```
Expand Down
18 changes: 16 additions & 2 deletions doc/api/hooks_client-side.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ Things in context:

This hook is made available to edit the edit events that might occur when changes are made. Currently you can change the editor information, some of the meanings of the edit, and so on. You can also make internal changes (internal to your plugin) that use the information provided by the edit event.

## aceRegisterNonScrollableEditEvents
Called from: src/static/js/ace2_inner.js

Things in context: None

When aceEditEvent (documented above) finishes processing the event, it scrolls the viewport to make caret visible to the user, but if you don't want that behavior to happen you can use this hook to register which edit events should not scroll viewport. The return value of this hook should be a list of event names.

Example:
```
exports.aceRegisterNonScrollableEditEvents = function(){
return [ 'repaginate', 'updatePageCount' ];
}
```

## aceRegisterBlockElements
Called from: src/static/js/ace2_inner.js

Expand Down Expand Up @@ -166,11 +180,11 @@ Called from: src/static/js/pad_editbar.js
Things in context:

1. ace - the ace object that is applied to this editor.
2. toolbar - Editbar instance. See below for the Editbar documentation.
2. toolbar - Editbar instance. See below for the Editbar documentation.

Can be used to register custom actions to the toolbar.

Usage examples:
Usage examples:

* [https://github.com/tiblu/ep_authorship_toggle]()

Expand Down
9 changes: 9 additions & 0 deletions doc/api/http_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,15 @@ returns an object of diffs from 2 points in a pad
* `{"code":0,"message":"ok","data":{"html":"<style>\n.authora_HKIv23mEbachFYfH {background-color: #a979d9}\n.authora_n4gEeMLsv1GivNeh {background-color: #a9b5d9}\n.removed {text-decoration: line-through; -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=80)'; filter: alpha(opacity=80); opacity: 0.8; }\n</style>Welcome to Etherpad!<br><br>This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!<br><br>Get involved with Etherpad at <a href=\"http&#x3a;&#x2F;&#x2F;etherpad&#x2e;org\">http:&#x2F;&#x2F;etherpad.org</a><br><span class=\"authora_HKIv23mEbachFYfH\">aw</span><br><br>","authors":["a.HKIv23mEbachFYfH",""]}}`
* `{"code":4,"message":"no or wrong API Key","data":null}`

#### restoreRevision(padId, rev)
* API >= 1.2.11

Restores revision from past as new changeset

*Example returns:*
* {code:0, message:"ok", data:null}
* {code: 1, message:"padID does not exist", data: null}

### Chat
#### getChatHistory(padID, [start, end])
* API >= 1.2.7
Expand Down
9 changes: 6 additions & 3 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Please edit settings.json, not settings.json.template

To still commit settings without credentials you can
To still commit settings without credentials you can
store any credential settings in credentials.json
*/
{
Expand All @@ -18,6 +18,9 @@
"ip": "0.0.0.0",
"port" : 9001,

// Option to hide/show the settings.json in admin page, default option is set to true
"showSettingsInAdminPage" : true,

/*
// Node native SSL support
// this is disabled by default
Expand Down Expand Up @@ -192,9 +195,9 @@
, "level": "error" // filters out all log messages that have a lower level than "error"
, "appender":
{ "type": "smtp"
, "subject": "An error occured in your EPL instance!"
, "subject": "An error occurred in your EPL instance!"
, "recipients": "[email protected], [email protected]"
, "sendInterval": 60*5 // in secs -- will buffer log messages; set to 0 to send a mail for every message
, "sendInterval": 300 // 60 * 5 = 5 minutes -- will buffer log messages; set to 0 to send a mail for every message
, "transport": "SMTP", "SMTP": { // see https://github.com/andris9/Nodemailer#possible-transport-methods
"host": "smtp.example.com", "port": 465,
"secureConnection": true,
Expand Down
23 changes: 12 additions & 11 deletions src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"Meno25",
"Test Create account",
"محمد أحمد عبد الفتاح",
"Haytham morsy"
"Haytham morsy",
"ديفيد"
]
},
"index.newPad": "باد جديد",
"index.createOpenPad": "أو صنع/فتح باد بوضع إسمه:",
"index.createOpenPad": "أو صنع/فتح باد بوضع اسمه:",
"pad.toolbar.bold.title": "سميك (Ctrl-B)",
"pad.toolbar.italic.title": "مائل (Ctrl-I)",
"pad.toolbar.underline.title": "تسطير (Ctrl-U)",
Expand All @@ -31,7 +32,7 @@
"pad.toolbar.showusers.title": "عرض المستخدمين على هذا الباد",
"pad.colorpicker.save": "تسجيل",
"pad.colorpicker.cancel": "إلغاء",
"pad.loading": "جاري التحميل...",
"pad.loading": "جارٍ التحميل...",
"pad.noCookie": "الكوكيز غير متاحة. الرجاء السماح بتحميل الكوكيز على متصفحك!",
"pad.passwordRequired": "تحتاج إلى كلمة مرور للوصول إلى هذا الباد",
"pad.permissionDenied": "ليس لديك إذن لدخول هذا الباد",
Expand Down Expand Up @@ -64,24 +65,24 @@
"pad.modals.forcereconnect": "فرض إعادة الاتصال",
"pad.modals.userdup": "مفتوح في نافذة أخرى",
"pad.modals.userdup.explanation": "يبدو أن هذا الباد تم فتحه في أكثر من نافذة متصفح في هذا الحاسوب.",
"pad.modals.userdup.advice": "إعادة الاتصال لإستعمال هذه النافذة بدلاً من الاخرى.",
"pad.modals.userdup.advice": "إعادة الاتصال لاستعمال هذه النافذة بدلاً من الأخرى.",
"pad.modals.unauth": "غير مخول",
"pad.modals.unauth.explanation": "لقد تغيرت الأذونات الخاصة بك أثناء عرض هذه الصفحة. حاول إعادة الاتصال.",
"pad.modals.unauth.explanation": "لقد تغيرت الأذونات الخاصة بك أثناء عرض هذه الصفحة. أعد محاولة الاتصال.",
"pad.modals.looping.explanation": "هناك مشاكل في الاتصال مع ملقم التزامن.",
"pad.modals.looping.cause": "ربما كنت متصلاً من خلال وكيل أو جدار حماية غير متوافق.",
"pad.modals.initsocketfail": "لا يمكن الوصول إلى الخادم",
"pad.modals.initsocketfail.explanation": "تعذر الاتصال بخادم المزامنة.",
"pad.modals.initsocketfail.cause": "وهذا على الأرجح بسبب مشكلة في المستعرض الخاص بك أو الاتصال بإنترنت.",
"pad.modals.initsocketfail.cause": "هذا على الأرجح بسبب مشكلة في المستعرض الخاص بك أو الاتصال بإنترنت.",
"pad.modals.slowcommit.explanation": "الخادم لا يستجيب.",
"pad.modals.slowcommit.cause": "يمكن أن يكون هذا بسبب مشاكل في الاتصال بالشبكة.",
"pad.modals.badChangeset.explanation": "لقد صنفت إحدى عمليات التحرير التي قمت بها كعملية غير مسموح بها من قبل ملقم التزامن.",
"pad.modals.badChangeset.explanation": "لقد صُنفَت إحدى عمليات التحرير التي قمت بها كعملية غير مسموح بها من قبل ملقم التزامن.",
"pad.modals.badChangeset.cause": "يمكن أن يكون هذا بسبب تكوين ملقم خاطئ أو بسبب سلوك آخر غير متوقع. يرجى الاتصال بمسؤول الخدمة إذا كنت تعتقد بأن هناك خطأ ما. حاول إعادة الاتصال لمتابعة التحرير.",
"pad.modals.corruptPad.explanation": "الباد الذي تحاول الوصول إليه تالف.",
"pad.modals.corruptPad.cause": "قد يكون هذا بسبب تكوين ملقم خاطئ أو بسبب سلوك آخر غير متوقع. يرجى الاتصال بمسؤول الخدمة.",
"pad.modals.deleted": "محذوف.",
"pad.modals.deleted.explanation": "تمت إزالة هذا الباد",
"pad.modals.disconnected": "لم تعد متّصل.",
"pad.modals.disconnected.explanation": "تم فقدان الإتصال بالخادم",
"pad.modals.disconnected": "لم تعد متصلا.",
"pad.modals.disconnected.explanation": "تم فقدان الاتصال بالخادم",
"pad.modals.disconnected.cause": "قد يكون الخادم غير متوفر. يرجى إعلام مسؤول الخدمة إذا كان هذا لا يزال يحدث.",
"pad.share": "شارك هذه الباد",
"pad.share.readonly": "للقراءة فقط",
Expand All @@ -98,7 +99,7 @@
"timeslider.exportCurrent": "تصدير النسخة الحالية ك:",
"timeslider.version": "إصدار {{version}}",
"timeslider.saved": "محفوظ {{month}} {{day}}, {{year}}",
"timeslider.playPause": "تشغيل / إيقاف مؤقت محتويات الباد",
"timeslider.playPause": "تشغيل / إيقاف مؤقت لمحتويات الباد",
"timeslider.backRevision": "عد إلى مراجعة في هذه الباد",
"timeslider.forwardRevision": "انطلق إلى مراجعة في هذه الباد",
"timeslider.dateformat": "{{day}}/{{month}}/{{year}} {{hours}}:{{minutes}}:{{seconds}}",
Expand Down Expand Up @@ -127,7 +128,7 @@
"pad.impexp.importing": "الاستيراد...",
"pad.impexp.confirmimport": "استيراد ملف سيؤدي للكتابة فوق النص الحالي بالباد. هل أنت متأكد من أنك تريد المتابعة؟",
"pad.impexp.convertFailed": "لم نتمكن من استيراد هذا الملف. يرجى استخدام تنسيق مستند مختلف، أو النسخ واللصق يدوياً",
"pad.impexp.padHasData": "لا يمكننا استيراد هذا الملف لأن هذه اللوحة تم بالفعل تغييره, الرجاء استيراد لوحة جديد",
"pad.impexp.padHasData": "لا يمكننا استيراد هذا الملف لأن هذا الباد تم بالفعل تغييره; الرجاء استيراد باد جديد",
"pad.impexp.uploadFailed": "فشل التحميل، الرجاء المحاولة مرة أخرى",
"pad.impexp.importfailed": "فشل الاستيراد",
"pad.impexp.copypaste": "الرجاء نسخ/لصق",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
"timeslider.version": "Versiya {{version}}",
"timeslider.saved": "Saxlanıldı {{day}} {{month}}, {{year}}",
"timeslider.playPause": "Geri oxutma / Lövhə Məzmunlarını Dayandır",
"timeslider.backRevision": "Sənədin bundan əvvəlki bir versiyasına qayıtmaq",
"timeslider.forwardRevision": "Sənədin bundan sonrakı bir versiyasına qayıtmaq",
"timeslider.dateformat": "{{day}} {{month}}, {{year}} {{hours}}:{{minutes}}:{{seconds}}",
"timeslider.month.january": "Yanvar",
"timeslider.month.february": "Fevral",
Expand Down
Loading

0 comments on commit 8992dd6

Please sign in to comment.