Skip to content

feat: customize welcome page#557

Merged
scbizu merged 1 commit into
helm:mainfrom
dirien:welcome_page
Mar 15, 2022
Merged

feat: customize welcome page#557
scbizu merged 1 commit into
helm:mainfrom
dirien:welcome_page

Conversation

@dirien

@dirien dirien commented Mar 5, 2022

Copy link
Copy Markdown
Contributor

Fixes: #550

Hi,

this PR enables potential users to provide their own Welcome page.

With the flag --web-template-path=<path>, you can specify the path to your custom welcome page.

The structure of the folder should be like this:

web/
  index.html
  xyz.html
  static/
      main.css
      main.js

I use c.HTML to serve the custom welcome page, this means we have full access to the go-template engine

The rules are: Every file with html ending will be picked up. This is useful if you want to create templates and include them in the main index.html file (see my example). But only the index.html will be served!

Static files (css, js or pics) should be saved into the static folder. I check the code, if the static folder if present to serve this.

Currently, their is no support for variables in the template.

If everybody like this, I will extend the enable the helm chart too.

Example:
image

Looking for your feedback!

@cbuto cbuto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! 🎉

Looks good for the most part, I did note one issue around auth that we'll have to figure out.

Comment thread pkg/chartmuseum/server/multitenant/server.go
Comment thread web/body.html Outdated
@dirien
dirien requested a review from cbuto March 7, 2022 23:57

@cbuto cbuto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing the auth! I think this should be good to go once some basic unit tests are updated/added to cover this new feature. Thanks!!

Comment thread pkg/chartmuseum/router/match.go Outdated
Comment thread pkg/chartmuseum/server/multitenant/handlers.go
@dirien
dirien force-pushed the welcome_page branch 2 times, most recently from e1fc6a0 to 93d4633 Compare March 8, 2022 23:37
@dirien

dirien commented Mar 8, 2022

Copy link
Copy Markdown
Contributor Author

Hi @cbuto,

add the tests and removed the folder with the example html files. The Readme has the new feature explained.

Looking for your feedback :)

@cbuto cbuto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! thanks for adding the tests!

maybe we can get one more review @nerdeveloper @scbizu?

Comment thread pkg/chartmuseum/server/multitenant/server.go Outdated
@cbuto
cbuto requested review from a team, nerdeveloper and scbizu and removed request for nerdeveloper and scbizu March 9, 2022 15:07
@cbuto cbuto added this to the v0.15.0 milestone Mar 9, 2022

@scbizu scbizu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM , adds some small code suggestions.

Comment thread pkg/chartmuseum/server/multitenant/handlers_test.go
Comment thread pkg/chartmuseum/server/multitenant/server.go Outdated
Comment thread pkg/chartmuseum/server/multitenant/server.go Outdated
@scbizu

scbizu commented Mar 11, 2022

Copy link
Copy Markdown
Contributor

@cbuto I am coming ~

@dirien Thanks for your creative PR ~

@dirien

dirien commented Mar 11, 2022

Copy link
Copy Markdown
Contributor Author

HI @scbizu, thanks for the input.

I changed the parts! Looking forward for your fedback!

Comment thread pkg/chartmuseum/server/multitenant/server.go

@scbizu scbizu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dirien Need some more small changes here XD

@dirien

dirien commented Mar 13, 2022

Copy link
Copy Markdown
Contributor Author

@scbizu done. moved the error check above the range.

@dirien
dirien requested a review from scbizu March 13, 2022 10:02

@scbizu scbizu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dirien add some error log is better ?

Comment thread pkg/chartmuseum/server/multitenant/server.go
Comment thread pkg/chartmuseum/server/multitenant/server.go
Signed-off-by: Engin Diri <[email protected]>
@dirien
dirien requested a review from scbizu March 14, 2022 06:40
@scbizu
scbizu merged commit 1de4aa3 into helm:main Mar 15, 2022
@scbizu

scbizu commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

LGTM , merged .

@dirien
dirien deleted the welcome_page branch March 15, 2022 05:53
@dirien

dirien commented Mar 15, 2022

Copy link
Copy Markdown
Contributor Author

Thanks a lot @scbizu and @cbuto

@cbuto

cbuto commented Mar 15, 2022

Copy link
Copy Markdown
Contributor

Thanks for working on this @dirien! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to customize welcome page

3 participants