Skip to content

Commit c5f7fdf

Browse files
Merge pull request #4992 from AllskyTeam/4990-add-trixie-support
4990 add trixie support
2 parents 596a2ef + 27a176a commit c5f7fdf

3 files changed

Lines changed: 22 additions & 21 deletions

File tree

html/cgi-bin/format.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import cgi
1+
#import cgi
22
import os
3+
import sys
34
import json
45
import re
56
import time
67
import locale
78
from datetime import datetime, timedelta, date
9+
import urllib.parse
810

911
class ALLSKYFORMAT:
1012

@@ -25,13 +27,24 @@ def __init__(self):
2527
except:
2628
pass
2729

28-
formData = cgi.FieldStorage()
29-
30-
self._config = formData["config"].value
31-
self._fields = formData["fields"].value
30+
#formData = cgi.FieldStorage()
31+
formData = self._get_params()
32+
33+
self._config = formData.get("config", [None])[0]
34+
self._fields = formData.get("fields", [None])[0]
35+
3236
self._jsonConfig = json.loads(self._config)
3337
self._jsonFields = json.loads(self._fields)
3438
self._getAllSkyVariables()
39+
40+
def _get_params(self):
41+
if os.environ.get("REQUEST_METHOD", "") == "POST":
42+
length = int(os.environ.get("CONTENT_LENGTH", "0"))
43+
data = sys.stdin.read(length)
44+
else:
45+
data = os.environ.get("QUERY_STRING", "")
46+
return urllib.parse.parse_qs(data)
47+
3548

3649
def _getAllSkyVariables(self):
3750
# Can't use ALLSKY_TMP since it's not defined

install.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@ source "${ALLSKY_SCRIPTS}/functions.sh" || exit "${EXIT_ERROR_STOP}"
1313
#shellcheck source-path=scripts
1414
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit "${EXIT_ERROR_STOP}"
1515

16-
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX TODO: temporary Trixie check
17-
if [[ ${PI_OS} == "trixie" ]]; then
18-
echo -e "\n\n================================\n"
19-
echo "Allsky does not yet work with the new Trixie operating system."
20-
echo "Please use Bookworm instead."
21-
echo "We will announce in the Allsky GitHub Discussions page when Trixie support is available."
22-
echo -e "\nCheck back in a week or so."
23-
echo -e "\n================================"
24-
exit 0
25-
fi
26-
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
27-
2816
# Default may be 700 (HOME) or 750 (ALLSKY_HOME) so web server can't read it
2917
chmod 755 "${HOME}" "${ALLSKY_HOME}" || exit "${EXIT_ERROR_STOP}"
3018
cd "${ALLSKY_HOME}" || exit "${EXIT_ERROR_STOP}"
@@ -1047,7 +1035,7 @@ install_webserver_et_al()
10471035
display_msg --log progress "Installing the web server."
10481036
TMP="${ALLSKY_LOGS}/lighttpd.install.log"
10491037
run_aptGet \
1050-
lighttpd php-cgi php-gd hostapd dnsmasq avahi-daemon hwinfo tree i2c-tools \
1038+
lighttpd php-fpm php-gd hostapd dnsmasq avahi-daemon hwinfo tree i2c-tools \
10511039
> "${TMP}" 2>&1
10521040
check_success $? "lighttpd installation failed" "${TMP}" "${DEBUG}" \
10531041
|| exit_with_image 1 "${STATUS_ERROR}" "lighttpd installation failed"
@@ -1057,7 +1045,7 @@ install_webserver_et_al()
10571045
create_lighttpd_log_file
10581046

10591047
# Ignore output since it may already be enabled.
1060-
sudo lighty-enable-mod fastcgi-php > /dev/null 2>&1
1048+
sudo lighty-enable-mod fastcgi-php-fpm > /dev/null 2>&1
10611049

10621050
TMP="${ALLSKY_LOGS}/lighttpd.start.log"
10631051
sudo systemctl start lighttpd > "${TMP}" 2>&1
@@ -3340,7 +3328,7 @@ install_Python()
33403328

33413329
NUM_TO_INSTALL=$( wc -l < "${REQUIREMENTS_FILE}" )
33423330

3343-
if [[ ${PI_OS} == "bookworm" ]]; then
3331+
if [[ ${PI_OS} == "bookworm" || ${PI_OS} == "trixie" ]]; then
33443332
PKGs="python3-full libgfortran5 libopenblas0-pthread"
33453333
display_msg --logonly progress "Installing ${PKGs}."
33463334
TMP="${ALLSKY_LOGS}/python3-full.log"

scripts/functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ function activate_python_venv()
13641364

13651365
local ACTIVATE="${ALLSKY_PYTHON_VENV}/bin/activate"
13661366

1367-
if [[ ${PI_OS} == "bookworm" && -s ${ACTIVATE} ]]; then
1367+
if [[ ( ${PI_OS} == "bookworm" || ${PI_OS} == "trixie" ) && -s ${ACTIVATE} ]]; then
13681368
#shellcheck disable=SC1090,SC1091
13691369
source "${ACTIVATE}" || exit 1
13701370
PYTHON_VENV_ACTIVATED="true"

0 commit comments

Comments
 (0)