Skip to content

Commit a3c0e12

Browse files
committed
Merge branch 'fix/local-dev-qol' into refactor/control-panel-infrastructure
2 parents b7fd8fc + 9f56234 commit a3c0e12

File tree

13 files changed

+625
-328
lines changed

13 files changed

+625
-328
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ EREPUTATION_MAPPING_DB_PATH="/path/to/erep/mapping/db"
7171
VITE_EREPUTATION_BASE_URL=http://localhost:8765
7272

7373
LOAD_TEST_USER_COUNT=6
74+
75+
PUBLIC_EID_WALLET_TOKEN=obtained-from-post-registry-service-/platforms/certification

db/init-multiple-databases.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Get the list of databases from environment variable
5+
# Default to empty if not set
6+
POSTGRES_MULTIPLE_DATABASES=${POSTGRES_MULTIPLE_DATABASES:-}
7+
8+
# If no databases specified, exit
9+
if [ -z "$POSTGRES_MULTIPLE_DATABASES" ]; then
10+
echo "No databases specified in POSTGRES_MULTIPLE_DATABASES"
11+
exit 0
12+
fi
13+
14+
echo "Creating multiple databases..."
15+
16+
# Split the comma-separated list and create each database
17+
IFS=',' read -ra DATABASES <<< "$POSTGRES_MULTIPLE_DATABASES"
18+
for db in "${DATABASES[@]}"; do
19+
# Trim whitespace
20+
db=$(echo "$db" | xargs)
21+
22+
if [ -n "$db" ]; then
23+
# Check if database exists
24+
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 "")
25+
26+
if [ "$DB_EXISTS" = "1" ]; then
27+
echo "Database $db already exists, skipping..."
28+
else
29+
echo "Creating database: $db"
30+
# Create the database directly (not inside a function)
31+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname postgres <<-EOSQL
32+
CREATE DATABASE "$db";
33+
EOSQL
34+
fi
35+
fi
36+
done
37+
38+
echo "Multiple databases created successfully!"
39+

dev-docker-compose.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ services:
126126
networks:
127127
- metastate-network
128128
<<: *common-host-access
129+
entrypoint: ["/bin/sh", "-c"]
130+
command:
131+
- |
132+
# Remove any stale PID files before starting Neo4j
133+
# Neo4j stores PID files in /var/lib/neo4j/run/neo4j.pid
134+
rm -f /var/lib/neo4j/run/neo4j.pid 2>/dev/null || true
135+
rm -f /var/lib/neo4j/data/run/neo4j.pid 2>/dev/null || true
136+
rm -f /var/lib/neo4j/data/neo4j.pid 2>/dev/null || true
137+
# Also clean up any other PID files
138+
find /var/lib/neo4j -name "*.pid" -type f -delete 2>/dev/null || true
139+
find /var/lib/neo4j/data -name "*.pid" -type f -delete 2>/dev/null || true
140+
# Start Neo4j with the original entrypoint
141+
exec /startup/docker-entrypoint.sh neo4j
129142
healthcheck:
130143
test: [ "CMD-SHELL", "cypher-shell -u neo4j -p ${NEO4J_PASSWORD:-neo4j} 'RETURN 1' || exit 1" ]
131144
interval: 10s

infrastructure/eid-wallet/src-tauri/gen/android/.idea/codeStyles/Project.xml

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/eid-wallet/src-tauri/gen/android/.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/eid-wallet/src-tauri/gen/android/.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/eid-wallet/src/lib/global/controllers/evault.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
2-
PUBLIC_REGISTRY_URL,
3-
PUBLIC_PROVISIONER_URL,
42
PUBLIC_EID_WALLET_TOKEN,
3+
PUBLIC_PROVISIONER_URL,
4+
PUBLIC_REGISTRY_URL,
55
} from "$env/static/public";
66
import type { Store } from "@tauri-apps/plugin-store";
77
import axios from "axios";
88
import { GraphQLClient } from "graphql-request";
99
import NotificationService from "../../services/NotificationService";
10-
import type { UserController } from "./user";
1110
import type { KeyService } from "./key";
11+
import type { UserController } from "./user";
1212

1313
const STORE_META_ENVELOPE = `
1414
mutation StoreMetaEnvelope($input: MetaEnvelopeInput!) {
@@ -176,7 +176,7 @@ export class VaultController {
176176
};
177177

178178
if (authToken) {
179-
headers["Authorization"] = `Bearer ${authToken}`;
179+
headers.Authorization = `Bearer ${authToken}`;
180180
}
181181

182182
await axios.patch(patchUrl, { publicKey }, { headers });

infrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ onMount(async () => {
198198
new URL("/entropy", PUBLIC_REGISTRY_URL).toString(),
199199
);
200200
const registryEntropy = entropyRes.data.token;
201+
console.log("Registry entropy:", registryEntropy);
201202
202203
const provisionRes = await axios.post(
203204
new URL("/provision", PUBLIC_PROVISIONER_URL).toString(),
@@ -208,6 +209,7 @@ onMount(async () => {
208209
publicKey: await getApplicationPublicKey(),
209210
},
210211
);
212+
console.log("Provision response:", provisionRes.data);
211213
212214
if (!provisionRes.data?.success) {
213215
throw new Error("Invalid verification code");

0 commit comments

Comments
 (0)