Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
agebhar1 committed Nov 17, 2024
1 parent 6a9332e commit dc21b0e
Show file tree
Hide file tree
Showing 9 changed files with 6,298 additions and 0 deletions.
61 changes: 61 additions & 0 deletions container/nginx-oauth2/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
services:
nginx:
image: docker.io/library/nginx:1.26.2-alpine3.20
volumes:
- ./etc/nginx/conf.d:/etc/nginx/conf.d:ro
ports:
- "8080:80/tcp"
restart: unless-stopped
depends_on:
keycloak:
condition: service_healthy
restart: true
oauth2-proxy:
condition: service_started
restart: true

keycloak:
image: quay.io/keycloak/keycloak:26.0
hostname: keycloak.localhost
environment:
KC_HTTP_PORT: 9080
KC_HEALTH_ENABLED: true
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
ports:
- "9080:9080/tcp"
command:
- start-dev
- --import-realm
volumes:
- ./etc/keycloak:/opt/keycloak/data/import # [email protected], password=password
healthcheck:
test: [ "CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/9000 && printf >&3 '%s\r\n' 'GET /health/ready HTTP/1.1' 'Host: localhost' 'Connection: close' '' && grep -q 'HTTP/1.1 200 OK' <&3" ]
interval: 30s
timeout: 5s
restart: unless-stopped

oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.7.1
environment:
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#general-provider-options
OAUTH2_PROXY_CLIENT_ID: "oauth2-proxy"
OAUTH2_PROXY_CLIENT_SECRET: "72341b6d-7065-4518-a0e4-50ee15025608"
OAUTH2_PROXY_OIDC_ISSUER_URL: "http://keycloak.localhost:9080/realms/oauth2-proxy"
OAUTH2_PROXY_PROVIDER: "oidc"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#cookie-options
# OAUTH2_PROXY_COOKIE_DOMAINS:
OAUTH2_PROXY_COOKIE_SECRET: "wenKY5NUBWSLO8CRh1a81K7I-sqROgoAfEpbXCKhtfI="
OAUTH2_PROXY_COOKIE_SECURE: "false"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview/#proxy-options
OAUTH2_PROXY_EMAIL_DOMAINS: "*"
OAUTH2_PROXY_REDIRECT_URL: "http://localhost:8080/oauth2/callback"
OAUTH2_PROXY_REVERSE_PROXY: "true"
OAUTH2_PROXY_WHITELIST_DOMAINS: "localhost:8080"
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#server-options
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:4180"
restart: unless-stopped
depends_on:
keycloak:
condition: service_healthy
15 changes: 15 additions & 0 deletions container/nginx-oauth2/e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import js from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import vitest from '@vitest/eslint-plugin'

// eslint.config.js
export default [
js.configs.recommended,
stylistic.configs['recommended-flat'],
vitest.configs.recommended,
{
rules: {
'sort-imports': 'error',
},
},
]
Loading

0 comments on commit dc21b0e

Please sign in to comment.