2015-07-11 00:52:04 -04:00
|
|
|
HackMD 0.3.2
|
2015-05-04 03:53:29 -04:00
|
|
|
===
|
|
|
|
|
2015-07-01 12:15:34 -04:00
|
|
|
HackMD is a realtime collaborative markdown notes on all platforms.
|
|
|
|
Inspired by Hackpad, but more focusing on speed and flexibility.
|
2015-07-01 12:10:20 -04:00
|
|
|
Still in early stage, feel free to fork or contribute to this.
|
2015-05-04 03:53:29 -04:00
|
|
|
|
2015-06-01 06:04:25 -04:00
|
|
|
Thanks for your using! :smile:
|
2015-05-15 00:58:13 -04:00
|
|
|
|
2015-07-11 00:52:04 -04:00
|
|
|
Operational Transformation
|
|
|
|
---
|
2015-07-11 00:54:22 -04:00
|
|
|
From 0.3.2, we start support operational transformation.
|
|
|
|
Which make concurrent editing safe and not break up other users' operations.
|
|
|
|
Even more, now can show other clients' selections.
|
|
|
|
See more at http://operational-transformation.github.io/
|
2015-07-11 00:52:04 -04:00
|
|
|
|
2015-07-01 12:10:20 -04:00
|
|
|
Database dependency
|
2015-06-01 06:04:25 -04:00
|
|
|
---
|
|
|
|
- PostgreSQL 9.3.6 or 9.4.1
|
|
|
|
- MongoDB 3.0.2
|
|
|
|
|
2015-07-01 12:10:20 -04:00
|
|
|
Import database schema
|
2015-06-01 06:04:25 -04:00
|
|
|
---
|
2015-07-01 12:15:34 -04:00
|
|
|
The notes are store in PostgreSQL, the schema is in the `hackmd_schema.sql`
|
2015-06-01 06:04:25 -04:00
|
|
|
To import the sql file in PostgreSQL, type `psql -i hackmd_schema.sql`
|
|
|
|
|
2015-07-01 12:10:20 -04:00
|
|
|
The users, temps and sessions are store in MongoDB, which don't need schema, so just make sure you have the correct connection string.
|
2015-06-01 06:04:25 -04:00
|
|
|
|
2015-07-01 12:10:20 -04:00
|
|
|
Structure
|
|
|
|
---
|
|
|
|
```
|
|
|
|
hackmd/
|
|
|
|
├── logs/ --- server logs
|
|
|
|
├── backups/ --- db backups
|
|
|
|
├── tmp/ --- temporary files
|
|
|
|
├── lib/ --- server libraries
|
|
|
|
└── public/ --- client files
|
|
|
|
├── css/ --- css styles
|
|
|
|
├── js/ --- js scripts
|
|
|
|
├── vendor/ --- vendor includes
|
|
|
|
└── views/ --- view templates
|
|
|
|
```
|
|
|
|
|
|
|
|
Configure
|
2015-06-01 06:04:25 -04:00
|
|
|
---
|
2015-05-15 00:58:13 -04:00
|
|
|
There are some config you need to change in below files
|
|
|
|
```
|
2015-07-01 12:10:20 -04:00
|
|
|
./Procfile --- for heroku start
|
|
|
|
./run.sh --- for forever start
|
|
|
|
./processes.json --- for pm2 start
|
|
|
|
./config.js --- for server settings
|
|
|
|
./public/js/common.js --- for client settings
|
|
|
|
./hackmd --- for logrotate
|
2015-05-15 00:58:13 -04:00
|
|
|
```
|
|
|
|
|
2015-07-01 12:10:20 -04:00
|
|
|
**From 0.3.1, we no longer recommend using `forever` to run your server.**
|
2015-05-15 00:58:13 -04:00
|
|
|
|
2015-07-01 12:15:34 -04:00
|
|
|
We using `pm2` to run server.
|
2015-07-01 12:10:20 -04:00
|
|
|
See [here](https://github.com/Unitech/pm2) for details.
|
2015-05-04 03:53:29 -04:00
|
|
|
|
2015-06-01 06:04:25 -04:00
|
|
|
You can use SSL to encrypt your site by passing certificate path in the `config.js` and set `usessl=true`
|
|
|
|
|
|
|
|
Run a server
|
|
|
|
---
|
2015-07-01 12:10:20 -04:00
|
|
|
- forever: `bash run.sh`
|
|
|
|
- pm2: `pm2 start processes.json`
|
2015-06-01 06:04:25 -04:00
|
|
|
|
|
|
|
Stop a server
|
|
|
|
---
|
2015-07-01 12:10:20 -04:00
|
|
|
- forever: `forever stop hackmd`
|
|
|
|
- pm2: `pm2 stop hackmd`
|
2015-06-01 06:04:25 -04:00
|
|
|
|
|
|
|
Backup db
|
|
|
|
---
|
2015-07-01 12:10:20 -04:00
|
|
|
To backup the db, type `bash backup.sh`
|
2015-05-07 23:52:30 -04:00
|
|
|
|
2015-07-01 12:15:34 -04:00
|
|
|
**License under MIT.**
|