diff --git a/modules/services.sh b/modules/services.sh index 457bbf25f..719bf2562 100644 --- a/modules/services.sh +++ b/modules/services.sh @@ -136,13 +136,13 @@ function services { check_tor "9000" ;; netdata) - check_space "treehouses/netdata" + check_space "netdata/netdata" create_yml "netdata" docker_compose_up "netdata" check_tor "19999" ;; mastodon) - check_space "treehouses/mastodon" + check_space "gilir/rpi-mastodon" create_yml "mastodon" docker_compose_up "mastodon" check_tor "3000" @@ -409,6 +409,47 @@ function services { get_port $service_name ;; + size) + case "$service_name" in + planet) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/treehouses/planet/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + kolibri) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/treehouses/kolibri/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + pihole) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/pihole/pihole/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + moodle) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/treehouses/moodle/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + privatebin) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/treehouses/privatebin/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + nextcloud) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/library/nextcloud/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + portainer) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/portainer/portainer/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + netdata) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/netdata/netdata/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + mastodon) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/gilir/rpi-mastodon/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + ntopng) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/jonbackhaus/ntopng/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + couchdb) + curl -s -H "Authorization: JWT " "https://hub.docker.com/v2/repositories/treehouses/couchdb/tags/?page_size=100" | jq -r '.results[] | select(.name == "latest") | .images[0].size' | numfmt --to=iec + ;; + *) + echo "unknown service" + ;; + esac + ;; + *) echo "unknown command" ;; @@ -570,11 +611,13 @@ function services_help { echo " ..... down" echo " ..... start" echo " ..... stop" + echo " ..... restart" echo " ..... autorun [true|false]" echo " ..... ps" + echo " ..... info" echo " ..... url " echo " ..... port" - echo " ..... info" + echo " ..... size" echo echo " up builds and starts " echo @@ -584,12 +627,16 @@ function services_help { echo echo " stop stops " echo + echo " restart restarts " + echo echo " autorun outputs true if is set to autorun or false otherwise" echo " [true] sets autorun to true" echo " [false] sets autorun to false" echo echo " ps outputs the containers related to " echo + echo " info gives some information about " + echo echo " url " echo " lists the local url for " echo " lists the tor url for " @@ -597,7 +644,7 @@ function services_help { echo echo " port lists the ports used by " echo - echo " info gives some information about " + echo " size outputs the size of " echo echo " Examples:" echo diff --git a/package.json b/package.json index e11d164a3..e34220159 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.13.40", + "version": "1.13.41", "remote": "2069", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh",