Last active
May 11, 2024 21:42
-
-
Save frederickding/6c614b8d473988dd7475383a1acaf6f3 to your computer and use it in GitHub Desktop.
Apache fancyindex for PKI files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Index of /pki</title> | |
<style type="text/css"> | |
body { | |
font-family: Georgia, Century, serif; | |
} | |
table { | |
border-spacing: 4px; | |
} | |
td { | |
font-family: monospace; | |
padding-left: 1em; | |
padding-right: 1em; | |
} | |
table tr th:nth-child(4), table tr td:nth-child(4) { | |
visibility: hidden; | |
} | |
table tr td:first-child { | |
width: 20em; | |
} | |
table tr td { | |
min-width: 6em; | |
} | |
</style> | |
</head> | |
<h1>Index of /pki</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Header set Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate" | |
Header set Pragma "no-cache" | |
IndexOptions FancyIndexing SuppressHTMLPreamble HTMLTable -SuppressDescription SuppressIcon SuppressColumnSorting | |
HeaderName .header.html | |
ReadmeName .footer.html | |
RewriteEngine On | |
RewriteRule "(.*\.crt)\.txt" "$1?txt" [QSD] | |
RewriteRule "(.*).pem" "$1.crt?txt" [QSD] | |
RewriteCond "%{QUERY_STRING}" "txt" | |
RewriteRule ".?" "-" [T=text/plain,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is some Apache configuration so that when root/intermediate certification authority files are stored as base64-encoded PEM files with the extension .crt (which Windows likes), the same file will also be available as .pem and .txt files. Additionally, those .pem and .txt options are served as plain text (which is useful for pasting from a browser into a terminal or other UI).
mod_rewrite and mod_autoindex are needed.
Screenshot