Skip to content

Commit 9c3c180

Browse files
authored
Merge pull request #4701 from AllskyTeam/v2024.12.06_04
V2024.12.06 04
2 parents fa7282f + 5db13ff commit 9c3c180

57 files changed

Lines changed: 3318 additions & 1811 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2024.12.06_03-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)
1+
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2024.12.06_04-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)
22

3-
This is the source code for the Allsky Camera project described [on Instructables](http://www.instructables.com/id/Wireless-All-Sky-Camera/).
3+
This is the source code for the Allsky Camera project. <!-- described [on Instructables](http://www.instructables.com/id/Wireless-All-Sky-Camera/). -->
44
&nbsp;
55
<p align="center">
66
<img src="https://github.com/AllskyTeam/allsky/blob/master/assets/allsky_camera.png" width="50%" title="Example of an allsky camera">
@@ -70,7 +70,7 @@ A public page is also available in order to view the current image without havin
7070
http://your_raspberry_IP/public.php
7171
```
7272

73-
Make sure this page is publically viewable.
73+
Make sure this page is publicly viewable.
7474
If it is behind a firewall consult the documentation for your network equipment for information on allowing inbound connections.
7575

7676
The WebUI has a link to the Allsky Documentation which describes all the settings Allsky uses as well as troubleshooting information.

allsky.sh

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2154 # referenced but not assigned - from convertJSON.php
23

34
[[ -z ${ALLSKY_HOME} ]] && export ALLSKY_HOME="$( realpath "$( dirname "${BASH_ARGV0}" )" )"
45
ME="$( basename "${BASH_ARGV0}" )"
@@ -104,10 +105,13 @@ if [[ ${NEEDS_REBOOT} == "true" ]]; then
104105
doExit "${EXIT_ERROR_STOP}" "RebootNeeded" "" "The Pi needs to be rebooted."
105106
fi
106107

108+
# Get all settings we're going to use.
109+
#shellcheck disable=SC2119
110+
getAllSettings --var "lastchanged cameranumber locale" || exit 1
111+
107112
# If the "lastchanged" setting is missing, the user needs to review/change the settings.
108113
# This will happen after an installation or upgrade, which also sets the Allsky status.
109-
LAST_CHANGED="$( settings ".lastchanged" )"
110-
if [[ -z ${LAST_CHANGED} ]]; then
114+
if [[ -z ${S_lastchanged} ]]; then
111115
STATUS="$( get_allsky_status )"
112116
if [[ ${STATUS} == "${ALLSKY_STATUS_REBOOT_NEEDED}" ]]; then
113117
# It's been rebooted and now we need to force "lastchanged" to be set.
@@ -159,7 +163,7 @@ if [[ -d ${PRIOR_ALLSKY_DIR} ]]; then
159163
MSG="Reminder: your prior Allsky is still in '${PRIOR_ALLSKY_DIR}'."
160164
MSG+="\nIf you are no longer using it, it can be removed to save disk space."
161165
"${ALLSKY_SCRIPTS}/addMessage.sh" --id AM_RM_PRIOR --type info --msg "${MSG}" \
162-
--cmd "Click here to remove."
166+
--cmd "Click here to remove the directory and all its contents."
163167
touch "${ALLSKY_OLD_REMINDER}" # Sets the last time we displayed the message.
164168
fi
165169
fi
@@ -198,15 +202,17 @@ if [[ -f ${ALLSKY_POST_INSTALL_ACTIONS} ]]; then
198202
set_allsky_status "${ALLSKY_STATUS_ACTIONS_NEEDED}"
199203
doExit "${EXIT_ERROR_STOP}" "no-image" "" ""
200204
else
205+
# First delete the initial message if there since we're posting a reminder.
206+
"${ALLSKY_SCRIPTS}/addMessage.sh" --id AM_POST --delete
207+
201208
MSG="Reminder: Click here to see the action(s) that need to be performed."
202209
PIA="${ALLSKY_POST_INSTALL_ACTIONS/${ALLSKY_HOME}/}"
203-
"${ALLSKY_SCRIPTS}/addMessage.sh" --id AM_RM_POST --type warning --msg "${MSG}" --url "${PIA}" \
210+
"${ALLSKY_SCRIPTS}/addMessage.sh" --id AM_RM_POST --type warning \
211+
--msg "${MSG}" --url "${PIA}" \
204212
--cmd "\nOnce you perform them, click here to remove this message."
205213
fi
206214
fi
207215

208-
USE_NOTIFICATION_IMAGES="$( settings ".notificationimages" )" || exit "${EXIT_ERROR_STOP}"
209-
210216
# Get the list of connected cameras and make sure the one we want is connected.
211217
if [[ ${CAMERA_TYPE} == "ZWO" ]]; then
212218
RPi_COMMAND_TO_USE=""
@@ -350,11 +356,8 @@ sudo chmod 775 "${ALLSKY_ABORTS_DIR}"
350356

351357
rm -f "${ALLSKY_NOTIFICATION_LOG}" # clear out any notificatons from prior runs.
352358

353-
# Optionally display a notification image.
354-
if [[ ${USE_NOTIFICATION_IMAGES} == "true" ]]; then
355-
# Can do this in the background to speed up startup.
356-
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" --expires 0 "StartingUp" 2>&1 &
357-
fi
359+
# Can do this in the background to speed up startup.
360+
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" --expires 0 "StartingUp" 2>&1 &
358361

359362
# Only pass settings that are used by the capture program.
360363
if ! ARGS="$( "${ALLSKY_SCRIPTS}/convertJSON.php" --capture-only )" ; then
@@ -394,14 +397,13 @@ trap "catch_signal" SIGTERM SIGINT SIGHUP
394397
set_allsky_status "${ALLSKY_STATUS_STARTING}"
395398

396399
# Run the camera-specific capture program - this is the main attraction...
397-
CAMERA_NUMBER="$( settings ".cameranumber" )"
398-
CAMERA_NUMBER="${CAMERA_NUMBER:-0}" # default
400+
CAMERA_NUMBER="${S_cameranumber:-0}" # default
399401
"${ALLSKY_BIN}/${CAPTURE}" \
400402
-debuglevel "${ALLSKY_DEBUG_LEVEL}" \
401403
-cmd "${RPi_COMMAND_TO_USE}" \
402404
-cameramodel "${CAMERA_MODEL}" \
403405
-cameranumber "${CAMERA_NUMBER}" \
404-
-locale "$( settings ".locale" )" \
406+
-locale "${S_locale}" \
405407
-config "${ARGS_FILE}"
406408
RETCODE=$?
407409

@@ -420,9 +422,7 @@ if [[ ${RETCODE} -eq ${EXIT_RESTARTING} ]]; then
420422
else
421423
NOTIFICATION_TYPE="Restarting"
422424
fi
423-
if [[ ${USE_NOTIFICATION_IMAGES} == "true" ]]; then
424-
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" "${NOTIFICATION_TYPE}"
425-
fi
425+
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" "${NOTIFICATION_TYPE}"
426426
set_allsky_status "${ALLSKY_STATUS_RESTARTING}"
427427
doExit 0 "${NOTIFICATION_TYPE}" # use 0 so the service is restarted
428428
fi
@@ -436,9 +436,7 @@ if [[ ${RETCODE} -eq ${EXIT_RESET_USB} ]]; then
436436
else
437437
NOTIFICATION_TYPE="Restarting"
438438
fi
439-
if [[ ${USE_NOTIFICATION_IMAGES} == "true" ]]; then
440-
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" "${NOTIFICATION_TYPE}"
441-
fi
439+
"${ALLSKY_SCRIPTS}/copyNotificationImage.sh" "${NOTIFICATION_TYPE}"
442440
set_allsky_status "${ALLSKY_STATUS_ERROR}"
443441
doExit 0 "" # use 0 so the service is restarted
444442
fi
@@ -457,11 +455,6 @@ if [[ ${RETCODE} -ge ${EXIT_ERROR_STOP} ]]; then
457455
fi
458456

459457
# Some other error
460-
if [[ ${USE_NOTIFICATION_IMAGES} == "true" ]]; then
461-
# If started by the service, it will restart us once we exit.
462-
set_allsky_status "${ALLSKY_STATUS_NOT_RUNNING}"
463-
doExit "${RETCODE}" "NotRunning"
464-
else
465-
set_allsky_status "${ALLSKY_STATUS_SEE_WEBUI}"
466-
doExit "${RETCODE}" ""
467-
fi
458+
# If started by the service, it will restart us once we exit.
459+
set_allsky_status "${ALLSKY_STATUS_NOT_RUNNING}"
460+
doExit "${RETCODE}" "NotRunning"

config_repo/allskyDefines.inc.repo

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ define('ALLSKY_OLD_REMINDER', 'XX_ALLSKY_OLD_REMINDER_XX');
1515
define('ALLSKY_POST_INSTALL_ACTIONS', 'XX_ALLSKY_POST_INSTALL_ACTIONS_XX');
1616
define('ALLSKY_ABORTS_DIR', 'XX_ALLSKY_ABORTS_DIR_XX');
1717
define('ALLSKY_WEBUI', 'XX_ALLSKY_WEBUI_XX');
18+
define('ALLSKY_SUPPORT_DIR', 'XX_ALLSKY_SUPPORT_DIR_XX');
1819
define('ALLSKY_WEBSITE', 'XX_ALLSKY_WEBSITE_XX');
1920
define('ALLSKY_WEBSITE_LOCAL_CONFIG_NAME', 'XX_ALLSKY_WEBSITE_LOCAL_CONFIG_NAME_XX');
2021
define('ALLSKY_WEBSITE_REMOTE_CONFIG_NAME', 'XX_ALLSKY_WEBSITE_REMOTE_CONFIG_NAME_XX');
2122
define('ALLSKY_WEBSITE_LOCAL_CONFIG', 'XX_ALLSKY_WEBSITE_LOCAL_CONFIG_XX');
2223
define('ALLSKY_WEBSITE_REMOTE_CONFIG', 'XX_ALLSKY_WEBSITE_REMOTE_CONFIG_XX');
2324
define('ALLSKY_OVERLAY', 'XX_ALLSKY_OVERLAY_XX');
25+
define('IMG_DIR', 'XX_IMG_DIR_XX');
2426
define('ALLSKY_ENV', 'XX_ALLSKY_ENV_XX');
2527
define('MY_OVERLAY_TEMPLATES', 'XX_MY_OVERLAY_TEMPLATES_XX');
2628
define('ALLSKY_MODULES', 'XX_ALLSKY_MODULES_XX');
@@ -30,13 +32,20 @@ define('ALLSKY_GROUP', 'XX_ALLSKY_GROUP_XX');
3032
define('WEBSERVER_OWNER', 'XX_WEBSERVER_OWNER_XX');
3133
define('WEBSERVER_GROUP', 'XX_WEBSERVER_GROUP_XX');
3234
define('ALLSKY_REPO', 'XX_ALLSKY_REPO_XX');
35+
define('GITHUB_ROOT', 'XX_GITHUB_ROOT_XX');
36+
define('GITHUB_ALLSKY_REPO', 'XX_GITHUB_ALLSKY_REPO_XX');
37+
define('GITHUB_ALLSKY_MODULES_REPO', 'XX_GITHUB_ALLSKY_MODULES_REPO_XX');
3338
define('ALLSKY_VERSION', 'XX_ALLSKY_VERSION_XX');
3439
define('ALLSKY_STATUS', 'XX_ALLSKY_STATUS_XX');
40+
define('ALLSKY_STATUS_INSTALLING', 'XX_ALLSKY_STATUS_INSTALLING_XX');
41+
define('ALLSKY_STATUS_NOT_RUNNING', 'XX_ALLSKY_STATUS_NOT_RUNNING_XX');
42+
define('ALLSKY_STATUS_RUNNING', 'XX_ALLSKY_STATUS_RUNNING_XX');
3543
define('ALLSKY_STATUS_NEEDS_REVIEW', 'XX_ALLSKY_STATUS_NEEDS_REVIEW_XX');
3644
define('ALLSKY_STATUS_NEEDS_CONFIGURATION', 'XX_ALLSKY_STATUS_NEEDS_CONFIGURATION_XX');
3745
define('RASPI_CONFIG', 'XX_RASPI_CONFIG_XX');
3846
define('RASPI_ADMIN_DETAILS', 'XX_RASPI_CONFIG_XX/raspap.auth');
3947
define('CONFIG_UPDATE_STRING', 'XX_NEED_TO_UPDATE_XX');
48+
define('EXIT_PARTIAL_OK', 'XX_EXIT_PARTIAL_OK_XX');
4049

4150
// Split the placeholder so it doesn't get replaced.
4251
if (ALLSKY_HOME == "XX_ALLSKY_HOME" . "_XX") {

config_repo/options.json.repo

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@
15721572
"type" : "header-tab"
15731573
},
15741574
{
1575-
"name" : "timelapseheader",
1575+
"name" : "keogramheader",
15761576
"label" : "Keogram and Startrails Settings",
15771577
"type" : "header"
15781578
},
@@ -1634,7 +1634,7 @@
16341634
},
16351635
{
16361636
"name" : "keogramfontcolor",
1637-
"default" : "#fff",
1637+
"default" : "#ffffff",
16381638
"description" : "Font color.",
16391639
"label" : "Font Color",
16401640
"label_prefix" : "Keograms",
@@ -2398,16 +2398,6 @@
23982398
"carryforward" : true
23992399
},
24002400
{
2401-
"name" : "notificationimages",
2402-
"default" : true,
2403-
"description" : "Enable to display notification images, e.g., 'Camera is off during the day'.<br>While these messages appear in the WebUI and Allsky Website, they are not saved so don't appear in timelapse, startrails, or keograms.",
2404-
"label" : "Notification Images",
2405-
"type" : "boolean",
2406-
"usage" : "capture",
2407-
"carryforward" : true,
2408-
"action" : "reload"
2409-
},
2410-
{
24112401
"name" : "webuidatafiles",
24122402
"default" : "",
24132403
"description" : "See the documentation for a <a allsky='true' external='true' href='/documentation/settings/allsky.html'>description of this setting</a>.",

config_repo/sudoers.repo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ www-data ALL=(ALL) NOPASSWD:/sbin/ifup
44
www-data ALL=(ALL) NOPASSWD:/sbin/ifdown
55
www-data ALL=(ALL) NOPASSWD:/sbin/ifup
66
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf
7-
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant.conf
87
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli scan_results
98
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli scan
109
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli reconfigure
11-
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf
1210
www-data ALL=(ALL) NOPASSWD:/etc/init.d/hostapd start
1311
www-data ALL=(ALL) NOPASSWD:/etc/init.d/hostapd stop
1412
www-data ALL=(ALL) NOPASSWD:/etc/init.d/dnsmasq start
1513
www-data ALL=(ALL) NOPASSWD:/etc/init.d/dnsmasq stop
16-
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf
1714
www-data ALL=(ALL) NOPASSWD:/sbin/shutdown -h now
1815
www-data ALL=(ALL) NOPASSWD:/sbin/reboot
1916
www-data ALL=(ALL) NOPASSWD:/bin/systemctl
@@ -22,7 +19,11 @@ www-data ALL=(ALL) NOPASSWD:/bin/chown
2219
www-data ALL=(ALL) NOPASSWD:/bin/chmod
2320
www-data ALL=(ALL) NOPASSWD:/bin/rm
2421
www-data ALL=(ALL) NOPASSWD:/bin/cp
22+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf
23+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf
24+
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant.conf
2525
www-data ALL=(ALL) NOPASSWD:/bin/mv
26+
www-data ALL=(ALL) NOPASSWD:/bin/mkdir
2627
www-data ALL=(ALL) NOPASSWD:/usr/bin/vcgencmd
2728
www-data ALL=(ALL) NOPASSWD:/usr/sbin/ifconfig
2829
www-data ALL=(ALL) NOPASSWD:/usr/bin/truncate

html/allsky/js/controller.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -782,11 +782,11 @@ function AppCtrl($scope, $timeout, $http, _) {
782782
2: "Quiet",
783783
3: "Unsettled",
784784
4: "Active",
785-
5: "Minor_storm",
786-
6: "Moderate_storm",
787-
7: "Strong_storm",
788-
8: "Severe_storm",
789-
9: "Extreme_storm",
785+
5: "Minor_Storm",
786+
6: "Moderate_Storm",
787+
7: "Strong_Storm",
788+
8: "Severe_Storm",
789+
9: "Extreme_Storm",
790790
100: "WARNING"
791791
};
792792
return scale[index];

0 commit comments

Comments
 (0)