/usr/share/doc/python-certbot-nginx-doc/html/api/parser.html is in python-certbot-nginx-doc 0.28.0-1~deb9u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | <!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>certbot_nginx.parser — certbot-nginx 0 documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="../genindex.html"/>
<link rel="search" title="Search" href="../search.html"/>
<link rel="top" title="certbot-nginx 0 documentation" href="../index.html"/>
<link rel="up" title="API Documentation" href="../api.html"/>
<link rel="next" title="certbot_nginx.tls_sni_01" href="tls_sni_01.html"/>
<link rel="prev" title="certbot_nginx.obj" href="obj.html"/>
<script src="../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../index.html" class="icon icon-home"> certbot-nginx
</a>
<div class="version">
0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../api.html">API Documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="nginxparser.html"><code class="docutils literal"><span class="pre">certbot_nginx.nginxparser</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="obj.html"><code class="docutils literal"><span class="pre">certbot_nginx.obj</span></code></a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="docutils literal"><span class="pre">certbot_nginx.parser</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="tls_sni_01.html"><code class="docutils literal"><span class="pre">certbot_nginx.tls_sni_01</span></code></a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">certbot-nginx</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li><a href="../api.html">API Documentation</a> »</li>
<li><code class="docutils literal"><span class="pre">certbot_nginx.parser</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/api/parser.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-certbot_nginx.parser">
<span id="certbot-nginx-parser"></span><h1><a class="reference internal" href="#module-certbot_nginx.parser" title="certbot_nginx.parser"><code class="xref py py-mod docutils literal"><span class="pre">certbot_nginx.parser</span></code></a><a class="headerlink" href="#module-certbot_nginx.parser" title="Permalink to this headline">¶</a></h1>
<p>NginxParser is a member object of the NginxConfigurator class.</p>
<dl class="class">
<dt id="certbot_nginx.parser.NginxParser">
<em class="property">class </em><code class="descclassname">certbot_nginx.parser.</code><code class="descname">NginxParser</code><span class="sig-paren">(</span><em>root</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Class handles the fine details of parsing the Nginx Configuration.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>root</strong> (<em>str</em>) – Normalized absolute path to the server root
directory. Without trailing slash.</li>
<li><strong>parsed</strong> (<em>dict</em>) – Mapping of file paths to parsed trees</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.load">
<code class="descname">load</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.load" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads Nginx files into a parsed tree.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._parse_recursively">
<code class="descname">_parse_recursively</code><span class="sig-paren">(</span><em>filepath</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._parse_recursively"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._parse_recursively" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses nginx config files recursively by looking at ‘include’
directives inside ‘http’ and ‘server’ blocks. Note that this only
reads Nginx files that potentially declare a virtual host.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filepath</strong> (<em>str</em>) – The path to the files to parse, as a glob</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.abs_path">
<code class="descname">abs_path</code><span class="sig-paren">(</span><em>path</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.abs_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.abs_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a relative path to an absolute path relative to the root.
Does nothing for paths that are already absolute.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<em>str</em>) – The path</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The absolute path</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._build_addr_to_ssl">
<code class="descname">_build_addr_to_ssl</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._build_addr_to_ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._build_addr_to_ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Builds a map from address to whether it listens on ssl in any server block</p>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._get_raw_servers">
<code class="descname">_get_raw_servers</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._get_raw_servers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._get_raw_servers" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a map of unparsed all server blocks</p>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.get_vhosts">
<code class="descname">get_vhosts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.get_vhosts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.get_vhosts" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets list of all ‘virtual hosts’ found in Nginx configuration.
Technically this is a misnomer because Nginx does not have virtual
hosts, it has ‘server blocks’.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">List of <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a>
objects found in configuration</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._update_vhosts_addrs_ssl">
<code class="descname">_update_vhosts_addrs_ssl</code><span class="sig-paren">(</span><em>vhosts</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._update_vhosts_addrs_ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._update_vhosts_addrs_ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Update a list of raw parsed vhosts to include global address sslishness</p>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._get_included_directives">
<code class="descname">_get_included_directives</code><span class="sig-paren">(</span><em>block</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._get_included_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._get_included_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns array with the “include” directives expanded out by
concatenating the contents of the included file to the block.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>block</strong> (<em>list</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">list</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._parse_files">
<code class="descname">_parse_files</code><span class="sig-paren">(</span><em>filepath</em>, <em>override=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._parse_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._parse_files" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse files from a glob</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>filepath</strong> (<em>str</em>) – Nginx config file path</li>
<li><strong>override</strong> (<em>bool</em>) – Whether to parse a file that has been parsed</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list of parsed tree structures</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">list</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser._find_config_root">
<code class="descname">_find_config_root</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser._find_config_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser._find_config_root" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the Nginx Configuration Root file.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.filedump">
<code class="descname">filedump</code><span class="sig-paren">(</span><em>ext='tmp'</em>, <em>lazy=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.filedump"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.filedump" title="Permalink to this definition">¶</a></dt>
<dd><p>Dumps parsed configurations into files.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>ext</strong> (<em>str</em>) – The file extension to use for the dumped files. If
empty, this overrides the existing conf files.</li>
<li><strong>lazy</strong> (<em>bool</em>) – Only write files that have been modified</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.parse_server">
<code class="descname">parse_server</code><span class="sig-paren">(</span><em>server</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.parse_server"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.parse_server" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a list of server directives, accounting for global address sslishness.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>server</strong> (<em>list</em>) – list of directives in a server block</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.has_ssl_on_directive">
<code class="descname">has_ssl_on_directive</code><span class="sig-paren">(</span><em>vhost</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.has_ssl_on_directive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.has_ssl_on_directive" title="Permalink to this definition">¶</a></dt>
<dd><p>Does vhost have ssl on for all ports?</p>
<p>:param <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a> vhost: The vhost in question</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if ‘ssl on’ directive is included</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.add_server_directives">
<code class="descname">add_server_directives</code><span class="sig-paren">(</span><em>vhost</em>, <em>directives</em>, <em>insert_at_top=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.add_server_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.add_server_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Add directives to the server block identified by vhost.</p>
<p>This method modifies vhost to be fully consistent with the new directives.</p>
<dl class="docutils">
<dt>..note :: It’s an error to try and add a nonrepeatable directive that already</dt>
<dd>exists in the config block with a conflicting value.</dd>
<dt>..todo :: Doesn’t match server blocks whose server_name directives are</dt>
<dd>split across multiple conf files.</dd>
<dt>:param <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a> vhost: The vhost</dt>
<dd>whose information we use to match on</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>directives</strong> (<em>list</em>) – The directives to add</li>
<li><strong>insert_at_top</strong> (<em>bool</em>) – True if the directives need to be inserted at the top
of the server block instead of the bottom</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.update_or_add_server_directives">
<code class="descname">update_or_add_server_directives</code><span class="sig-paren">(</span><em>vhost</em>, <em>directives</em>, <em>insert_at_top=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.update_or_add_server_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.update_or_add_server_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Add or replace directives in the server block identified by vhost.</p>
<p>This method modifies vhost to be fully consistent with the new directives.</p>
<p>..note :: When a directive with the same name already exists in the
config block, the first instance will be replaced. Otherwise, the directive
will be appended/prepended to the config block as in add_server_directives.</p>
<dl class="docutils">
<dt>..todo :: Doesn’t match server blocks whose server_name directives are</dt>
<dd>split across multiple conf files.</dd>
<dt>:param <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a> vhost: The vhost</dt>
<dd>whose information we use to match on</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>directives</strong> (<em>list</em>) – The directives to add</li>
<li><strong>insert_at_top</strong> (<em>bool</em>) – True if the directives need to be inserted at the top
of the server block instead of the bottom</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.remove_server_directives">
<code class="descname">remove_server_directives</code><span class="sig-paren">(</span><em>vhost</em>, <em>directive_name</em>, <em>match_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.remove_server_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.remove_server_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove all directives of type directive_name.</p>
<dl class="docutils">
<dt>:param <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a> vhost: The vhost</dt>
<dd>to remove directives from</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>directive_name</strong> (<em>string</em>) – The directive type to remove</li>
<li><strong>match_func</strong> (<em>callable</em>) – Function of the directive that returns true for directives
to be deleted.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_nginx.parser.NginxParser.duplicate_vhost">
<code class="descname">duplicate_vhost</code><span class="sig-paren">(</span><em>vhost_template</em>, <em>remove_singleton_listen_params=False</em>, <em>only_directives=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#NginxParser.duplicate_vhost"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.NginxParser.duplicate_vhost" title="Permalink to this definition">¶</a></dt>
<dd><p>Duplicate the vhost in the configuration files.</p>
<dl class="docutils">
<dt>:param <a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a> vhost_template: The vhost</dt>
<dd>whose information we copy</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>remove_singleton_listen_params</strong> (<em>bool</em>) – If we should remove parameters
from listen directives in the block that can only be used once per address</li>
<li><strong>only_directives</strong> (<em>list</em>) – If it exists, only duplicate the named directives. Only
looks at first level of depth; does not expand includes.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A vhost object for the newly created vhost</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference internal" href="obj.html#certbot_nginx.obj.VirtualHost" title="certbot_nginx.obj.VirtualHost"><code class="xref py py-class docutils literal"><span class="pre">VirtualHost</span></code></a></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._do_for_subarray">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_do_for_subarray</code><span class="sig-paren">(</span><em>entry</em>, <em>condition</em>, <em>func</em>, <em>path=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_do_for_subarray"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._do_for_subarray" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes a function for a subarray of a nested array if it matches
the given condition.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry</strong> (<em>list</em>) – The list to iterate over</li>
<li><strong>condition</strong> (<em>function</em>) – Returns true iff func should be executed on item</li>
<li><strong>func</strong> (<em>function</em>) – The function to call for each matching item</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser.get_best_match">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">get_best_match</code><span class="sig-paren">(</span><em>target_name</em>, <em>names</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#get_best_match"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.get_best_match" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds the best match for target_name out of names using the Nginx
name-matching rules (exact > longest wildcard starting with * >
longest wildcard ending with * > regex).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>target_name</strong> (<em>str</em>) – The name to match</li>
<li><strong>names</strong> (<em>set</em>) – The candidate server names</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Tuple of (type of match, the name that matched)</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">tuple</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._is_include_directive">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_is_include_directive</code><span class="sig-paren">(</span><em>entry</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_is_include_directive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._is_include_directive" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if an nginx parsed entry is an ‘include’ directive.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong> (<em>list</em>) – the parsed entry</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Whether it’s an ‘include’ directive</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._is_ssl_on_directive">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_is_ssl_on_directive</code><span class="sig-paren">(</span><em>entry</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_is_ssl_on_directive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._is_ssl_on_directive" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if an nginx parsed entry is an ‘ssl on’ directive.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong> (<em>list</em>) – the parsed entry</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Whether it’s an ‘ssl on’ directive</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._add_directives">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_add_directives</code><span class="sig-paren">(</span><em>directives</em>, <em>insert_at_top</em>, <em>block</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_add_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._add_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds directives to a config block.</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._update_or_add_directives">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_update_or_add_directives</code><span class="sig-paren">(</span><em>directives</em>, <em>insert_at_top</em>, <em>block</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_update_or_add_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._update_or_add_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds or replaces directives in a config block.</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser.comment_directive">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">comment_directive</code><span class="sig-paren">(</span><em>block</em>, <em>location</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#comment_directive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser.comment_directive" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a <code class="docutils literal"><span class="pre">#managed</span> <span class="pre">by</span> <span class="pre">Certbot</span></code> comment to the end of the line at location.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>block</strong> (<em>list</em>) – The block containing the directive to be commented</li>
<li><strong>location</strong> (<em>int</em>) – The location within <code class="docutils literal"><span class="pre">block</span></code> of the directive to be commented</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._comment_out_directive">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_comment_out_directive</code><span class="sig-paren">(</span><em>block</em>, <em>location</em>, <em>include_location</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_comment_out_directive"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._comment_out_directive" title="Permalink to this definition">¶</a></dt>
<dd><p>Comment out the line at location, with a note of explanation.</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._find_location">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_find_location</code><span class="sig-paren">(</span><em>block</em>, <em>directive_name</em>, <em>match_func=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_find_location"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._find_location" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds the index of the first instance of directive_name in block.
If no line exists, use None.</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._is_whitespace_or_comment">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_is_whitespace_or_comment</code><span class="sig-paren">(</span><em>directive</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_is_whitespace_or_comment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._is_whitespace_or_comment" title="Permalink to this definition">¶</a></dt>
<dd><p>Is this directive either a whitespace or comment directive?</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._remove_directives">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_remove_directives</code><span class="sig-paren">(</span><em>directive_name</em>, <em>match_func</em>, <em>block</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_remove_directives"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._remove_directives" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes directives of name directive_name from a config block if match_func matches.</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._apply_global_addr_ssl">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_apply_global_addr_ssl</code><span class="sig-paren">(</span><em>addr_to_ssl</em>, <em>parsed_server</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_apply_global_addr_ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._apply_global_addr_ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply global sslishness information to the parsed server block</p>
</dd></dl>
<dl class="function">
<dt id="certbot_nginx.parser._parse_server_raw">
<code class="descclassname">certbot_nginx.parser.</code><code class="descname">_parse_server_raw</code><span class="sig-paren">(</span><em>server</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_nginx/parser.html#_parse_server_raw"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_nginx.parser._parse_server_raw" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a list of server directives.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>server</strong> (<em>list</em>) – list of directives in a server block</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="tls_sni_01.html" class="btn btn-neutral float-right" title="certbot_nginx.tls_sni_01" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="obj.html" class="btn btn-neutral" title="certbot_nginx.obj" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014-2018, Let's Encrypt Project.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|