summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.js3
-rw-r--r--docs/setup/manual-setup.md37
-rw-r--r--package.json2
3 files changed, 23 insertions, 19 deletions
diff --git a/app.js b/app.js
index 3de99e6c..ceb22596 100644
--- a/app.js
+++ b/app.js
@@ -289,6 +289,9 @@ function handleTermSignals () {
socket.disconnect(true)
}, 0)
})
+ if (config.path) {
+ fs.unlink(config.path)
+ }
var checkCleanTimer = setInterval(function () {
if (realtime.isReady()) {
models.Revision.checkAllNotesRevision(function (err, notes) {
diff --git a/docs/setup/manual-setup.md b/docs/setup/manual-setup.md
index 721d5bf7..82ed085c 100644
--- a/docs/setup/manual-setup.md
+++ b/docs/setup/manual-setup.md
@@ -6,34 +6,35 @@ Manual Installation
- Node.js 6.x or up (test up to 7.5.0) and <10.x
- Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset `utf8`
- npm (and its dependencies, [node-gyp](https://github.com/nodejs/node-gyp#installation))
+- yarn
- `libssl-dev` for building scrypt (see [here](https://github.com/ml1nk/node-scrypt/blob/master/README.md#installation-instructions) for further information)
+- Bash (for the setup script)
- For **building** CodiMD we recommend to use a machine with at least **2GB** RAM
## Instructions
-1. Download a release and unzip or clone into a directory
-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.
-3. Setup the configs, see more below
-4. Setup environment variables which will overwrite the configs
-5. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
-6. Modify the file named `.sequelizerc`, change the value of the variable `url` with your db connection string
+1. Check if you meet the [requirements at the top of this document](#requirements-on-your-server).
+2. Clone this repository (preferred) or download a release and unzip it.
+3. Enter the directory and type `bin/setup`, which will install npm dependencies and create configs.
+4. Setup the configs, see more below
+5. Setup environment variables which will overwrite the configs
+6. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
+7. Modify the file named `.sequelizerc`, change the value of the variable `url` with your db connection string
For example: `postgres://username:password@localhost:5432/codimd`
-7. Run `node_modules/.bin/sequelize db:migrate`, this step will migrate your db to the latest schema
-8. Run the server as you like (node, forever, pm2)
+8. It is recommended to start your server manually once: `npm start --production`, this way it's easier to see warnings or errors that might occur (leave out `--production` for development).
+9. Run the server as you like (node, forever, pm2, SystemD, Init-Scripts)
## How to upgrade your installation
-:warning: When you are still running from the old repository, please run: `git remote set-url origin https://github.com/codimd/server.git` :warning:
-
If you are upgrading CodiMD from an older version, follow these steps:
-1. Fully stop your old server first (important)
-2. `git pull` or do whatever that updates the files
-3. `npm install` to update dependencies
-4. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
-5. Modify the file named `.sequelizerc`, change the value of the variable `url` with your db connection string
- For example: `postgres://username:password@localhost:5432/codimd`
-6. Run `node_modules/.bin/sequelize db:migrate`, this step will migrate your db to the latest schema
-7. Start your whole new server!
+1. Check if you meet the [requirements at the top of this document](#requirements-on-your-server).
+2. Verify which version you were running before and take a look at [migrations and breaking changes](../guides/migrations-and-breaking-changes.md) to see if additional steps, or configuration changes are necessary!
+3. Fully stop your old CodiMD server.
+4. `git pull` or unzip a new release in the directory.
+5. Run `bin/setup`. This will take care of installing dependencies. It is safe to run on an existing installation.
+6. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development).
+7. It is recommended to start your server manually once: `npm start --production`, this way it's easier to see warnings or errors that might occur (leave out `--production` for development).
+8. You can now restart the CodiMD server!
diff --git a/package.json b/package.json
index 4d52d47b..48bf1eff 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"formidable": "^1.0.17",
"gist-embed": "~2.6.0",
"graceful-fs": "^4.1.11",
- "handlebars": "^4.0.13",
+ "handlebars": "^4.1.2",
"helmet": "^3.13.0",
"highlight.js": "~9.12.0",
"i18n": "^0.8.3",