Skip to content

Commit

Permalink
fix: formatting and removed rafiki network from docker-compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
JoblersTune committed Mar 1, 2024
1 parent 8012ffa commit 95d7882
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
4 changes: 0 additions & 4 deletions localenv/happy-life-bank/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,3 @@ services:
- cloud-nine-admin
- happy-life-backend
- hydra

networks:
rafiki:
external: true
28 changes: 13 additions & 15 deletions packages/frontend/app/lib/run_seed.server.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { CONFIG, type Config } from '../parse_config.server'
import axios, { AxiosError } from 'axios'
import type { AxiosError } from 'axios';
import axios from 'axios'

interface HydraClientData {
grant_types: string[];
client_id: string;
client_name: string;
redirect_uris: string[];
response_types: string[];
scope: string;
client_secret: string;
skip_consent: boolean;
token_endpoint_auth_method: string;
grant_types: string[]
client_id: string
client_name: string
redirect_uris: string[]
response_types: string[]
scope: string
client_secret: string
skip_consent: boolean
token_endpoint_auth_method: string
}

async function createHydraClient(
Expand Down Expand Up @@ -42,11 +43,8 @@ async function createHydraClient(
const axiosError = error as AxiosError
if (axiosError.response && axiosError.response.status === 404) {
try {
await axios.post(
'http://hydra:4445/admin/clients',
clientData
)
} catch(postError) {
await axios.post('http://hydra:4445/admin/clients', clientData)
} catch (postError) {
throw new Error(`Error creating Hydra client: ${postError}`)
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/app/parse_config.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Config {
}

export const CONFIG: Config = parse(
readFileSync(
process.env.SEED_FILE_LOCATION || `./seed.example.yml`
).toString('utf8')
readFileSync(process.env.SEED_FILE_LOCATION || `./seed.example.yml`).toString(
'utf8'
)
)
10 changes: 3 additions & 7 deletions packages/frontend/hydra/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ services:
- shared-database
environment:
- DSN=postgres://hydra:hydra_password@shared-database:5432/hydra?sslmode=disable
- URLS_SELF_ISSUER=http://localhost:4444/
- URLS_CONSENT=http://localhost:3010/consent
- URLS_LOGIN=http://localhost:3010/login
- URLS_SELF_ISSUER=http://127.0.0.1:4444/
- URLS_CONSENT=http://127.0.0.1:3010/consent
- URLS_LOGIN=http://127.0.0.1:3010/login
- SECRETS_SYSTEM=some-random-secret
- OAUTH2_EXPOSE_INTERNAL_ERRORS=true
- LOG_LEVEL=debug
Expand All @@ -36,7 +36,3 @@ services:

volumes:
database-data: # named volumes can be managed easier using docker-compose

networks:
rafiki:
external: true

0 comments on commit 95d7882

Please sign in to comment.