diff --git a/ci/test-postgis-radf-s3-values.yaml b/ci/test-postgis-radf-s3-values.yaml
index acd953ad6d905358e55b95739e3046b85356595d..550587c0686b0620cde76b2f97feeff100ee6bc0 100644
--- a/ci/test-postgis-radf-s3-values.yaml
+++ b/ci/test-postgis-radf-s3-values.yaml
@@ -17,9 +17,6 @@ ingress:
paths:
- path: "/wms"
pathType: ImplementationSpecific
- # the test site uses the production WMS server
-# - host: geosphere-test.ssec.wisc.edu
-# paths: ["/wms", "/wms_times"]
tls:
- hosts:
- "test"
diff --git a/ci/test-shapefiles-and-postgis-radf-values.yaml b/ci/test-shapefiles-and-postgis-radf-values.yaml
index b3f966950aa06136fe8caa5a339f24e7f678e020..fbe47967f856d1f71ee0b5b7caff3160c20433eb 100644
--- a/ci/test-shapefiles-and-postgis-radf-values.yaml
+++ b/ci/test-shapefiles-and-postgis-radf-values.yaml
@@ -19,11 +19,6 @@ ingress:
paths:
- path: "/wms"
pathType: ImplementationSpecific
- - path: "/wms_times"
- pathType: ImplementationSpecific
- # the test site uses the production WMS server
-# - host: geosphere-test.ssec.wisc.edu
-# paths: ["/wms", "/wms_times"]
tls:
- hosts:
- "test"
diff --git a/ci/test-shapefiles-only-values.yaml b/ci/test-shapefiles-only-values.yaml
index 5838858c4c25e59d7da3ae1ea4faf3c890004aea..21874ac2b360722858813e8fa056686a0f53b7e2 100644
--- a/ci/test-shapefiles-only-values.yaml
+++ b/ci/test-shapefiles-only-values.yaml
@@ -13,11 +13,6 @@ ingress:
paths:
- path: "/wms"
pathType: ImplementationSpecific
- - path: "/wms_times"
- pathType: ImplementationSpecific
- # the test site uses the production WMS server
-# - host: geosphere-test.ssec.wisc.edu
-# paths: ["/wms", "/wms_times"]
tls:
- hosts:
- "test"
diff --git a/mapserver/Dockerfile b/mapserver/Dockerfile
index 2dfb21548af0a4783d19e442a7986e28df324ad8..84abb7f5e8376479a25fcfbdcec1cbebfd162d9c 100644
--- a/mapserver/Dockerfile
+++ b/mapserver/Dockerfile
@@ -157,7 +157,7 @@ RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula selec
COPY site-conf /etc/apache2/sites-available/cspp_geo.conf
# disable the default which would conflict with our custom
RUN a2ensite cspp_geo && a2dissite 000-default
-COPY cgi-bin/* /usr/lib/cgi-bin/
+
# Trick apache log to stdout/stderr
RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
ln -sf /dev/stderr /var/log/apache2/error.log
diff --git a/mapserver/cgi-bin/layer_times.py b/mapserver/cgi-bin/layer_times.py
deleted file mode 100755
index 1fe6f1962f775250477d4074caadbb4638594623..0000000000000000000000000000000000000000
--- a/mapserver/cgi-bin/layer_times.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python3
-"""CGI script to read on-disk shapefiles for available times for one layer."""
-import os
-import cgi
-import json
-import fiona
-
-form = cgi.FieldStorage()
-layer = form['layer'].value
-if not os.path.isfile(layer):
- times = []
-else:
- with fiona.open(layer, 'r') as shp_file:
- times = [x['properties']['time'] for x in shp_file]
-
-print("Content-Type: application/json")
-print("Access-Control-Allow-Origin: *")
-print() # blank line, end of headers
-print(json.dumps(times))
diff --git a/mapserver/cgi-bin/layer_times_postgres.py b/mapserver/cgi-bin/layer_times_postgres.py
deleted file mode 100755
index aa131978bb7315f0cb64facac9c6c7704d9f6531..0000000000000000000000000000000000000000
--- a/mapserver/cgi-bin/layer_times_postgres.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python3
-"""CGI script to read PostGIS for available times for one layer."""
-import os
-import sys
-import cgi
-import json
-from datetime import datetime
-import psycopg2
-from psycopg2 import sql
-
-
-def bad_request(msg):
- print("""Status: 400 Bad Request
-Content-type: text/plain
-Access-Control-Allow-Origin: *
-
-{}""".format(msg))
- sys.exit(1)
-
-
-def get_connect_str():
- pw_filename = "__POSTGRES_PASSWORD_FILE__"
- connect_str = "host=__POSTGRES_HOST__ " \
- "port=__POSTGRES_PORT__ " \
- "dbname=__POSTGRES_DBNAME__ " \
- "user=__POSTGRES_USER__"
- if not os.path.isfile(pw_filename) or '__' in connect_str:
- print("""Status: 500 Backend Misconfigured\n
-Content-type: text/plain
-Access-Control-Allow-Origin: *
-
-Backend has not been configured properly and doesn't know how to communicate with the database.
-Please contact site administrator.
- """)
- sys.exit(1)
-
- with open(pw_filename, 'r') as pw_file:
- password = pw_file.read().strip()
- connect_str += " password={}".format(password)
- return connect_str
-
-
-connect_str = get_connect_str()
-form = cgi.FieldStorage()
-table_name = form.getvalue('layer')
-start_time = form.getvalue('start_time')
-end_time = form.getvalue('end_time')
-num_times = form.getvalue('num_times', 0)
-order = form.getvalue('order', 'ASC')
-
-if table_name is None:
- bad_request("Missing required parameter 'layer'.")
-
-if start_time is not None:
- try:
- start_time = datetime.strptime(start_time, "%Y-%m-%dT%H:%M:%S")
- except ValueError:
- bad_request("""Bad 'start_time' format. Expected: 'YYYY-MM-DDTHH:MM:SS'""")
-
-if end_time is not None:
- try:
- end_time = datetime.strptime(end_time, "%Y-%m-%dT%H:%M:%S")
- except ValueError:
- bad_request("""Bad 'end_time' format. Expected: 'YYYY-MM-DDTHH:MM:SS'""")
-
-try:
- num_times = int(num_times)
- if num_times < 0:
- raise ValueError("'num_times' must greater or equal to 0.")
-except ValueError:
- bad_request("""Invalid integer for 'num_times'.""")
-
-order = order.upper()
-if order not in ('ASC', 'DESC'):
- bad_request("""'order' must be either 'ASC' or 'DESC'.""")
-
-query_str = """SELECT to_char(start_time, 'YYYY-MM-DD"T"HH24:MI:SS') FROM {}"""
-if start_time is not None or end_time is not None:
- query_str += " WHERE "
-if start_time is not None:
- query_str += "start_time >= timestamp '{}'".format(start_time.strftime('%Y-%m-%dT%H:%M:%S'))
-if start_time is not None and end_time is not None:
- query_str += " AND "
-if end_time is not None:
- query_str += "start_time <= timestamp '{}'".format(end_time.strftime('%Y-%m-%dT%H:%M:%S'))
-query_str += " ORDER BY start_time {}".format(order)
-if num_times != 0:
- query_str += " LIMIT {}".format(num_times)
-
-try:
- conn = psycopg2.connect(connect_str)
- with conn:
- with conn.cursor() as cur:
- cur.execute(sql.SQL(query_str).format(sql.Identifier(table_name)))
- times = cur.fetchall()
-except psycopg2.errors.DatabaseError:
- print("""Status: 500 Database Error
-Content-type: text/plain
-Access-Control-Allow-Origin: *
-
-Error requesting time information from database.
-""")
- sys.exit(1)
-
-# postgres returned a list of tuples
-times = [time_tuple[0] for time_tuple in times]
-
-print("Content-Type: application/json")
-print("Access-Control-Allow-Origin: *")
-print() # blank line, end of headers
-print(json.dumps(times))
diff --git a/mapserver/run.sh b/mapserver/run.sh
index 7662146e40d3f565d3e6bb128e86c1c8c2dd21c2..31b40b7b6f49e5e56419c5584394ac30b7278d72 100755
--- a/mapserver/run.sh
+++ b/mapserver/run.sh
@@ -15,14 +15,9 @@ export LAYER_BASE_DIR=${LAYER_BASE_DIR:-"/data/tiles"}
# Update the mapcache.xml file with the real host and port name
mf_tmpl="/work/abi_l1b_template.map"
-sed -i "s:__LAYER_BASE_DIR__:$LAYER_BASE_DIR:g" /etc/apache2/sites-available/cspp_geo.conf
if [[ ${POSTGRES_HOST} != "" ]]; then
- sed -i "s:wms_times_postgres:wms_times:g" /etc/apache2/sites-available/cspp_geo.conf
- replace_pg_params /usr/lib/cgi-bin/layer_times_postgres.py
replace_pg_params /work/render.py
-else
- sed -i "s:wms_times_shapes:wms_times:g" /etc/apache2/sites-available/cspp_geo.conf
fi
export GEOSPHERE_CONFIG=${GEOSPHERE_CONFIG:-"/work/geosphere_settings.yaml"}
diff --git a/mapserver/site-conf b/mapserver/site-conf
index 9c77af4ef8119a43ebf18d63e9ae1b2f8216230c..d3e7dbae2b2067f63d8d43def14c9426935a4142 100644
--- a/mapserver/site-conf
+++ b/mapserver/site-conf
@@ -37,10 +37,6 @@
# FCGI version of the URL
RewriteRule "^/wms/([^/]+)/([^/]+)/([^/]+)/([^/]+)?(.*)" "/cgi-bin/mapserv.fcgi?map=/work/mapfiles/$1_$2_$3_$4.map&$5" [PT,QSA]
RewriteRule "^/wms/([^/]+)?(.*)" "/cgi-bin/mapserv.fcgi?map=/work/mapfiles/$1.map&$2" [PT,QSA]
- # /wms_times/g16/abi/radf/true_color
- # LAYER_BASE_DIR defaults to /data/tiles
- RewriteRule "^/wms_times_postgres/([^/]+)/([^/]+)/([^/]+)/([^/]+)" "/cgi-bin/layer_times_postgres.py?layer=$1_$2_$3_l1b_${lc:$4}" [PT,QSA]
- RewriteRule "^/wms_times_shapes/([^/]+)/([^/]+)/([^/]+)/([^/]+)" "/cgi-bin/layer_times.py?layer=__LAYER_BASE_DIR__/$1/$2/$3/$4/$4.shp" [PT,QSA]
# Regular CGI version of the URL (put last since it should be used less often)
RewriteRule "^/wms_cgi/([^/]+)/([^/]+)/([^/]+)/([^/]+)?(.*)" "/cgi-bin/mapserv?map=/work/mapfiles/$1_$2_$3_$4.map&$5" [PT,QSA]
RewriteRule "^/wms_cgi/([^/]+)?(.*)" "/cgi-bin/mapserv?map=/work/mapfiles/$1.map&$2" [PT,QSA]