kabanero-io / kabanero-landing

A console application for managing your Kabanero instances. This repo will be archived soon.
Apache License 2.0
4 stars 6 forks source link

Build Status

Introduction

Console Application for Kabanero

Contributing to the landing page

Please view our contribution guidelines for the Kabanero.io console.

Community

Develop the front end

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.

  1. Run: ./scripts/jekyll_serve_dev.sh

Develop the full server

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.

  1. Package the jekyll frontend. From the repository's root directory:
  2. Run: mvn liberty:dev

Configure GitHub OAuth for production

See Configuring the Kabanero Console with OAuth

Configure GitHub OAuth for Liberty dev mode

  1. Follow Configuring the Kabanero Console with OAuth until you have a GitHub ClientID and Secret, then stop and come back here.
  2. On the root of this project if you do not already have a folder named oauth, create it.
  3. 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>
  4. Replace YOUR_ID and YOUR_SECRET with your GitHub ID and Secret from the first step.
    • If targeting GitHub Enterprise, update the userApi, tokenEndpoint, and authorizationEndpoint fields as well.
  5. Check if a target dir exists, if not, run: mvn liberty:create
  6. Create a dropin dir: mkdir -p target/liberty/wlp/usr/servers/defaultServer/configDropins/defaults/
  7. Copy the file you just edited into it: cp oauth/social_login_dev.xml target/liberty/wlp/usr/servers/defaultServer/configDropins/defaults/
  8. Export necessary env variables in your terminal, the values are not necessary as you have them filled in social_login_dev.xml already
      export USER_API=
      export AUTHORIZATION_ENDPOINT=
      export TOKEN_ENDPOINT=
      export WEBSITE=
  9. Start dev mode mvn liberty:dev

Docker

Build

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

Run for development purposes

For production you do not need to mount the kube config, or add the -u 0 parameter.

  1. Ensure Kabanero is installed on your cluster
  2. Login to your cluster using the oc CLI.
  3. 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

Configure GitHub OAuth for Docker builds

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:

  1. Follow Configuring the Kabanero Console with OAuth until you have a GitHub ClientID and Secret.
  2. Create an oauth directory in the root of this repository.
  3. Create 3 files inside the oauth directory:
    1. clientID and place your GitHub OAuth ID in it and save.
    2. clientSecret and place your GitHub OAuth secret in it and save.
    3. .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 and AUTHORIZATION_ENDPOINT should be the same (except the hostname) and USER_API should be https://<YOUR_HOSTNAME>/api/v3/user
  4. Build and run the image.
    1. Build the image
      • From the root of this repo run: ./ci/build.sh
    2. 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