This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Initial proposal for integration with Zitadel #148
Draft
maxkondr
wants to merge
2
commits into
main
Choose a base branch
from
auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# ======================= GENERAL CONTAINERS PARAMS ====================================== | ||
# Domain name Everest is exposed. | ||
# Default=127.0.0.1.nip.io - points to 127.0.0.1 | ||
# Mandatory. | ||
EVEREST_DOMAIN=127.0.0.1.nip.io | ||
|
||
# The prefix name for all Everest containers. | ||
# Default=everest | ||
# Optional. | ||
EVEREST_CONTAINER_PREFIX=everest | ||
|
||
# ======================== TRAEFIK PARAMS ====================================================== | ||
# Exposed secured port. | ||
# Default 443 | ||
# Optional. | ||
TRAEFIK_SECURE_HOST_PORT=443 | ||
|
||
# Exposed incured port. | ||
# Traefik is configured to redirect all requests to SECURE ENDPOINT. | ||
# Default 80 | ||
# Optional. | ||
TRAEFIK_INSECURE_HOST_PORT=80 | ||
|
||
# ======================== ZITADEL PARAMS ========================================================== | ||
# Master encryption key for Zitadel. | ||
# Must be >=32 chars. | ||
# Mandatory. | ||
ZITADEL_MASTERKEY= | ||
|
||
# Used for sending e-mail to users. | ||
# Mandatory. | ||
SMTP_HOST= | ||
|
||
# Used for sending e-mail to users. | ||
# Mandatory. | ||
SMTP_USER= | ||
|
||
# Used for sending e-mail to users. | ||
# Mandatory. | ||
SMTP_PASSWORD= | ||
|
||
# ======================== EVERST BACKEND PARAMS ==================================== | ||
# Everest backend docker container tag. | ||
# Default='dev-latest'. | ||
# Optional. | ||
#EVEREST_TAG=v0.1.0 | ||
|
||
# OAuth Everest client JWT key path. | ||
# Mandatory. | ||
OAUTH_CLIENT_KEY_PATH= | ||
|
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
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
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 |
---|---|---|
|
@@ -20,9 +20,11 @@ import "github.com/kelseyhightower/envconfig" | |
|
||
// EverestConfig stores the configuration for the application. | ||
type EverestConfig struct { | ||
DSN string `default:"postgres://admin:[email protected]:5432/postgres?sslmode=disable" envconfig:"DSN"` | ||
HTTPPort int `default:"8080" envconfig:"HTTP_PORT"` | ||
Verbose bool `default:"false" envconfig:"VERBOSE"` | ||
DSN string `default:"postgres://admin:[email protected]:5432/postgres?sslmode=disable" envconfig:"DSN"` | ||
HTTPPort int `default:"8080" envconfig:"HTTP_PORT"` | ||
Verbose bool `default:"false" envconfig:"VERBOSE"` | ||
OAuthIssuerUrl string `default:"" envconfig:"OAUTH_ISSUER_URL"` | ||
OAuthClientKeyPath string `default:"" envconfig:"OAUTH_CLIENT_KEY_PATH"` | ||
} | ||
|
||
// ParseConfig parses env vars and fills EverestConfig. | ||
|
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 |
---|---|---|
@@ -1,9 +1,148 @@ | ||
version: "3" | ||
version: '3.8' | ||
|
||
services: | ||
traefik: | ||
image: traefik:v2.10.1 | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-traefik" | ||
hostname: account.${EVEREST_DOMAIN} | ||
networks: | ||
- everest | ||
restart: unless-stopped | ||
environment: | ||
# static configuration: https://docs.traefik.io/reference/static-configuration/env/ | ||
|
||
TRAEFIK_ACCESSLOG: "info" | ||
TRAEFIK_LOG_LEVEL: "info" | ||
|
||
TRAEFIK_ENTRYPOINTS_WEBSECURE_ADDRESS: ":443" | ||
# in case browser doesn't support TLS1.3 change the value below to "tls12" | ||
TRAEFIK_ENTRYPOINTS_WEBSECURE_HTTP_TLS_OPTIONS: "tls13" | ||
|
||
# setup traffic redirection to secured port. | ||
TRAEFIK_ENTRYPOINTS_WEB_ADDRESS: ":80" | ||
TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_TO: "websecure" | ||
TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME: "https" | ||
TRAEFIK_ENTRYPOINTS_WEB_HTTP_REDIRECTIONS_ENTRYPOINT_PERMANENT: "true" | ||
|
||
TRAEFIK_PROVIDERS_FILE_FILENAME: "/etc/traefik/traefik-dynamic.yml" | ||
|
||
EVEREST_DOMAIN: "${EVEREST_DOMAIN}" | ||
|
||
ports: | ||
- "${TRAEFIK_INSECURE_HOST_PORT:-80}:80" | ||
- "${TRAEFIK_SECURE_HOST_PORT:-443}:443" | ||
volumes: | ||
- ./traefik-dynamic.yml:/etc/traefik/traefik-dynamic.yml | ||
- ./dev-cert.pem:/etc/traefik-ssl-cert/tls.crt | ||
- ./dev-key.pem:/etc/traefik-ssl-cert/tls.key | ||
|
||
zitadel: | ||
image: ghcr.io/zitadel/zitadel:v2.35.0 | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-zitadel" | ||
restart: unless-stopped | ||
networks: | ||
- everest | ||
command: | ||
- start-from-init | ||
- --config=/zitadel-config.yml | ||
- --steps=/zitadel-init-steps.yml | ||
- --masterkeyFromEnv | ||
- --tlsMode=external | ||
environment: | ||
- ZITADEL_MASTERKEY=${ZITADEL_MASTERKEY} | ||
- ZITADEL_EXTERNALDOMAIN=account.${EVEREST_DOMAIN} | ||
- ZITADEL_EXTERNALPORT=${TRAEFIK_SECURE_HOST_PORT:-443} | ||
- ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_HOST=${SMTP_HOST} | ||
- ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_USER=${SMTP_USER} | ||
- ZITADEL_DEFAULTINSTANCE_SMTPCONFIGURATION_SMTP_PASSWORD=${SMTP_PASSWORD} | ||
depends_on: | ||
crdb: | ||
condition: service_healthy | ||
certs: | ||
condition: service_completed_successfully | ||
healthcheck: | ||
test: [ "CMD", "/app/zitadel", "ready" ] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 5 | ||
start_period: 20s | ||
volumes: | ||
- ./zitadel-config.yml:/zitadel-config.yml:ro | ||
- ./zitadel-init-steps.yml:/zitadel-init-steps.yml:ro | ||
- zitadel-certs:/crdb-certs:ro | ||
|
||
certs: | ||
image: cockroachdb/cockroach:v22.2.2 | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-certs" | ||
entrypoint: [ '/bin/bash', '-c' ] | ||
command: [ 'cp /certs/* /zitadel-certs/ && | ||
cockroach cert create-client --overwrite --certs-dir /zitadel-certs/ --ca-key /zitadel-certs/ca.key zitadel_user && chown 1000:1000 /zitadel-certs/*' | ||
] | ||
volumes: | ||
- certs:/certs:ro | ||
- zitadel-certs:/zitadel-certs:rw | ||
depends_on: | ||
crdb: | ||
condition: service_healthy | ||
|
||
crdb: | ||
image: cockroachdb/cockroach:v22.2.2 | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-crdb" | ||
restart: unless-stopped | ||
networks: | ||
- everest | ||
command: | ||
- start-single-node | ||
- --advertise-addr=crdb | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"] | ||
interval: 10s | ||
timeout: 30s | ||
retries: 5 | ||
start_period: 10s | ||
volumes: | ||
- certs:/cockroach/certs:rw | ||
- cockroach-data:/cockroach/cockroach-data:rw | ||
|
||
pg: | ||
image: postgres | ||
image: postgres:15.4 | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-pg" | ||
restart: unless-stopped | ||
networks: | ||
- everest | ||
environment: | ||
- POSTGRES_USER=admin | ||
- POSTGRES_PASSWORD=pwd | ||
ports: | ||
- 5432:5432 | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U admin" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
everest: | ||
image: perconalab/everest:${EVEREST_TAG:-dev-latest} | ||
container_name: "${EVEREST_CONTAINER_PREFIX:-everest}-backend" | ||
pull_policy: always | ||
restart: unless-stopped | ||
networks: | ||
- everest | ||
depends_on: | ||
pg: | ||
condition: service_healthy | ||
zitadel: | ||
condition: service_healthy | ||
environment: | ||
- DSN=postgres://admin:pwd@pg:5432/postgres?sslmode=disable | ||
- OAUTH_ISSUER_URL=https://account.${EVEREST_DOMAIN} | ||
- OAUTH_CLIENT_KEY_PATH=/oauth_client_key.json | ||
volumes: | ||
- ${OAUTH_CLIENT_KEY_PATH}:/oauth_client_key.json:ro | ||
- ${CAROOT_PATH:-.}:/etc/ssl/certs:ro | ||
|
||
networks: | ||
everest: | ||
|
||
volumes: | ||
certs: | ||
zitadel-certs: | ||
cockroach-data: |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it use Postgres?