-
Notifications
You must be signed in to change notification settings - Fork 2
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
upgrade to Keycloakify 11 #3272
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
4b2d680
Add starter; add nvmrc; add yarn to package.json; copy over Dockerfile
fhennig b1167a5
yarn install
fhennig c6993bd
Apply theos fix
fhennig dabec3d
Fix casing warning
fhennig e3d4c29
don't copy .yarn/releases, as it shouldn't be needed if packageManage…
fhennig bdf6de3
Restrict license to apply only to this repo as before!
fhennig 5f4e5cf
Set theme name
fhennig 957ef6f
Fix package name
fhennig e0eea87
Update README
fhennig b751fbb
yarn install
fhennig ba04eca
Update Dockerfile for new output filenames
fhennig e505074
Update auto-gen file
fhennig 3e36cd4
fix docker
fhennig 09394c9
remove outdated comment
fhennig 1b75cab
Add comment about the version switch
fhennig 5f7ddc8
Update README a bit more
fhennig d6f991e
Copy over dockerignore
fhennig 1d6124a
add 'nvm use' to README
fhennig 8ef9e01
add email theme as we did so previously
fhennig 47989e7
delete upstream ci file
fhennig 755a507
Update favicon
fhennig cfafdbc
apparently formatting the README?
fhennig df1d67d
Add ORCID button to register?
fhennig a8bab1f
Make ORCID logo prettier -- use the same code as on the login page
fhennig 1b0acea
fix
fhennig f2543ab
Add old email text back
fhennig e4a9233
Upercase KcContext
fhennig 97cf2c0
Fix export back to how it is in starter
corneliusroemer a35e31e
Update Readme, it's one of the few things that are good to change fro…
corneliusroemer d8f904f
Add ToS Storybook with ORCID
fhennig 828c759
add basic styling
fhennig b9e60f9
Add link to ToS and Privacy Policy
fhennig 2fcd1ad
Fix org invite text
fhennig d735279
Improve Orcid icon handling
fhennig d04d5e4
formatting
fhennig 09af143
Hide realm name in layout
fhennig e9ea5f8
Hardcode termsAcceptanceRequired=true
fhennig 554579b
Add link to GH issue
fhennig 6d9d189
Eject IdpReviewUserProfile
fhennig 85db45b
Add back email theme; use PROJECT_NAME env var instead of realmName
fhennig cf0a503
Display header again, but don't use realm name, use env.PROJECT_NAME …
fhennig 6c1a866
Fix env var usage
fhennig 1bfb616
Add checkbox to the post-orcid-profile thingie
fhennig 3ab7bc8
add REGISTRATION_TERMS_MESSAGE env var
fhennig 923370f
Use ToS from env
fhennig 7a65f9a
helmchart: Set PROJECT_NAME from Values.name
fhennig fd4c9f4
silly me ... fix
fhennig b0b0bd7
Fix HTML injection
fhennig c679fcc
Update readme
fhennig 6b073c5
remove old theme
fhennig a7467af
Add theme.properties back
fhennig 3bf4195
email fix now?
fhennig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react-hooks/recommended", | ||
"plugin:storybook/recommended" | ||
], | ||
'react-hooks/exhaustive-deps': 'off', | ||
'@typescript-eslint/no-redeclare': 'off', | ||
'no-labels': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.stories.*'], | ||
rules: { | ||
'import/no-anonymous-default-export': 'off', | ||
}, | ||
ignorePatterns: ["dist", ".eslintrc.cjs"], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["react-refresh"], | ||
rules: { | ||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }], | ||
"react-hooks/exhaustive-deps": "off", | ||
"@typescript-eslint/no-redeclare": "off", | ||
"no-labels": "off" | ||
}, | ||
], | ||
} | ||
overrides: [ | ||
{ | ||
files: ["**/*.stories.*"], | ||
rules: { | ||
"import/no-anonymous-default-export": "off" | ||
} | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,4 @@ jspm_packages | |
|
||
/dist_keycloak | ||
/build | ||
/storybook-static | ||
/storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
/dist/ | ||
/dist_keycloak/ | ||
/public/keycloakify-dev-resources/ | ||
/.vscode/ | ||
/.yarn_home/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"printWidth": 90, | ||
"tabWidth": 4, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"**/login/pages/*.tsx", | ||
"**/account/pages/*.tsx", | ||
"**/login/Template.tsx", | ||
"**/account/Template.tsx", | ||
"**/login/UserProfileFormFields.tsx", | ||
"KcApp.tsx" | ||
], | ||
"options": { | ||
"printWidth": 150 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-onboarding", | ||
"@storybook/addon-interactions", | ||
"@chromatic-com/storybook" | ||
], | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
staticDirs: ["../public"], | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [], | ||
framework: { | ||
name: "@storybook/react-vite", | ||
options: {} | ||
}, | ||
staticDirs: ["../public"] | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<style> | ||
body.sb-show-main.sb-main-padded { | ||
padding: 0; | ||
} | ||
|
||
/* Following styles are just meant to avoid white flash when switching from one story to another */ | ||
@keyframes fadeToTransparent { | ||
from { | ||
background-color: #393939; | ||
} | ||
|
||
to { | ||
background-color: transparent; | ||
} | ||
} | ||
html { | ||
animation: fadeToTransparent 500ms forwards ease-in; | ||
} | ||
body > .sb-preparing-docs { | ||
visibility: hidden; | ||
} | ||
body > .sb-preparing-story { | ||
visibility: hidden; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default preview; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
nodeLinker: node-modules | ||
yarnPath: .yarn/releases/yarn-4.2.2.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,74 @@ | ||
# Keycloakify theme | ||
# Loculus Keycloakify theme | ||
|
||
This is a keycloak theme, built with keycloakify, and branched from <https://github.com/keycloakify/keycloakify-starter>. | ||
This theme is primarily used for: | ||
|
||
We last synced with upstream on 2024-05-11. | ||
- Adding ORCID support | ||
- Adding a little tickbox to the registration process, as well as the IDP review page (after registering with ORCID). | ||
- Minimal styling changes. | ||
- Overriding the realm name in various places. | ||
|
||
To preview in the storybook: | ||
Changes are deliberately kept minimal to make it easier to maintain the theme. | ||
|
||
Based on upstream commit: https://github.com/keycloakify/keycloakify-starter/commit/a543bc0f73e5874648cf6d907c88aba9b4b48536 | ||
|
||
## Quick start | ||
|
||
```bash | ||
nvm use | ||
corepack install | ||
yarn install --immutable | ||
``` | ||
|
||
If you get: | ||
|
||
```log | ||
error This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.22. | ||
``` | ||
|
||
then uninstall the global yarn version (e.g. `homebrew install yarn`) and try `yarn install` again. | ||
|
||
## Testing the theme locally | ||
|
||
### Storybook | ||
|
||
For a quick preview of the theme, you can use Storybook: | ||
|
||
```bash | ||
nvm use # use the correct node version | ||
yarn install --immutable # install dependencies (it's like npm install) | ||
yarn storybook | ||
``` | ||
|
||
To build a JAR and package it into an image that copies it to an output directory, build the Dockerfile. (This is done by CI). | ||
Then visit http://localhost:6006/ | ||
|
||
### Use with actual dev Keycloak | ||
|
||
Currently, only the login theme is implemented. | ||
Not so useful right now as it doesn't show the right pages yet: | ||
|
||
## Dependency documentation | ||
```sh | ||
npx keycloakify start-keycloak | ||
``` | ||
|
||
(needs port 8080 to be available, so shut down your cluster if you have one running) | ||
|
||
### Keycloakify | ||
Then visit https://my-theme.keycloakify.dev (ensure ad blocker is disabled if you get an error). | ||
|
||
https://docs.keycloakify.dev/ | ||
[Documentation](https://docs.keycloakify.dev/testing-your-theme) | ||
|
||
### Keycloak ORCID | ||
## How to customize the theme | ||
|
||
https://github.com/eosc-kc/keycloak-orcid | ||
[Documentation](https://docs.keycloakify.dev/customization-strategies) | ||
|
||
## Installing yarn 4 | ||
## Building the theme | ||
|
||
Prerequisite: node | ||
You need to have [Maven](https://maven.apache.org/) installed to build the theme (Maven >= 3.1.1, Java >= 7). | ||
The `mvn` command must be in the $PATH. | ||
|
||
- macOS: `brew install maven` | ||
- On Debian/Ubuntu: `sudo apt-get install maven` | ||
- On Windows: `choco install openjdk` and `choco install maven` (Or download from [here](https://maven.apache.org/download.cgi)) | ||
|
||
```bash | ||
corepack enable | ||
corepack install yarn | ||
npm run build-keycloak-theme | ||
``` | ||
|
||
Note that by default Keycloakify generates multiple .jar files for different versions of Keycloak. | ||
You can customize this behavior, see documentation [here](https://docs.keycloakify.dev/targeting-specific-keycloak-versions). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<!-- | ||
Notice the use of %BASE_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
|
||
Unlike "/favicon.ico" or "favicon.ico", "%BASE_URL%favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
--> | ||
<link rel="icon" type="image/svg+xml" sizes="32x32" href="%BASE_URL%favicon.svg"> | ||
|
||
<title>Loculus Authentication</title> | ||
|
||
<meta name="keycloakify-ignore-start"> | ||
<script>console.log("This is logged Only in the main app, stripped out in the theme")</script> | ||
<meta name="keycloakify-ignore-end"> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we use storybook we should test it in CI so we can upgrade without surprises. I.e. don't revert this
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.
build-storybook
doesn't exist anymore, and there isn't a replacement AFAIK