diff --git a/scripts/dist/cleanup.sh b/scripts/dist/cleanup.sh index 63f7727f0..4a0d63540 100755 --- a/scripts/dist/cleanup.sh +++ b/scripts/dist/cleanup.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/create-users.sh b/scripts/dist/create-users.sh index 44d09b80a..e8b2ab01f 100755 --- a/scripts/dist/create-users.sh +++ b/scripts/dist/create-users.sh @@ -2,7 +2,7 @@ PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [ $(id -u) != "0" ]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/dist-upgrade.sh b/scripts/dist/dist-upgrade.sh index 8af64c350..30162ff60 100755 --- a/scripts/dist/dist-upgrade.sh +++ b/scripts/dist/dist-upgrade.sh @@ -2,7 +2,7 @@ PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/entrypoint-init.sh b/scripts/dist/entrypoint-init.sh index 511f80300..8f632adae 100755 --- a/scripts/dist/entrypoint-init.sh +++ b/scripts/dist/entrypoint-init.sh @@ -3,7 +3,7 @@ # INITIALIZES CONTAINER PACKAGES AND PERMISSIONS export PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-admin-tools.sh b/scripts/dist/install-admin-tools.sh index cedce2428..10c815c3f 100755 --- a/scripts/dist/install-admin-tools.sh +++ b/scripts/dist/install-admin-tools.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -# Installs Admin Tools on Linux +# This installs the "duf" and "muffet" admin tools on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-admin-tools.sh) -# abort if not executed as root +# Abort if not executed as root.. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 @@ -11,6 +11,7 @@ fi set -eux; +# Is Go installed? if ! command -v go &> /dev/null then echo "Go must be installed to run this." @@ -23,7 +24,5 @@ GOBIN="/usr/local/bin" go install github.com/muesli/duf@latest echo "Installing muffet, a fast website link checker..." GOBIN="/usr/local/bin" go install github.com/raviqqe/muffet@latest -echo "Installing nuclei, a fast and customizable vulnerability scanner..." -GOBIN="/usr/local/bin" go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest - +# Create a symbolic link for "duf" so that it is used instead of the original "df". ln -sf /usr/local/bin/duf /usr/local/bin/df \ No newline at end of file diff --git a/scripts/dist/install-caddy.sh b/scripts/dist/install-caddy.sh index c5e4bac53..65ecacd33 100755 --- a/scripts/dist/install-caddy.sh +++ b/scripts/dist/install-caddy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Installs Caddy on Linux +# This installs the Caddy web server on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-caddy.sh) set -e diff --git a/scripts/dist/install-chrome.sh b/scripts/dist/install-chrome.sh index 134e0e8bb..c4b3e4d8b 100755 --- a/scripts/dist/install-chrome.sh +++ b/scripts/dist/install-chrome.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs Google Chrome on Linux +# This installs Google Chrome on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-chrome.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-darktable.sh b/scripts/dist/install-darktable.sh index 0873ab4e4..65fe1fd5c 100755 --- a/scripts/dist/install-darktable.sh +++ b/scripts/dist/install-darktable.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs Darktable on Linux +# This installs Darktable on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-darktable.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-davfs.sh b/scripts/dist/install-davfs.sh index d8bf04257..4c9d3e38a 100755 --- a/scripts/dist/install-davfs.sh +++ b/scripts/dist/install-davfs.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash +# This installs the DavFS filesystem driver on Linux. + PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-docker.sh b/scripts/dist/install-docker.sh index 9a3ec7957..f7ed750e0 100755 --- a/scripts/dist/install-docker.sh +++ b/scripts/dist/install-docker.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Installs Docker on Ubuntu Linux +# This installs Docker on Ubuntu Linux # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-docker.sh) echo "Installing Docker..." diff --git a/scripts/dist/install-go-tools.sh b/scripts/dist/install-go-tools.sh index 1ef792367..f817959e5 100755 --- a/scripts/dist/install-go-tools.sh +++ b/scripts/dist/install-go-tools.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs Go tools on Linux +# This installs Go tools on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-go-tools.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:/usr/local/go/bin:/go/bin:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-go.sh b/scripts/dist/install-go.sh index ed2497ce4..42fca0089 100755 --- a/scripts/dist/install-go.sh +++ b/scripts/dist/install-go.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# Installs latest Go on Linux +# This installs latest Go on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-go.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" DESTDIR=$(realpath "${1:-/usr/local}") -# Abort if not executed as root. +# Abort if not executed as root.. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-gpu.sh b/scripts/dist/install-gpu.sh index ced1d5882..fd3388d4e 100755 --- a/scripts/dist/install-gpu.sh +++ b/scripts/dist/install-gpu.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs GPU drivers on Linux +# This installs GPU drivers on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-gpu.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Error: Run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-https.sh b/scripts/dist/install-https.sh index 43ca008e0..493f7b00f 100755 --- a/scripts/dist/install-https.sh +++ b/scripts/dist/install-https.sh @@ -5,7 +5,7 @@ PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# Abort if not executed as root. +# Abort if not executed as root.. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-libheif.sh b/scripts/dist/install-libheif.sh index a503b50c0..b59f41c43 100755 --- a/scripts/dist/install-libheif.sh +++ b/scripts/dist/install-libheif.sh @@ -9,7 +9,7 @@ DESTARCH=${DESTARCH:-$SYSTEM_ARCH} . /etc/os-release -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]] && [[ $DESTDIR == "/usr" || $DESTDIR == "/usr/local" ]]; then echo "Error: Run ${0##*/} as root to install in a system directory!" 1>&2 exit 1 diff --git a/scripts/dist/install-mariadb.sh b/scripts/dist/install-mariadb.sh index beb2c403a..ed672dc9e 100755 --- a/scripts/dist/install-mariadb.sh +++ b/scripts/dist/install-mariadb.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs MariaDB on Linux +# This installs MariaDB on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-mariadb.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-nodejs.sh b/scripts/dist/install-nodejs.sh index 399429bbf..9820ba237 100755 --- a/scripts/dist/install-nodejs.sh +++ b/scripts/dist/install-nodejs.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Installs NodeJS, NPM and TestCafe on Linux +# This installs NodeJS, NPM and TestCafe on Linux. # bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-nodejs.sh) PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH" -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]]; then echo "Usage: run ${0##*/} as root" 1>&2 exit 1 diff --git a/scripts/dist/install-nuclei.sh b/scripts/dist/install-nuclei.sh new file mode 100755 index 000000000..dfb0d82de --- /dev/null +++ b/scripts/dist/install-nuclei.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# This installs the Nuclei Vulnerability Scanner on Linux. +# bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-nuclei.sh) + +# Abort if not executed as root.. +if [[ $(id -u) != "0" ]]; then + echo "Usage: run ${0##*/} as root" 1>&2 + exit 1 +fi + +set -eux; + +# Is Go installed? +if ! command -v go &> /dev/null +then + echo "Go must be installed to run this." + exit 1 +fi + +# Install Nuclei via go install. +echo "Installing nuclei, a fast and customizable vulnerability scanner..." +GOBIN="/usr/local/bin" go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest diff --git a/scripts/dist/install-tensorflow.sh b/scripts/dist/install-tensorflow.sh index 8a66af1aa..f6c62a774 100755 --- a/scripts/dist/install-tensorflow.sh +++ b/scripts/dist/install-tensorflow.sh @@ -18,7 +18,7 @@ fi TMPDIR=${TMPDIR:-/tmp} -# abort if not executed as root +# Abort if not executed as root. if [[ $(id -u) != "0" ]] && [[ $DESTDIR == "/usr" || $DESTDIR == "/usr/local" ]]; then echo "Error: Run ${0##*/} as root to install in a system directory!" 1>&2 exit 1