Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding hydra to quickstart #3297

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
integration:
name: Bats tests
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 18
steps:
- name: Setup BATS
uses: mig4/setup-bats@v1
Expand Down
15 changes: 8 additions & 7 deletions core/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,32 +424,33 @@ services:
image: postgres:14.1
environment:
POSTGRES_PASSWORD: postgres

hydra:
image: oryd/hydra:v2.1.2
ports: []
extra_hosts: []
command: serve -c /home/ory/hydra.yml all --dev
volumes:
- type: bind
source: dev/ory
target: /home/ory
- ${HOST_PROJECT_PATH:-.}/dev/ory:/home/ory
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
restart: unless-stopped
depends_on:
- hydra-migrate
- postgresdhydra
ports: []

hydra-migrate:
image: oryd/hydra:v2.1.2
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command: migrate -c /home/ory/hydra.yml sql -e --yes
volumes:
- type: bind
source: dev/ory
target: /home/ory
- ${HOST_PROJECT_PATH:-.}/dev/ory:/home/ory

restart: on-failure
depends_on:
- postgresdhydra

postgresdhydra:
image: postgres:14.1
environment:
Expand Down
18 changes: 8 additions & 10 deletions docs/hydra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ resource "hydra_oauth2_client" "example" {
token_endpoint_auth_method = "none"
}

output "example_client_id" {
description = "The client ID of the example OAuth2 client."
value = hydra_oauth2_client.example.client_id
output "blink_app_client_id" {
value = hydra_oauth2_client.example.client_id
}

output "example_client_secret" {
description = "The client secret of the example OAuth2 client."
value = hydra_oauth2_client.example.client_secret
sensitive = true
output "blink_app_client_secret" {
value = hydra_oauth2_client.example.client_secret
sensitive = true
}

resource "hydra_oauth2_client" "example2" {
client_name = "example2"
resource "hydra_oauth2_client" "blink_app" {
client_name = "blink_app"
grant_types = ["client_credentials"]
redirect_uris = ["http://localhost:8080/callback"]
response_types = ["token"]
token_endpoint_auth_method = "client_secret_basic"
scopes = ["editor"]
}
7 changes: 6 additions & 1 deletion quickstart/docker-compose.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- stablesats
- svix
- svix-pg
- hydra
restart: on-failure:10

#! Proxies
Expand All @@ -37,6 +38,10 @@ services:
kratos: #@ data.values.services["kratos"]
kratos-pg: #@ data.values.services["kratos-pg"]

hydra: #@ data.values.services["hydra"]
hydra-migrate: #@ data.values.services["hydra-migrate"]
postgresdhydra: #@ data.values.services["postgresdhydra"]

galoy:
#@ if galoy_image_digest == "local":
build:
Expand Down Expand Up @@ -140,7 +145,7 @@ services:
#@overlay/match when=1
volumes:
#@overlay/match by=overlay.all, expects="0+"
#@overlay/replace via=lambda left, right: left.replace("HOST_PROJECT_PATH:-.}", "HOST_PROJECT_PATH:-.}/${GALOY_QUICKSTART_PATH:-vendor/galoy-quickstart}")
#@overlay/replace via=lambda left, right: str(left).replace("HOST_PROJECT_PATH:-.}", "HOST_PROJECT_PATH:-.}/${GALOY_QUICKSTART_PATH:-vendor/galoy-quickstart}")
- REPLACED

#@overlay/match by=overlay.all
Expand Down
31 changes: 31 additions & 0 deletions quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- stablesats
- svix
- svix-pg
- hydra
restart: on-failure:10
apollo-router:
image: ghcr.io/apollographql/router:v1.25.0
Expand Down Expand Up @@ -63,6 +64,36 @@ services:
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=default
hydra:
image: oryd/hydra:v2.1.2
command: serve -c /home/ory/hydra.yml all --dev
volumes:
- yamlfragment(*yamlmeta.Map)
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
restart: unless-stopped
depends_on:
- hydra-migrate
- postgresdhydra
ports:
- 4444:4444
- 4445:4445
hydra-migrate:
image: oryd/hydra:v2.1.2
environment:
- DSN=postgres://hydra:secret@postgresdhydra:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command: migrate -c /home/ory/hydra.yml sql -e --yes
volumes:
- yamlfragment(*yamlmeta.Map)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t think this will work. It didn’t replace the path

restart: on-failure
depends_on:
- postgresdhydra
postgresdhydra:
image: postgres:14.1
environment:
- POSTGRES_USER=hydra
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=hydra
galoy:
image: us.gcr.io/galoy-org/galoy-app@sha256:496ce20c6697893579312207b4142145f70d658cd323e3dc4cf84c82dd8d6125
command:
Expand Down