-
Notifications
You must be signed in to change notification settings - Fork 506
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
Add an introduction page as the home page #1945
Conversation
@nrwiersma great ideas code wise. What do you think about the concept of the feature though? I have an alternative idea that I also listed here that I'm kind of leaning in the direction of, which is to allow the user to specify their own template and we just load it from disk. |
I like the idea here of a fixed one to start, and should people need a customisable, then add the complexity, IMO. |
This is great feedback. I do think I'm going to move it to a file based Go-template the user can swap out, but I'll add something to the container image so that we ship a default one. |
Normalize the homepage test to be like the others. We just want to make sure it results in a 200.
@nrwiersma let me know what you think of this. Instead of adding a file to the container image I just kept the default baked in and simplified the logic. |
Revert linting changes and improve error handling of the template file read
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [gomods/athens](https://github.com/gomods/athens) | minor | `v0.13.3` -> `v0.14.0` | --- ### Release Notes <details> <summary>gomods/athens (gomods/athens)</summary> ### [`v0.14.0`](https://github.com/gomods/athens/releases/tag/v0.14.0) [Compare Source](https://github.com/gomods/athens/compare/v0.13.3...v0.14.0) #### What's Changed - update-go-pkg(deps): bump github.com/aws/aws-sdk-go from 1.44.220 to 1.51.21 by [@​dependabot](https://github.com/dependabot) in [https://github.com/gomods/athens/pull/1942](https://github.com/gomods/athens/pull/1942) - Add an introduction page as the home page by [@​matt0x6F](https://github.com/matt0x6F) in [https://github.com/gomods/athens/pull/1945](https://github.com/gomods/athens/pull/1945) - build(deps): bump golang.org/x/net from 0.22.0 to 0.23.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/gomods/athens/pull/1946](https://github.com/gomods/athens/pull/1946) - Add logging configuration docs by [@​matt0x6F](https://github.com/matt0x6F) in [https://github.com/gomods/athens/pull/1952](https://github.com/gomods/athens/pull/1952) - Docs overhaul by [@​matt0x6F](https://github.com/matt0x6F) in [https://github.com/gomods/athens/pull/1954](https://github.com/gomods/athens/pull/1954) - Upgrade to AWS SDK v2 ([#​1938](https://github.com/gomods/athens/issues/1938)) by [@​nesangcode](https://github.com/nesangcode) in [https://github.com/gomods/athens/pull/1950](https://github.com/gomods/athens/pull/1950) - update-github-action(deps): bump golangci/golangci-lint-action from 4 to 5 by [@​dependabot](https://github.com/dependabot) in [https://github.com/gomods/athens/pull/1956](https://github.com/gomods/athens/pull/1956) - Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.25.0 to 0.46.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/gomods/athens/pull/1901](https://github.com/gomods/athens/pull/1901) - update-go-pkg(deps): bump github.com/unrolled/secure from 0.0.0-20181221173256-0d6b5bb13069 to 1.14.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/gomods/athens/pull/1955](https://github.com/gomods/athens/pull/1955) #### New Contributors - [@​nesangcode](https://github.com/nesangcode) made their first contribution in [https://github.com/gomods/athens/pull/1950](https://github.com/gomods/athens/pull/1950) **Full Changelog**: gomods/athens@v0.13.3...v0.14.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/gomods/athens-charts). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: DrPsychick <[email protected]>
What is the problem I am trying to address?
The home page of Athens is just "Welcome to The Athens Proxy". While this is cute in an old internet kind of way, it isn't super informative to users of Athens. At my workplace we spent a decent amount of time building messaging for how to configure clients. It would be nice if users could land on the Athens page and know how to configure their clients.
How is the fix applied?
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, I've introduced
ATHENS_HOME_TEMPLATE_PATH
as an environment variable along withHomeTemplatePath
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.What GitHub issue(s) does this PR fix or close?
Closes #1944