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: change licence #956

Merged
merged 8 commits into from
Dec 7, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/actions/extract-in-tag/service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const value = process.argv[2];

const getValue = (string) => {
const value = string.match(/(?<=\/)[^\/]+(?=\/)/)[0];
const value = string.match(/([a-z].*)\/([a-z].*)\/([a-z].*)/)[2];
return value;
};

Expand Down
8 changes: 8 additions & 0 deletions .github/actions/extract-in-tag/type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const value = process.argv[2];

const getValue = (string) => {
const value = string.match(/([a-z].*)\/([a-z].*)\/([a-z].*)/)[1];
return value;
};

console.log(getValue(value));
62 changes: 43 additions & 19 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/*
# Apps
'components/fctl':
- components/fctl/*
- changed-files:
- any-glob-to-any-file: "components/fctl/*"
'components/ledger':
- components/ledger/*
- changed-files:
- any-glob-to-any-file: "components/ledger/*"
'components/operator':
- components/operator/*
'components/orchestration':
- components/orchestration/*
- changed-files:
- any-glob-to-any-file: "components/operator/*"
'components/payments':
- components/payments/*
'components/search':
- components/search/*
'components/wallets':
- components/wallets/*
'components/webhooks':
- components/webhooks/*
- changed-files:
- any-glob-to-any-file: "components/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/*"
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: Default - Release
on:
push:
tags:
- 'components/*/v*.*.*'
- '*/*/v*.*.*'

jobs:
Extract:
name: Extract
runs-on: "formance-runner"
outputs:
type: ${{ steps.extract3.outputs.type }}
service: ${{ steps.extract.outputs.service }}
version: ${{ steps.extract.outputs.version }}
version: ${{ steps.extract2.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -24,6 +25,9 @@ jobs:
- name: Extract version name
id: extract2
run: echo "version=$(node .github/actions/extract-in-tag/version.js ${{ github.ref_name }})" >> $GITHUB_OUTPUT
- name: Extract type name
id: extract3
run: echo "type=$(node .github/actions/extract-in-tag/type.js ${{ github.ref_name }})" >> $GITHUB_OUTPUT

Release:
runs-on: "formance-runner"
Expand All @@ -41,7 +45,17 @@ jobs:
registry: ghcr.io
username: "NumaryBot"
password: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: "earthly --no-output --allow-privileged --secret GITHUB_TOKEN=$GITHUB_TOKEN --secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY --secret FURY_TOKEN=$FURY_TOKEN --secret GORELEASER_KEY=$GORELEASER_KEY --secret SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY +goreleaser --mode=release --component=${{ needs.Extract.outputs.service }}"
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
--secret SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY
--secret GITHUB_TOKEN=$GITHUB_TOKEN
--secret FURY_TOKEN=$FURY_TOKEN
--secret GORELEASER_KEY=$GORELEASER_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+goreleaser --mode=release --type=${{ needs.Extract.outputs.type }} --component=${{ needs.Extract.outputs.service }}
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
Expand Down
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
}
}
Loading
Loading