In this recipe, we will install a collaborative document editor, Hackpad. It is a document editor based on an open source editor, EtherPad. Hackpad was acquired by Dropbox, and in early 2015 they open sourced its code.
You will need a system with at least 2 GB of memory.
As always, you will need an account with super user privileges.
Hackpad is a web application based on Java. We will need to install the JDK; Scala, which is another programming language; and MySQL as a data store. We will start by installing dependencies and then cloning the Hackpad repository from GitHub.
$ sudo apt-get update $ sudo apt-get install openjdk-7-jdk scala -y
$ sudo apt-get install mysql-server-5.6
$ git clone https://github.com/dropbox/hackpad.git
hackpad
. Before we run the build script, we need to set some configuration parameters to match our environment. Change the directory to hackpad
and edit the bin/exports.sh
file as follows:export SCALA_HOME="/usr/share/java" export SCALA_LIBRARY_JAR="$SCALA_HOME/scala-library.jar" export JAVA_HOME="/usr/share/java"
$ cp etherpad/etc/etherpad.localdev-default.properties etherpad/etc/etherpad.local.properties
etherpad/etc/etherpad.local.properties
:etherpad.superUserEmailAddresses = __email_addresses_with_admin_access__
Replace it with:
etherpad.superUserEmailAddresses = [email protected]
Optionally, you can set the project to production mode by setting isProduction
to true
:
devMode = false verbose = true etherpad.fakeProduction = false etherpad.isProduction = true
topdomains =yourdomain.tld,localhost
smtpServer = Your SMTP server smtpUser = SMTP user smtpPass = SMTP password
$ ./bin/build.sh
hackpad
and a MySQL user account. You will be asked to enter your MySQL root account password:$ ./contrib/scripts/setup-mysql-db.sh
run.sh
from the bin directory:$ ./bin/run.sh
This will take a few seconds to start the application. Once you see the HTTP server is listening to the line, you can access Hackpad at http://yourdomain.tld:9000
:
If you have not set up email server access to the MySQL database to get your authentication token, open the MySQL client and use the following queries to get your token. The MySQL password for the Hackpad account is taken from the configuration file:
$ mysql -h localhost -u hackpad -ppassword mysql> use hackpad; mysql> select * from email_signup;
PgEJoGAiL3E2ZDl2FqMc
:http://yourdomain.com:9000/ep/account/[email protected]&token=your_auth_token_from_db
The full auth URL for my admin account will look like this:
http://localhost.local:9000/ep/account/[email protected]&token= PgEJoGAiL3E2ZDl2FqMc
Once you log in to your new account, Hackpad will start with a welcome screen listing all the default pads that looks something like the following:
You can click any of them and start editing or create a new document. When opened, you will get a full page to add contents, with basic text editing options in the top bar:
The document can be shared using the invite box or simply by sharing the URL.
As mentioned before, Hackpad is a collaborative editor based on an open source project, EtherPad. It allows you to create online documents directly in your browser. In the same way as Google Docs, you can use Hackpad to create and store your documents in the cloud. Plus, you can access Hackpad from any device. All your documents will be rendered in a proper format suitable for your device.
When you log in for the first time, the home screen will greet you with stock pads. You can edit existing pads or start a new one from the top bar. An editor will give you a basic text editing setting, plus options to create lists and add comments. You can even add data in a tabular format. Click on the gear icon from the top bar and it will give you options to view document history, get an embedded link, or delete the document.
Every change in the document will be marked with your username, and if two or more people are working with the document at the same time, then the specific line being edited by each user is marked with the user's tag:
On the right-hand side of the document, you can see the options to invite your peers to collaborate on this document. You can invite people using their email address. Make sure that you have configured your email server before using this feature. Alternatively, the invites are also shown in a chat window with clickable links, as shown in the following screenshot:
At the bottom of the document, you can find all activity logs about the new initiation and the editing of this document. There is an option to chat with participating people directly from the same window. It is located at the bottom corner of the right-hand side; it's the small bar with a chat icon named after your domain. This provides one-to-one chat, as well as a group chat:
Hackpad is a collaborative document editor. You can add snippets of code in a given document but not entire code files. To edit your code, you can use an open source Cloud IDE named Cloud 9 IDE. Check out the GitHub repo at https://github.com/c9/core/. Alternatively, you can get Docker images set up quickly and play around with the IDE.
Read more about Hackpad at the following links: