diff --git a/.travis.yml b/.travis.yml index 02a74f8..c82969a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ sudo: required install: - sudo apt-get -y install libgif-dev calibre npm + - sudo npm config set strict-ssl false - sudo npm cache clean -f - sudo npm install -g n - sudo n stable @@ -18,6 +19,7 @@ install: - npm install gitbook-plugin-github - npm install gitbook-plugin-toc - npm install gitbook-plugin-anchors + - npm install gitbook-plugin-image-class script: - gitbook install diff --git a/USAGE.md b/USAGE.md index 8cfc7b9..333f49d 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,14 +4,18 @@ Install notes :warning: Make sure to be in the *misp-book* repository directory for the *npm magic*. Also: The *npm* plugin *autocover* is broken. It pulls an incompatible *canvas* module version. Thus patched repository used (forked from original) +Finally: You will get a few errors on Ubuntu 18.04 which you can ignore for now. In the rather near future we need to think about an alternative as gitbook glides towards obsoletion and security risk. -Tested on: *Ubuntu 16.04.4 LTS* +Tested on: *Ubuntu 18.04 LTS* *Debian 9.5/sid/testing* +[Terminal Recording of npm install lines on Ubuntu 18.04](https://asciinema.org/a/84JZMuGu2QlFH59q6mK8jbdQS) ```bash -curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - +git clone git@github.com:MISP/misp-book.git +cd misp-book +curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential -sudo apt install -y npm pkg-config libcairo2-dev +sudo apt install -y pkg-config libcairo2-dev libgif-dev npm install gitbook git+https://github.com/SteveClement/plugin-autocover.git gitbook-plugin-github gitbook-plugin-toc gitbook-plugin-anchors gitbook-plugin-image-class sudo npm install gitbook-cli -g gitbook install @@ -101,7 +105,7 @@ xcode-select --install brew install pkg-config cairo pango libpng jpeg giflib ``` -:warning: Make sure to be in the *misp-book* repository directory for the npm magic. +:warning: Make sure to be in the *misp-book* repository directory for the npm magic to work correctly. Installing gitbook and all dependencies wants to look like this (Tested on *macOS 11.13.3*): @@ -111,6 +115,19 @@ npm install gitbook-cli -g gitbook install ``` +gitbook rebuild on change +========================= + +By default gitbook has the '--watch' option enabled. +If this is broken, use the included 'serve.sh' and the 'inoticoming' package. +Start 'gitbook serve &' and run the following command line: + +``` +inoticoming --foreground . --suffix .md bash serve.sh \; +``` + +If any md changes, the gitbook process is killed and restarted. + npm salvage =========== diff --git a/general-layout/figures/menu_image.png b/general-layout/figures/menu_image.png deleted file mode 100644 index eed2695..0000000 Binary files a/general-layout/figures/menu_image.png and /dev/null differ diff --git a/serve.sh b/serve.sh new file mode 100755 index 0000000..3e9bfdd --- /dev/null +++ b/serve.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Kill any existing instances of "gitbook serve" +ps -Af | grep node | grep "gitbook serve" | awk '{print $2}' | xargs kill 2>/dev/null +if [ "$1" = "shutdown" ]; then echo "Goodbye!"; exit 0; fi; + +# Launch the server +gitbook serve . &