Merge branch 'main' of ssh://git.hamburg.ccc.de/CCCHH/sunders
All checks were successful
Build (and tag) Images / Build data_handler Image (push) Successful in 54s
Build (and tag) Images / Build web Image (push) Successful in 1m1s

This commit is contained in:
Stefan Bethke 2026-11-18 22:13:58 +01:00
commit 0dc7dcb77f
5 changed files with 120 additions and 17 deletions

View file

@ -1,4 +1,4 @@
FROM docker.io/library/php:apache
FROM docker.io/library/php:8.5.12-apache
RUN docker-php-ext-install mysqli bcmath

View file

@ -1,5 +1,4 @@
<?php
error_reporting(0);
// Convert the content of the symbology JSON file to HTML.
function addListSymbology($jsonPath, $i18n, $i18nDefault) {
global $pathToWebFolder;

View file

@ -1,5 +1,4 @@
<?php
error_reporting(0);
include $pathToWebFolder.'config.php';
define('MAX_POINTS_FOR_QUICKHULL', 3000);

View file

@ -13,4 +13,15 @@
define('MYSQL_PASSWORD', getenv('CAMERA_SELECT_USER_PASSWORD') ?: '');
define('USE_STATISTICS', false);
$environment = getenv('APP_ENV') ?: 'production';
if ($environment === 'development') {
ini_set('display_errors', 1);
error_reporting(E_ALL);
return;
}
ini_set('display_errors', 0);
error_reporting(0);
?>

View file

@ -0,0 +1,30 @@
<?php
error_reporting(0);
include $pathToWebFolder.'config.php';
try {
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
if($mysqli->connect_errno) {
throw new Exception("Could not connect to database");
}
$syncstate_querry = $mysqli->query("SELECT * FROM sync_state WHERE k = 'sequenceNumber'");
while($row = $syncstate_querry->fetch_assoc()) {
$syncstate = array('sequenceNumber' => $row["v"]);
}
$result = json_encode($syncstate);
$mysqli->close();
header('Content-type: application/json; Charset : utf-8');
echo $result;
mysqli_report(MYSQLI_REPORT_OFF);
} catch (Exception $e) {
http_response_code(503);
header('Content-type: application/json');
$result = '{"error":"Database unavailable"}';
echo $result;
}
?>