From 6576b0a2b5a10ea0ce25f8362a41a9188ae5d255 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 17 Oct 2021 15:13:17 +0200 Subject: [PATCH 01/13] load mapquest leaflet scripts w/ api key --- www/index.html.de | 2 ++ www/index.html.en | 2 ++ 2 files changed, 4 insertions(+) diff --git a/www/index.html.de b/www/index.html.de index e4bec03..361dc3a 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -35,6 +35,8 @@ + + diff --git a/www/index.html.en b/www/index.html.en index ab8e817..b74d5b4 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -35,6 +35,8 @@ + + From 137b4a2761381db39ecf15c2078fc9fe8c633ab5 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 17 Oct 2021 16:56:58 +0200 Subject: [PATCH 02/13] fixing broken TopPlus baselayer --- www/map.js | 8 ++++++-- www/map.js.en | 6 +++++- www/misc.js | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/www/map.js b/www/map.js index c10bb19..05b6cfb 100644 --- a/www/map.js +++ b/www/map.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* add station marker */ @@ -153,9 +153,13 @@ $(document).ready(function() { case 'opentopo': // add OpenTopoMap tile layer L.tileLayer.provider('OpenTopoMap').addTo(map); break; - case 'mapnik': // add OpenStreetMap.Mapni tile layer + case 'mapnik': // add OpenStreetMap.Mapnik tile layer L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: Geodatenzentrum'}).addTo(map); + break; default: // use OpenStreetMap.DE as default L.tileLayer.provider('OpenStreetMap.DE').addTo(map); }; diff --git a/www/map.js.en b/www/map.js.en index 95f6f3b..1d97a00 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* add station marker */ @@ -157,6 +157,10 @@ $(document).ready(function() { case 'mapnik': // add OpenStreetMap.Mapni tile layer L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: Geodatenzentrum'}).addTo(map); + break; default: // use OpenStreetMap.DE as default L.tileLayer.provider('OpenStreetMap.DE').addTo(map); }; diff --git a/www/misc.js b/www/misc.js index 83e9c22..20261c5 100644 --- a/www/misc.js +++ b/www/misc.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* calculate marker radius from magnitude @@ -81,6 +81,7 @@ function parseQueryString() { } /* create global vars */ +var jahr = new Date().getFullYear(); var map; var openMarkerID; var eventTable = {}; From 2e5e998d8a0cc397cff75ea859a33caac02cab5d Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 18 Oct 2021 10:58:32 +0200 Subject: [PATCH 03/13] added mapquest baselayer option uses API key registered to https://araidne.geophysik.ruhr-uni-bochum.de/map/ --- www/index.html.de | 7 +++--- www/index.html.en | 11 ++++++---- www/map.js | 55 ++++++++++++++++++++++++++--------------------- www/map.js.en | 53 +++++++++++++++++++++++++-------------------- 4 files changed, 72 insertions(+), 54 deletions(-) diff --git a/www/index.html.de b/www/index.html.de index b091d4a..b6eb3c0 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -1,5 +1,5 @@ - + @@ -36,8 +36,9 @@ - - + + + diff --git a/www/index.html.en b/www/index.html.en index dd06d3d..b53e553 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -1,5 +1,5 @@ - + @@ -36,8 +36,9 @@ - - + + + @@ -156,7 +157,9 @@

Download as CSV file.

-
+
+

Loading text ...

+
diff --git a/www/map.js b/www/map.js index 05b6cfb..125c4b3 100644 --- a/www/map.js +++ b/www/map.js @@ -139,31 +139,38 @@ function initMapLink() { **********************************************************************/ $(document).ready(function() { - // create a map in the "map" div, set the view to a given place and zoom - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - - // create baselayer - switch ( config['map']['baselayer'] ) { - case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) - L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); - break; - case 'aerial': // add ESRI WordImagery tile layer - L.tileLayer.provider('Esri.WorldImagery').addTo(map); - break; - case 'opentopo': // add OpenTopoMap tile layer - L.tileLayer.provider('OpenTopoMap').addTo(map); - break; - case 'mapnik': // add OpenStreetMap.Mapnik tile layer - L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); - break; - case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) - L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', - {attribution: '© Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: Geodatenzentrum'}).addTo(map); - break; - default: // use OpenStreetMap.DE as default - L.tileLayer.provider('OpenStreetMap.DE').addTo(map); - }; + if ( config['map']['baselayer'] == 'mapquest' ) { + L.mapquest.key = 'RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt'; + map = L.mapquest.map('map', { + layers: L.mapquest.tileLayer('map'), + zoomControl: false, worldCopyJump: true + }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + } else { + // create a map in the "map" div, set the view to a given place and zoom + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + // create baselayer + switch ( config['map']['baselayer'] ) { + case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); + break; + case 'aerial': // add ESRI WordImagery tile layer + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapnik tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: Geodatenzentrum'}).addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); + }; + }; // add controls new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); diff --git a/www/map.js.en b/www/map.js.en index 1d97a00..0cb5d0a 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -139,30 +139,37 @@ function initMapLink() { **********************************************************************/ $(document).ready(function() { - // create a map in the "map" div, set the view to a given place and zoom - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - + if ( config['map']['baselayer'] == 'mapquest' ) { + L.mapquest.key = 'RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt'; + map = L.mapquest.map('map', { + layers: L.mapquest.tileLayer('map'), + zoomControl: false, worldCopyJump: true + }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + } else { + // create a map in the "map" div, set the view to a given place and zoom + map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - // create baselayer - switch ( config['map']['baselayer'] ) { - case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) - L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); - break; - case 'aerial': // add ESRI WordImagery tile layer - L.tileLayer.provider('Esri.WorldImagery').addTo(map); - break; - case 'opentopo': // add OpenTopoMap tile layer - L.tileLayer.provider('OpenTopoMap').addTo(map); - break; - case 'mapnik': // add OpenStreetMap.Mapni tile layer - L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); - break; - case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) - L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', - {attribution: '© Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: Geodatenzentrum'}).addTo(map); - break; - default: // use OpenStreetMap.DE as default - L.tileLayer.provider('OpenStreetMap.DE').addTo(map); + // create baselayer + switch ( config['map']['baselayer'] ) { + case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); + break; + case 'aerial': // add ESRI WordImagery tile layer + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapnik tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: Geodatenzentrum'}).addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); + }; }; // add controls new L.Control.Zoom({ position: 'topright' }).addTo(map); From 93c15d86403411094ddb2cb42a8380e88514efeb Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 18 Oct 2021 11:27:01 +0200 Subject: [PATCH 04/13] add Dockerfile for simple local testing usage: docker build -t seisobs-webapp:dev . docker run --name seisobs-map -d -p 8080:80 seisobs-webapp:dev --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5cf5659 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx +COPY www /usr/share/nginx/html \ No newline at end of file From 7e7f7d59a0eb49224e50e7801ce381e80c50dccc Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 18 Oct 2021 12:44:04 +0200 Subject: [PATCH 05/13] using mapquest leaflet sdk --- www/index.html.de | 3 +-- www/index.html.en | 3 +-- www/map.js | 60 +++++++++++++++++++++++------------------------ www/map.js.en | 60 +++++++++++++++++++++++------------------------ 4 files changed, 62 insertions(+), 64 deletions(-) diff --git a/www/index.html.de b/www/index.html.de index b6eb3c0..97ed9b4 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -36,8 +36,7 @@ - - + diff --git a/www/index.html.en b/www/index.html.en index b53e553..b6f4f3e 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -36,8 +36,7 @@ - - + diff --git a/www/map.js b/www/map.js index 125c4b3..9e8fa58 100644 --- a/www/map.js +++ b/www/map.js @@ -139,38 +139,38 @@ function initMapLink() { **********************************************************************/ $(document).ready(function() { - if ( config['map']['baselayer'] == 'mapquest' ) { - L.mapquest.key = 'RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt'; - map = L.mapquest.map('map', { - layers: L.mapquest.tileLayer('map'), - zoomControl: false, worldCopyJump: true - }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - } else { - // create a map in the "map" div, set the view to a given place and zoom - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + map = L.map('map', { + center: config['map']['centerDefault'], + zoom: config['map']['zoomDefault'], + zoomControl: false, + worldCopyJump: true + }); - // create baselayer - switch ( config['map']['baselayer'] ) { - case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) - L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); - break; - case 'aerial': // add ESRI WordImagery tile layer - L.tileLayer.provider('Esri.WorldImagery').addTo(map); - break; - case 'opentopo': // add OpenTopoMap tile layer - L.tileLayer.provider('OpenTopoMap').addTo(map); - break; - case 'mapnik': // add OpenStreetMap.Mapnik tile layer - L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); - break; - case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) - L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', - {attribution: '© Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: Geodatenzentrum'}).addTo(map); - break; - default: // use OpenStreetMap.DE as default - L.tileLayer.provider('OpenStreetMap.DE').addTo(map); - }; + // change baselayer if mapquest is not requested + switch ( config['map']['baselayer'] ) { + case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); + break; + case 'aerial': // add ESRI WordImagery tile layer + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapnik tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Bundesamt für Kartographie und Geodäsie ('+jahr+'), Datenquellen: Geodatenzentrum'}).addTo(map); + break; + case 'mapquest': + MQ.mapLayer().addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); }; + // add controls new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); diff --git a/www/map.js.en b/www/map.js.en index 0cb5d0a..380b742 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -139,38 +139,38 @@ function initMapLink() { **********************************************************************/ $(document).ready(function() { - if ( config['map']['baselayer'] == 'mapquest' ) { - L.mapquest.key = 'RPOPuz3lA2GGBtVpEU0ugxtVoGba53Dt'; - map = L.mapquest.map('map', { - layers: L.mapquest.tileLayer('map'), - zoomControl: false, worldCopyJump: true - }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); - } else { - // create a map in the "map" div, set the view to a given place and zoom - map = L.map('map', { zoomControl: false, worldCopyJump: true }).setView(config['map']['centerDefault'], config['map']['zoomDefault']); + map = L.map('map', { + center: config['map']['centerDefault'], + zoom: config['map']['zoomDefault'], + zoomControl: false, + worldCopyJump: true + }); - // create baselayer - switch ( config['map']['baselayer'] ) { - case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) - L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); - break; - case 'aerial': // add ESRI WordImagery tile layer - L.tileLayer.provider('Esri.WorldImagery').addTo(map); - break; - case 'opentopo': // add OpenTopoMap tile layer - L.tileLayer.provider('OpenTopoMap').addTo(map); - break; - case 'mapnik': // add OpenStreetMap.Mapnik tile layer - L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); - break; - case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) - L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', - {attribution: '© Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: Geodatenzentrum'}).addTo(map); - break; - default: // use OpenStreetMap.DE as default - L.tileLayer.provider('OpenStreetMap.DE').addTo(map); - }; + // change baselayer if mapquest is not requested + switch ( config['map']['baselayer'] ) { + case 'esrigray': // add ESRI Grayscale World Map (neither city nor road names) + L.tileLayer.provider('Esri.WorldGrayCanvas').addTo(map); + break; + case 'aerial': // add ESRI WordImagery tile layer + L.tileLayer.provider('Esri.WorldImagery').addTo(map); + break; + case 'opentopo': // add OpenTopoMap tile layer + L.tileLayer.provider('OpenTopoMap').addTo(map); + break; + case 'mapnik': // add OpenStreetMap.Mapnik tile layer + L.tileLayer.provider('OpenStreetMap.Mapnik').addTo(map); + break; + case 'topplus': // add TopPlus tile layer (https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wmts-topplusopen-wmts-topplus-open.html) + L.tileLayer('https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png', + {attribution: '© Federal Agency for Cartography and Geodesy ('+jahr+'), Datasource: Geodatenzentrum'}).addTo(map); + break; + case 'mapquest': + MQ.mapLayer().addTo(map); + break; + default: // use OpenStreetMap.DE as default + L.tileLayer.provider('OpenStreetMap.DE').addTo(map); }; + // add controls new L.Control.Zoom({ position: 'topright' }).addTo(map); new L.control.scale({position: 'bottomright', imperial: false}).addTo(map); From 0fa012c95dce69da6bfa992c855d54d532213e5c Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Thu, 21 Oct 2021 23:13:00 +0200 Subject: [PATCH 06/13] add nginx.conf default nginx.conf form standard docker container --- Dockerfile | 3 ++- nginx.conf | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 5cf5659..04ecc83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,3 @@ FROM nginx -COPY www /usr/share/nginx/html \ No newline at end of file +COPY www /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..e4bad8d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,32 @@ + +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} From c022aa318cbcb3a9b368c9172588523726ae3312 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Fri, 22 Oct 2021 23:19:22 +0200 Subject: [PATCH 07/13] update Dockerfile and nginx config --- Dockerfile | 12 +++++++-- nginx/default.conf | 46 ++++++++++++++++++++++++++++++++++ nginx.conf => nginx/nginx.conf | 0 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 nginx/default.conf rename nginx.conf => nginx/nginx.conf (100%) diff --git a/Dockerfile b/Dockerfile index 04ecc83..557450e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ -FROM nginx +FROM nginx:alpine + +# set labels +LABEL org.opencontainers.image.authors="kasper.fischer@rub.de" + +# copy nginx config files +COPY nginx/nginx.conf /etc/nginx/nginx.conf +COPY nginx/default.conf /etc/nginx/conf.d/default.conf + +# copy webpage content COPY www /usr/share/nginx/html -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..b460be0 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,46 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} + diff --git a/nginx.conf b/nginx/nginx.conf similarity index 100% rename from nginx.conf rename to nginx/nginx.conf From 73419827166231cf4705160fd7c746925c9b6776 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 26 Oct 2021 22:04:50 +0200 Subject: [PATCH 08/13] add language auto-negotiation --- Dockerfile | 1 + nginx/default.conf | 16 +++++++- nginx/mime.types | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 nginx/mime.types diff --git a/Dockerfile b/Dockerfile index 557450e..47415a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ LABEL org.opencontainers.image.authors="kasper.fischer@rub.de" # copy nginx config files COPY nginx/nginx.conf /etc/nginx/nginx.conf +COPY nginx/mime.types /etc/nginx/mime.types COPY nginx/default.conf /etc/nginx/conf.d/default.conf # copy webpage content diff --git a/nginx/default.conf b/nginx/default.conf index b460be0..be738e2 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -5,11 +5,25 @@ server { #charset koi8-r; #access_log /var/log/nginx/host.access.log main; + set $first_language $http_accept_language; + if ($http_accept_language ~* '^(.+?),') { + set $first_language $1; + } + + set $language_suffix 'en'; + if ($first_language ~* 'de') { + set $language_suffix 'de'; + } location / { root /usr/share/nginx/html; - index index.html index.htm; + index index.html.$language_suffix index.htm.$language_suffix index.html index.htm + try_files $uri.$language_suffix $uri $uri.html.$language_suffix $uri.html $uri.htm.$language_suffix $uri.htm; } + #location / { + # root /usr/share/nginx/html; + # index index.html index.htm; + #} #error_page 404 /404.html; diff --git a/nginx/mime.types b/nginx/mime.types new file mode 100644 index 0000000..169d16d --- /dev/null +++ b/nginx/mime.types @@ -0,0 +1,98 @@ + +types { + text/html html htm shtml de en; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/svg+xml svg svgz; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/webp webp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + + font/woff woff; + font/woff2 woff2; + + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.oasis.opendocument.graphics odg; + application/vnd.oasis.opendocument.presentation odp; + application/vnd.oasis.opendocument.spreadsheet ods; + application/vnd.oasis.opendocument.text odt; + application/vnd.openxmlformats-officedocument.presentationml.presentation + pptx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + xlsx; + application/vnd.openxmlformats-officedocument.wordprocessingml.document + docx; + application/vnd.wap.wmlc wmlc; + application/wasm wasm; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; +} From 788f4fa091c5de284a77f873654b5427470a3b70 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 26 Oct 2021 22:05:06 +0200 Subject: [PATCH 09/13] add favicon.ico --- .gitignore | 1 - www/favicon.ico | Bin 0 -> 318 bytes 2 files changed, 1 deletion(-) create mode 100644 www/favicon.ico diff --git a/.gitignore b/.gitignore index b45e439..f9a8a2b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,5 @@ www/geolocation.js www/geolocationTable.js www/stations.xml www/index.html -www/favicon.ico scripts/*.json scripts/*.xml diff --git a/www/favicon.ico b/www/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..023f2ee5cdfb4ffb6bf8ec7bcd986453614b8c3e GIT binary patch literal 318 zcmZQzU<5(|0RbS%!l1#(z#zuJz@P!d0zj+)#2|5W0Fr}&|Ns9pynXeY;pT;73<;(T z3?=@G3`e&uWjKF$E5qZv*BG*#1Q_aK3>i8yofsyS1u@KNPG(p(p_t+O_wNiYa1b)n zYs%^n7Z)wNrq=J>E-va_DtW*2TwL_*RPw&7y11zIspS0wir+hOW$U{uaBUPaV16K% F1^^H6MwI{n literal 0 HcmV?d00001 From 5455f182d751d97701e329bebf4f4b295dac0683 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 26 Oct 2021 23:28:42 +0200 Subject: [PATCH 10/13] adding script to patch version strings version strings are "VVVVV" --- scripts/patchVersion.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/patchVersion.sh diff --git a/scripts/patchVersion.sh b/scripts/patchVersion.sh new file mode 100755 index 0000000..c2b7b94 --- /dev/null +++ b/scripts/patchVersion.sh @@ -0,0 +1,17 @@ +#!/bin/bash -x +# version: VVVVV + +if [ $# -le 1 ] ; then + echo usage: ${0} version_string files ... + exit 0 +fi +version="$1" +shift +files="$*" + +echo ${version} ${files} +which sponge > /dev/null || ( echo "sponge util must be installed" ; exit 0 ) + +for file in ${files}; do + sed "s/V\{5\}/${version}"/ ${file} | sponge ${file} +done \ No newline at end of file From 8b2b58be05e72fa211fbad233201ae8ad5240fc9 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Wed, 27 Oct 2021 10:02:12 +0200 Subject: [PATCH 11/13] removed -x option from shebang --- scripts/patchVersion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patchVersion.sh b/scripts/patchVersion.sh index c2b7b94..ad0846d 100755 --- a/scripts/patchVersion.sh +++ b/scripts/patchVersion.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash # version: VVVVV if [ $# -le 1 ] ; then From af7c6642ffe8617e363bf1b20caee942aeb9c19e Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Wed, 27 Oct 2021 10:27:32 +0200 Subject: [PATCH 12/13] prepared version placeholder placeholder is "VVVVV" use patchVersion.sh to replace version for new release. Do not use this script in develop branch. --- Dockerfile | 1 + nginx/default.conf | 1 + nginx/nginx.conf | 2 +- scripts/fetchEvents.sh | 1 + scripts/mkGeolocationTable.py | 4 +++- wsgi/plotFDSN.py | 6 ++---- wsgi/showEnv.py | 2 ++ wsgi/traceDayplot.py | 3 +-- www/events.js | 2 +- www/events.js.en | 2 +- www/stations.js | 2 +- www/stations.js.en | 2 +- 12 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47415a4..2b21412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# Version: VVVVV FROM nginx:alpine # set labels diff --git a/nginx/default.conf b/nginx/default.conf index be738e2..4b15472 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,3 +1,4 @@ +# Version: VVVVV server { listen 80; listen [::]:80; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index e4bad8d..9aba6f6 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,4 +1,4 @@ - +# Version: VVVVV user nginx; worker_processes 1; diff --git a/scripts/fetchEvents.sh b/scripts/fetchEvents.sh index 0848b87..f033650 100755 --- a/scripts/fetchEvents.sh +++ b/scripts/fetchEvents.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Version: VVVVV # get starting date # find gdate or date command ( OSX: brew install coreutils) diff --git a/scripts/mkGeolocationTable.py b/scripts/mkGeolocationTable.py index a0a1d3f..5621746 100755 --- a/scripts/mkGeolocationTable.py +++ b/scripts/mkGeolocationTable.py @@ -12,6 +12,8 @@ AJAX calls to the Nominatim service small, e. g. : curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js + Version: VVVVV + License Copyright 2020-2021 Kasper D. Fischer @@ -123,7 +125,7 @@ if __name__ == "__main__": # parse arguments import argparse - versionText = 'r20211017 (2021-10-17)' + versionText = 'VVVVV' parser = argparse.ArgumentParser( description='Reverse geocoding lookup of events in xml format (stdin).', epilog=versionText) diff --git a/wsgi/plotFDSN.py b/wsgi/plotFDSN.py index 6e36210..0cdfde3 100755 --- a/wsgi/plotFDSN.py +++ b/wsgi/plotFDSN.py @@ -4,8 +4,7 @@ Get waveform data from FDSN web service and create a fancy plot This programme runs as a script or as a WSGI application. - Subversion information: - $Id$ + :version VVVVV :license Copyright 2020 Kasper Fischer @@ -379,8 +378,7 @@ if __name__ == "__main__": epilog=u'$Revision$ ($Date$, $Author$)'.replace( "$", "")) parser.add_argument(u'-v', u'-V', u'--version', action='version', - version=u'$Revision$ ($Date$, \ - $Author$)'.replace('$', '')) + version=u'VVVVV') parser.add_argument(u'-u', u'--url', action='store', dest='server', default=u'https://ariadne.geophysik.ruhr-uni-bochum.de', help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).') diff --git a/wsgi/showEnv.py b/wsgi/showEnv.py index fc28441..2bc0c4e 100644 --- a/wsgi/showEnv.py +++ b/wsgi/showEnv.py @@ -7,6 +7,8 @@ def application(environ, start_response): :type start_response: function :return: response to be sent to the client by the wsgi server :rtype: list + + :version: VVVVV """ from cgi import FieldStorage diff --git a/wsgi/traceDayplot.py b/wsgi/traceDayplot.py index 8ef1f4a..cad38d0 100755 --- a/wsgi/traceDayplot.py +++ b/wsgi/traceDayplot.py @@ -3,8 +3,7 @@ """ Produce a dayplot from seismogram recordings -Subversion information: -$Id$ +version: VVVVV license: gpl3 Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum diff --git a/www/events.js b/www/events.js index 09ca4fe..7c11138 100644 --- a/www/events.js +++ b/www/events.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/events.js.en b/www/events.js.en index 839ebef..67858e8 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/stations.js b/www/stations.js index 3647d9e..47b664c 100644 --- a/www/stations.js +++ b/www/stations.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* Load the stations using ajax */ diff --git a/www/stations.js.en b/www/stations.js.en index a3aad6b..718cff1 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version r20211017.2 (2021-10-17) + Version VVVVV */ /* Load the stations using ajax */ From 95fb75ef149ce2895ee769410dd282ade879f76d Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Wed, 27 Oct 2021 10:30:22 +0200 Subject: [PATCH 13/13] set version to "v1.0 (2021-10-27)" --- Dockerfile | 2 +- nginx/default.conf | 2 +- nginx/nginx.conf | 2 +- scripts/fetchEvents.sh | 2 +- scripts/mkGeolocationTable.py | 4 ++-- scripts/patchVersion.sh | 2 +- wsgi/plotFDSN.py | 4 ++-- wsgi/showEnv.py | 2 +- wsgi/traceDayplot.py | 2 +- www/events.js | 2 +- www/events.js.en | 2 +- www/index.html.de | 2 +- www/index.html.en | 2 +- www/map.js | 2 +- www/map.js.en | 2 +- www/misc.js | 2 +- www/stations.js | 2 +- www/stations.js.en | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b21412..2f9a47a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Version: VVVVV +# Version: v1.0 (2021-10-27) FROM nginx:alpine # set labels diff --git a/nginx/default.conf b/nginx/default.conf index 4b15472..4b0410e 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,4 +1,4 @@ -# Version: VVVVV +# Version: v1.0 (2021-10-27) server { listen 80; listen [::]:80; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 9aba6f6..26cad8e 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,4 +1,4 @@ -# Version: VVVVV +# Version: v1.0 (2021-10-27) user nginx; worker_processes 1; diff --git a/scripts/fetchEvents.sh b/scripts/fetchEvents.sh index f033650..cc7e046 100755 --- a/scripts/fetchEvents.sh +++ b/scripts/fetchEvents.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Version: VVVVV +# Version: v1.0 (2021-10-27) # get starting date # find gdate or date command ( OSX: brew install coreutils) diff --git a/scripts/mkGeolocationTable.py b/scripts/mkGeolocationTable.py index 5621746..f114f54 100755 --- a/scripts/mkGeolocationTable.py +++ b/scripts/mkGeolocationTable.py @@ -12,7 +12,7 @@ AJAX calls to the Nominatim service small, e. g. : curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js - Version: VVVVV + Version: v1.0 (2021-10-27) License Copyright 2020-2021 Kasper D. Fischer @@ -125,7 +125,7 @@ if __name__ == "__main__": # parse arguments import argparse - versionText = 'VVVVV' + versionText = 'v1.0 (2021-10-27)' parser = argparse.ArgumentParser( description='Reverse geocoding lookup of events in xml format (stdin).', epilog=versionText) diff --git a/scripts/patchVersion.sh b/scripts/patchVersion.sh index ad0846d..6ef1a39 100755 --- a/scripts/patchVersion.sh +++ b/scripts/patchVersion.sh @@ -1,5 +1,5 @@ #!/bin/bash -# version: VVVVV +# version: v1.0 (2021-10-27) if [ $# -le 1 ] ; then echo usage: ${0} version_string files ... diff --git a/wsgi/plotFDSN.py b/wsgi/plotFDSN.py index 0cdfde3..1d01315 100755 --- a/wsgi/plotFDSN.py +++ b/wsgi/plotFDSN.py @@ -4,7 +4,7 @@ Get waveform data from FDSN web service and create a fancy plot This programme runs as a script or as a WSGI application. - :version VVVVV + :version v1.0 (2021-10-27) :license Copyright 2020 Kasper Fischer @@ -378,7 +378,7 @@ if __name__ == "__main__": epilog=u'$Revision$ ($Date$, $Author$)'.replace( "$", "")) parser.add_argument(u'-v', u'-V', u'--version', action='version', - version=u'VVVVV') + version=u'v1.0 (2021-10-27)') parser.add_argument(u'-u', u'--url', action='store', dest='server', default=u'https://ariadne.geophysik.ruhr-uni-bochum.de', help=u'Base URL of the FDSN web service (https://ariadne.geophysik.ruhr-uni-bochum.de).') diff --git a/wsgi/showEnv.py b/wsgi/showEnv.py index 2bc0c4e..1cf5656 100644 --- a/wsgi/showEnv.py +++ b/wsgi/showEnv.py @@ -8,7 +8,7 @@ def application(environ, start_response): :return: response to be sent to the client by the wsgi server :rtype: list - :version: VVVVV + :version: v1.0 (2021-10-27) """ from cgi import FieldStorage diff --git a/wsgi/traceDayplot.py b/wsgi/traceDayplot.py index cad38d0..cbf8678 100755 --- a/wsgi/traceDayplot.py +++ b/wsgi/traceDayplot.py @@ -3,7 +3,7 @@ """ Produce a dayplot from seismogram recordings -version: VVVVV +version: v1.0 (2021-10-27) license: gpl3 Copyright 2012-2020 Seismological Observatory, Ruhr-University Bochum diff --git a/www/events.js b/www/events.js index 7c11138..6fbbd03 100644 --- a/www/events.js +++ b/www/events.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/events.js.en b/www/events.js.en index 67858e8..3cd74e4 100644 --- a/www/events.js.en +++ b/www/events.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/index.html.de b/www/index.html.de index 97ed9b4..2cff39b 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -1,5 +1,5 @@ - + diff --git a/www/index.html.en b/www/index.html.en index b6f4f3e..261d903 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -1,5 +1,5 @@ - + diff --git a/www/map.js b/www/map.js index 9e8fa58..d6ea140 100644 --- a/www/map.js +++ b/www/map.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* add station marker */ diff --git a/www/map.js.en b/www/map.js.en index 380b742..1d12a48 100644 --- a/www/map.js.en +++ b/www/map.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* add station marker */ diff --git a/www/misc.js b/www/misc.js index 20261c5..03af4cf 100644 --- a/www/misc.js +++ b/www/misc.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* calculate marker radius from magnitude diff --git a/www/stations.js b/www/stations.js index 47b664c..96916e5 100644 --- a/www/stations.js +++ b/www/stations.js @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* Load the stations using ajax */ diff --git a/www/stations.js.en b/www/stations.js.en index 718cff1..abe438d 100644 --- a/www/stations.js.en +++ b/www/stations.js.en @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. - Version VVVVV + Version v1.0 (2021-10-27) */ /* Load the stations using ajax */