Skip to content

Commit 15b8493

Browse files
authored
Add warning and remove duplicated docs (#1088)
1 parent 77307d3 commit 15b8493

2 files changed

Lines changed: 47 additions & 130 deletions

File tree

‎en/cgi/mapcontext.txt‎

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ following syntax:
1515

1616
http://localhost/mapserver.cgi?MODE=map&MAP=/path/to/mapfile.map&CONTEXT=
1717
/path/to/contextfile.xml&LAYERS=layer_name1 layers_name2
18-
18+
1919
.. note::
2020

2121
All layers created from a context file have their status set to ON. To be
@@ -36,22 +36,34 @@ accessing a local context file:
3636

3737
Due to security concerns loading a file from a URL is disabled by default. To
3838
enable this functionality, the user needs to set a CONFIG parameter called
39-
CGI_CONTEXT_URL in the default map file that will allow this functionality.
39+
``CGI_CONTEXT_URL`` in the default map file that will allow this functionality.
4040
Here is an example of a map file with the CONFIG parameter:
4141

4242
::
4343

44-
# Start of map file
45-
NAME DEMO
46-
STATUS ON
47-
SIZE 400 300
48-
EXTENT -2200000 -712631 3072800 3840000
49-
UNITS METERS
50-
IMAGECOLOR 255 255 255
51-
IMAGETYPE png
52-
CONFIG "CGI_CONTEXT_URL" "1"
44+
MAP
45+
NAME DEMO
46+
STATUS ON
47+
SIZE 400 300
48+
EXTENT -2200000 -712631 3072800 3840000
49+
UNITS METERS
50+
IMAGECOLOR 255 255 255
51+
IMAGETYPE png
52+
CONFIG "CGI_CONTEXT_URL" "1"
5353
...
5454

55+
.. warning::
56+
57+
``CGI_CONTEXT_URL`` is disabled by default. Enabling this option allows
58+
MapServer to load remote context documents specified through the
59+
``CONTEXT`` CGI parameter and may result in server-side requests to
60+
URLs contained in those documents.
61+
62+
Only enable this option when context documents come from trusted
63+
sources. Where possible, outbound network access from the MapServer
64+
host should be limited (for example through firewall or network policy
65+
rules) to trusted services.
66+
5567
Default Map File
5668
----------------
5769

@@ -68,24 +80,25 @@ required parameters:
6880

6981
::
7082

71-
NAME CGI-CONTEXT-DEMO
72-
STATUS ON
73-
SIZE 400 300
74-
EXTENT -2200000 -712631 3072800 3840000
75-
UNITS METERS
76-
IMAGECOLOR 255 255 255
77-
IMAGETYPE png
78-
#
79-
# Start of web interface definition
80-
#
81-
WEB
82-
MINSCALE 2000000
83-
MAXSCALE 50000000
84-
#
85-
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
86-
# of the drive where the .MAP file resides.
87-
#
88-
IMAGEPATH "/ms4w/tmp/ms_tmp/"
89-
IMAGEURL "/ms_tmp/"
90-
END
91-
END # Map File
83+
MAP
84+
NAME CGI-CONTEXT-DEMO
85+
STATUS ON
86+
SIZE 400 300
87+
EXTENT -2200000 -712631 3072800 3840000
88+
UNITS METERS
89+
IMAGECOLOR 255 255 255
90+
IMAGETYPE png
91+
#
92+
# Start of web interface definition
93+
#
94+
WEB
95+
MINSCALE 2000000
96+
MAXSCALE 50000000
97+
#
98+
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
99+
# of the drive where the .MAP file resides.
100+
#
101+
IMAGEPATH "/ms4w/tmp/ms_tmp/"
102+
IMAGEURL "/ms_tmp/"
103+
END
104+
END # Map File

‎en/ogc/mapcontext.txt‎

Lines changed: 2 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Introduction
1919
============
2020

21-
The term 'map context' comes from the Open Geospatial Constortium's (OGC) `Web
21+
The term 'map context' comes from the Open Geospatial Consortium's (OGC) `Web
2222
Map Context Specification v1.0.0`_, which coincides with the OGC `Web Map
2323
Server Specification (WMS) v1.1.1`_. A map context is a XML document that
2424
describes the appearance of layers from one or more WMS servers, and can be
@@ -385,103 +385,7 @@ Map Context Support Through CGI
385385
-------------------------------
386386

387387
MapServer CGI allows you to load a map context through the use of a CONTEXT
388-
parameter, and you can point this parameter to a locally stored context file
389-
or a context file accessible through a URL. For more information on MapServer
390-
CGI see the :ref:`CGI Reference <cgi>`.
391-
392-
Support for Local Map Context Files
393-
***********************************
394-
395-
There is a new cgi parameter called *CONTEXT* that is used to specify a local
396-
context file. The user can then use MapServer to request a map using the
397-
following syntax:
398-
399-
::
400-
401-
http://localhost/mapserver.cgi?MODE=map&MAP=/path/to/mapfile.map&CONTEXT=
402-
/path/to/contextfile.xml&LAYERS=layer_name1 layers_name2
403-
404-
.. note::
405-
406-
All layers created from a context file have their status set to ON. To be
407-
able to display layers, the user needs to add the LAYERS argument in the
408-
URL.
409-
410-
Support for Context Files Accessed Through a URL
411-
************************************************
412-
413-
The syntax of using a web accessible context file would be similar to accessing
414-
a local context file:
415-
416-
::
417-
418-
http://localhost/mapserver.cgi?MODE=map&MAP=/path/to/mapfile.map&CONTEXT=
419-
http://URL/path/to/contextfile.xml&LAYERS=layers_name1 layer_name2
420-
421-
Due to security concerns loading a file from a URL is disabled by default. To enable
422-
this functionality, the user needs to set a CONFIG parameter called *CGI_CONTEXT_URL*
423-
in the default mapfile that will allow this functionality. Here is an example of a
424-
map file with the CONFIG parameter:
425-
426-
.. code-block:: mapfile
427-
428-
# Start of map file
429-
NAME "map-context"
430-
STATUS ON
431-
SIZE 400 300
432-
EXTENT -2200000 -712631 3072800 3840000
433-
UNITS METERS
434-
IMAGECOLOR 255 255 255
435-
IMAGETYPE png
436-
CONFIG "CGI_CONTEXT_URL" "1"
437-
...
438-
WEB
439-
...
440-
END
441-
LAYER
442-
...
443-
END
444-
445-
END
446-
447-
Default Mapfile
448-
****************
449-
450-
To smoothly run a MapServer CGI application with a Map Context, the
451-
application administrator needs to provide a default mapfile with at least the
452-
basic required parameters that will be used with the Context file. This
453-
default mapfile can contain as little information as the imagepath and
454-
imageurl or contain a list of layers. Information coming from the context
455-
(e.g.: layers, width, height, ...) would either be appended or will replace
456-
values found in the mapfile.
457-
458-
Here is an example of a default map file containing the minimum required
459-
parameters:
460-
461-
.. code-block:: mapfile
462-
:linenos:
463-
464-
NAME "CGI-CONTEXT-DEMO"
465-
STATUS ON
466-
SIZE 400 300
467-
EXTENT -2200000 -712631 3072800 3840000
468-
UNITS METERS
469-
IMAGECOLOR 255 255 255
470-
IMAGETYPE png
471-
#
472-
# Start of web interface definition
473-
#
474-
WEB
475-
MINSCALE 2000000
476-
MAXSCALE 50000000
477-
#
478-
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
479-
# of the drive where the .MAP file resides.
480-
#
481-
IMAGEPATH "/ms4w/tmp/ms_tmp/"
482-
IMAGEURL "/ms_tmp/"
483-
END
484-
END # Map File
388+
parameter. See :ref:`mapcontext_cgi` for details.
485389

486390
Map Context Support Through WMS
487391
-------------------------------

0 commit comments

Comments
 (0)