Commit graph

13 commits

Author SHA1 Message Date
Joona Hoikkala
ba84b7ab49 Add test to prevent regressions of #4183 (#5134) 2017-09-27 15:51:28 -07:00
Joona Hoikkala
1ce813c3cc Do not parse disabled configuration files from under sites-available on Debian / Ubuntu (#4104)
This changes the apache plugin behaviour to only parse enabled configuration files and respecting the --apache-vhost-root CLI parameter for new SSL vhost creation. If --apache-vhost-root isn't defined, or doesn't exist, the SSL vhost will be created to originating non-SSL vhost directory.

This PR also implements actual check for vhost enabled state, and makes sure parser.parse_file() does not discard changes in Augeas DOM, by doing an autosave.

Also handles enabling the new SSL vhost, if it's on a path that's not parsed by Apache.

Fixes: #1328
Fixes: #3545
Fixes: #3791
Fixes: #4523
Fixes: #4837
Fixes: #4905

* First changes

* Handle rest of the errors

* Test fixes

* Final fixes

* Make parse_files accessible and fix linter problems

* Activate vhost at later time

* Cleanup

* Add a new test case, and fix old

* Enable site later in deploy_cert

* Make apache-conf-test default dummy configuration enabled

* Remove is_sites_available as obsolete

* Cleanup

* Brought back conditional vhost_path parsing

* Parenthesis

* Fix merge leftovers

* Fix to work with the recent changes to new file creation

* Added fix and tests for non-symlink vhost in sites-enabled

* Made vhostroot parameter for ApacheParser optional, and removed extra_path

* Respect vhost-root, and add Include statements to root configuration if needed

* Fixed site enabling order to prevent apache restart error while enabling mod_ssl

* Don't exclude Ubuntu / Debian vhost-root cli argument

* Changed the SSL vhost directory selection priority

* Requested fixes for paths and vhost discovery

* Make sure the Augeas DOM is written to disk before loading new files

* Actual checking for if the file is parsed within existing Apache configuration

* Fix the order of dummy SSL directives addition and enabling modules

* Restructured site_enabled checks

* Enabling vhost correctly for non-debian systems
2017-09-25 12:03:09 -07:00
Joona Hoikkala
65c7a5a6f7 Add support for multivhosts in Apache
* Case sensitivity fixes

* Clean up merge leftovers

* Get correct vhost paths when appending to already existing multivhost -le-ssl.conf

* Test, lint and reverter fixes

* Make py26 happy

* Removed skeletons

* Changed new vhost matching

* Added span flag for augeas init

* Extract VirtualHost using aug_span

* Removed dead code

* Fix tests to mitigate not being able to reload Augeas span values after write

* Small fixes and test coverage

* Implementing changes requested in review
2017-05-02 15:56:55 -07:00
Noah Swartz
f57f35b1dd Start work on multivhost support in Apache
* get through parsing

* not slice

* add mult vhost per file

* idx line backwards

* blocks be wrong

* always close ifmod

* let's not mess up indexes

* don't double add multi

* fix some lint, only dedupe multi

* tests

* fix lint

* in progress bit flip

* try to pick the right vhost

* take Dominic's suggestion

* don't redo search

* add ancestor

* we now support multiple vhosts

* yay

* add docstrings
2017-05-02 15:38:27 -07:00
Brad Warren
28ce10fef5 Don't add ServerAlias directives when the domain is already covered by a wildcard (#3917)
* correctly match * and ? in ServerAlias directives

* update Apache wildcard test

* Consolidate wildcard matching and remove bad test

* Test Apache vhost selection with wildcards

* Added few more tests to proof vhost selection
2016-12-20 15:53:52 -08:00
Noah Swartz
a4d38c8831 add file in sites-enabled so git doesn't throw it out 2016-07-11 14:32:00 -07:00
Noah Swartz
8f1a141d2a incorporate brad's comments 2016-07-11 13:20:31 -07:00
Noah Swartz
395843f3f4 fix coverage 2016-06-29 11:06:18 -07:00
Noah Swartz
78b30539fa augeas tests 2016-06-28 17:56:31 -07:00
Noah Swartz
50d900718b add invalid file for cover 2016-06-16 16:22:42 -07:00
Sagi Kedmi
ad76de2502 OCSP Stapling Enhancement for Apache (#2723)
Currently supports only Apache >=2.3.3.
letsencrypt --staple-ocsp -d dumpbits.com [no problem to set it on for apache => 2.3.3]
To check OCSP Stapling:
[~]$ echo QUIT | openssl s_client -connect dumpbits.com:443 -status 2>/dev/null | grep -A 31 'OCSP Resp'
OCSP Response Data:
    OCSP Response Status: successful (0x0)
    Response Type: Basic OCSP Response
    Version: 1 (0x0)
    Responder Id: C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
    Produced At: Mar 26 17:54:00 2016 GMT
    Responses:
    Certificate ID:
      Hash Algorithm: sha1
      Issuer Name Hash: 7EE66AE7729AB3FCF8A220646C16A12D6071085D
      Issuer Key Hash: A84A6A63047DDDBAE6D139B7A64565EFF3A8ECA1
      Serial Number: 032A2108AAA650E6EE2E6B041C03C2612A19
    Cert Status: good
    This Update: Mar 26 17:00:00 2016 GMT
    Next Update: Apr  2 17:00:00 2016 GMT

    Signature Algorithm: sha256WithRSAEncryption
         64:f2:71:02:6a:97:d9:eb:13:c1:5c:7a:f5:eb:26:89:3b:40:
         e3:08:82:f7:71:d4:fa:61:4a:8e:4a:7d:e9:53:84:e9:3a:89:
         67:66:08:d9:0e:79:65:9a:8d:dc:fb:07:cc:93:4f:eb:4e:3c:
         cc:7f:cd:fd:db:8f:c3:25:c3:54:87:a9:9c:35:6f:c1:39:31:
         e0:b1:f6:b1:3d:52:5d:db:bb:69:0f:23:05:fe:33:29:1f:ff:
         c6:af:17:a5:98:58:50:3a:48:93:5c:09:4b:f3:91:36:48:31:
         ed:ee:47:4d:66:c3:25:cf:56:b7:f4:48:80:eb:b8:f0:27:b1:
         97:18:b4:88:71:c6:55:5d:bb:25:16:48:98:85:8a:12:8d:64:
         bf:51:df:39:b1:44:91:e1:f2:c6:c3:7d:23:2b:d2:0f:4c:7f:
         57:b1:c9:ae:ec:32:b5:6a:87:bd:83:43:f1:f7:3c:8c:11:5c:
         9d:a5:12:fa:e6:79:87:45:c6:1d:46:c8:14:1e:8d:d1:de:7a:
         0d:e4:53:f2:c9:b6:e5:6e:cb:91:14:bb:04:38:36:4f:71:55:
         e1:ff:71:c7:a6:31:ed:db:6c:0f:d7:f5:ef:0c:6e:08:6b:e0:
         37:cf:ca:a5:67:89:c2🇩🇪8e:36:6d:2f:41:7f:9f:10:c6🇩🇪
         4d:b1:2d:09
======================================
2016-05-19 16:04:18 -07:00
Brad Warren
755dc2f08d s/Let's Encrypt/Certbot certbot-apache 2016-04-13 16:36:53 -07:00
Brad Warren
2002511f81 s/letsencrypt/certbot letsencrypt-apache 2016-04-13 16:30:57 -07:00