You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-24Lines changed: 22 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
HackMD
2
2
===
3
3
4
-
[](https://gitter.im/hackmdio/hackmd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
+
[![Join the chat at https://gitter.im/hackmdio/hackmd][gitter-image]][gitter-url]
5
+
[![build status][travis-image]][travis-url]
6
+
5
7
6
8
HackMD lets you create realtime collaborative markdown notes on all platforms.
7
9
Inspired by Hackpad, with more focus on speed and flexibility.
@@ -48,9 +50,9 @@ Browsers Requirement
48
50
Prerequisite
49
51
---
50
52
51
-
- Node.js 4.x or up (test up to 6.7.0)
53
+
- Node.js 6.x or up (test up to 7.5.0)
52
54
- Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset `utf8`
53
-
- npm
55
+
- npm (and its dependencies, especially [uWebSockets](https://github.com/uWebSockets/uWebSockets#nodejs-developers), [node-gyp](https://github.com/nodejs/node-gyp#installation))
54
56
55
57
Get started
56
58
---
@@ -59,7 +61,7 @@ Get started
59
61
2. Enter the directory and type `bin/setup`, which will install npm dependencies and create configs. The setup script is written in Bash, you would need bash as a prerequisite.
60
62
3. Setup the configs, see more below
61
63
4. Setup environment variables which will overwrite the configs
62
-
5. Build front-end bundle by `npm run build:prod` (use `npm run build:dev` if you are in development)
64
+
5. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
63
65
6. Run the server as you like (node, forever, pm2)
64
66
65
67
Upgrade guide
@@ -70,7 +72,7 @@ If you are upgrading HackMD from an older version, follow these steps:
70
72
1. Fully stop your old server first (important)
71
73
2.`git pull` or do whatever that updates the files
72
74
3.`npm install` to update dependencies
73
-
4. Build front-end bundle by `npm run build:prod` (use `npm run build:dev` if you are in development)
75
+
4. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
74
76
5. Modify the file named `.sequelizerc`, change the value of the variable `url` with your db connection string
75
77
For example: `postgres://username:password@localhost:5432/hackmd`
76
78
6. Run `node_modules/.bin/sequelize db:migrate`, this step will migrate your db to the latest schema
@@ -97,19 +99,9 @@ Configuration files
97
99
There are some configs you need to change in the files below
98
100
99
101
```
100
-
./config.json --- for server settings
101
-
./public/js/config.js --- for client settings
102
+
./config.json ----application settings
102
103
```
103
104
104
-
Client settings `config.js`
105
-
---
106
-
107
-
| variables | example values | description |
108
-
| --------- | ------ | ----------- |
109
-
| debug |`true` or `false`| set debug mode, show more logs |
110
-
| domain |`localhost`| domain name |
111
-
| urlpath |`hackmd`| sub url path, like: `www.example.com/<urlpath>`|
112
-
113
105
Environment variables (will overwrite other server configs)
114
106
---
115
107
@@ -126,6 +118,7 @@ Environment variables (will overwrite other server configs)
126
118
| HMD_USECDN |`true` or `false`| set to use CDN resources or not (default is `true`) |
127
119
| HMD_ALLOW_ANONYMOUS |`true` or `false`| set to allow anonymous usage (default is `true`) |
128
120
| HMD_ALLOW_FREEURL |`true` or `false`| set to allow new note by accessing not exist note url |
121
+
| HMD_DEFAULT_PERMISSION |`freely`, `editable`, `limited`, `locked` or `private`| set notes default permission (only applied on signed users) |
129
122
| HMD_DB_URL |`mysql://localhost:3306/database`| set the db url |
130
123
| HMD_FACEBOOK_CLIENTID | no example | Facebook API client id |
131
124
| HMD_FACEBOOK_CLIENTSECRET | no example | Facebook API client secret |
@@ -140,15 +133,15 @@ Environment variables (will overwrite other server configs)
140
133
| HMD_DROPBOX_CLIENTSECRET | no example | Dropbox API client secret |
141
134
| HMD_GOOGLE_CLIENTID | no example | Google API client id |
142
135
| HMD_GOOGLE_CLIENTSECRET | no example | Google API client secret |
143
-
| HMD_LDAP_URL | ldap://example.com | url of LDAP server |
136
+
| HMD_LDAP_URL |`ldap://example.com`| url of LDAP server |
144
137
| HMD_LDAP_BINDDN | no example | bindDn for LDAP access |
145
138
| HMD_LDAP_BINDCREDENTIALS | no example | bindCredentials for LDAP access |
146
-
| HMD_LDAP_TOKENSECRET | supersecretkey | secret used for generating access/refresh tokens |
147
-
| HMD_LDAP_SEARCHBASE | o=users,dc=example,dc=com | LDAP directory to begin search from |
148
-
| HMD_LDAP_SEARCHFILTER | (uid={{username}}) | LDAP filter to search with |
139
+
| HMD_LDAP_TOKENSECRET |`supersecretkey`| secret used for generating access/refresh tokens |
140
+
| HMD_LDAP_SEARCHBASE |`o=users,dc=example,dc=com`| LDAP directory to begin search from |
141
+
| HMD_LDAP_SEARCHFILTER |`(uid={{username}})`| LDAP filter to search with |
149
142
| HMD_LDAP_SEARCHATTRIBUTES | no example | LDAP attributes to search with |
150
-
| HMD_LDAP_TLS_CA |no example| Root CA for LDAP TLS in PEM format |
151
-
| HMD_LDAP_PROVIDERNAME | My institution | Optional name to be displayed at login form indicating the LDAP provider |
143
+
| HMD_LDAP_TLS_CA |`server-cert.pem, root.pem`| Root CA for LDAP TLS in PEM format (use comma to separate)|
144
+
| HMD_LDAP_PROVIDERNAME |`My institution`| Optional name to be displayed at login form indicating the LDAP provider |
152
145
| HMD_IMGUR_CLIENTID | no example | Imgur API client id |
153
146
| HMD_EMAIL |`true` or `false`| set to allow email signin |
154
147
| HMD_ALLOW_EMAIL_REGISTER |`true` or `false`| set to allow email register (only applied when email is set, default is `true`) |
@@ -158,7 +151,7 @@ Environment variables (will overwrite other server configs)
158
151
| HMD_S3_REGION |`ap-northeast-1`| AWS S3 region |
159
152
| HMD_S3_BUCKET | no example | AWS S3 bucket name |
160
153
161
-
Server settings `config.json`
154
+
Application settings `config.json`
162
155
---
163
156
164
157
| variables | example values | description |
@@ -174,6 +167,7 @@ Server settings `config.json`
174
167
| usecdn |`true` or `false`| set to use CDN resources or not (default is `true`) |
175
168
| allowanonymous |`true` or `false`| set to allow anonymous usage (default is `true`) |
176
169
| allowfreeurl |`true` or `false`| set to allow new note by accessing not exist note url |
170
+
| defaultpermission |`freely`, `editable`, `limited`, `locked` or `private`| set notes default permission (only applied on signed users) |
177
171
| dburl |`mysql://localhost:3306/database`| set the db url, if set this variable then below db config won't be applied |
178
172
| db |`{ "dialect": "sqlite", "storage": "./db.hackmd.sqlite" }`| set the db configs, [see more here](http://sequelize.readthedocs.org/en/latest/api/sequelize/)|
179
173
| sslkeypath |`./cert/client.key`| ssl key path (only need when you set usessl) |
@@ -207,7 +201,7 @@ Third-party integration api key settings
207
201
| ------- | --------- | ----------- |
208
202
| facebook, twitter, github, gitlab, dropbox, google, ldap | environment variables or `config.json`| for signin |
209
203
| imgur | environment variables or `config.json`| for image upload |
210
-
| google drive, dropbox |`public/js/config.js`| for export and import |
204
+
| google drive(`google/apiKey`, `google/clientID`), dropbox(`dropbox/appKey`)|`config.json`| for export and import |
211
205
212
206
Third-party integration oauth callback urls
213
207
---
@@ -230,3 +224,7 @@ Additionally, now can show other clients' selections.
230
224
See more at [http://operational-transformation.github.io/](http://operational-transformation.github.io/)
0 commit comments