From 559e85949495cd1ca78b16ba2fbc4d942d1e55d6 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:37:27 -0600 Subject: [PATCH 1/7] Update variables.sh: Add myFiles variables --- variables.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/variables.sh b/variables.sh index 63d0fbde5..41500aabf 100644 --- a/variables.sh +++ b/variables.sh @@ -133,6 +133,10 @@ if [[ -z "${ALLSKY_VARIABLE_SET}" ]]; then ALLSKY_REMOTE_WEBSITE_CONFIGURATION_NAME="remote_${ALLSKY_WEBSITE_CONFIGURATION_NAME}" ALLSKY_REMOTE_WEBSITE_CONFIGURATION_FILE="${ALLSKY_CONFIG}/${ALLSKY_REMOTE_WEBSITE_CONFIGURATION_NAME}" + # Areas for users' Allsky-related files that get propogated to new releases. + ALLSKY_MYFILES="${ALLSKY_CONFIG}/myFiles" + ALLSKY_WEBSITE_MYFILES="${ALLSKY_WEBSITE}/myFiles" + # Holds all the Allsky documentation. ALLSKY_DOCUMENTATION="${ALLSKY_WEBUI}/documentation" From 4118c76e3aa7c6d8dc467ef1c451b4ed8c010c2d Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:41:01 -0600 Subject: [PATCH 2/7] Create README.txt --- html/allsky/myFiles/README.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/allsky/myFiles/README.txt diff --git a/html/allsky/myFiles/README.txt b/html/allsky/myFiles/README.txt new file mode 100644 index 000000000..e5a1f53f2 --- /dev/null +++ b/html/allsky/myFiles/README.txt @@ -0,0 +1,5 @@ +This directory is for your personal Allsky Website-related files and is moved to new Allsky releases. +Things you may want to store here: + * Website home page background image. + * Website "favicon". + * Any personal file you want in new Allsky releases. From 61ecb265c5e43b050e5c6a5c6d376368f6229359 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:11:54 -0600 Subject: [PATCH 3/7] Delete html/allsky/myFiles/README.txt --- html/allsky/myFiles/README.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 html/allsky/myFiles/README.txt diff --git a/html/allsky/myFiles/README.txt b/html/allsky/myFiles/README.txt deleted file mode 100644 index e5a1f53f2..000000000 --- a/html/allsky/myFiles/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -This directory is for your personal Allsky Website-related files and is moved to new Allsky releases. -Things you may want to store here: - * Website home page background image. - * Website "favicon". - * Any personal file you want in new Allsky releases. From 9fa33365adc7aa60b44d9da2ebcf9f3df0bf6efb Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:26:29 -0600 Subject: [PATCH 4/7] Update installUpgradeFunctions.sh: add PRIOR_MYFILES_DIR --- scripts/installUpgradeFunctions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/installUpgradeFunctions.sh b/scripts/installUpgradeFunctions.sh index 4ec069515..0ee7e7270 100644 --- a/scripts/installUpgradeFunctions.sh +++ b/scripts/installUpgradeFunctions.sh @@ -25,7 +25,7 @@ export REPO_OPTIONS_FILE="${ALLSKY_REPO}/$( basename "${OPTIONS_FILE}" ).repo" export REPO_ENV_FILE="${ALLSKY_REPO}/$( basename "${ALLSKY_ENV}" ).repo" export REPO_WEBSITE_CONFIGURATION_FILE="${ALLSKY_REPO}/${ALLSKY_WEBSITE_CONFIGURATION_NAME}.repo" -##### Information on prior Allsky versions +##### Information on prior Allsky versions and files. # Location of old-style WebUI and Website. export OLD_WEBUI_LOCATION="/var/www/html" export OLD_WEBSITE_LOCATION="${OLD_WEBUI_LOCATION}/allsky" @@ -35,6 +35,7 @@ export PRIOR_ALLSKY_DIR="$( dirname "${ALLSKY_HOME}" )/${ALLSKY_INSTALL_DIR}-OLD export PRIOR_CONFIG_DIR="${PRIOR_ALLSKY_DIR}/$( basename "${ALLSKY_CONFIG}" )" export PRIOR_REMOTE_WEBSITE_CONFIGURATION_FILE="${PRIOR_CONFIG_DIR}/${ALLSKY_REMOTE_WEBSITE_CONFIGURATION_NAME}" export PRIOR_PYTHON_VENV="${PRIOR_ALLSKY_DIR}/venv/lib" +export PRIOR_MYFILES_DIR="${ALLSKY_MYFILES_DIR/${ALLSKY_HOME}/${PRIOR_ALLSKY_DIR}}" # Name of setting that determines version of Website config file. export WEBSITE_CONFIG_VERSION="ConfigVersion" From 421243c7c3c373a5d0e53494833fd8a3d526ce1a Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:27:37 -0600 Subject: [PATCH 5/7] Update variables.sh: append _DIR and _NAME to MYFILES variables --- variables.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/variables.sh b/variables.sh index 41500aabf..10911885b 100644 --- a/variables.sh +++ b/variables.sh @@ -134,8 +134,9 @@ if [[ -z "${ALLSKY_VARIABLE_SET}" ]]; then ALLSKY_REMOTE_WEBSITE_CONFIGURATION_FILE="${ALLSKY_CONFIG}/${ALLSKY_REMOTE_WEBSITE_CONFIGURATION_NAME}" # Areas for users' Allsky-related files that get propogated to new releases. - ALLSKY_MYFILES="${ALLSKY_CONFIG}/myFiles" - ALLSKY_WEBSITE_MYFILES="${ALLSKY_WEBSITE}/myFiles" + ALLSKY_MYFILES_NAME="myFiles" + ALLSKY_MYFILES_DIR="${ALLSKY_CONFIG}/${ALLSKY_MYFILES_NAME}" + ALLSKY_WEBSITE_MYFILES_DIR="${ALLSKY_WEBSITE}/${ALLSKY_MYFILES_NAME}" # Holds all the Allsky documentation. ALLSKY_DOCUMENTATION="${ALLSKY_WEBUI}/documentation" From f8ce8d4a922b1b3c3d09cd08b4ce7cfea93ef254 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:30:34 -0600 Subject: [PATCH 6/7] Update install.sh: don't hardcode 'myFiles' Use ALLSKY_MYFILES_{NAME|DIR} instead. Also make sure the ALLSKY and ALLSKY_WEBSITE files are created. --- install.sh | 65 +++++++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/install.sh b/install.sh index 4dfc89be8..846b2e3cf 100755 --- a/install.sh +++ b/install.sh @@ -929,6 +929,11 @@ set_permissions() fi done + # These directories aren't in GitHub so need to be manually created. + mkdir -p \ + "${ALLSKY_EXTRA}" \ + "${ALLSKY_MYFILES_DIR}" + # The web server needs to be able to create and update many of the files in ${ALLSKY_CONFIG}. # Not all, but go ahead and chgrp all of them so we don't miss any new ones. sudo find "${ALLSKY_CONFIG}/" -type f -exec chmod 664 '{}' \; @@ -956,6 +961,7 @@ set_permissions() # These directories aren't in GitHub so need to be manually created. mkdir -p \ + "${ALLSKY_WEBSITE_MYFILES_DIR}" \ "${ALLSKY_WEBSITE}/videos/thumbnails" \ "${ALLSKY_WEBSITE}/keograms/thumbnails" \ "${ALLSKY_WEBSITE}/startrails/thumbnails" @@ -2383,11 +2389,6 @@ restore_prior_files() CONFIGURATION_NEEDED="${STATUS_NO_LAT_LONG}" fi - # Default permissions for these are ok. - mkdir -p \ - "${ALLSKY_EXTRA}" \ - "${ALLSKY_CONFIG}/myFiles" - STATUS_VARIABLES+=( "${FUNCNAME[0]}='true'\n" ) return # Nothing left to do in this function, so return fi @@ -2431,12 +2432,11 @@ restore_prior_files() display_msg --log progress "${ITEM}: ${NOT_RESTORED}" fi - ITEM="${SPACE}'config/myFiles' directory" - if [[ -d ${PRIOR_CONFIG_DIR}/myFiles ]]; then + ITEM="${SPACE}'$( basename "$( dirname "${ALLSKY_MYFILES_DIR}" )" )/${ALLSKY_MYFILES_NAME}' directory" + if [[ -d ${PRIOR_MYFILES_DIR} ]]; then display_msg --log progress "${ITEM} (moving)" - mv "${PRIOR_CONFIG_DIR}/myFiles" "${ALLSKY_CONFIG}" + mv "${PRIOR_MYFILES_DIR}" "${ALLSKY_MYFILES_DIR}" else - mkdir -p "${ALLSKY_CONFIG}/myFiles" # Almost no one has this directory, so don't show to user. display_msg --logonly info "${ITEM}: ${NOT_RESTORED}" fi @@ -2711,16 +2711,13 @@ restore_prior_website_files() display_msg --log progress "${ITEM}: ${NOT_RESTORED}" fi - ITEM="${SPACE}${SPACE}'myFiles' directory" - D="${PRIOR_WEBSITE_DIR}/myFiles" + ITEM="${SPACE}${SPACE}'${ALLSKY_MYFILES_NAME}' directory" + D="${PRIOR_WEBSITE_DIR}/${ALLSKY_MYFILES_NAME}" if [[ -d ${D} ]]; then - count=$( get_count "${D}" '*' ) - if [[ ${count} -gt 1 ]]; then - display_msg --log progress "${ITEM} (moving)" - mv "${D}" "${ALLSKY_WEBSITE}" - fi + display_msg --log progress "${ITEM} (moving)" + mv "${D}" "${ALLSKY_WEBSITE_MYFILES_DIR}" else - display_msg --log progress "${ITEM}: ${NOT_RESTORED}" + display_msg --logonly info "${ITEM}: ${NOT_RESTORED}" fi # This is the old name. @@ -2730,9 +2727,10 @@ restore_prior_website_files() if [[ -d ${D} ]]; then count=$( get_count "${D}" '*' ) if [[ ${count} -gt 1 ]]; then - local MSG2=" Please use 'myFiles' going forward." - display_msg --log progress "${ITEM} (copying to '${ALLSKY_WEBSITE}/myFiles')" "${MSG2}" - cp "${D}"/* "${ALLSKY_WEBSITE}/myFiles" + local MSG2=" Please use '${ALLSKY_WEBSITE_MYFILES_DIR}' going forward." + display_msg --log progress "${ITEM} (copying to '${ALLSKY_WEBSITE_MYFILES_DIR}')" "${MSG2}" + # TODO: This won't copy dot files. + cp "${D}"/* "${ALLSKY_WEBSITE_MYFILES_DIR}" fi else # Since this is obsolete only add to log file. @@ -2777,7 +2775,7 @@ restore_prior_website_files() echo -e "${MSG}" echo "When done, check in '${PRIOR_WEBSITE_DIR}' for any files" echo "you may have added; if there are any, store them in" - echo -e "\n ${ALLSKY_WEBSITE}/myFiles" + echo -e "\n ${ALLSKY_WEBSITE_MYFILES_DIR}" echo "then remove the old website: sudo rm -fr ${PRIOR_WEBSITE_DIR}" } >> "${POST_INSTALLATION_ACTIONS}" @@ -2881,10 +2879,10 @@ do_restore() display_msg --log progress "${ITEM}: ${NOT_RESTORED}" fi - ITEM="${SPACE}'config/myFiles' directory" - if [[ -d ${ALLSKY_CONFIG}/myFiles ]]; then + ITEM="${SPACE}'$( basename "$( dirname "${ALLSKY_MYFILES_DIR}" )" )/${ALLSKY_MYFILES_NAME}' directory" + if [[ -d ${ALLSKY_MYFILES_DIR} ]]; then display_msg --log progress "${ITEM} (moving back)" - mv "${ALLSKY_CONFIG}/myFiles" "${PRIOR_CONFIG_DIR}" + mv "${ALLSKY_MYFILES_DIR}" "${PRIOR_MYFILES_DIR}" else # Few people have this directory, so don't show to user. display_msg --logonly info "${ITEM}: ${NOT_RESTORED}" @@ -2926,22 +2924,13 @@ do_restore() display_msg --log progress "${ITEM}: ${NOT_RESTORED}" fi - ITEM="${SPACE}${SPACE}'myFiles' directory" - D="${ALLSKY_WEBSITE}/myFiles" - if [[ -d ${D} ]]; then - count=$( get_count "${D}" '*' ) - if [[ ${count} -gt 1 ]]; then - display_msg --log progress "${ITEM} (moving)" - mv "${D}" "${PRIOR_WEBSITE_DIR}" - fi + ITEM="${SPACE}${SPACE}${ALLSKY_MYFILES_NAME}" + if [[ -d ${ALLSKY_MYWEBSITE_MYFILES_DIR} ]]; then + display_msg --log progress "${ITEM} (moving)" + mv "${ALLSKY_WEBSITE_MYFILES_DIR}" "${PRIOR_WEBSITE_DIR}" else - display_msg --log progress "${ITEM}: ${NOT_RESTORED}" + display_msg --logonly info "${ITEM}: ${NOT_RESTORED}" fi - -#xx TODO: huh? why remove it? -#xx ITEM="${SPACE}${SPACE}Local Website directory" -#xx display_msg --log progress "${ITEM} (removing)" -#xx rm -fr "${ALLSKY_WEBSITE}" fi # Since we'll be running a new Allsky, start off with clean log files. From 27d105cc40152569a22fe5d88cf958206ab9dae8 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:32:51 -0600 Subject: [PATCH 7/7] Update install.sh: Fix typo --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 846b2e3cf..e0ca0a0a0 100755 --- a/install.sh +++ b/install.sh @@ -2925,7 +2925,7 @@ do_restore() fi ITEM="${SPACE}${SPACE}${ALLSKY_MYFILES_NAME}" - if [[ -d ${ALLSKY_MYWEBSITE_MYFILES_DIR} ]]; then + if [[ -d ${ALLSKY_WEBSITE_MYFILES_DIR} ]]; then display_msg --log progress "${ITEM} (moving)" mv "${ALLSKY_WEBSITE_MYFILES_DIR}" "${PRIOR_WEBSITE_DIR}" else