Add an introduction page as the home page (#1945)

A default homepage is baked into the server that uses the request host address, or in HTTP 2 the authority. This includes ports. It also checks for schema. The values are used to indicate to users how to configure their go env

Of course, this won't work on all installations - especially enterprise ones. For that, we've introduced ATHENS_HOME_TEMPLATE_PATH as an environment variable along with HomeTemplatePath in the config. This value defaults to /var/lib/athens/home.html but can be configured to any location that Athens can reliably read from. This is a Go HTML template so it should use Go HTML template formatting and logic.
This commit is contained in:
Matt
2024-04-20 00:19:34 -07:00
committed by GitHub
parent 8d9b7676fd
commit 359c119441
7 changed files with 291 additions and 31 deletions
+4
View File
@@ -169,6 +169,10 @@ BasicAuthUser = ""
# Env override: BASIC_AUTH_PASS
BasicAuthPass = ""
# A path on disk to a Go HTML template to be used on the homepage
# Env override: ATHENS_HOME_TEMPLATE_PATH
HomeTemplatePath = "/var/lib/athens/home.html"
# Set to true to force an SSL redirect
# Env override: PROXY_FORCE_SSL
ForceSSL = false