From 57858c1788e899fd5d727bf24107de4c4658c250 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 28 Oct 2021 02:41:10 -0400 Subject: [PATCH] fix: ensure installations treat raspbian as similar to debian buster as possible --- bootstrap.sh | 7 ++++++- docs/development/plugin-triggers.md | 2 +- plugins/20_events/install | 6 +++--- plugins/nginx-vhosts/dependencies | 2 +- plugins/nginx-vhosts/install | 2 +- plugins/nginx-vhosts/internal-functions | 2 +- plugins/storage/install | 17 +---------------- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index cf91c4591..9869aaa3b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -189,7 +189,7 @@ install-dokku-from-deb-package() { fi OS_ID="$(lsb_release -cs 2>/dev/null || echo "bionic")" - if ! in-array "$DOKKU_DISTRO" "debian" "ubuntu"; then + if ! in-array "$DOKKU_DISTRO" "debian" "ubuntu" "raspbian"; then DOKKU_DISTRO="ubuntu" OS_ID="bionic" fi @@ -204,6 +204,11 @@ install-dokku-from-deb-package() { if ! in-array "$OS_ID" "${OS_IDS[@]}"; then OS_ID="bullseye" fi + elif [[ "$DOKKU_DISTRO" == "raspbian" ]]; then + OS_IDS=("buster") + if ! in-array "$OS_ID" "${OS_IDS[@]}"; then + OS_ID="buster" + fi fi echo "--> Installing dokku" diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 1d9faafb6..c89069338 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -433,7 +433,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x export DEBIAN_FRONTEND=noninteractive case "$DOKKU_DISTRO" in - debian|ubuntu) + debian|raspbian|ubuntu) apt-get -qq -y --no-install-recommends install nginx ;; diff --git a/plugins/20_events/install b/plugins/20_events/install index afcff54fc..10e05bc3d 100755 --- a/plugins/20_events/install +++ b/plugins/20_events/install @@ -17,7 +17,7 @@ trigger-events-install() { # shellcheck disable=SC2174 mkdir -m 775 -p "$DOKKU_LOGS_DIR" case "$DOKKU_DISTRO" in - arch | debian | centos | fedora | rhel) + arch | debian | centos | fedora | raspbian | rhel) chgrp dokku "$DOKKU_LOGS_DIR" ;; *) @@ -28,7 +28,7 @@ trigger-events-install() { if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then touch "$DOKKU_EVENTS_LOGFILE" case "$DOKKU_DISTRO" in - arch | debian | centos | fedora | rhel) + arch | debian | centos | fedora | raspbian | rhel) chgrp dokku "$DOKKU_EVENTS_LOGFILE" ;; *) @@ -70,7 +70,7 @@ $DOKKU_LOGS_DIR/*.log { } EOF - if [[ "$DOKKU_DISTRO" == "debian" ]]; then + if [[ "$DOKKU_DISTRO" == "debian" ]] || [[ "$DOKKU_DISTRO" == "raspbian" ]]; then sed -i 's/ syslog dokku$/ root dokku/g' $DOKKU_LOGROTATE_FILE fi diff --git a/plugins/nginx-vhosts/dependencies b/plugins/nginx-vhosts/dependencies index 407b0457c..71c3e3261 100755 --- a/plugins/nginx-vhosts/dependencies +++ b/plugins/nginx-vhosts/dependencies @@ -34,7 +34,7 @@ trigger-nginx-vhosts-dependencies() { declare trigger="dependencies" case "$DOKKU_DISTRO" in - debian) + debian | raspbian) nginx_install ;; diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 3c3570503..88b4e6e68 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -25,7 +25,7 @@ trigger-nginx-vhosts-install() { fi case "$DOKKU_DISTRO" in - debian) + debian | raspbian) echo "%dokku ALL=(ALL) NOPASSWD:/usr/sbin/invoke-rc.d $NGINX_INIT_NAME reload, $NGINX_BIN -t, ${NGINX_BIN} -t -c *" >"$NGINX_SUDOERS_FILE" ;; diff --git a/plugins/nginx-vhosts/internal-functions b/plugins/nginx-vhosts/internal-functions index f375a368e..b6efcc405 100755 --- a/plugins/nginx-vhosts/internal-functions +++ b/plugins/nginx-vhosts/internal-functions @@ -102,7 +102,7 @@ fn-nginx-vhosts-nginx-init-cmd() { fi case "$DOKKU_DISTRO" in - debian) + debian | raspbian) sudo /usr/sbin/invoke-rc.d "$NGINX_INIT_NAME" "$CMD" ;; diff --git a/plugins/storage/install b/plugins/storage/install index 28629b925..bda82c024 100755 --- a/plugins/storage/install +++ b/plugins/storage/install @@ -12,22 +12,7 @@ trigger-storage-install() { STORAGE_SUDOERS_FILE="/etc/sudoers.d/dokku-storage" case "$DOKKU_DISTRO" in - debian) - echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE" - echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE" - ;; - - ubuntu) - echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE" - echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE" - ;; - - opensuse) - echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE" - echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE" - ;; - - arch) + arch | debian | opensuse | raspbian | ubuntu) echo "%dokku ALL=(ALL) NOPASSWD:$PLUGIN_AVAILABLE_PATH/storage/bin/chown-storage-dir *" >"$STORAGE_SUDOERS_FILE" echo "Defaults env_keep += \"DOKKU_LIB_ROOT\"" >>"$STORAGE_SUDOERS_FILE" ;;