mmmWiki setup mongodb

Setting up mmmWiki

DISCLAIMER: The software is offered as is.

If you find any bugs, check with known bugs, or otherwise report them.

Requirements:

To run the software locally / digitalocean.com

Risk of getting stuck
/ making an error
Action
Medium Install Node.js (Google it (Personally I use the "Installing Node.js via binary archive on Linux"-insturctions from nodejs.org))
Medium Install Mongodb.
Medium Install Redis (they have pretty good "quick start"-instructions (ref))
Small Download the files: git (use the mongodb branch)
Medium In the extracted folder: Run npm install. (This will download the required packages ).
Medium Create a file config.js (for example by copying and editing config.example.js). Read the comments (follow the instructions) of the file. config.example.js
Info only run node script.js -h to see available commands.
Small Create a site.csv-file in a directory "mmmWikiBackUp" parallel to the "mmmWiki" folder. Like this:

(directory_containing_mmmWiki_folder)/mmmWiki/script.js
(directory_containing_mmmWiki_folder)/mmmWikiBackUp/site.csv

site.csv should look something like this (replace with your own values):

"boDefault","boTLS","srcIcon16","strLangSite","googleAnalyticsTrackingID","aWPassword","aRPassword","name","www"
false,true,"Site/Icon/iconRed16.png","en","UA-34811619-2","","","gav","192.168.0.7:5000"
true,true,"Site/Icon/iconRed16.png","en","UA-34811619-3","","","emag","localhost:5000"
One and only one row should have boDefault=true.

The "aWPassword" and "aRPassword"-variables aren't used so those can be left empty. (There are "aWPassword" and "aRPassword"-variables in the config.js-file however.)

Small execute node script.js --load site.csv

(This will load the site.csv-file created above.)

(If you want to revert this, run node script.js --mongodb drop (node script.js -h for more commands))

Info only node script.js --mongodb countRows to verify that the created tables and how many rows there are.
Small Start the app (By executing node script.js for example)

In production you might want the app to start automatically after reboot and after crash. To do this I personally use pm2.

Starting with a backup

Follow the instructions above.

Instead of executing "node script.js --load site.csv", execute:

node script.js --load (this will load all the files that constitute the backup: site.csv, page.zip, image.zip, page.csv, image.csv, redirect.csv)

TLS (SSL (https))

This is a story of its own.

I'm currently using nginx as a reverse proxy which is able to handle TLS.

I'm using letsencrypt as certificate authority.

See also