From fed22521ed4f98abb94479a573dbcdc9ddd0d6a1 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Thu, 14 Jan 2021 18:57:32 +0900 Subject: [PATCH] new: [doc] Added doc about how to change the installer generator --- INSTALL/README.md | 182 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 173 insertions(+), 9 deletions(-) diff --git a/INSTALL/README.md b/INSTALL/README.md index eecf5cd20..3b7c38cb9 100644 --- a/INSTALL/README.md +++ b/INSTALL/README.md @@ -1,4 +1,4 @@ -# Main INSTALL Documentation for the MISP Project. +# INSTALL Documentation for the MISP Project. To have a more web friendly view please visit the mkdocs generated gh-pages site [here](https://misp.github.io/MISP/) @@ -6,21 +6,185 @@ The text files in this folder are symlink to ../docs - Which is the actual sourc Currently the following install guides are being tested on a regular basis: ``` -INSTALL.kali.txt -INSTALL.ubuntu1804.txt +INSTALL.ubuntu1804.md +INSTALL.ubuntu2004.md +INSTALL.kali.md +INSTALL.rhel7.md +INSTALL.rhel8.md ``` -A folder of interest might be 'old'. In old you will find previous INSTALL guides. - Files prefixed with 'CONFIG.' are CONFIGuration guides and not full blown INSTALL guides. -UPDATE.txt give you a brief overview on how to update MISP to the latest version, as well as some other core dependencies that can be updated. +UPDATE.md gives you a brief overview on how to update MISP to the latest version, as well as some other core dependencies that can be updated. Install guides with the 'x' prefix, are marked as Experimental. The following are tested on a semi-regular basis: ``` -xINSTALL.centos7.txt -xINSTALL.debian_testing.txt -xINSTALL.Arch.txt +xINSTALL.centos7.md +xINSTALL.debian10.md +``` + +# INSTALL.sh hacking + +First of all, please read the *INSTALL.sh* script. Running a random piece of shell script that randomly invokes sudo left right and center is dangerous. (Without a sword) + +Now read *INSTALL.tpl.sh*. This is the generator for *INSTALL.sh*. + +If for example you want to modify *INSTALL.sh*, NEVER EVER touch *INSTALL.sh*. This will break the checksum and I will be very, very angry. + +*INSTALL.tpl.sh* will source the various Markdown files and generate the main installer. Meaning, if changes happen they mostly happen in the .md files. +The advantage being that when the manual documentation is up to date the installer is up to date. + + +There are 2 scenarios here. + +1. There is an issue or improvement to be made in *INSTALL.ubuntu2004.md* for example. +2. A core *INSTALL.sh* issue or improvement needs to be done. + +You will need *xsnippet* that extracts bits of shell code from the .md files: + +```bash +mkdir -p ~/bin +git clone https://github.com/SteveClement/xsnippet.git +cd xsnippet; cp xsnippet ~/bin/ +export PATH="$PATH:~/bin" # By now you are aware that this needs to be in your $PATH, aren't you. #PAAF +``` + +You need *rhash* too: +```bash +sudo apt install rhash +``` + +Now you are ready. + +To test if you are really ready, do the following: + +``` +git clone https://github.com/MISP/MISP.git +cd MISP/INSTALL ; ./INSTALL.tpl.sh +``` + +The only file that should have been changed is: *INSTALL.sh.sfv* +And nothing on *stdout* should have been displayed, and the exit code would have been obviously 0. + +## Scenario 1 + +The easiest scenario. Everythin between *#