2015-04-22 04:32:34 -04:00
|
|
|
"""Apache plugin constants."""
|
|
|
|
|
import pkg_resources
|
|
|
|
|
|
|
|
|
|
|
2015-05-08 17:32:13 -04:00
|
|
|
CLI_DEFAULTS = dict(
|
|
|
|
|
server_root="/etc/apache2",
|
|
|
|
|
ctl="apache2ctl",
|
|
|
|
|
enmod="a2enmod",
|
2015-07-30 02:40:07 -04:00
|
|
|
dismod="a2dismod",
|
2015-05-22 03:28:21 -04:00
|
|
|
le_vhost_ext="-le-ssl.conf",
|
2015-05-08 17:32:13 -04:00
|
|
|
)
|
|
|
|
|
"""CLI defaults."""
|
2015-04-22 04:32:34 -04:00
|
|
|
|
2015-06-01 20:14:10 -04:00
|
|
|
MOD_SSL_CONF_DEST = "options-ssl-apache.conf"
|
|
|
|
|
"""Name of the mod_ssl config file as saved in `IConfig.config_dir`."""
|
2015-04-22 04:32:34 -04:00
|
|
|
|
2015-06-01 20:14:10 -04:00
|
|
|
MOD_SSL_CONF_SRC = pkg_resources.resource_filename(
|
2015-06-07 04:31:50 -04:00
|
|
|
"letsencrypt_apache", "options-ssl-apache.conf")
|
2015-04-22 04:32:34 -04:00
|
|
|
"""Path to the Apache mod_ssl config file found in the Let's Encrypt
|
|
|
|
|
distribution."""
|
|
|
|
|
|
2015-11-04 15:12:39 -05:00
|
|
|
AUGEAS_LENS_DIR = pkg_resources.resource_filename(
|
|
|
|
|
"letsencrypt_apache", "augeas_lens")
|
|
|
|
|
"""Path to the Augeas lens directory"""
|
2015-11-02 19:22:58 -05:00
|
|
|
|
2015-04-22 04:32:34 -04:00
|
|
|
REWRITE_HTTPS_ARGS = [
|
2015-07-21 20:16:46 -04:00
|
|
|
"^", "https://%{SERVER_NAME}%{REQUEST_URI}", "[L,QSA,R=permanent]"]
|
2015-04-22 04:32:34 -04:00
|
|
|
"""Apache rewrite rule arguments used for redirections to https vhost"""
|
2015-11-06 17:31:30 -05:00
|
|
|
|
2015-11-07 23:37:57 -05:00
|
|
|
|
|
|
|
|
HSTS_ARGS = ["always", "set", "Strict-Transport-Security",
|
2015-11-06 17:31:30 -05:00
|
|
|
"\"max-age=31536000; includeSubDomains\""]
|
|
|
|
|
"""Apache header arguments for HSTS"""
|
|
|
|
|
|
2015-11-07 23:37:57 -05:00
|
|
|
UIR_ARGS = ["always", "set", "Content-Security-Policy",
|
2015-11-08 10:21:36 -05:00
|
|
|
"upgrade-insecure-requests"]
|
2015-11-07 23:37:57 -05:00
|
|
|
|
2015-11-08 10:21:36 -05:00
|
|
|
HEADER_ARGS = {"Strict-Transport-Security": HSTS_ARGS,
|
|
|
|
|
"Upgrade-Insecure-Requests": UIR_ARGS}
|
2015-11-07 23:37:57 -05:00
|
|
|
|