/usr/share/doc/python3-certbot-apache/html/api/parser.html is in python-certbot-apache-doc 0.23.0-1.
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 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 | <!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_apache.parser — certbot-apache 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-apache 0 documentation" href="../index.html"/>
<link rel="up" title="API Documentation" href="../api.html"/>
<link rel="next" title="certbot_apache.tls_sni_01" href="tls_sni_01.html"/>
<link rel="prev" title="certbot_apache.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-apache
</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="augeas_configurator.html"><code class="docutils literal"><span class="pre">certbot_apache.augeas_configurator</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="configurator.html"><code class="docutils literal"><span class="pre">certbot_apache.configurator</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="display_ops.html"><code class="docutils literal"><span class="pre">certbot_apache.display_ops</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="obj.html"><code class="docutils literal"><span class="pre">certbot_apache.obj</span></code></a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="docutils literal"><span class="pre">certbot_apache.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_apache.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-apache</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_apache.parser</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/api/parser.rst.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_apache.parser">
<span id="certbot-apache-parser"></span><h1><a class="reference internal" href="#module-certbot_apache.parser" title="certbot_apache.parser"><code class="xref py py-mod docutils literal"><span class="pre">certbot_apache.parser</span></code></a><a class="headerlink" href="#module-certbot_apache.parser" title="Permalink to this headline">¶</a></h1>
<p>ApacheParser is a member object of the ApacheConfigurator class.</p>
<dl class="class">
<dt id="certbot_apache.parser.ApacheParser">
<em class="property">class </em><code class="descclassname">certbot_apache.parser.</code><code class="descname">ApacheParser</code><span class="sig-paren">(</span><em>aug</em>, <em>root</em>, <em>vhostroot=None</em>, <em>version=(2</em>, <em>4)</em>, <em>configurator=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser" 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 Apache Configuration.</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Make parsing general… remove sites-available etc…</p>
</div>
<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>modules</strong> (<em>set</em>) – All module names that are currently enabled.</li>
<li><strong>loc</strong> (<em>dict</em>) – Location to place directives, root - configuration origin,
default - user config file, name - NameVirtualHost,</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.add_include">
<code class="descname">add_include</code><span class="sig-paren">(</span><em>main_config</em>, <em>inc_path</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.add_include"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.add_include" title="Permalink to this definition">¶</a></dt>
<dd><p>Add Include for a new configuration file if one does not exist</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>main_config</strong> (<em>str</em>) – file path to main Apache config file</li>
<li><strong>inc_path</strong> (<em>str</em>) – path of file to include</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.add_mod">
<code class="descname">add_mod</code><span class="sig-paren">(</span><em>mod_name</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.add_mod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.add_mod" title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut for updating parser modules.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.reset_modules">
<code class="descname">reset_modules</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.reset_modules"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.reset_modules" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset the loaded modules list. This is called from cleanup to clear
temporarily loaded modules.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.parse_modules">
<code class="descname">parse_modules</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.parse_modules"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.parse_modules" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterates on the configuration until no new modules are loaded.</p>
<dl class="docutils">
<dt>..todo:: This should be attempted to be done with a binary to avoid</dt>
<dd>the iteration issue. Else… parse and enable mods at same time.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.update_runtime_variables">
<code class="descname">update_runtime_variables</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.update_runtime_variables"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.update_runtime_variables" title="Permalink to this definition">¶</a></dt>
<dd><p>Update Includes, Defines and Includes from httpd config dump data</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.update_defines">
<code class="descname">update_defines</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.update_defines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.update_defines" title="Permalink to this definition">¶</a></dt>
<dd><p>Get Defines from httpd process</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.update_includes">
<code class="descname">update_includes</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.update_includes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.update_includes" title="Permalink to this definition">¶</a></dt>
<dd><p>Get includes from httpd process, and add them to DOM if needed</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.update_modules">
<code class="descname">update_modules</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.update_modules"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.update_modules" title="Permalink to this definition">¶</a></dt>
<dd><p>Get loaded modules from httpd process, and add them to DOM</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.parse_from_subprocess">
<code class="descname">parse_from_subprocess</code><span class="sig-paren">(</span><em>command</em>, <em>regexp</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.parse_from_subprocess"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.parse_from_subprocess" title="Permalink to this definition">¶</a></dt>
<dd><p>Get values from stdout of subprocess command</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>command</strong> (<em>list</em>) – Command to run</li>
<li><strong>regexp</strong> (<em>str</em>) – Regexp for parsing</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">list parsed from command output</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_apache.parser.ApacheParser._get_runtime_cfg">
<code class="descname">_get_runtime_cfg</code><span class="sig-paren">(</span><em>command</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._get_runtime_cfg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._get_runtime_cfg" title="Permalink to this definition">¶</a></dt>
<dd><p>Get runtime configuration info.
:param command: Command to run</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">stdout from command</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.filter_args_num">
<code class="descname">filter_args_num</code><span class="sig-paren">(</span><em>matches</em>, <em>args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.filter_args_num"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.filter_args_num" title="Permalink to this definition">¶</a></dt>
<dd><p>Filter out directives with specific number of arguments.</p>
<p>This function makes the assumption that all related arguments are given
in order. Thus /files/apache/directive[5]/arg[2] must come immediately
after /files/apache/directive[5]/arg[1]. Runs in 1 linear pass.</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>matches</strong> (<em>string</em>) – Matches of all directives with arg nodes</li>
<li><strong>args</strong> (<em>int</em>) – Number of args you would like to filter</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">List of directives that contain # of arguments.
(arg is stripped off)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.add_dir_to_ifmodssl">
<code class="descname">add_dir_to_ifmodssl</code><span class="sig-paren">(</span><em>aug_conf_path</em>, <em>directive</em>, <em>args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.add_dir_to_ifmodssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.add_dir_to_ifmodssl" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds directive and value to IfMod ssl block.</p>
<p>Adds given directive and value along configuration path within
an IfMod mod_ssl.c block. If the IfMod block does not exist in
the file, it is created.</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>aug_conf_path</strong> (<em>str</em>) – Desired Augeas config path to add directive</li>
<li><strong>directive</strong> (<em>str</em>) – Directive you would like to add, e.g. Listen</li>
<li><strong>args</strong> (<em>list</em>) – Values of the directive; str “443” or list of str</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._get_ifmod">
<code class="descname">_get_ifmod</code><span class="sig-paren">(</span><em>aug_conf_path</em>, <em>mod</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._get_ifmod"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._get_ifmod" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the path to <IfMod mod> and creates one if it doesn’t exist.</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>aug_conf_path</strong> (<em>str</em>) – Augeas configuration path</li>
<li><strong>mod</strong> (<em>str</em>) – module ie. mod_ssl.c</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.add_dir">
<code class="descname">add_dir</code><span class="sig-paren">(</span><em>aug_conf_path</em>, <em>directive</em>, <em>args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.add_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.add_dir" title="Permalink to this definition">¶</a></dt>
<dd><p>Appends directive to the end fo the file given by aug_conf_path.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Not added to AugeasConfigurator because it may depend
on the lens</p>
</div>
<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>aug_conf_path</strong> (<em>str</em>) – Augeas configuration path to add directive</li>
<li><strong>directive</strong> (<em>str</em>) – Directive to add</li>
<li><strong>args</strong> (<em>list</em><em> or </em><em>str</em>) – Value of the directive. ie. Listen 443, 443 is arg</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.add_dir_beginning">
<code class="descname">add_dir_beginning</code><span class="sig-paren">(</span><em>aug_conf_path</em>, <em>dirname</em>, <em>args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.add_dir_beginning"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.add_dir_beginning" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds the directive to the beginning of defined aug_conf_path.</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>aug_conf_path</strong> (<em>str</em>) – Augeas configuration path to add directive</li>
<li><strong>dirname</strong> (<em>str</em>) – Directive to add</li>
<li><strong>args</strong> (<em>list</em><em> or </em><em>str</em>) – Value of the directive. ie. Listen 443, 443 is arg</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.find_dir">
<code class="descname">find_dir</code><span class="sig-paren">(</span><em>directive</em>, <em>arg=None</em>, <em>start=None</em>, <em>exclude=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.find_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.find_dir" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds directive in the configuration.</p>
<p>Recursively searches through config files to find directives
Directives should be in the form of a case insensitive regex currently</p>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">arg should probably be a list</p>
</div>
<div class="admonition-todo admonition" id="index-2">
<p class="first admonition-title">Todo</p>
<p class="last">arg search currently only supports direct matching. It does
not handle the case of variables or quoted arguments. This should
be adapted to use a generic search for the directive and then do a
case-insensitive self.get_arg filter</p>
</div>
<p>Note: Augeas is inherently case sensitive while Apache is case
insensitive. Augeas 1.0 allows case insensitive regexes like
regexp(/Listen/, “i”), however the version currently supported
by Ubuntu 0.10 does not. Thus I have included my own case insensitive
transformation by calling case_i() on everything to maintain
compatibility.</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>directive</strong> (<em>str</em>) – Directive to look for</li>
<li><strong>arg</strong> (<em>str</em><em> or </em><em>None</em>) – Specific value directive must have, None if all should
be considered</li>
<li><strong>start</strong> (<em>str</em>) – Beginning Augeas path to begin looking</li>
<li><strong>exclude</strong> (<em>bool</em>) – Whether or not to exclude directives based on
variables and enabled modules</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.get_arg">
<code class="descname">get_arg</code><span class="sig-paren">(</span><em>match</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.get_arg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.get_arg" title="Permalink to this definition">¶</a></dt>
<dd><p>Uses augeas.get to get argument value and interprets result.</p>
<p>This also converts all variables and parameters appropriately.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._exclude_dirs">
<code class="descname">_exclude_dirs</code><span class="sig-paren">(</span><em>matches</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._exclude_dirs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._exclude_dirs" title="Permalink to this definition">¶</a></dt>
<dd><p>Exclude directives that are not loaded into the configuration.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._pass_filter">
<code class="descname">_pass_filter</code><span class="sig-paren">(</span><em>match</em>, <em>filter_</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._pass_filter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._pass_filter" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine if directive passes a filter.</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>match</strong> (<em>str</em>) – Augeas path</li>
<li><strong>filter</strong> (<em>list</em>) – list of tuples of form
[(“lowercase if directive”, set of relevant parameters)]</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._get_include_path">
<code class="descname">_get_include_path</code><span class="sig-paren">(</span><em>arg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._get_include_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._get_include_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts an Apache Include directive into Augeas path.</p>
<p>Converts an Apache Include directive argument into an Augeas
searchable path</p>
<div class="admonition-todo admonition" id="index-3">
<p class="first admonition-title">Todo</p>
<p class="last">convert to use os.path.join()</p>
</div>
<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>arg</strong> (<em>str</em>) – Argument of Include directive</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Augeas path string</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_apache.parser.ApacheParser.fnmatch_to_re">
<code class="descname">fnmatch_to_re</code><span class="sig-paren">(</span><em>clean_fn_match</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.fnmatch_to_re"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.fnmatch_to_re" title="Permalink to this definition">¶</a></dt>
<dd><p>Method converts Apache’s basic fnmatch to regular expression.</p>
<p>Assumption - Configs are assumed to be well-formed and only writable by
privileged users.</p>
<p><a class="reference external" href="https://apr.apache.org/docs/apr/2.0/apr__fnmatch_8h_source.html">https://apr.apache.org/docs/apr/2.0/apr__fnmatch_8h_source.html</a>
<a class="reference external" href="http://apache2.sourcearchive.com/documentation/2.2.16-6/apr__fnmatch_8h_source.html">http://apache2.sourcearchive.com/documentation/2.2.16-6/apr__fnmatch_8h_source.html</a></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>clean_fn_match</strong> (<em>str</em>) – Apache style filename match, like globs</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">regex suitable for augeas</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_apache.parser.ApacheParser.parse_file">
<code class="descname">parse_file</code><span class="sig-paren">(</span><em>filepath</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.parse_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.parse_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse file with Augeas</p>
<p>Checks to see if file_path is parsed by Augeas
If filepath isn’t parsed, the file is added and Augeas is reloaded</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>) – Apache config file path</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.parsed_in_current">
<code class="descname">parsed_in_current</code><span class="sig-paren">(</span><em>filep</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.parsed_in_current"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.parsed_in_current" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the file path is parsed by current Augeas parser config
ie. returns True if the file is found on a path that’s found in live
Augeas 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">Parameters:</th><td class="field-body"><strong>filep</strong> (<em>str</em>) – Path to match</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if file is parsed in existing configuration tree</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="method">
<dt id="certbot_apache.parser.ApacheParser.parsed_in_original">
<code class="descname">parsed_in_original</code><span class="sig-paren">(</span><em>filep</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.parsed_in_original"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.parsed_in_original" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the file path is parsed by existing Apache config.
ie. returns True if the file is found on a path that matches Include or
IncludeOptional statement in the Apache 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">Parameters:</th><td class="field-body"><strong>filep</strong> (<em>str</em>) – Path to match</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">True if file is parsed in existing configuration tree</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="method">
<dt id="certbot_apache.parser.ApacheParser._parsed_by_parser_paths">
<code class="descname">_parsed_by_parser_paths</code><span class="sig-paren">(</span><em>filep</em>, <em>paths</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._parsed_by_parser_paths"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._parsed_by_parser_paths" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper function that searches through provided paths and returns
True if file path is found in the set</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._check_path_actions">
<code class="descname">_check_path_actions</code><span class="sig-paren">(</span><em>filepath</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._check_path_actions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._check_path_actions" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine actions to take with a new augeas path</p>
<p>This helper function will return a tuple that defines
if we should try to append the new filepath to augeas
parser paths, and / or remove the old one with more
narrow matching.</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>) – filepath to check the actions for</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._remove_httpd_transform">
<code class="descname">_remove_httpd_transform</code><span class="sig-paren">(</span><em>filepath</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._remove_httpd_transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._remove_httpd_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove path from Augeas transform</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>) – filepath to remove</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._add_httpd_transform">
<code class="descname">_add_httpd_transform</code><span class="sig-paren">(</span><em>incl</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._add_httpd_transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._add_httpd_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a transform to Augeas.</p>
<p>This function will correctly add a transform to augeas
The existing augeas.add_transform in python doesn’t seem to work for
Travis CI as it loads in libaugeas.so.0.10.0</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>incl</strong> (<em>str</em>) – filepath to include for transform</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser.standardize_excl">
<code class="descname">standardize_excl</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser.standardize_excl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser.standardize_excl" title="Permalink to this definition">¶</a></dt>
<dd><p>Standardize the excl arguments for the Httpd lens in Augeas.</p>
<p>Note: Hack!
Standardize the excl arguments for the Httpd lens in Augeas
Servers sometimes give incorrect defaults
Note: This problem should be fixed in Augeas 1.0. Unfortunately,
Augeas 0.10 appears to be the most popular version currently.</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._set_locations">
<code class="descname">_set_locations</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#ApacheParser._set_locations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._set_locations" title="Permalink to this definition">¶</a></dt>
<dd><p>Set default location for directives.</p>
<p>Locations are given as file_paths
.. todo:: Make sure that files are included</p>
</dd></dl>
<dl class="method">
<dt id="certbot_apache.parser.ApacheParser._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_apache/parser.html#ApacheParser._find_config_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.ApacheParser._find_config_root" title="Permalink to this definition">¶</a></dt>
<dd><p>Find the Apache Configuration Root file.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="certbot_apache.parser.case_i">
<code class="descclassname">certbot_apache.parser.</code><code class="descname">case_i</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#case_i"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.case_i" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns case insensitive regex.</p>
<p>Returns a sloppy, but necessary version of a case insensitive regex.
Any string should be able to be submitted and the string is
escaped and then made case insensitive.
May be replaced by a more proper /i once augeas 1.0 is widely
supported.</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>string</strong> (<em>str</em>) – string to make case i regex</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="certbot_apache.parser.get_aug_path">
<code class="descclassname">certbot_apache.parser.</code><code class="descname">get_aug_path</code><span class="sig-paren">(</span><em>file_path</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/certbot_apache/parser.html#get_aug_path"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#certbot_apache.parser.get_aug_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Return augeas path for full filepath.</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>file_path</strong> (<em>str</em>) – Full filepath</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div class="articleComments">
</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_apache.tls_sni_01" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="obj.html" class="btn btn-neutral" title="certbot_apache.obj" accesskey="p" rel="prev"><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,
SOURCELINK_SUFFIX: '.txt'
};
</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>
|