certbot_apache.obj
¶
Module contains classes used by the Apache Configurator.
-
class
certbot_apache.obj.
Addr
(tup, ipv6=False)[source]¶ Bases:
certbot.plugins.common.Addr
Represents an Apache address.
-
_addr_less_specific
(addr)[source]¶ Returns if addr.get_addr() is more specific than self.get_addr().
-
_rank_specific_addr
()[source]¶ Returns numerical rank for get_addr()
Returns: 2 - FQ, 1 - wildcard, 0 - _default_ Return type: int
-
conflicts
(addr)[source]¶ Returns if address could conflict with correct function of self.
Could addr take away service provided by self within Apache?
Todo
Handle domain name addrs…
Examples:
127.0.0.1:\*.conflicts(127.0.0.1:443)
True 127.0.0.1:443.conflicts(127.0.0.1:\*)
False \*:443.conflicts(\*:80)
False _default_:443.conflicts(\*:443)
True
-
-
class
certbot_apache.obj.
VirtualHost
(filep, path, addrs, ssl, enabled, name=None, aliases=None, modmacro=False, ancestor=None)[source]¶ Bases:
object
Represents an Apache Virtualhost.
Variables: - filep (str) – file path of VH
- path (str) – Augeas path to virtual host
- addrs (set) – Virtual Host addresses (
set
ofcommon.Addr
) - name (str) – ServerName of VHost
- aliases (list) – Server aliases of vhost
(
list
ofstr
) - ssl (bool) – SSLEngine on in vhost
- enabled (bool) – Virtual host is enabled
- modmacro (bool) – VirtualHost is using mod_macro
- ancestor (VirtualHost) – A non-SSL VirtualHost this is based on
https://httpd.apache.org/docs/2.4/vhosts/details.html
Todo
Any vhost that includes the magic _default_ wildcard is given the same ServerName as the main server.
-
conflicts
(addrs)[source]¶ See if vhost conflicts with any of the addrs.
This determines whether or not these addresses would/could overwrite the vhost addresses.
Parameters: addrs (Iterable :class:~obj.Addr) – Iterable Addresses Returns: If addresses conflicts with vhost Return type: bool
-
same_server
(vhost, generic=False)[source]¶ Determines if the vhost is the same ‘server’.
Used in redirection - indicates whether or not the two virtual hosts serve on the exact same IP combinations, but different ports. The generic flag indicates that that we’re trying to match to a default or generic vhost
Todo
Handle _default_