-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements, code refactor, frontend
* Add html frontend click/copy feature, and ability to use your own assets * Add skip main page (see option web_output.skip_main_page) * Fix multiple client_id in html render when using cross_client feature. (see option web_output.main_client_id) * Code refactor * Add some configuration checks * Update README with new opts and doc for development env
- Loading branch information
Showing
19 changed files
with
309 additions
and
83 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ ARG REPO=github.com/fydrah/loginapp | |
LABEL maintainer="Flavien Hardy <[email protected]>" | ||
|
||
COPY --from=build /go/src/${REPO}/bin/loginapp-static /loginapp | ||
COPY --from=build /go/src/${REPO}/assets /assets | ||
|
||
ENTRYPOINT ["/loginapp"] | ||
CMD [""] |
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 |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
|
||
[![Docker Repository on Quay](https://quay.io/repository/fydrah/loginapp/status "Docker Repository on Quay")](https://quay.io/repository/fydrah/loginapp) | ||
|
||
**Simple application for Kubernetes CLI configuration with OIDC** | ||
**Web application for Kubernetes CLI configuration with OIDC** | ||
|
||
Original source code from [coreos/dex repository](https://github.com/coreos/dex/tree/master/cmd/example-app) | ||
|
||
## Usage | ||
|
||
```shell | ||
NAME: | ||
loginapp - Simple application for Kubernetes CLI configuration with OIDC | ||
loginapp - Web application for Kubernetes CLI configuration with OIDC | ||
|
||
AUTHOR: | ||
fydrah <[email protected]> | ||
|
@@ -31,46 +31,72 @@ GLOBAL OPTIONS: | |
|
||
```yaml | ||
# AppName | ||
# default: mandatory | ||
name: "Kubernetes Auth" | ||
# Bind IP and port (format: "IP:PORT") | ||
# default: mandatory | ||
listen: "0.0.0.0:5555" | ||
# OIDC relative configuration | ||
# OIDC configuration | ||
oidc: | ||
# Client configuration | ||
client: | ||
# Application ID | ||
# default: mandatory | ||
id: "loginapp" | ||
# Application Secret | ||
# default: mandatory | ||
secret: ZXhhbXBsZS1hcHAtc2VjcmV0 | ||
# Application Redirect URL | ||
# default: mandatory | ||
redirect_url: "https://127.0.0.1:5555/callback" | ||
# Issuer configuration | ||
issuer: | ||
# Location of issuer root CA certificate | ||
# default: mandatory | ||
root_ca: "example/ssl/ca.pem" | ||
# Issuer URL | ||
# default: mandatory | ||
url: "https://dex.example.com:5556" | ||
# Extra scopes | ||
# default: [] | ||
extra_scopes: | ||
- groups | ||
# Enable offline scope | ||
# default: false | ||
offline_as_scope: true | ||
# Request token on behalf of other clients | ||
# default: [] | ||
cross_clients: [] | ||
# Tls support | ||
tls: | ||
# Enable tls termination | ||
# default: false | ||
enabled: true | ||
# Certificate location | ||
# default: mandatory if tls.enabled is true | ||
cert: example/ssl/cert.pem | ||
# Key location | ||
# default: mandatory if tls.enabled is true | ||
key: example/ssl/key.pem | ||
# Logging configuration | ||
log: | ||
# Loglevel: debug|info|warning|error|fatal|panic | ||
# default: info | ||
level: debug | ||
# Log format: json|text | ||
# default: json | ||
format: json | ||
# Configure the web behavior | ||
web_output: | ||
# ClientID to output (useful for cross_client) | ||
# default: 'oidc.client.id' | ||
main_client_id: loginapp | ||
# Assets directory | ||
# default: ${pwd}/assets | ||
assets_dir: /assets | ||
# Skip main page of login app | ||
# default: false | ||
skip_main_page: false | ||
``` | ||
## Kubernetes | ||
|
@@ -82,7 +108,7 @@ This application is built to run on a Kubernetes cluster. You will find usage ex | |
## Dev | ||
* Setup Dex | ||
###### Setup Dex | ||
``` | ||
# Configure github oauth secrets if needed. | ||
|
@@ -96,10 +122,10 @@ EOF | |
docker-compose up -d | ||
``` | ||
|
||
* User: [email protected] | ||
* Password: password | ||
* User: [email protected] | ||
* Password: password | ||
|
||
* Manage dependencies | ||
###### Manage dependencies | ||
|
||
Loginapp uses [golang dep](https://golang.github.io/dep/docs/installation.html). | ||
|
||
|
@@ -108,7 +134,7 @@ Loginapp uses [golang dep](https://golang.github.io/dep/docs/installation.html). | |
dep ensure | ||
``` | ||
|
||
* Compile, configure and run | ||
###### Compile, configure and run | ||
|
||
Configuration files are located in [example directory](./example/) | ||
|
||
|
@@ -117,7 +143,31 @@ Configuration files are located in [example directory](./example/) | |
bin/loginapp serve example/config-loginapp.yaml | ||
``` | ||
|
||
## Contibutions | ||
You can also build a temporary Docker image for loginapp, and | ||
run it with docker-compose (uncomment lines and replace image name): | ||
|
||
``` | ||
make docker-tmp | ||
``` | ||
|
||
###### Run checks | ||
|
||
Some checks can be launched before commits: | ||
* errorcheck: check for unchecked errors | ||
* gocyclo: cyclomatic complexities of functions | ||
* gosimple: simplify code | ||
|
||
``` | ||
make checks | ||
``` | ||
|
||
Run also gofmt before any new commit: | ||
|
||
``` | ||
make gofmt | ||
``` | ||
|
||
## Contributions | ||
|
||
Contributions (and issues) are welcomed. | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.