There is console client available which allows you to automate some routine Heretic tasks such as creating or removing new pages.
To use CLI, please run the following command:
npm run cli --
Parameters available:
Option | Description |
---|---|
--addModule <id> [--navigation] | Create a new page (optionally add to navbar) |
--removeModule <id> | Delete existing page |
--addLanguage <id:name> | Add new language (example: de-de:Deutsch) |
--removeLanguage <id> | Delete existing language |
--importGeoData | Import geo database (requires MongoDB to be enabled) |
--createAdmin | Create admin user with access to admin panel (requires MongoDB to be enabled) |
--resetPassword <username> | Create user or reset existing user's password to "password" |
Add a new page with ID test, route /test and include it into the navbar:
npm run cli -- --addModule test --navigation
Remove a page with ID test (also removes the corresponding entries in the navbar):
npm run cli -- --removeModule test
Add a new language (with ISO code de-de and name Deutsch):
npm run cli -- --addLanguage de-de:Deutsch
Remove an existing language de-de:
npm run cli -- --removeLanguage de-de
In order to create full backup of your website, please run the following command:
npm run backup
By default, backup archive is saved to backup folder, example: backup/heretic_YYYYMMDD_HHMMDD.zip. You may change this behavior by using options:
npm run backup -- --dir "myBackupDir" --filename "sample.zip"
The directory is relative to Heretic root.
Heretic backup file is a regular ZIP archive which contains the following directories:
Option | Description |
---|---|
dist | Copy of dist directory |
dump | Database dump created by mongodump utility |
etc | All configuration files from etc directory |
root | Copy of root directory |
src | Copy of src directory |
site | Copy of site directory |
In order to restore backup archive, please run the following command:
npm run restore -- --path "path/to/your/backup.zip"
The directory is relative to Heretic root. Your current site will be saved to save_YYYYMMDD_HHMMSS directory, including current database dump. If you don't wish to save current website, you may wish to specify --no-save option:
npm run restore -- --path "path/to/your/backup.zip" --no-save
What happens if you restore your backup archive using this utility:
You may wish to use an user-friendly interactive version of console client if you don't want to keep all the parameter names in mind:
npm run cli-interactive