Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4134 don't allow changing remotewebsite{timelapse | keogram |startrails} names #4135

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 6 additions & 39 deletions config_repo/options.json.repo
Original file line number Diff line number Diff line change
Expand Up @@ -2012,50 +2012,17 @@
{
"name" : "remotewebsiteimageuploadoriginalname",
"default" : false,
"description" : "Enable to upload images using YYYYMMDDHHMMSS naming.",
"description" : "Enable to upload images using YYYYMMDDHHMMSS naming. <strong>Rarely used.</strong>",
"label" : "Upload With Original Name",
"label_prefix" : "Remote Website",
"type" : "boolean",
"carryforward" : true,
"valuedependson" : "imageuploadfrequency=[1-9]*"
},
{
"name" : "remotewebsitevideodestinationname",
"default" : "",
"description" : "Optional name of the remote video file.",
"label" : "Remote Video File Name",
"label_prefix" : "Remote Website",
"type" : "text",
"carryforward" : true,
"booldependson" : "useremotewebsite",
"optional" : true
},
{
"name" : "remotewebsitekeogramdestinationname",
"default" : "",
"description" : "Optional name of the remote keogram file.",
"label" : "Remote Keogram File Name",
"label_prefix" : "Remote Website",
"type" : "text",
"carryforward" : true,
"booldependson" : "useremotewebsite",
"optional" : true
},
{
"name" : "remotewebsitestartrailsdestinationname",
"default" : "",
"description" : "Optional name of the remote startrails file.",
"label" : "Remote Startrails File Name",
"label_prefix" : "Remote Website",
"type" : "text",
"carryforward" : true,
"booldependson" : "useremotewebsite",
"optional" : true
},
{
"name" : "remotewebsiteurl",
"default" : "",
"description" : "The URL of your Allsky Website, for example: https://mywebsite.com/allsky/.<br>Must begin with <span class='WebUIValue'>http</span> or <span class='WebUIValue'>https</span>.",
"description" : "The URL of your Allsky Website, for example: <span class='WebUIValue'>https://mywebsite.com/allsky/</span>.<br>Must begin with <span class='WebUIValue'>http</span> or <span class='WebUIValue'>https</span>.",
"label" : "Website URL",
"label_prefix" : "Remote Website",
"type" : "widetext",
Expand All @@ -2067,7 +2034,7 @@
{
"name" : "remotewebsiteimageurl",
"default" : "",
"description" : "The URL of the image on your Allsky Website, for example: https://mywebsite.com/allsky/image.jpg.<br>Must begin with <span class='WebUIValue'>http</span> or <span class='WebUIValue'>https</span>.",
"description" : "The URL of the image on your Allsky Website, for example: <span class='WebUIValue'>https://mywebsite.com/allsky/image.jpg</span>.<br>Must begin with <span class='WebUIValue'>http</span> or <span class='WebUIValue'>https</span>.",
"label" : "Image URL",
"label_prefix" : "Remote Website",
"type" : "widetext",
Expand Down Expand Up @@ -2275,7 +2242,7 @@
},
{
"name" : "remoteservervideodestinationname",
"default" : "",
"default" : "allsky.mp4",
"description" : "Optional name of the remote video file.",
"label" : "Remote Video File Name",
"label_prefix" : "Remote Server",
Expand All @@ -2286,7 +2253,7 @@
},
{
"name" : "remoteserverkeogramdestinationname",
"default" : "",
"default" : "keogram.jpg",
"description" : "Optional name of the remote keogram file.",
"label" : "Remote Keogram File Name",
"label_prefix" : "Remote Server",
Expand All @@ -2297,7 +2264,7 @@
},
{
"name" : "remoteserverstartrailsdestinationname",
"default" : "",
"default" : "startrails.jpg",
"description" : "Optional name of the remote startrails file.",
"label" : "Remote Startrails File Name",
"label_prefix" : "Remote Server",
Expand Down
20 changes: 17 additions & 3 deletions html/documentation/changeLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,24 @@ <h4>Enhancements / Changes</h4>
<li>Displaying image previews is now done via <code>allsky.sh --preview</code>.
It was previously <code>allsky.sh preview</code>.
</ul>
<h4>Settings</h4>
<h4>New Settings</h4>
<ul>
<li>New: xxx
<li>Deleted: xxx
<li><span class="WebUISetting">xxx</span>
</ul>
<h4>Deleted Settings</h4>
<ul>
<li>To further simplify configuring a remote Website and
remove a source of user error,
changing the name of the timelapse, keogram, and startrails files
uploaded to a remote Website is no longer allowed
(these already couldn't be changed for local Websites).
Hence, the
<span class="WebUISetting">Remote Video File Name</span>,
<span class="WebUISetting">Remote Keogram File Name</span>, and
<span class="WebUISetting">Remote Startrails File Name</span>
settings in the
<span class="subSettingsHeader">Remote Website</span>
sub-section of the WebUI were deleted.
</ul>
<h4>Bug Fixes</h4>
<ul>
Expand Down
18 changes: 0 additions & 18 deletions html/documentation/settings/allsky.html
Original file line number Diff line number Diff line change
Expand Up @@ -1241,24 +1241,6 @@
<br>This is rarely used since changing the image name will make it unviewable.
</td>
</tr>
<tr><td id="remotewebsitevideodestinationname"><span class="WebUISetting">Remote Video File Name</span></td>
<td></td>
<td>The name to give to the remote timelapse video file.
If not specified it's the same as the file on your Pi.
<br>This is rarely used since changing the image name will make it unviewable.
</td></tr>
<tr><td id="remotewebsitekeogramdestinationname"><span class="WebUISetting">Remote Keogram File Name</span></td>
<td></td>
<td>The name to give to the remote keogram file.
If not specified it's the same as the file on your Pi.
<br>This is rarely used since changing the image name will make it unviewable.
</td></tr>
<tr><td id="remotewebsitestartrailsdestinationname"><span class="WebUISetting">Remote Startrails File Name</span></td>
<td></td>
<td>The name to give to the remote startrails file.
If not specified it's the same as the file on your Pi.
<br>This is rarely used since changing the image name will make it unviewable.
</td></tr>
<tr><td id="remotewebsiteurl"><span class="WebUISetting">Website URL</span></td>
<td></td>
<td>Your website's URL, for example
Expand Down
43 changes: 24 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ COMBINED_BASE_VERSION="v2024.12.06"
# "cameratype" in the settings file.
FIRST_CAMERA_TYPE_BASE_VERSION="v2023.05.01"
# First Allsky version that used the "version" file.
# It's also when ftp-settings.sh moved to ${ALLSKY_CONFIG}
# It's also when ftp-settings.sh moved to the ${ALLSKY_CONFIG} directory.
FIRST_VERSION_VERSION="v2022.03.01"
# Versions before ${FIRST_VERSION_VERSION} that didn't have version numbers.
# Versions before ${FIRST_VERSION_VERSION} didn't have version numbers.
PRE_FIRST_VERSION_VERSION="old"

##### Information on the prior Allsky version, if used
Expand Down Expand Up @@ -1664,7 +1664,8 @@ create_allsky_logs()
# runs in a subshell.
DISPLAYED_BRIGHTNESS_MSG="/tmp/displayed_brightness_msg"
DISPLAYED_OFFSET_MSG="/tmp/displayed_offset_msg"
rm -f "${DISPLAYED_BRIGHTNESS_MSG}" "${DISPLAYED_OFFSET_MSG}"
DISPLAYED_CHANGE_NAMES_MSG="/tmp/displayed_change_names_msg"
rm -f "${DISPLAYED_BRIGHTNESS_MSG}" "${DISPLAYED_OFFSET_MSG}" "${DISPLAYED_CHANGE_NAMES_MSG}"

convert_settings() # prior_file, new_file
{
Expand All @@ -1677,14 +1678,10 @@ convert_settings() # prior_file, new_file
return
fi

# If we're upgrading a version >= COMBINED_BASE_VERSION then return.
# bash doesn't have >= so use ! <
if [[ ! (${PRIOR_ALLSKY_BASE_VERSION} < "${COMBINED_BASE_VERSION}") ]]; then
display_msg --logonly info "Not converting '${PRIOR_FILE}'; >= COMBINED_BASE_VERSION."
return
fi
# TODO: Keep track somehow of which upgrades added, deleted, and/or changed names of
# settings so we know if the settings file needs to be updated.

local MSG="Converting '$( basename "${PRIOR_FILE}" )' to new format:"
local MSG="Converting '$( basename "${PRIOR_FILE}" )' to new format if needed:"
display_msg --log progress "${MSG}"

DIR="/tmp/converted_settings"
Expand All @@ -1695,7 +1692,7 @@ convert_settings() # prior_file, new_file
# and quotes around numbers. Change that.
# Don't modify the prior file, so make the changes to a temporary file.
# --settings-only says only output settings that are in the settings file.
# The OPTIONS_FILE doesn't exist yet so use REPO_OPTIONS_FILE>
# The OPTIONS_FILE doesn't exist yet so use REPO_OPTIONS_FILE.
"${ALLSKY_SCRIPTS}/convertJSON.php" \
--convert \
--settings-only \
Expand Down Expand Up @@ -1729,7 +1726,7 @@ convert_settings() # prior_file, new_file
;;

"computer")
# We now compute the value.
# As of ${COMBINED_BASE_VERSION}, we compute the value.
VALUE="$( get_computer )"
doV "${FIELD}" "VALUE" "${FIELD}" "text" "${NEW_FILE}"
;;
Expand All @@ -1738,12 +1735,11 @@ convert_settings() # prior_file, new_file
"XX_END_XX")
;;

# These don't exist anymore:
# ===== Deleted in ${COMBINED_BASE_VERSION}.
"autofocus" | "background" | "alwaysshowadvanced" | \
"newexposure" | "experimentalexposure" | "showbrightness")
;;

# These two were deleted in ${COMBINED_BASE_VERSION}:
"brightness" | "daybrightness" | "nightbrightness")
if [[ ! -f ${DISPLAYED_BRIGHTNESS_MSG} ]]; then
touch "${DISPLAYED_BRIGHTNESS_MSG}"
Expand All @@ -1761,7 +1757,19 @@ convert_settings() # prior_file, new_file
fi
;;

# These changed names:
# ===== Deleted after ${COMBINED_BASE_VERSION}.
"remotewebsitevideodestinationname" | \
"remotewebsitekeogramdestinationname" | \
"remotewebsitestartrailsdestinationname")
if [[ -n ${VALUE} && ! -f ${DISPLAYED_CHANGE_NAMES_MSG} ]]; then
touch "${DISPLAYED_CHANGE_NAMES_MSG}"
MSG="Changing timelapse, keogram, and/or startrails names"
MSG+="\nfor remote Websites is no longer allowed."
display_msg --log notice "${MSG}"
fi
;;

# ===== Names changed in ${COMBINED_BASE_VERSION}
"darkframe")
doV "${FIELD}" "VALUE" "takedarkframes" "boolean" "${NEW_FILE}"
;;
Expand All @@ -1781,7 +1789,7 @@ convert_settings() # prior_file, new_file
doV "${FIELD}" "VALUE" "remotewebsiteimageurl" "text" "${NEW_FILE}"
;;

# These now have day and night versions:
# ===== Now have day and night versions as of ${COMBINED_BASE_VERSION}
"awb" | "autowhitebalance")
FIELD="awb"
doV "${FIELD}" "VALUE" "day${FIELD}" "boolean" "${NEW_FILE}"
Expand Down Expand Up @@ -2087,9 +2095,6 @@ convert_ftp_sh()
doV "NEW" "X" "useremotewebsite" "boolean" "${NEW_FILE}"

doV "" "IMG_UPLOAD_ORIGINAL_NAME" "remotewebsiteimageuploadoriginalname" "boolean" "${NEW_FILE}"
doV "" "VIDEOS_DESTINATION_NAME" "remotewebsitevideodestinationname" "text" "${NEW_FILE}"
doV "" "KEOGRAM_DESTINATION_NAME" "remotewebsitekeogramdestinationname" "text" "${NEW_FILE}"
doV "" "STARTRAILS_DESTINATION_NAME" "remotewebsitestartrailsdestinationname" "text" "${NEW_FILE}"
doV "" "REMOTE_HOST" "REMOTEWEBSITE_HOST" "text" "${ALLSKY_ENV}"
doV "" "REMOTE_PORT" "REMOTEWEBSITE_PORT" "text" "${ALLSKY_ENV}"

Expand Down
Loading
Loading