-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathconfig_main.py
222 lines (209 loc) · 6.89 KB
/
config_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# =================================================================
#
# Authors: Tom Kralidis <[email protected]>
#
# Copyright (c) 2014 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# =================================================================
DEBUG = False
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENGINE_OPTION_PRE_PING = False
SQLALCHEMY_DATABASE_URI = 'sqlite:///data.db'
# Alternative configuration for PostgreSQL database
# SQLALCHEMY_DATABASE_URI = 'postgresql://user:password@host:port/database'
# Replace None with 'your secret key string' in quotes
SECRET_KEY = None
GHC_RETENTION_DAYS = 30
GHC_PROBE_HTTP_TIMEOUT_SECS = 30
GHC_MINIMAL_RUN_FREQUENCY_MINS = 10
GHC_SELF_REGISTER = False
GHC_NOTIFICATIONS = False
GHC_NOTIFICATIONS_VERBOSITY = True
GHC_WWW_LINK_EXCEPTION_CHECK = False
GHC_LARGE_XML = False
GHC_SITE_TITLE = 'GeoHealthCheck Demonstration'
GHC_SITE_URL = 'http://host'
GHC_RUNNER_IN_WEBAPP = True
GHC_REQUIRE_WEBAPP_AUTH = False
GHC_BASIC_AUTH_DISABLED = False
GHC_VERIFY_SSL = True
# 10=DEBUG 20=INFO 30=WARN(ING) 40=ERROR 50=FATAL/CRITICAL
GHC_LOG_LEVEL = 30
GHC_LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
# Some GetCaps docs are huge. This allows
# caching them for N seconds. Set to -1 to
# disable caching.
GHC_METADATA_CACHE_SECS = 900
GHC_SMTP = {
'server': None,
'port': None,
'tls': False,
'ssl': False,
'username': None,
'password': None
}
GHC_RELIABILITY_MATRIX = {
'red': {
'min': 0,
'max': 49
},
'orange': {
'min': 50,
'max': 79
},
'green': {
'min': 80,
'max': 100
}
}
GHC_MAP = {
'url': 'https://tile.osm.org/{z}/{x}/{y}.png',
'centre_lat': 42.3626,
'centre_long': -71.0843,
'maxzoom': 18,
'subdomains': 1234,
}
# GHC Core Plugins
# Each GHC Plugin should derive from GeoHealthCheck.plugin.Plugin,
# and should be findable in sys/PYTHONPATH.
# An entry may be a Python classname or module.
# The latter will include all classes derived from GeoHealthCheck.plugin.Plugin
# in the module file.
GHC_PLUGINS = [
# Probes
'GeoHealthCheck.plugins.probe.owsgetcaps',
'GeoHealthCheck.plugins.probe.wcs',
'GeoHealthCheck.plugins.probe.wms',
'GeoHealthCheck.plugins.probe.wmts',
'GeoHealthCheck.plugins.probe.wfs',
'GeoHealthCheck.plugins.probe.tms',
'GeoHealthCheck.plugins.probe.http',
'GeoHealthCheck.plugins.probe.sta',
'GeoHealthCheck.plugins.probe.wmsdrilldown',
'GeoHealthCheck.plugins.probe.ogcfeat',
'GeoHealthCheck.plugins.probe.ogc3dtiles',
'GeoHealthCheck.plugins.probe.esrifs',
'GeoHealthCheck.plugins.probe.esrims',
'GeoHealthCheck.plugins.probe.oracle',
'GeoHealthCheck.plugins.probe.postgres',
'GeoHealthCheck.plugins.probe.ghcreport',
'GeoHealthCheck.plugins.probe.mapbox',
# Checkers
'GeoHealthCheck.plugins.check.checks',
# Resource Auth Plugins
'GeoHealthCheck.plugins.resourceauth.resourceauths',
]
# Entry for User Plugins: will be added to default core GHC_PLUGINS
# This makes it easier for users to just configure their Plugins
# and always get the latest core GHC_PLUGINS without having to upgrade
# their config.
GHC_USER_PLUGINS = []
# Default Probe to assign on "add" per Resource-type
GHC_PROBE_DEFAULTS = {
'OGC:WMS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WmsGetCaps'
},
'OGC:WMTS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WmtsGetCaps'
},
'OSGeo:TMS': {
'probe_class': 'GeoHealthCheck.plugins.probe.tms.TmsCaps'
},
'OGC:WFS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WfsGetCaps'
},
'OGC:WCS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WcsGetCaps'
},
'OGC:WPS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WpsGetCaps'
},
'OGC:CSW': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.CswGetCaps'
},
'OGC:SOS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.SosGetCaps'
},
'OGC:STA': {
'probe_class': 'GeoHealthCheck.plugins.probe.sta.StaCaps'
},
'OGCFeat': {
'probe_class': 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatCaps'
},
'OGC:3DTiles': {
'probe_class': 'GeoHealthCheck.plugins.probe.ogc3dtiles.OGC3DTiles'
},
'ORACLE': {
'probe_class': 'GeoHealthCheck.plugins.probe.oracle.OracleDrilldown'
},
'POSTGRES': {
'probe_class': 'GeoHealthCheck.plugins.probe.postgres.PostgresDrilldown'
},
'ESRI:FS': {
'probe_class': 'GeoHealthCheck.plugins.probe.esrifs.ESRIFSDrilldown'
},
'ESRI:MS': {
'probe_class': 'GeoHealthCheck.plugins.probe.esrims.ESRIMSDrilldown'
},
'Mapbox:TileJSON': {
'probe_class': 'GeoHealthCheck.plugins.probe.mapbox.TileJSON'
},
'urn:geoss:waf': {
'probe_class': 'GeoHealthCheck.plugins.probe.http.HttpGet'
},
'WWW:LINK': {
'probe_class': 'GeoHealthCheck.plugins.probe.http.HttpGet'
},
'FTP': {
'probe_class': None
},
'OSGeo:GeoNode': {
'probe_class': None
},
'GHC:Report': {
'probe_class':
'GeoHealthCheck.plugins.probe.ghcreport.GHCEmailReporter'
},
}
# Entry for Geocoder plugin
# Use this service to locate the configured servers on a map. In case you want
# to use fixed location (i.e. no geolocator service), use the `FixedLocation`:
# GEOIP = {
# 'plugin': 'GeoHealthCheck.plugins.geocode.fixedlocation.FixedLocation',
# 'parameters': {
# 'lat': 50,
# 'lon': 5
# }
# }
GEOIP = {
'plugin': 'GeoHealthCheck.plugins.geocode.webgeocoder.HttpGetGeocoder',
'parameters': {
'geocoder_url': 'http://ip-api.com/json/{hostname}',
'lat_field': 'lat',
'lon_field': 'lon'
}
}