forked from kamba4/sunders
Compare commits
No commits in common. "b8e6c4605c9da05245018887f0c9ea6395b618ef" and "325c3c665d16478e6d9871dc3a4fa800fedfdeda" have entirely different histories.
b8e6c4605c
...
325c3c665d
17 changed files with 117704 additions and 150 deletions
|
@ -16,6 +16,11 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Hello World Docker image
|
||||||
|
run: |
|
||||||
|
echo -e 'FROM alpine\nCMD echo Hello, World!' > Dockerfile
|
||||||
|
docker build -t hello-world:latest .
|
||||||
|
|
||||||
- name: Login to Container Registry
|
- name: Login to Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -23,22 +28,7 @@ jobs:
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push web image to Container Registry
|
- name: Push Docker image to Container Registry
|
||||||
run: |
|
run: |
|
||||||
docker build -t web:latest .
|
docker tag hello-world:latest git.hamburg.ccc.de/ccchh/sunders/tmp:latest
|
||||||
docker tag web:latest git.hamburg.ccc.de/ccchh/sunders/web:latest
|
docker push git.hamburg.ccc.de/ccchh/sunders/tmp:latest
|
||||||
docker push git.hamburg.ccc.de/ccchh/sunders/web:latest
|
|
||||||
working-directory: ./www/sunders
|
|
||||||
|
|
||||||
- name: Build and push db image to Container Registry
|
|
||||||
run: |
|
|
||||||
docker build -t db:latest .
|
|
||||||
docker tag db:latest git.hamburg.ccc.de/ccchh/sunders/db:latest
|
|
||||||
docker push git.hamburg.ccc.de/ccchh/sunders/db:latest
|
|
||||||
working-directory: ./home/sunders/init_cameras/db
|
|
||||||
|
|
||||||
- name: Start Docker Compose services
|
|
||||||
run: |
|
|
||||||
docker compose up -d --wait
|
|
||||||
docker compose down
|
|
||||||
working-directory: /
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
change_file.osc*
|
change_file.osc*
|
||||||
|
config.php
|
||||||
lastState.txt
|
lastState.txt
|
||||||
lastStatisticsUpdate.txt
|
lastStatisticsUpdate.txt
|
||||||
log.*
|
log.*
|
||||||
|
|
|
@ -84,7 +84,7 @@ If you like to run Surveillance under Surveillance on your own LAMP or LNMP serv
|
||||||
|
|
||||||
- Rename the file **config.php.example** to **config.php**.
|
- Rename the file **config.php.example** to **config.php**.
|
||||||
|
|
||||||
- Open the file **config.php** and enter the **MYSQL_PASSWORD** of the database user **camera**. Furthermore enter the **REPLICATE_URL** that fits to your project, e.g. from [planet.openstreetmap.org](https://planet.openstreetmap.org/replication/) or from [download.openstreetmap.fr](http://download.openstreetmap.fr/replication/). Here are some examples:
|
- Open the file **config.php** and enter the **MYSQL_PASSWD** of the database user **camera**. Furthermore enter the **REPLICATE_URL** that fits to your project, e.g. from [planet.openstreetmap.org](https://planet.openstreetmap.org/replication/) or from [download.openstreetmap.fr](http://download.openstreetmap.fr/replication/). Here are some examples:
|
||||||
|
|
||||||
`https://planet.openstreetmap.org/replication/minute/`
|
`https://planet.openstreetmap.org/replication/minute/`
|
||||||
`http://download.openstreetmap.fr/replication/planet/minute/`
|
`http://download.openstreetmap.fr/replication/planet/minute/`
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
version: '3.8'
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: git.hamburg.ccc.de/ccchh/sunders/db:latest
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: rootpassword # ${{secrets.MYSQL_ROOT_PASSWORD}}
|
|
||||||
MYSQL_DATABASE: camera # ${{secrets.MYSQL_DATABASE}}
|
|
||||||
MYSQL_USER: camera # ${{secrets.MYSQL_USER}}
|
|
||||||
MYSQL_PASSWORD: camerapassword # ${{secrets.MYSQL_PASSWORD}}
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
web:
|
|
||||||
image: git.hamburg.ccc.de/ccchh/sunders/web:latest
|
|
||||||
environment:
|
|
||||||
MYSQL_HOST: db
|
|
||||||
MYSQL_DB: camera # ${{secrets.MYSQL_DATABASE}}
|
|
||||||
MYSQL_USER: camera # ${{secrets.MYSQL_USER}}
|
|
||||||
MYSQL_PASSWORD: camerapassword # ${{secrets.MYSQL_PASSWORD}}
|
|
||||||
DEFAULT_ZOOM: 12
|
|
||||||
DEFAULT_LAT: 0
|
|
||||||
DEFAULT_LON: 0
|
|
||||||
DEFAULT_LANGUAGE: en
|
|
||||||
ports:
|
|
||||||
- "8080:80"
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
volumes:
|
|
||||||
- ./www/sunders:/var/www/html
|
|
|
@ -1,3 +0,0 @@
|
||||||
FROM mysql:9.4
|
|
||||||
|
|
||||||
COPY ./scripts /docker-entrypoint-initdb.d/
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
create database camera;
|
||||||
use camera;
|
use camera;
|
||||||
|
|
||||||
|
grant all privileges on camera.* to camera@localhost identified by 'xxxxxxxx';
|
||||||
|
grant select on camera.* to camselect@localhost;
|
||||||
|
|
||||||
CREATE TABLE position (
|
CREATE TABLE position (
|
||||||
id BIGINT PRIMARY KEY,
|
id BIGINT PRIMARY KEY,
|
||||||
latitude INT,
|
latitude INT,
|
117667
home/sunders/init_cameras/db/initializeDB_planet_20120912.sql
Normal file
117667
home/sunders/init_cameras/db/initializeDB_planet_20120912.sql
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,60 +0,0 @@
|
||||||
DELETE FROM position; DELETE FROM tag; COMMIT;
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (135795, 451957648,57348639);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'lat', '45.1957648');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'lon', '5.7348639');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'userid', 'Syl');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'version', '4');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'timestamp', '2010-12-18T11:30:49Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135795, 'source', 'v2 ; cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre ; mise à jour : 2009');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (135839, 451871545,57275523);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'lat', '45.1871545');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'lon', '5.7275523');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'userid', 'Virgile1994');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'version', '10');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'timestamp', '2012-07-01T19:15:11Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'highway', 'traffic_signals');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135839, 'source', 'v2 ; cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre ; mise à jour : 2009');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (135873, 451948183,57306964);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'lat', '45.1948183');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'lon', '5.7306964');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'userid', 'Gilles Nogues');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'version', '10');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'timestamp', '2012-06-29T09:51:02Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'highway', 'traffic_signals');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (135873, 'source', 'v2 ; cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre ; mise à jour : 2009');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (146663, 482074496,116513533);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'lat', '48.2074496');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'lon', '11.6513533');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'userid', 'Basstoelpel');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'version', '4');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'timestamp', '2009-05-23T15:17:37Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146663, 'surveillance', 'public');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (146665, 482028333,116606119);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'lat', '48.2028333');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'lon', '11.6606119');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'userid', 'holger_l');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'version', '4');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'timestamp', '2009-05-13T22:35:13Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146665, 'surveillance', 'public');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (146676, 481989327,116709193);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'lat', '48.1989327');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'lon', '11.6709193');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'userid', 'Peter14');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'version', '4');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'timestamp', '2012-01-07T15:07:28Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146676, 'surveillance', 'public');
|
|
||||||
INSERT INTO position (id, latitude, longitude) VALUES (146679, 481954845,116828458);
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'lat', '48.1954845');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'lon', '11.6828458');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'userid', 'holger_l');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'version', '3');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'timestamp', '2009-05-13T22:35:14Z');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'man_made', 'surveillance');
|
|
||||||
INSERT INTO tag (id, k, v) VALUES (146679, 'surveillance', 'public');
|
|
||||||
COMMIT;
|
|
|
@ -5,7 +5,7 @@ define('REPLICATE_URL', 'https://planet.openstreetmap.org/replication/minute');
|
||||||
define('MYSQL_HOST', 'localhost');
|
define('MYSQL_HOST', 'localhost');
|
||||||
define('MYSQL_DB', 'camera');
|
define('MYSQL_DB', 'camera');
|
||||||
define('MYSQL_USER', 'camera');
|
define('MYSQL_USER', 'camera');
|
||||||
define('MYSQL_PASSWORD', 'xxxxxxxx');
|
define('MYSQL_PASSWD', 'xxxxxxxx');
|
||||||
|
|
||||||
define('USE_STATISTICS', false);
|
define('USE_STATISTICS', false);
|
||||||
define('WEBSERVICE_COUNTRY_URL', 'http://api.geonames.org/countryCode');
|
define('WEBSERVICE_COUNTRY_URL', 'http://api.geonames.org/countryCode');
|
||||||
|
|
|
@ -15,7 +15,7 @@ $id = 0;
|
||||||
$latitude = 0;
|
$latitude = 0;
|
||||||
$longitude = 0;
|
$longitude = 0;
|
||||||
|
|
||||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWD, MYSQL_DB);
|
||||||
|
|
||||||
if($mysqli->connect_errno) {
|
if($mysqli->connect_errno) {
|
||||||
echo "Error while connecting to DB : $mysqli->error \n" ;
|
echo "Error while connecting to DB : $mysqli->error \n" ;
|
||||||
|
|
|
@ -4,7 +4,7 @@ include "config.php";
|
||||||
|
|
||||||
if (USE_STATISTICS) {
|
if (USE_STATISTICS) {
|
||||||
|
|
||||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWD, MYSQL_DB);
|
||||||
|
|
||||||
if ($mysqli->connect_errno) {
|
if ($mysqli->connect_errno) {
|
||||||
echo "Error while connecting to DB : ".$mysqli->error." \n" ;
|
echo "Error while connecting to DB : ".$mysqli->error." \n" ;
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
FROM php:8.2-apache
|
|
||||||
COPY . /var/www/html/
|
|
||||||
WORKDIR /var/www/html/
|
|
||||||
# Enable Apache mod_rewrite if needed
|
|
||||||
RUN a2enmod rewrite
|
|
||||||
# Set permissions if needed
|
|
||||||
ENV DEFAULT_ZOOM=12
|
|
||||||
ENV DEFAULT_LAT=0
|
|
||||||
ENV DEFAULT_LON=0
|
|
||||||
ENV DEFAULT_LANGUAGE=en
|
|
||||||
ENV MYSQL_PASSWORD=changeme
|
|
||||||
# Optionally install extensions
|
|
||||||
RUN docker-php-ext-install mysqli bcmath
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include 'config.php';
|
include $pathToWebFolder.'config.php';
|
||||||
|
|
||||||
define('MAX_POINTS_FOR_QUICKHULL', 3000);
|
define('MAX_POINTS_FOR_QUICKHULL', 3000);
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
$divDiag2 = ($divWidth * $divWidth) + ($divHeight * $divHeight);
|
$divDiag2 = ($divWidth * $divWidth) + ($divHeight * $divHeight);
|
||||||
|
|
||||||
/* Connect to database */
|
/* Connect to database */
|
||||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWD, MYSQL_DB);
|
||||||
if($mysqli->connect_errno) {
|
if($mysqli->connect_errno) {
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
$result = '{"error":"error while connecting to db : ' . $mysqli->error . '"}';
|
$result = '{"error":"error while connecting to db : ' . $mysqli->error . '"}';
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?php
|
|
||||||
define('DEFAULT_ZOOM', getenv('DEFAULT_ZOOM') ?: 11);
|
|
||||||
define('DEFAULT_LAT', getenv('DEFAULT_LAT') ?: 53.5550);
|
|
||||||
define('DEFAULT_LON', getenv('DEFAULT_LON') ?: 10.0099);
|
|
||||||
define('DEFAULT_LANGUAGE', getenv('DEFAULT_LANGUAGE') ?: 'en');
|
|
||||||
define('DEFAULT_PIE', 'country');
|
|
||||||
define('DEFAULT_TIME', 'single');
|
|
||||||
|
|
||||||
define('MYSQL_HOST', getenv('MYSQL_HOST') ?: '');
|
|
||||||
define('MYSQL_DB', getenv('MYSQL_DB') ?: '');
|
|
||||||
define('MYSQL_USER', getenv('MYSQL_USER') ?: '');
|
|
||||||
define('MYSQL_PASSWORD', getenv('MYSQL_PASSWORD') ?: '');
|
|
||||||
|
|
||||||
define('USE_STATISTICS', false);
|
|
||||||
?>
|
|
17
www/sunders/config.php.example
Normal file
17
www/sunders/config.php.example
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
define('DEFAULT_ZOOM', 15);
|
||||||
|
define('DEFAULT_LAT', 52.37672572);
|
||||||
|
define('DEFAULT_LON', 9.73787785);
|
||||||
|
define('DEFAULT_LANGUAGE', 'en');
|
||||||
|
define('DEFAULT_PIE', 'country');
|
||||||
|
define('DEFAULT_TIME', 'single');
|
||||||
|
|
||||||
|
define('MYSQL_HOST', 'localhost');
|
||||||
|
define('MYSQL_DB', 'camera');
|
||||||
|
define('MYSQL_USER', 'camselect');
|
||||||
|
define('MYSQL_PASSWD', null);
|
||||||
|
|
||||||
|
define('USE_STATISTICS', false);
|
||||||
|
|
||||||
|
?>
|
|
@ -138,7 +138,7 @@
|
||||||
$statsQueryObject = $levelObject->{$statsKey};
|
$statsQueryObject = $levelObject->{$statsKey};
|
||||||
|
|
||||||
/* Connect to database */
|
/* Connect to database */
|
||||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWD, MYSQL_DB);
|
||||||
if($mysqli->connect_errno) {
|
if($mysqli->connect_errno) {
|
||||||
echo 'Error while connecting to DB : $mysqli->error \n' ;
|
echo 'Error while connecting to DB : $mysqli->error \n' ;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue