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/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2f9a47a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# Version: v1.0 (2021-10-27) +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/mime.types /etc/nginx/mime.types +COPY nginx/default.conf /etc/nginx/conf.d/default.conf + +# copy webpage content +COPY www /usr/share/nginx/html diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..4b0410e --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,61 @@ +# Version: v1.0 (2021-10-27) +server { + listen 80; + listen [::]:80; + server_name localhost; + + #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.$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; + + # 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/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; +} diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..26cad8e --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,32 @@ +# Version: v1.0 (2021-10-27) +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; +} diff --git a/scripts/fetchEvents.sh b/scripts/fetchEvents.sh index 0848b87..cc7e046 100755 --- a/scripts/fetchEvents.sh +++ b/scripts/fetchEvents.sh @@ -1,4 +1,5 @@ #!/bin/bash +# 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 a0a1d3f..f114f54 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: v1.0 (2021-10-27) + License Copyright 2020-2021 Kasper D. Fischer @@ -123,7 +125,7 @@ if __name__ == "__main__": # parse arguments import argparse - versionText = 'r20211017 (2021-10-17)' + 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 new file mode 100755 index 0000000..6ef1a39 --- /dev/null +++ b/scripts/patchVersion.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# version: v1.0 (2021-10-27) + +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 diff --git a/wsgi/plotFDSN.py b/wsgi/plotFDSN.py index 6e36210..1d01315 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 v1.0 (2021-10-27) :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'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 fc28441..1cf5656 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: v1.0 (2021-10-27) """ from cgi import FieldStorage diff --git a/wsgi/traceDayplot.py b/wsgi/traceDayplot.py index 8ef1f4a..cbf8678 100755 --- a/wsgi/traceDayplot.py +++ b/wsgi/traceDayplot.py @@ -3,8 +3,7 @@ """ Produce a dayplot from seismogram recordings -Subversion information: -$Id$ +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 09ca4fe..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 r20211017.2 (2021-10-17) + 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 839ebef..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* adding row(s) to a table and format date strings afterwards */ diff --git a/www/favicon.ico b/www/favicon.ico new file mode 100644 index 0000000..023f2ee Binary files /dev/null and b/www/favicon.ico differ diff --git a/www/index.html.de b/www/index.html.de index 4caf785..2cff39b 100755 --- a/www/index.html.de +++ b/www/index.html.de @@ -1,5 +1,5 @@ - + @@ -35,7 +35,9 @@ - + + + diff --git a/www/index.html.en b/www/index.html.en index f216ef7..261d903 100755 --- a/www/index.html.en +++ b/www/index.html.en @@ -1,5 +1,5 @@ - + @@ -35,7 +35,9 @@ - + + + @@ -154,7 +156,9 @@

Download as CSV file.

-
+
+

Loading text ...

+
diff --git a/www/map.js b/www/map.js index c10bb19..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* add station marker */ @@ -139,10 +139,14 @@ 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 + map = L.map('map', { + center: config['map']['centerDefault'], + zoom: config['map']['zoomDefault'], + zoomControl: false, + worldCopyJump: true + }); + + // 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); @@ -153,9 +157,16 @@ $(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; + case 'mapquest': + MQ.mapLayer().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..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* add station marker */ @@ -139,11 +139,14 @@ 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']); - + map = L.map('map', { + center: config['map']['centerDefault'], + zoom: config['map']['zoomDefault'], + zoomControl: false, + worldCopyJump: true + }); - // create baselayer + // 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); @@ -154,12 +157,20 @@ $(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: '© 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); diff --git a/www/misc.js b/www/misc.js index 83e9c22..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* 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 = {}; diff --git a/www/stations.js b/www/stations.js index 3647d9e..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* Load the stations using ajax */ diff --git a/www/stations.js.en b/www/stations.js.en index a3aad6b..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 r20211017.2 (2021-10-17) + Version v1.0 (2021-10-27) */ /* Load the stations using ajax */