Skip to content
Closed
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
276 changes: 140 additions & 136 deletions docker-compose.core.yml
Original file line number Diff line number Diff line change
@@ -1,147 +1,151 @@
version: '3.8'
version: "3.8"

x-common-host-access: &common-host-access
extra_hosts:
- "host.docker.internal:host-gateway"
dns:
- 8.8.8.8
- 8.8.4.4
- 1.1.1.1
extra_hosts:
- "host.docker.internal:host-gateway"
dns:
- 8.8.8.8
- 8.8.4.4
- 1.1.1.1

services:
# PostgreSQL database for registry and evault-core
postgres:
image: postgres:15-alpine
container_name: metastate-postgres
ports:
- "5433:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_MULTIPLE_DATABASES=registry
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init-multiple-databases.sh:/docker-entrypoint-initdb.d/init-multiple-databases.sh
networks:
- metastate-core-network
<<: *common-host-access
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "none"
# PostgreSQL database for registry and evault-core
postgres:
image: postgres:15-alpine
container_name: metastate-postgres
ports:
- "5433:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_MULTIPLE_DATABASES=registry
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init-multiple-databases.sh:/docker-entrypoint-initdb.d/init-multiple-databases.sh
networks:
- metastate-core-network
<<: *common-host-access
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "none"

# Neo4j for evault-core graph data
neo4j:
image: neo4j:5.15
container_name: metastate-neo4j
ports:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
environment:
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD:-neo4j}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-neo4j}
- NEO4J_dbms_connector_bolt_listen__address=0.0.0.0:7687
- NEO4J_dbms_connector_http_listen__address=0.0.0.0:7474
- NEO4J_dbms_connector_bolt_advertised__address=neo4j:7687
volumes:
- neo4j_data:/var/lib/neo4j/data
networks:
- metastate-core-network
<<: *common-host-access
entrypoint: ["/bin/sh", "-c"]
command:
- |
# Remove any stale PID files before starting Neo4j
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
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
exec /startup/docker-entrypoint.sh neo4j
healthcheck:
test: ["CMD-SHELL", "cypher-shell -u neo4j -p ${NEO4J_PASSWORD:-neo4j} 'RETURN 1' || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# Neo4j for evault-core graph data
neo4j:
image: neo4j:5.15
container_name: metastate-neo4j
ports:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
environment:
- NEO4J_AUTH=${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD:-neo4j}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-neo4j}
- NEO4J_dbms_connector_bolt_listen__address=0.0.0.0:7687
- NEO4J_dbms_connector_http_listen__address=0.0.0.0:7474
- NEO4J_dbms_connector_bolt_advertised__address=neo4j:7687
volumes:
- neo4j_data:/var/lib/neo4j/data
networks:
- metastate-core-network
<<: *common-host-access
entrypoint: ["/bin/sh", "-c"]
command:
- |
# Remove any stale PID files before starting Neo4j
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
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
exec /startup/docker-entrypoint.sh neo4j
healthcheck:
test:
[
"CMD-SHELL",
"cypher-shell -u neo4j -p ${NEO4J_PASSWORD:-neo4j} 'RETURN 1' || exit 1",
]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s

# Registry service
registry:
profiles:
- core
build:
context: .
dockerfile: ./docker/Dockerfile.registry
network: host
container_name: metastate-registry
ports:
- "4321:4321"
environment:
- NODE_ENV=${NODE_ENV:-production}
- DATABASE_URL=${REGISTRY_DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/registry}
- REGISTRY_SHARED_SECRET=${REGISTRY_SHARED_SECRET:-dev-secret-change-me}
- PUBLIC_REGISTRY_URL=${PUBLIC_REGISTRY_URL:-http://localhost:4321}
depends_on:
postgres:
condition: service_healthy
networks:
- metastate-core-network
<<: *common-host-access
restart: unless-stopped
# Registry service
registry:
profiles:
- core
build:
context: .
dockerfile: ./docker/Dockerfile.registry
network: host
container_name: metastate-registry
ports:
- "4321:4321"
environment:
- NODE_ENV=${NODE_ENV:-production}
- DATABASE_URL=${REGISTRY_DATABASE_URL}
- REGISTRY_SHARED_SECRET=${REGISTRY_SHARED_SECRET}
- PUBLIC_REGISTRY_URL=${PUBLIC_REGISTRY_URL}
depends_on:
postgres:
condition: service_healthy
networks:
- metastate-core-network
<<: *common-host-access
restart: unless-stopped

# eVault Core service
evault-core:
profiles:
- core
build:
context: .
dockerfile: ./docker/Dockerfile.evault-core
network: host
container_name: metastate-evault-core
ports:
- "3001:3001" # Express (provisioning API)
- "4000:4000" # Fastify (GraphQL/HTTP)
environment:
- NODE_ENV=${NODE_ENV:-production}
- EXPRESS_PORT=3001
- FASTIFY_PORT=4000
- PORT=4000
- REGISTRY_DATABASE_URL=${REGISTRY_DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/registry}
- PUBLIC_REGISTRY_URL=${PUBLIC_REGISTRY_URL:-http://registry:4321}
- REGISTRY_SHARED_SECRET=${REGISTRY_SHARED_SECRET:-dev-secret-change-me}
- NEO4J_URI=${NEO4J_URI:-bolt://neo4j:7687}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-neo4j}
- EVAULT_PUBLIC_KEY=${EVAULT_PUBLIC_KEY:-}
- W3ID=${W3ID:-}
depends_on:
postgres:
condition: service_healthy
registry:
condition: service_started
neo4j:
condition: service_healthy
networks:
- metastate-core-network
<<: *common-host-access
restart: unless-stopped
# eVault Core service
evault-core:
profiles:
- core
build:
context: .
dockerfile: ./docker/Dockerfile.evault-core
network: host
container_name: metastate-evault-core
ports:
- "3001:3001" # Express (provisioning API)
- "4000:4000" # Fastify (GraphQL/HTTP)
environment:
- NODE_ENV=${NODE_ENV:-production}
- EXPRESS_PORT=3001
- FASTIFY_PORT=4000
- PORT=4000
- REGISTRY_DATABASE_URL=${REGISTRY_DATABASE_URL}
- PUBLIC_REGISTRY_URL=${PUBLIC_REGISTRY_URL}
- REGISTRY_SHARED_SECRET=${REGISTRY_SHARED_SECRET}
- NEO4J_URI=${NEO4J_URI:-bolt://neo4j:7687}
- NEO4J_USER=${NEO4J_USER:-neo4j}
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-neo4j}
- EVAULT_PUBLIC_KEY=${EVAULT_PUBLIC_KEY:-}
- W3ID=${W3ID:-}
depends_on:
postgres:
condition: service_healthy
registry:
condition: service_started
neo4j:
condition: service_healthy
networks:
- metastate-core-network
<<: *common-host-access
restart: unless-stopped

volumes:
postgres_data:
driver: local
neo4j_data:
driver: local
postgres_data:
driver: local
neo4j_data:
driver: local

networks:
metastate-core-network:
driver: bridge
driver_opts:
com.docker.network.bridge.enable_icc: "true"
com.docker.network.bridge.enable_ip_masquerade: "true"
ipam:
config:
- subnet: 172.28.0.0/16
metastate-core-network:
driver: bridge
driver_opts:
com.docker.network.bridge.enable_icc: "true"
com.docker.network.bridge.enable_ip_masquerade: "true"
ipam:
config:
- subnet: 172.28.0.0/16
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
</TableHeadCell>
{/snippet}

{#snippet BodyCell(data: Record<string, TableCell>, field: string, i: number)}
{#snippet BodyCell(data: Record<string, TableCell<T>>, field: string, i: number)}
<TableBodyCell
class="wide:text-base font-roboto text-black-700 overflow-hidden p-2 text-xs font-normal text-ellipsis
{i === 0 && !withSelection && 'rounded-s-2xl pl-6'}
Expand Down
73 changes: 38 additions & 35 deletions platforms/blabsy/src/components/login/login-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,50 @@ export function LoginMain(): JSX.Element {
const eventSourceRef = useRef<EventSource | null>(null);
const refreshTimerRef = useRef<NodeJS.Timeout | null>(null);

const watchEventStream = useCallback((id: string): EventSource => {
const sseUrl = new URL(
`/api/auth/sessions/${id}`,
process.env.NEXT_PUBLIC_BASE_URL
).toString();
const eventSource = new EventSource(sseUrl);

eventSource.onopen = (): void => {
console.log('Successfully connected.');
setErrorMessage(null);
};
const watchEventStream = useCallback(
(id: string): EventSource => {
const sseUrl = new URL(
`/api/auth/sessions/${id}`,
process.env.NEXT_PUBLIC_BASE_URL
).toString();
const eventSource = new EventSource(sseUrl);

eventSource.onmessage = async (e): Promise<void> => {
const data = JSON.parse(e.data as string) as {
token?: string;
error?: boolean;
message?: string;
type?: string;
eventSource.onopen = (): void => {
console.log('Successfully connected.');
setErrorMessage(null);
};

if (data.error && data.type === 'version_mismatch') {
setErrorMessage(
data.message ||
'Your eID Wallet app version is outdated. Please update to continue.'
);
eventSource.close();
return;
}
eventSource.onmessage = async (e): Promise<void> => {
const data = JSON.parse(e.data as string) as {
token?: string;
error?: boolean;
message?: string;
type?: string;
};

if (data.token) {
await signInWithCustomToken(data.token);
}
};
if (data.error && data.type === 'version_mismatch') {
setErrorMessage(
data.message ||
'Your eID Wallet app version is outdated. Please update to continue.'
);
eventSource.close();
return;
}

eventSource.onerror = (): void => {
console.error('SSE connection error');
eventSource.close();
};
if (data.token) {
await signInWithCustomToken(data.token);
}
};

return eventSource;
}, [signInWithCustomToken]);
eventSource.onerror = (): void => {
console.error('SSE connection error');
eventSource.close();
};

return eventSource;
},
[signInWithCustomToken]
);

const getOfferData = useCallback(async (): Promise<void> => {
// Clean up existing SSE connection
Expand Down
Loading