-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from release/2.1.0
Release `2.1.0` to `main`
- Loading branch information
Showing
354 changed files
with
18,770 additions
and
3,959 deletions.
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,49 @@ | ||
# Generate a new keypair for the distribution account | ||
SEP10_SIGNING_PUBLIC_KEY= | ||
SEP10_SIGNING_PRIVATE_KEY= | ||
|
||
# Generate a new keypair for the distribution account | ||
DISTRIBUTION_PUBLIC_KEY= | ||
DISTRIBUTION_SEED= | ||
DISTRIBUTION_ACCOUNT_ENCRYPTION_PASSPHRASE=${DISTRIBUTION_SEED} | ||
CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE=${DISTRIBUTION_SEED} | ||
|
||
# Anchor platform configuration | ||
ANCHOR_PLATFORM_BASE_PLATFORM_URL=http://localhost:8085 | ||
ANCHOR_PLATFORM_BASE_SEP_URL=http://localhost:8080 | ||
ANCHOR_PLATFORM_BASE_URL=http://localhost:8090 | ||
|
||
CORS_ALLOWED_ORIGINS=* | ||
BASE_URL=http://stellar.local:8000 | ||
SDP_UI_BASE_URL=http://stellar.local:3000 | ||
DATABASE_URL="postgres://postgres@localhost:5432/sdp_mtn?sslmode=disable" | ||
|
||
LOG_LEVEL=info | ||
EC256_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJ3HNphPAEKHvtRjsl5Kjwc9tTMqS\n2pmYNybrLsxZ6cuQvg2yiEoXZixP2cJ77csHClXC6cb1wQp/BNGDvGKoPg==\n-----END PUBLIC KEY-----" | ||
EC256_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgdo6o+tdFkF94B7z8\nnoybH6/zO3PryLLjLbj54/zOi4WhRANCAAQncc2mE8AQoe+1GOyXkqPBz21MypLa\nmZg3JusuzFnpy5C+DbKIShdmLE/ZwnvtywcKVcLpxvXBCn8E0YO8Yqg+\n-----END PRIVATE KEY-----" | ||
EMAIL_SENDER_TYPE=DRY_RUN | ||
SMS_SENDER_TYPE=DRY_RUN | ||
DISABLE_MFA=true | ||
DISABLE_RECAPTCHA=true | ||
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI | ||
RECAPTCHA_SITE_SECRET_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe | ||
SEP24_JWT_SECRET='jwt_secret_1234567890' | ||
ANCHOR_PLATFORM_OUTGOING_JWT_SECRET=mySdpToAnchorPlatformSecret | ||
|
||
# multi-tenant | ||
INSTANCE_NAME="SDP Testnet on Docker" | ||
ADMIN_PORT="8003" | ||
TENANT_XLM_BOOTSTRAP_AMOUNT=5 | ||
ADMIN_ACCOUNT=SDP-admin | ||
ADMIN_API_KEY=api_key_1234567890 | ||
|
||
# Event broker configuration | ||
EVENT_BROKER_TYPE=kafka | ||
BROKER_URLS=localhost:9094 | ||
KAFKA_SECURITY_PROTOCOL=PLAINTEXT | ||
CONSUMER_GROUP_ID=group-id | ||
|
||
# scheduler options | ||
ENABLE_SCHEDULER=false | ||
SCHEDULER_RECEIVER_INVITATION_JOB_SECONDS="10" | ||
SCHEDULER_PAYMENT_JOB_SECONDS="10" |
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,41 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "02:00" | ||
open-pull-requests-limit: 2 | ||
groups: | ||
minor-and-patch: | ||
applies-to: version-updates | ||
update-types: | ||
- "patch" | ||
- "minor" | ||
major: | ||
applies-to: version-updates | ||
update-types: | ||
- "major" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "02:00" | ||
open-pull-requests-limit: 2 | ||
groups: | ||
all-actions: | ||
applies-to: version-updates | ||
patterns: [ "*" ] | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "sunday" | ||
time: "02:00" | ||
open-pull-requests-limit: 2 | ||
groups: | ||
all-docker: | ||
applies-to: version-updates | ||
patterns: [ "*" ] |
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
145 changes: 145 additions & 0 deletions
145
.github/workflows/singletenant_to_multitenant_db_migration_test.yml
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,145 @@ | ||
name: Single-tenant to Multi-tenant | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- "release/**" | ||
- "releases/**" | ||
- "hotfix/**" | ||
pull_request: | ||
|
||
env: | ||
USER_EMAIL: "sdp_user@stellar.org" | ||
USER_PASSWORD: "mockPassword123!" | ||
DATABASE_URL: "postgres://postgres@db:5432/e2e-sdp?sslmode=disable" | ||
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV" | ||
DISTRIBUTION_PUBLIC_KEY: ${{ vars.DISTRIBUTION_PUBLIC_KEY }} | ||
DISTRIBUTION_SEED: ${{ vars.DISTRIBUTION_SEED }} | ||
CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE: ${{ vars.DISTRIBUTION_SEED }} | ||
SEP10_SIGNING_PUBLIC_KEY: ${{ vars.SEP10_SIGNING_PUBLIC_KEY }} | ||
SEP10_SIGNING_PRIVATE_KEY: ${{ vars.SEP10_SIGNING_PRIVATE_KEY }} | ||
|
||
jobs: | ||
db-migration: | ||
runs-on: ubuntu-latest | ||
environment: "Receiver Registration - E2E Integration Tests (Stellar)" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cleanup data | ||
working-directory: internal/integrationtests/docker | ||
run: docker-compose -f docker-compose-e2e-tests.yml down -v | ||
shell: bash | ||
|
||
- name: Run Docker Compose for SDP, Anchor Platform and TSS | ||
working-directory: internal/integrationtests/docker | ||
run: docker-compose -f docker-compose-e2e-tests.yml up --build -V -d | ||
shell: bash | ||
|
||
- name: Install curl | ||
run: sudo apt-get update && sudo apt-get install -y curl | ||
shell: bash | ||
|
||
- name: Copy DB Dump to Container and Restore | ||
run: | | ||
docker cp internal/integrationtests/resources/single_tenant_dump.sql e2e-sdp-v2-database:/tmp/single_tenant_dump.sql | ||
docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -f /tmp/single_tenant_dump.sql" | ||
- name: Provision New Tenant | ||
run: | | ||
adminAccount="SDP-admin" | ||
adminApiKey="api_key_1234567890" | ||
encodedCredentials=$(echo -n "$adminAccount:$adminApiKey" | base64) | ||
AuthHeader="Authorization: Basic $encodedCredentials" | ||
tenant="migrated-tenant" | ||
baseURL="http://$tenant.stellar.local:8000" | ||
sdpUIBaseURL="http://$tenant.stellar.local:3000" | ||
ownerEmail="init_owner@$tenant.local" | ||
AdminTenantURL="http://localhost:8003/tenants" | ||
response=$(curl -s -w "\n%{http_code}" -X POST $AdminTenantURL \ | ||
-H "Content-Type: application/json" \ | ||
-H "$AuthHeader" \ | ||
-d '{ | ||
"name": "'"$tenant"'", | ||
"organization_name": "'"$tenant"'", | ||
"base_url": "'"$baseURL"'", | ||
"sdp_ui_base_url": "'"$sdpUIBaseURL"'", | ||
"owner_email": "'"$ownerEmail"'", | ||
"owner_first_name": "jane", | ||
"owner_last_name": "doe", | ||
"distribution_account_type": "DISTRIBUTION_ACCOUNT.STELLAR.DB_VAULT" | ||
}') | ||
http_code=$(echo "$response" | tail -n1) | ||
response_body=$(echo "$response" | sed '$d') | ||
if [[ "$http_code" -ge 200 && "$http_code" -lt 300 ]]; then | ||
echo "✅ Tenant $tenant created successfully." | ||
echo "🔗 You can now reset the password for the owner $ownerEmail on $sdpUIBaseURL/forgot-password" | ||
echo "Response body: $response_body" | ||
else | ||
echo "❌ Failed to create tenant $tenant. HTTP status code: $http_code" | ||
echo "Server response: $response_body" | ||
exit 1 | ||
fi | ||
- name: Run Migration | ||
run: | | ||
docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -c \"SELECT admin.migrate_tenant_data_from_v1_to_v2('migrated-tenant');\"" | ||
- name: Verify Row Counts | ||
run: | | ||
submitter_public_count=$(docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -t -c 'SELECT COUNT(*) FROM public.submitter_transactions;'") | ||
submitter_tss_count=$(docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -t -c 'SELECT COUNT(*) FROM tss.submitter_transactions;'") | ||
receiver_public_count=$(docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -t -c 'SELECT COUNT(*) FROM public.receivers;'") | ||
receiver_migrated_count=$(docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -t -c 'SELECT COUNT(*) FROM \"sdp_migrated-tenant\".receivers;'") | ||
if [ "$submitter_public_count" -eq "$submitter_tss_count" ] && [ "$submitter_public_count" -gt 0 ]; then | ||
echo "✅ submitter_transactions row counts match and are greater than zero." | ||
else | ||
echo "❌ submitter_transactions row counts do not match or are not greater than zero." | ||
exit 1 | ||
fi | ||
if [ "$receiver_public_count" -eq "$receiver_migrated_count" ] && [ "$receiver_public_count" -gt 0 ]; then | ||
echo "✅ receivers row counts match and are greater than zero." | ||
else | ||
echo "❌ receivers row counts do not match or are not greater than zero." | ||
exit 1 | ||
fi | ||
- name: Exclude Deprecated Tables | ||
run: | | ||
docker exec e2e-sdp-v2-database bash -c "psql -d $DATABASE_URL -c \" | ||
BEGIN TRANSACTION; | ||
DROP TABLE public.messages CASCADE; | ||
DROP TABLE public.payments CASCADE; | ||
DROP TABLE public.disbursements CASCADE; | ||
DROP TABLE public.receiver_verifications CASCADE; | ||
DROP TABLE public.receiver_wallets CASCADE; | ||
DROP TABLE public.auth_user_password_reset CASCADE; | ||
DROP TABLE public.auth_user_mfa_codes CASCADE; | ||
DROP TABLE public.receivers CASCADE; | ||
DROP TABLE public.auth_users CASCADE; | ||
DROP TABLE public.wallets_assets CASCADE; | ||
DROP TABLE public.assets CASCADE; | ||
DROP TABLE public.wallets CASCADE; | ||
DROP TABLE public.organizations CASCADE; | ||
DROP TABLE public.gorp_migrations CASCADE; | ||
DROP TABLE public.auth_migrations CASCADE; | ||
DROP TABLE public.countries CASCADE; | ||
DROP TABLE public.submitter_transactions CASCADE; | ||
DROP TABLE public.channel_accounts CASCADE; | ||
COMMIT; | ||
\"" | ||
- name: Docker logs | ||
if: always() | ||
working-directory: internal/integrationtests/docker | ||
run: | | ||
docker-compose -f docker-compose-e2e-tests.yml logs | ||
docker-compose -f docker-compose-e2e-tests.yml down -v | ||
shell: bash |
Oops, something went wrong.