diff --git a/hack/helm/hydra.yaml b/hack/helm/hydra.yaml index e3589dae..44e7cb2b 100644 --- a/hack/helm/hydra.yaml +++ b/hack/helm/hydra.yaml @@ -27,8 +27,8 @@ hydra: public: https://iam.internal/ login: https://iam.internal/ui/login consent: https://iam.internal/ui/consent - device: http://iam.internal/admin/oauth2/auth/requests/device/verify - # device: http://iam.internal:9000/api/device # this relies on the fact i have localhost as iam.internal and a script with server on port 9000 + # device: http://iam.internal/admin/oauth2/auth/requests/device/verify + device: https://iam.internal/ui/device post_device_done: https://iam.internal/api/v0/status error: https://iam.internal//ui/oidc_error ttl: diff --git a/hack/kubectl/iam.yaml b/hack/kubectl/iam.yaml index ba31633a..9abfd455 100644 --- a/hack/kubectl/iam.yaml +++ b/hack/kubectl/iam.yaml @@ -19,7 +19,7 @@ spec: spec: containers: - name: iam - image: ghcr.io/canonical/identity-platform-login-ui:v0.11.3 + image: identity-platform-login-ui envFrom: - configMapRef: name: iam @@ -78,6 +78,13 @@ spec: name: iam port: number: 8000 + - pathType: Prefix + path: "/api/device" + backend: + service: + name: iam + port: + number: 8000 - pathType: Prefix path: "/api/kratos" backend: diff --git a/hack/login-ui/build.sh b/hack/login-ui/build.sh new file mode 100755 index 00000000..3594210b --- /dev/null +++ b/hack/login-ui/build.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -x +# script requires the availability of rockcraft, skopeo, yq and docker in the host system +# it also requires sudo permissions to run skopeo + +# export version=$(yq -r '.version' rockcraft.yaml) +rockcraft pack -v + +sudo skopeo --insecure-policy copy "oci-archive:identity-platform-login-ui_$(yq -r '.version' rockcraft.yaml)_amd64.rock" docker-daemon:$IMAGE + +docker push $IMAGE diff --git a/hack/login-ui/identity-platform-login-ui_0.11.3_amd64.rock b/hack/login-ui/identity-platform-login-ui_0.11.3_amd64.rock new file mode 100644 index 00000000..0e03e1e1 Binary files /dev/null and b/hack/login-ui/identity-platform-login-ui_0.11.3_amd64.rock differ diff --git a/hack/login-ui/rockcraft.yaml b/hack/login-ui/rockcraft.yaml new file mode 100644 index 00000000..b34ef37d --- /dev/null +++ b/hack/login-ui/rockcraft.yaml @@ -0,0 +1,44 @@ +name: identity-platform-login-ui + +base: bare +build-base: ubuntu@22.04 +version: '0.11.3' # x-release-please-version +summary: Canonical Identity platform login UI +description: | + This is the Canonical Identity platform login UI used for connecting + Ory Kratos with Ory Hydra. +license: Apache-2.0 + +platforms: + amd64: + +services: + login-ui: + override: replace + command: /usr/bin/identity-platform-login-ui + startup: enabled + +parts: + certificates: + plugin: nil + stage-packages: + - ca-certificates + + go-build: + plugin: go + source: https://github.com/canonical/identity-platform-login-ui + source-type: git + source-branch: device-flow-poc + build-snaps: + - go/1.19/stable + - node/18/stable + build-packages: + - make + - git + override-build: | + make npm-build build + install -D -m755 cmd/app ${CRAFT_PART_INSTALL}/opt/identity-platform-login-ui/bin/app + organize: + opt/identity-platform-login-ui/bin/app: usr/bin/identity-platform-login-ui + stage-packages: + - base-files_var \ No newline at end of file diff --git a/skaffold.yaml b/skaffold.yaml index 9e40f7ef..d090f0d3 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -2,10 +2,19 @@ apiVersion: skaffold/v4beta6 kind: Config build: artifacts: + - image: "identity-platform-login-ui" + context: hack/login-ui + custom: + buildCommand: ./build.sh + dependencies: + paths: + - rockcraft.yaml + platforms: ["linux/amd64"] - image: "flow-test" context: hack/flow-test docker: - dockerfile: hack/flow-test/Dockerfile + dockerfile: Dockerfile + platforms: ["linux/amd64"] - image: "hydra" custom: buildCommand: ./build.sh