Console Application for Kabanero
Please view our contribution guidelines for the Kabanero.io console.
This will only run the front end code (with hot reloading). These are the files under src/main/content/
. If you want the whole server running see Develop the full server.
- Run:
./scripts/jekyll_serve_dev.sh
This will run the server in liberty's dev mode which provides hot reloading for server side changes. Updates to the frontend files (html, css, js) won't be reloaded in this current setup. To develop the front end see Develop the front end.
- Package the jekyll frontend. From the repository's root directory:
-
export PAT=<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN> ./scripts/build_jekyll_maven.sh
- You can get a github PAT from your GitHub account. More information about Personal Access Tokens
-
- Run:
mvn liberty:dev
- The app will be available at
https://localhost:9443
- If you would like to enable the optional OAuth feature with this dev mode see Configure GitHub OAuth for Liberty dev mode
- The app will be available at
See Configuring the Kabanero Console with OAuth
- Follow Configuring the Kabanero Console with OAuth until you have a GitHub ClientID and Secret, then stop and come back here.
- On the root of this project if you do not already have a folder named
oauth
, create it. - Create a file
oauth/social_login_dev.xml
add copy the below in.<server> <featureManager> <feature>socialLogin-1.0</feature> <feature>appSecurity-2.0</feature> </featureManager> <githubLogin userApi="https://api.github.com/user" userNameAttribute="login" clientId="YOUR_ID" clientSecret="YOUR_SECRET" tokenEndpoint="https://github.com/login/oauth/access_token" authorizationEndpoint="https://github.com/login/oauth/authorize" scope="repo admin:org user" /> </server>
- Replace
YOUR_ID
andYOUR_SECRET
with your GitHub ID and Secret from the first step.- If targeting GitHub Enterprise, update the
userApi
,tokenEndpoint
, andauthorizationEndpoint
fields as well.
- If targeting GitHub Enterprise, update the
- Check if a
target
dir exists, if not, run:mvn liberty:create
- Create a dropin dir:
mkdir -p target/liberty/wlp/usr/servers/defaultServer/configDropins/defaults/
- Copy the file you just edited into it:
cp oauth/social_login_dev.xml target/liberty/wlp/usr/servers/defaultServer/configDropins/defaults/
- Export necessary env variables in your terminal, the values are not necessary as you have them filled in
social_login_dev.xml
alreadyexport USER_API= export AUTHORIZATION_ENDPOINT= export TOKEN_ENDPOINT= export WEBSITE=
- Start dev mode
mvn liberty:dev
Builds the base application. If you would like the optional OAuth feature enabled, follow Configure GitHub OAuth for Docker builds before running the build script.
./ci/build.sh
For production you do not need to mount the kube config, or add the -u 0
parameter.
-
Ensure Kabanero is installed on your cluster
- See Installing Kabanero Foundation for help installing Kabanero
-
Login to your cluster using the
oc
CLI. -
Run the docker image produced from the build step above:
docker run --rm -p 9443:9443 -v ~/.kube/config:/root/.kube/config -u 0 landing:latest
To manage your stacks via this console you must configure OAuth to your GitHub. When OAuth is configured properly, you will see "Manage Stacks" button on the instance page inside the stacks tile UI.
If you would like to setup GitHub OAuth for local development follow these steps:
- Follow Configuring the Kabanero Console with OAuth until you have a GitHub ClientID and Secret.
- Create an
oauth
directory in the root of this repository. - Create 3 files inside the oauth directory:
clientID
and place your GitHub OAuth ID in it and save.clientSecret
and place your GitHub OAuth secret in it and save..env
, and copy the below env vars into it. Change the values if you want to point to a different GitHub server. *USER_API=https://api.github.com/user TOKEN_ENDPOINT=https://github.com/login/oauth/access_token AUTHORIZATION_ENDPOINT=https://github.com/login/oauth/authorize WEBSITE=https://github.com
- For GitHub Enterprise both
TOKEN_ENDPOINT
andAUTHORIZATION_ENDPOINT
should be the same (except the hostname) andUSER_API
should behttps://<YOUR_HOSTNAME>/api/v3/user
- For GitHub Enterprise both
- Build and run the image.
- Build the image
- From the root of this repo run:
./ci/build.sh
- From the root of this repo run:
- Run the image
cd
to the root of this repository then run:docker run --rm -p 9443:9443 -v ~/.kube/config:/root/.kube/config -v "$(pwd)/oauth":/etc/oauth --env-file "$(pwd)/oauth/.env" -u 0 landing:latest
- Build the image