diff --git a/k8s/cluster/deployer-sa.yaml b/k8s/cluster/deployer-sa.yaml new file mode 100644 index 0000000..7f2a5d3 --- /dev/null +++ b/k8s/cluster/deployer-sa.yaml @@ -0,0 +1,119 @@ +# Deployer ServiceAccount for using.cash CI/CD pipeline. +# Apply this manifest with cluster-admin credentials once, then run +# scripts/bootstrap-kubeconfig.sh to generate the kubeconfig for CI. +# +# Required permissions: +# - Namespace create (cluster-scoped, for using-cash + analytics) +# - Full CRUD on Deployment, Service, Ingress, PVC, Secret, ConfigMap +# in namespaces: using-cash, analytics +# - ClusterIssuer create (cert-manager, cluster-scoped) +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: using-cash-deployer + namespace: kube-system +--- +# Cluster-scoped: create Namespace + ClusterIssuer +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: using-cash-deployer +rules: + - apiGroups: [""] + resources: ["namespaces"] + verbs: ["get", "create", "patch"] + - apiGroups: ["cert-manager.io"] + resources: ["clusterissuers"] + verbs: ["get", "create", "patch", "apply"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: using-cash-deployer +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: using-cash-deployer +subjects: + - kind: ServiceAccount + name: using-cash-deployer + namespace: kube-system +--- +# Namespace-scoped: full access in using-cash +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: using-cash-deployer + namespace: using-cash +rules: + - apiGroups: ["apps"] + resources: ["deployments", "replicasets"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: [""] + resources: ["services", "configmaps", "secrets", "persistentvolumeclaims", "pods"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: ["networking.k8s.io"] + resources: ["ingresses"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: ["apps"] + resources: ["deployments/status"] + verbs: ["get"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: using-cash-deployer + namespace: using-cash +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: using-cash-deployer +subjects: + - kind: ServiceAccount + name: using-cash-deployer + namespace: kube-system +--- +# Namespace-scoped: full access in analytics +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: using-cash-deployer + namespace: analytics +rules: + - apiGroups: ["apps"] + resources: ["deployments", "replicasets"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: [""] + resources: ["services", "configmaps", "secrets", "persistentvolumeclaims", "pods"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: ["networking.k8s.io"] + resources: ["ingresses"] + verbs: ["get", "list", "create", "patch", "update", "delete"] + - apiGroups: ["apps"] + resources: ["deployments/status"] + verbs: ["get"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: using-cash-deployer + namespace: analytics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: using-cash-deployer +subjects: + - kind: ServiceAccount + name: using-cash-deployer + namespace: kube-system +--- +# Long-lived token for kubeconfig (k8s 1.24+) +apiVersion: v1 +kind: Secret +metadata: + name: using-cash-deployer-token + namespace: kube-system + annotations: + kubernetes.io/service-account.name: using-cash-deployer +type: kubernetes.io/service-account-token diff --git a/scripts/bootstrap-kubeconfig.sh b/scripts/bootstrap-kubeconfig.sh new file mode 100755 index 0000000..e8cda58 --- /dev/null +++ b/scripts/bootstrap-kubeconfig.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# Generate kubeconfig for the using-cash-deployer ServiceAccount. +# Run this ONCE with cluster-admin credentials after applying +# k8s/cluster/deployer-sa.yaml. +# +# Usage: +# KUBECONFIG=/path/to/admin.kubeconfig bash scripts/bootstrap-kubeconfig.sh +# # Outputs KUBECONFIG_B64 to stdout — store in Johan's adapter env + CI secrets. +set -euo pipefail + +SA_NAME="using-cash-deployer" +SA_NS="kube-system" +SECRET_NAME="using-cash-deployer-token" +CLUSTER_NAME="using-cash" +CONTEXT_NAME="using-cash-deployer" + +echo "==> Applying RBAC manifests..." >&2 +kubectl apply -f k8s/cluster/deployer-sa.yaml + +echo "==> Waiting for token secret to be populated..." >&2 +for i in $(seq 1 30); do + TOKEN=$(kubectl get secret "$SECRET_NAME" -n "$SA_NS" \ + -o jsonpath='{.data.token}' 2>/dev/null || true) + if [ -n "$TOKEN" ]; then + break + fi + sleep 2 +done + +if [ -z "$TOKEN" ]; then + echo "ERROR: Token not populated in secret $SECRET_NAME after 60s" >&2 + exit 1 +fi + +# Get cluster CA and server from current kubeconfig +CA_DATA=$(kubectl config view --raw -o jsonpath="{.clusters[0].cluster.certificate-authority-data}") +SERVER=$(kubectl config view --raw -o jsonpath="{.clusters[0].cluster.server}") + +echo "==> Cluster server: $SERVER" >&2 +echo "==> Generating kubeconfig..." >&2 + +KUBECONFIG_YAML=$(cat <&2 +echo "==> Done. Set these in Johan's adapter env AND the CI repo secrets:" >&2 +echo "" >&2 +echo "KUBECONFIG_B64 (adapter env):" >&2 +echo "$KUBECONFIG_YAML" | base64 -w0 +echo "" >&2 +echo "" >&2 +echo "KUBECONFIG (CI secret — raw YAML, no base64 wrapper):" >&2 +echo "$KUBECONFIG_YAML" >&2 diff --git a/src/app/globals.css b/src/app/globals.css index 955ea34..efa692b 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -267,7 +267,8 @@ code, pre, .mono { transition: border-color 0.15s ease; } -.waitlist-input:focus { border-color: var(--color-primary); } +.waitlist-input:focus, +.waitlist-select:focus { border-color: var(--color-primary); } .waitlist-input::placeholder { color: var(--color-text-secondary); } .waitlist-select { diff --git a/src/components/WaitlistForm.module.css b/src/components/WaitlistForm.module.css index 3338911..6af6fe0 100644 --- a/src/components/WaitlistForm.module.css +++ b/src/components/WaitlistForm.module.css @@ -1,7 +1,7 @@ .form { display: flex; flex-direction: column; - gap: var(--space-4); + gap: var(--sp-4); } .full { @@ -11,7 +11,7 @@ .field { display: flex; flex-direction: column; - gap: var(--space-1); + gap: var(--sp-1); } .label { @@ -20,9 +20,10 @@ color: var(--color-text-secondary); } +/* Inline variant: email + button side by side */ .emailRow { display: flex; - gap: var(--space-3); + gap: var(--sp-3); align-items: stretch; } @@ -31,6 +32,17 @@ min-width: 0; } +/* Full variant: email is a labeled field, button full-width below */ +.emailFieldFull { + display: flex; + flex-direction: column; + gap: var(--sp-1); +} + +.submitFull { + width: 100%; +} + @media (max-width: 480px) { .emailRow { flex-direction: column; @@ -46,8 +58,8 @@ display: flex; flex-direction: column; align-items: flex-start; - gap: var(--space-1); - padding: var(--space-6); + gap: var(--sp-1); + padding: var(--sp-6); background-color: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)); border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent); border-radius: var(--radius-md); @@ -64,7 +76,7 @@ border-radius: 50%; font-weight: 700; font-size: 16px; - margin-bottom: var(--space-2); + margin-bottom: var(--sp-2); } .successTitle { diff --git a/src/components/WaitlistForm.tsx b/src/components/WaitlistForm.tsx index 95a0600..8ffb70c 100644 --- a/src/components/WaitlistForm.tsx +++ b/src/components/WaitlistForm.tsx @@ -64,15 +64,15 @@ export default function WaitlistForm({ variant = 'inline', defaultPlan }: Waitli return (
- {variant === 'full' && ( + {variant === 'full' ? ( <>
- + setBusiness(e.target.value)} disabled={status === 'loading'} @@ -82,7 +82,7 @@ export default function WaitlistForm({ variant = 'inline', defaultPlan }: Waitli
+
+ + setEmail(e.target.value)} + disabled={status === 'loading'} + /> +
+ {status === 'error' && ( +

{errorMsg}

+ )} + + + ) : ( + <> +
+
+ setEmail(e.target.value)} + disabled={status === 'loading'} + aria-label="Work email" + /> +
+ +
+ {status === 'error' && ( +

{errorMsg}

+ )} - )} - -
-
- setEmail(e.target.value)} - disabled={status === 'loading'} - aria-label="Work email" - /> -
- -
- - {status === 'error' && ( -

{errorMsg}

)}

We won't spam you. Cancel anytime.