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

Add an introduction page as the home page #1945

Merged
merged 10 commits into from Apr 20, 2024

Conversation

matt0x6F
Copy link
Contributor

@matt0x6F matt0x6F commented Apr 18, 2024

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 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.

What GitHub issue(s) does this PR fix or close?

Closes #1944

@matt0x6F matt0x6F added the proposal A proposal for discussion and possibly a vote label Apr 18, 2024
@matt0x6F matt0x6F self-assigned this Apr 18, 2024
@matt0x6F matt0x6F requested a review from a team as a code owner April 18, 2024 01:53
@matt0x6F matt0x6F added the do not merge discussion prs, opinion prs, etc. label Apr 18, 2024
@matt0x6F matt0x6F added this to the 0.14.0 milestone Apr 18, 2024
cmd/proxy/actions/home.go Outdated Show resolved Hide resolved
cmd/proxy/actions/home.go Outdated Show resolved Hide resolved
cmd/proxy/actions/home.go Outdated Show resolved Hide resolved
@matt0x6F
Copy link
Contributor Author

@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.

@nrwiersma
Copy link
Contributor

I like the idea here of a fixed one to start, and should people need a customisable, then add the complexity, IMO.

@matt0x6F
Copy link
Contributor Author

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.

@matt0x6F
Copy link
Contributor Author

@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.

@matt0x6F matt0x6F added enhancement New feature or request and removed do not merge discussion prs, opinion prs, etc. labels Apr 20, 2024
@matt0x6F matt0x6F merged commit 359c119 into gomods:main Apr 20, 2024
11 checks passed
@matt0x6F matt0x6F deleted the introduction-page branch April 20, 2024 07:19
DrPsychick added a commit to gomods/athens-charts that referenced this pull request May 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [gomods/athens](https://togithub.com/gomods/athens) | minor |
`v0.13.3` -> `v0.14.0` |

---

### Release Notes

<details>
<summary>gomods/athens (gomods/athens)</summary>

### [`v0.14.0`](https://togithub.com/gomods/athens/releases/tag/v0.14.0)

[Compare
Source](https://togithub.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 [@&#8203;dependabot](https://togithub.com/dependabot) in
[gomods/athens#1942
- Add an introduction page as the home page by
[@&#8203;matt0x6F](https://togithub.com/matt0x6F) in
[gomods/athens#1945
- build(deps): bump golang.org/x/net from 0.22.0 to 0.23.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gomods/athens#1946
- Add logging configuration docs by
[@&#8203;matt0x6F](https://togithub.com/matt0x6F) in
[gomods/athens#1952
- Docs overhaul by [@&#8203;matt0x6F](https://togithub.com/matt0x6F) in
[gomods/athens#1954
- Upgrade to AWS SDK v2
([#&#8203;1938](https://togithub.com/gomods/athens/issues/1938)) by
[@&#8203;nesangcode](https://togithub.com/nesangcode) in
[gomods/athens#1950
- update-github-action(deps): bump golangci/golangci-lint-action from 4
to 5 by [@&#8203;dependabot](https://togithub.com/dependabot) in
[gomods/athens#1956
- Bump
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
from 0.25.0 to 0.46.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gomods/athens#1901
- update-go-pkg(deps): bump github.com/unrolled/secure from
0.0.0-20181221173256-0d6b5bb13069 to 1.14.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gomods/athens#1955

#### New Contributors

- [@&#8203;nesangcode](https://togithub.com/nesangcode) made their first
contribution in
[gomods/athens#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 <drpsychick@drsick.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal A proposal for discussion and possibly a vote
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a splash page
2 participants