Skip to content
Draft
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: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ EREPUTATION_MAPPING_DB_PATH="/path/to/erep/mapping/db"
VITE_EREPUTATION_BASE_URL=http://localhost:8765

LOAD_TEST_USER_COUNT=6

PUBLIC_EID_WALLET_TOKEN=obtained-from-post-registry-service-/platforms/certification
39 changes: 39 additions & 0 deletions db/init-multiple-databases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -e

# Get the list of databases from environment variable
# Default to empty if not set
POSTGRES_MULTIPLE_DATABASES=${POSTGRES_MULTIPLE_DATABASES:-}

# If no databases specified, exit
if [ -z "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "No databases specified in POSTGRES_MULTIPLE_DATABASES"
exit 0
fi

echo "Creating multiple databases..."

# Split the comma-separated list and create each database
IFS=',' read -ra DATABASES <<< "$POSTGRES_MULTIPLE_DATABASES"
for db in "${DATABASES[@]}"; do
# Trim whitespace
db=$(echo "$db" | xargs)

if [ -n "$db" ]; then
# Check if database exists
DB_EXISTS=$(psql -v ON_ERROR_STOP=0 --username "$POSTGRES_USER" --dbname postgres -tAc "SELECT 1 FROM pg_database WHERE datname='$db'" 2>/dev/null || echo "")

if [ "$DB_EXISTS" = "1" ]; then
echo "Database $db already exists, skipping..."
else
echo "Creating database: $db"
# Create the database directly (not inside a function)
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname postgres <<-EOSQL
CREATE DATABASE "$db";
EOSQL
fi
fi
done

echo "Multiple databases created successfully!"

13 changes: 13 additions & 0 deletions dev-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ services:
networks:
- metastate-network
<<: *common-host-access
entrypoint: ["/bin/sh", "-c"]
command:
- |
# Remove any stale PID files before starting Neo4j
# Neo4j stores PID files in /var/lib/neo4j/run/neo4j.pid
rm -f /var/lib/neo4j/run/neo4j.pid 2>/dev/null || true
rm -f /var/lib/neo4j/data/run/neo4j.pid 2>/dev/null || true
rm -f /var/lib/neo4j/data/neo4j.pid 2>/dev/null || true
# Also clean up any other PID files
find /var/lib/neo4j -name "*.pid" -type f -delete 2>/dev/null || true
find /var/lib/neo4j/data -name "*.pid" -type f -delete 2>/dev/null || true
# Start Neo4j with the original entrypoint
exec /startup/docker-entrypoint.sh neo4j
healthcheck:
test: [ "CMD-SHELL", "cypher-shell -u neo4j -p ${NEO4J_PASSWORD:-neo4j} 'RETURN 1' || exit 1" ]
interval: 10s
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
PUBLIC_REGISTRY_URL,
PUBLIC_PROVISIONER_URL,
PUBLIC_EID_WALLET_TOKEN,
PUBLIC_PROVISIONER_URL,
PUBLIC_REGISTRY_URL,
} from "$env/static/public";
import type { Store } from "@tauri-apps/plugin-store";
import axios from "axios";
import { GraphQLClient } from "graphql-request";
import NotificationService from "../../services/NotificationService";
import type { UserController } from "./user";
import type { KeyService } from "./key";
import type { UserController } from "./user";

const STORE_META_ENVELOPE = `
mutation StoreMetaEnvelope($input: MetaEnvelopeInput!) {
Expand Down Expand Up @@ -176,7 +176,7 @@ export class VaultController {
};

if (authToken) {
headers["Authorization"] = `Bearer ${authToken}`;
headers.Authorization = `Bearer ${authToken}`;
}

await axios.patch(patchUrl, { publicKey }, { headers });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ onMount(async () => {
new URL("/entropy", PUBLIC_REGISTRY_URL).toString(),
);
const registryEntropy = entropyRes.data.token;
console.log("Registry entropy:", registryEntropy);

const provisionRes = await axios.post(
new URL("/provision", PUBLIC_PROVISIONER_URL).toString(),
Expand All @@ -208,6 +209,7 @@ onMount(async () => {
publicKey: await getApplicationPublicKey(),
},
);
console.log("Provision response:", provisionRes.data);

if (!provisionRes.data?.success) {
throw new Error("Invalid verification code");
Expand Down
Loading