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
feat(idp): support login page background configuration #7900
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Edit: fixed in #7915 Note for reviewers, I wasn't able to build the project without updating the Go version in the dockerfile. Some modules were using a newer Go version. Here's what I was seeing:
Here was the fix: diff --git a/Dockerfile b/Dockerfile
index 48ac9f23a0..24dc73d61d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,7 +21,7 @@ COPY ./ /ocis/
WORKDIR /ocis/ocis
RUN make ci-node-generate
-FROM owncloudci/golang:1.20 as build
+FROM owncloudci/golang:1.21 as build
COPY --from=generate /ocis /ocis |
200f402
to
1c9d108
Compare
services/idp/src/index.tsx
Outdated
@@ -9,11 +9,18 @@ import store from './store'; | |||
|
|||
import './app.css'; | |||
|
|||
const root = document.getElementById('root') | |||
|
|||
// if a custome background image has been configured, use it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// if a custome background image has been configured, use it | |
// if a custom background image has been configured, make use of it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops 😅 Will include in the next patch
services/idp/src/index.tsx
Outdated
ReactDOM.render( | ||
<React.StrictMode> | ||
<Provider store={store as any}> | ||
<App/> | ||
<div className='oc-login-bg' style={bgImg ? { backgroundImage: `url(${bgImg})` } : {}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have the attributes on the App or even deeper (slot or something), I'd like to avoid adding an extra wrapping div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping to go that route, but I had some trouble getting the background to render when I added this directly on the App
or children. I'm don't know enough about Material UI to know why that isn't working :/
I made a few adjustments though, I moved the div down to App
and pass the image url as a prop. I think it's a bit cleaner, keeping the styling contained in App
and out of the root component.
1c9d108
to
2e3b6e7
Compare
services/idp/src/App.jsx
Outdated
@@ -13,14 +14,23 @@ const LazyMain = lazy(() => import(/* webpackChunkName: "identifier-main" */ './ | |||
|
|||
console.info(`Kopano Identifier build version: ${version.build}`); // eslint-disable-line no-console | |||
|
|||
const App = (): ReactElement => { | |||
const App = ({ bgImg }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check the type again? Might be ReactNode ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely :-)
2e3b6e7
to
88a4561
Compare
This revision introduces a new environment variable `IDP_LOGIN_BACKGROUND_URL` that overrides the default background image of the IDP login page when present.
88a4561
to
fbb4f9b
Compare
Rebased onto the tip of master. @kulmann @janackermann this should be ready for re-review :-) |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
feat(idp): support login page background configuration
Description
This revision introduces a new environment variable
IDP_LOGIN_BACKGROUND_URL
that overrides the default background image of the IDP login page when present.Related Issue
Motivation and Context
First, I want to confess that I'm by no means a frontend developer. I'll happily accept any feedback :-)
One of the main motivations of this change is to get closer to improving consistency across the services that I host in my lab. It's possible to configure the PhotoPrism background image, and I wanted a similar look and feel with owncloud.
My original idea was to allow the user to upload or configure an image, but that's a fair bit of work and it doesn't need to be that complicated. Simply updating the stylesheet with an externally configurable address is good enough ™️
Discussed in #7674 was the eventual migration to another provider like Authelia, and I understand that this feature will become irrelevant when that migration happens. I think this is acceptable, and I think this small feature provides good value in the meantime 🙂
How Has This Been Tested?
Tested with and without
IDP_LOGIN_BACKGROUND_URL
:Then, in the browser navigate to
locahost:9200
.Screenshots (if appropriate):
Types of changes
Checklist: