Skip to content

Commit

Permalink
chore: change licence
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Dec 6, 2023
1 parent f516b97 commit ea88738
Show file tree
Hide file tree
Showing 2,648 changed files with 805 additions and 880 deletions.
70 changes: 47 additions & 23 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,52 @@
libs:
- libs/*
- changed-files:
- any-glob-to-any-file: "libs/*"
openapi:
- openapi/*
- changed-files:
- any-glob-to-any-file: "openapi/*"
sdks:
- sdks/*
- changed-files:
- any-glob-to-any-file: "sdks/*"
github:
- .github/*
- changed-files:
- any-glob-to-any-file: ".github/*"

# Components
'components/auth':
- components/auth/*
'components/fctl':
- components/fctl/*
'components/ledger':
- components/ledger/*
'components/operator':
- components/operator/*
'components/orchestration':
- components/orchestration/*
'components/payments':
- components/payments/*
'components/search':
- components/search/*
'components/wallets':
- components/wallets/*
'components/webhooks':
- components/webhooks/*
# Apps
'apps/fctl':
- changed-files:
- any-glob-to-any-file: "apps/fctl/*"
'apps/ledger':
- changed-files:
- any-glob-to-any-file: "apps/ledger/*"
'apps/operator':
- changed-files:
- any-glob-to-any-file: "apps/operator/*"
'apps/payments':
- changed-files:
- any-glob-to-any-file: "apps/payments/*"

# EE
'ee/agent':
- changed-files:
- any-glob-to-any-file: "ee/agent/*"
'ee/auth':
- changed-files:
- any-glob-to-any-file: "ee/auth/*"
'ee/gateway':
- changed-files:
- any-glob-to-any-file: "ee/gateway/*"
'ee/orchestration':
- changed-files:
- any-glob-to-any-file: "ee/orchestration/*"
'ee/search':
- changed-files:
- any-glob-to-any-file: "ee/search/*"
'ee/stargate':
- changed-files:
- any-glob-to-any-file: "ee/stargate/*"
'ee/wallets':
- changed-files:
- any-glob-to-any-file: "ee/wallets/*"
'ee/webhooks':
- changed-files:
- any-glob-to-any-file: "ee/webhooks/*"
24 changes: 0 additions & 24 deletions .local/auth/config.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions .local/dex/dex-config.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions .local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
volumes:
postgres_data:
services:
postgres:
platform: linux/x86_64
image: "postgres:15-alpine"
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ledger" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- "${FORMANCE_POSTGRES_PORT:-5432}:5432"
environment:
POSTGRES_USER: "formance"
POSTGRES_PASSWORD: "formance"
POSTGRES_MULTIPLE_DATABASES: "ledger,payments"
PGDATA: "/data/postgres"
volumes:
- postgres_data:/data/postgres
- ./postgres:/docker-entrypoint-initdb.d
91 changes: 13 additions & 78 deletions .local/gateway/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,21 @@
}
}

(handle_route_without_auth) {
# handle does not strips the prefix from the request path
handle {args.0}/* {
reverse_proxy {args.1}

import cors
}
}

(handle_path_route_with_auth) {
(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}

import cors

import auth
}
}

(handle_route_with_auth) {
(handle_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle {args.0} {
reverse_proxy {args.2}
uri strip_prefix {args.1}

import cors
import auth
}
}

(handle_path_route_without_auth) {
# handle_path automatically strips the prefix from the request path
handle_path {args.0}* {
reverse_proxy {args.1}

import cors
}
}
Expand Down Expand Up @@ -80,75 +59,31 @@
path {args.0}/accounts*
}

import handle_route_with_auth @transferinitiationreadermatcher {args.0} {args.1}
import handle_route_with_auth @bankaccountsreadermatcher {args.0} {args.1}
import handle_route_with_auth @accountsmatcher {args.0} {args.1}
import handle_route_without_auth @transferinitiationreadermatcher {args.0} {args.1}
import handle_route_without_auth @bankaccountsreadermatcher {args.0} {args.1}
import handle_route_without_auth @accountsmatcher {args.0} {args.1}

import handle_route_with_auth @bankaccountswritermatcher {args.0} {args.2}
import handle_route_with_auth @transferinitiationwritermatcher {args.0} {args.2}
import handle_route_with_auth @connectorsmatcher {args.0} {args.2}
import handle_route_with_auth @configmatcher {args.0} {args.2}
import handle_route_without_auth @bankaccountswritermatcher {args.0} {args.2}
import handle_route_without_auth @transferinitiationwritermatcher {args.0} {args.2}
import handle_route_without_auth @connectorsmatcher {args.0} {args.2}
import handle_route_without_auth @configmatcher {args.0} {args.2}

# All other requests on the api
import handle_path_route_with_auth {args.0} {args.1}
}

(auth) {
auth {
issuer http://localhost/api/auth

read_key_set_max_retries 10
}
import handle_path_route_without_auth {args.0} {args.1}
}

{
# Many directives manipulate the HTTP handler chain and the order in which
# those directives are evaluated matters. So the jwtauth directive must be
# ordered.
# c.f. https://caddyserver.com/docs/caddyfile/directives#directive-order
order auth before basicauth
order versions after metrics

# Local env dev config
debug
}

localhost:80 {
tracing {
span gateway
}

import handle_route_without_auth "/api/auth/dex" "127.0.0.1:5556"
import handle_path_route_without_auth "/api/auth" "127.0.0.1:8083"
import handle_path_route_with_auth "/api/ledger" "127.0.0.1:3068"
import handle_path_route_with_auth "/api/wallets" "127.0.0.1:8081"
import handle_path_route_with_auth "/api/search" "127.0.0.1:8080"
import payments "/api/payments" "127.0.0.1:8082" "127.0.0.1:8087"
import handle_path_route_with_auth "/api/webhooks" "127.0.0.1:8084"

handle /versions {
versions {
region "local"
env "local"
endpoints {
auth http://127.0.0.1:8083/_info http://127.0.0.1:8083/_healthcheck
ledger http://127.0.0.1:3068/_info http://127.0.0.1:3068/_healthcheck
wallets http://127.0.0.1:8081/_info http://127.0.0.1:8081/_healthcheck
paymentsapi http://127.0.0.1:8082/_info http://127.0.0.1:8082/_healthcheck
paymentsconnectors http://127.0.0.1:8087/_info http://127.0.0.1:8087/_healthcheck
search http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck
webhooks http://127.0.0.1:8084/_info http://127.0.0.1:8084/_healthcheck
}
}
}

handle /api/* {
respond "Bad Gateway" 502
}
import handle_path_route_without_auth "/api/ledger" "ledger:3068"
import payments "/api/payments" "payments-api:8080" "payments-connectors:8080"

# handle all other requests
handle {
reverse_proxy 127.0.0.1:3000
import cors
respond "Bad Gateway" 502
}
}
73 changes: 1 addition & 72 deletions .local/process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ processes:
- "OTEL_EXPORTER_OTLP_INSECURE=true"
- "OTEL_EXPORTER_OTLP_PROTOCOL=grpc"

dex:
command: dex serve /etc/formance/dex/dex-config.yaml
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=dex"

auth:
command: auth serve --listen 0.0.0.0:8083 --debug --config /etc/formance/auth/config.yaml --postgres-uri postgresql://formance:formance@postgres/auth?sslmode=disable --base-url http://localhost/api/auth --delegated-client-id gateway --delegated-client-secret ZXhhbXBsZS1hcHAtc2VjcmV0 --delegated-issuer http://localhost/api/auth/dex
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=auth"

ledger:
command: ledger server start --storage.driver=postgres --storage.postgres.conn_string postgresql://formance:formance@postgres/ledger?sslmode=disable --server.http.bind_address 0.0.0.0:3068 --publisher-nats-enabled true --publisher-nats-url nats:4222 --publisher-topic-mapping *:ledger
availability:
Expand Down Expand Up @@ -66,61 +52,4 @@ processes:
payments-migrate:
command: payments migrate up --postgres-uri postgresql://formance:formance@postgres/payments?sslmode=disable
availability:
restart: never

search:
command: search serve --open-search-scheme http --open-search-service opensearch:9200 --es-indices formance --stack local
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=search"

webhooks:
command: webhooks serve --listen 0.0.0.0:8084 --storage-postgres-conn-string postgresql://formance:formance@postgres/webhooks?sslmode=disable --kafka-topics ledger payments --publisher-nats-enabled true --publisher-nats-url nats:4222 --publisher-nats-client-id webhooks
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=webhooks"

webhooks-worker:
command: webhooks worker --listen 0.0.0.0:8085 --storage-postgres-conn-string postgresql://formance:formance@postgres/webhooks?sslmode=disable --kafka-topics ledger payments --publisher-nats-enabled true --publisher-nats-url nats:4222 --publisher-nats-client-id webhooks
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=webhooks"

orchestration:
command: orchestration serve --listen 0.0.0.0:8086 --postgres-dsn postgresql://formance:formance@postgres/orchestration?sslmode=disable --temporal-address temporalite:7233 --stack-url http://localhost --stack-client-id orchestration --stack-client-secret orchestration --worker
availability:
restart: always
environment:
- "OTEL_SERVICE_NAME=orchestration"

benthos:
command: benthos -r "/benthos/resources/*.yaml" -t "/benthos/templates/*.yaml" -c /benthos/config.yml --log.level trace streams "/benthos/streams/*.yaml"
availability:
restart: always
environment:
- "TOPIC_PREFIX="
- "NATS_URL=nats:4222"
- "BROKER=nats"
- "OPENSEARCH_URL=http://opensearch:9200"
- "OPENSEARCH_INDEX=formance"
- "OPENSEARCH_TLS_ENABLED=true"
- "OPENSEARCH_TLS_SKIP_CERT_VERIFY=true"
- "OPENSEARCH_BASIC_AUTH_ENABLED=false"
- "OTEL_SERVICE_NAME=benthos"
- "STACK=local"

control:
command: yarn run start
availability:
restart: always
environment:
- "API_URL=http://localhost/api"
- "REDIRECT_URI=http://localhost"
- "CLIENT_ID=control"
- "CLIENT_SECRET=mysupersecret"
- "ENCRYPTION_KEY=mysuperencryptionkey"
- "ENCRYPTION_IV=6f0c77c78a624022"
- "OTEL_SERVICE_NAME=control"
restart: never
Loading

0 comments on commit ea88738

Please sign in to comment.