From 1d21665c1648cdf2fe9758ce9adb7158a6397a25 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 4 Sep 2018 01:30:30 +0300 Subject: [PATCH] Add Monkey web server --- clever/launch/clever.launch | 4 ++ clever/src/monkey | 3 ++ clever/static/index.html | 12 +++++ deploy/monkey | 57 +++++++++++++++++++++++ image_builder/scripts/software_install.sh | 14 +++++- 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100755 clever/src/monkey create mode 100644 clever/static/index.html create mode 100644 deploy/monkey diff --git a/clever/launch/clever.launch b/clever/launch/clever.launch index 4257769e..9dedd4b5 100644 --- a/clever/launch/clever.launch +++ b/clever/launch/clever.launch @@ -3,6 +3,7 @@ + @@ -21,6 +22,9 @@ + + + diff --git a/clever/src/monkey b/clever/src/monkey new file mode 100755 index 00000000..fd541278 --- /dev/null +++ b/clever/src/monkey @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec /home/pi/monkey/build/monkey --port 80 diff --git a/clever/static/index.html b/clever/static/index.html new file mode 100644 index 00000000..919c6fb0 --- /dev/null +++ b/clever/static/index.html @@ -0,0 +1,12 @@ +

CLEVER Drone Kit Tools

+ + + + diff --git a/deploy/monkey b/deploy/monkey new file mode 100644 index 00000000..bf5e22e9 --- /dev/null +++ b/deploy/monkey @@ -0,0 +1,57 @@ +# Default Host - Configuration +# ============================ +# Here the variable principals of the program are defined in respect +# to the configuration of the different types of directives. + +[HOST] + # ServerName: + # ----------- + # Allow you to set a host and domain name (e.g monkey.linuxchile.cl). If + # you are working in a local network just set your IP address or if you + # are working like localhost set your loopback address (127.0.0.1). + + ServerName 0.0.0.0 + + # DocumentRoot: + # ------------- + # This variable corresponds to the location of the main server directory + # of the web pages, where the files of your site are located. + # + # Example: + # DocumentRoot /home/krypton/htdocs + + DocumentRoot /home/pi/catkin_ws/src/clever/clever/static + + # Redirect: + # --------- + # Under specific conditions, you may want the server performs a HTTP + # redirect when this Virtual Host is reach. If that is the case, append + # to the Redirect key the value of the address where to redirect the + # HTTP client. + # + # Redirect http://monkey-project.com + +[LOGGER] + # AccessLog: + # ---------- + # Registration file of correct request. + + AccessLog /home/pi/monkey/build/log/access.log + + # ErrorLog: + # --------- + # Registration file of incorrect request. + + ErrorLog /home/pi/monkey/build/log/error.log + +[ERROR_PAGES] + 404 404.html + +[HANDLERS] + # FastCGI + # ======= + # Match /.*\.php fastcgi + + # CGI + # === + # Match /cgi-bin/.*\.cgi cgi diff --git a/image_builder/scripts/software_install.sh b/image_builder/scripts/software_install.sh index fd2fbdd3..b5f25e4e 100755 --- a/image_builder/scripts/software_install.sh +++ b/image_builder/scripts/software_install.sh @@ -28,7 +28,19 @@ apt-get install --no-install-recommends -y \ libjpeg8-dev=8d1-2 \ tcpdump \ libpoco-dev=1.7.6+dfsg1-5+deb9u1 - + +# install Monkey web-server +cd /home/pi +git clone git@github.com:monkey/monkey.git +cd monkey +git checkout v1.6.9 +./configure --malloc-libc --local +make +sudo setcap 'cap_net_bind_service=+ep' ./build/monkey # allow using 80 port +rm build/conf/sites/default +ln -s /home/pi/catkin_ws/src/clever/deploy/monkey ./build/conf/sites/default +cd /home/pi + echo -e "\033[0;31m\033[1m$(date) | #2 Adding mjpg-streamer at /home/pi\033[0m\033[0m" # https://github.com/jacksonliam/mjpg-streamer