Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken templates #2

Merged
merged 1 commit into from Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -4,19 +4,25 @@ if (${lemonldap}{CrtFile}) {
$cert = ${lemonldap}{CrtFile};
} elsif (${pki}{CrtFile}) {
$cert = ${pki}{CrtFile};
} else $cert = "/etc/pki/tls/certs/localhost.crt";
} else {
$cert = "/etc/pki/tls/certs/localhost.crt";
}

if (${lemonldap}{KeyFile}) {
$key = ${lemonldap}{KeyFile};
} elsif (${pki}{KeyFile}) {
$key = ${pki}{KeyFile};
} else $key = "/etc/pki/tls/private/localhost.key";
} else {
$key = "/etc/pki/tls/private/localhost.key";
}

if (${lemonldap}{ChainFile}) {
$chain = "SSLCertificateChainFile " . ${lemonldap}{ChainFile};
} elsif (${pki}{ChainFile}) {
$chain = "SSLCertificateChainFile " . ${pki}{ChainFile};
} else $chain = "#SSLCertificateChainFile";
} else {
$chain = "#SSLCertificateChainFile";
}

$OUT .= <<__EOF__

Expand Down Expand Up @@ -116,4 +122,4 @@ $OUT .= <<__EOF__
#Header set Strict-Transport-Security "max-age=15768000"
</VirtualHost>
__EOF__
}
}
Expand Up @@ -4,19 +4,25 @@ if (${lemonldap}{CrtFile}) {
$cert = ${lemonldap}{CrtFile};
} elsif (${pki}{CrtFile}) {
$cert = ${pki}{CrtFile};
} else $cert = "/etc/pki/tls/certs/localhost.crt";
} else {
$cert = "/etc/pki/tls/certs/localhost.crt";
}

if (${lemonldap}{KeyFile}) {
$key = ${lemonldap}{KeyFile};
} elsif (${pki}{KeyFile}) {
$key = ${pki}{KeyFile};
} else $key = "/etc/pki/tls/private/localhost.key";
} else {
$key = "/etc/pki/tls/private/localhost.key";
}

if (${lemonldap}{ChainFile}) {
$chain = "SSLCertificateChainFile " . ${lemonldap}{ChainFile};
} elsif (${pki}{ChainFile}) {
$chain = "SSLCertificateChainFile " . ${pki}{ChainFile};
} else $chain = "#SSLCertificateChainFile";
} else {
$chain = "#SSLCertificateChainFile";
}

$OUT .= <<__EOF__

Expand All @@ -28,7 +34,7 @@ if (${lemonldap}{ChainFile}) {
SSLEngine on
# For example with certbot (you need a certificate to run https)
SSLCertificateFile $cert
SSLCertificateChainFile $chain
$chain
SSLCertificateKeyFile $key

# Uncomment this if you are running behind a reverse proxy and want
Expand Down