From 1543f455949381a9607255d2fac8c0110df74e27 Mon Sep 17 00:00:00 2001 From: Tristan Date: Thu, 6 Feb 2020 01:31:06 -0500 Subject: [PATCH] treehouses services ntopng added (fixes #618) (#656) --- modules/services.sh | 26 +++++++++++++++++++++--- package.json | 2 +- templates/services/ntopng/ntopng_autorun | 7 +++++++ 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 templates/services/ntopng/ntopng_autorun diff --git a/modules/services.sh b/modules/services.sh index 3c703b839..e18edb3e8 100644 --- a/modules/services.sh +++ b/modules/services.sh @@ -138,6 +138,12 @@ function services { echo "portainer built and started" check_tor "9000" ;; + ntopng) + docker volume create ntopng_data + docker run --name ntopng -d -p 8090:8090 -v /var/run/docker.sock:/var/run/docker.sock -v ntopng_data:/data jonbackhaus/ntopng --http-port=8090 + echo "ntopng built and started" + check_tor "8090" + ;; *) echo "unknown service" ;; @@ -146,7 +152,7 @@ function services { down) case "$service_name" in - planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer) + planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng) if [ ! -e /srv/${service_name}/${service_name}.yml ]; then echo "yml file doesn't exit" else @@ -162,7 +168,7 @@ function services { start) case "$service_name" in - planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer) + planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng) if docker ps -a | grep -q $service_name; then docker-compose -f /srv/${service_name}/${service_name}.yml start echo "${service_name} started" @@ -178,7 +184,7 @@ function services { stop) case "$service_name" in - planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer) + planet|kolibri|pihole|moodle|privatebin|nextcloud|portainer|ntopng) if docker ps -a | grep -q $service_name; then docker-compose -f /srv/${service_name}/${service_name}.yml stop echo "${service_name} stopped" @@ -311,6 +317,16 @@ function services { echo "easily manage your different Docker environments (Docker hosts or" echo "Swarm clusters).\"" ;; + ntopng) + echo "https://github.com/ntop/ntopng" + echo + echo "\"ntopng is the next generation version of the original ntop," + echo "a network traffic probe that monitors network usage. ntopng is" + echo "based on libpcap and it has been written in a portable way in order" + echo "to virtually run on every Unix platform, MacOSX and on Windows as well." + echo "Educational users can obtain commercial products at no cost please see here:" + echo "https://www.ntop.org/support/faq/do-you-charge-universities-no-profit-and-research/\"" + ;; esac ;; @@ -421,6 +437,9 @@ function get_port { portainer) echo "9000" ;; + ntopng) + echo "8090" + ;; *) echo "unknown service" ;; @@ -438,6 +457,7 @@ function services_help { # echo " Moodle" echo " PrivateBin" echo " Portainer" + echo " Ntopng" echo echo echo "Top-Level Commands:" diff --git a/package.json b/package.json index e4702d30f..a63969a06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.13.10", + "version": "1.13.11", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh", "bin": { diff --git a/templates/services/ntopng/ntopng_autorun b/templates/services/ntopng/ntopng_autorun new file mode 100644 index 000000000..e224ec042 --- /dev/null +++ b/templates/services/ntopng/ntopng_autorun @@ -0,0 +1,7 @@ +ntopng_autorun=true + +if [ "ntopng_autorun" = true ]; then + docker volume create ntopng_data + docker run --name ntopng -d -p 8090:8090 -v /var/run/docker.sock:/var/run/docker.sock -v ntopng_data:/data jonbackhaus/ntopng --http-port=8090 +fi +