diff --git a/docker-compose.yml b/docker-compose.yml index e177cbca..73d22d9a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -218,6 +218,34 @@ services: retries: 3 start_period: 60s + ihm_client: + build: + context: ./ihm_client + dockerfile: Dockerfile + container_name: 4nk-ihm-client + ports: + - "8080:80" + environment: + - SDK_RELAY_WS_URL=ws://sdk_relay_1:8090 + - SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091 + - BITCOIN_RPC_URL=http://bitcoin:18443 + - BLINDBIT_URL=http://blindbit:8000 + volumes: + - ihm_client_logs:/var/log/nginx + networks: + - btcnet + depends_on: + - sdk_relay_1 + - sdk_relay_2 + - sdk_relay_3 + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + volumes: bitcoin_data: name: 4nk_node_bitcoin_data @@ -229,6 +257,8 @@ volumes: name: 4nk_node_sdk_relay_2_data sdk_relay_3_data: name: 4nk_node_sdk_relay_3_data + ihm_client_logs: + driver: local networks: btcnet: diff --git a/ihm_client/Dockerfile b/ihm_client/Dockerfile new file mode 100644 index 00000000..e3e37402 --- /dev/null +++ b/ihm_client/Dockerfile @@ -0,0 +1,53 @@ +# Dockerfile optimisé pour l'intégration dans 4NK_node +FROM node:20-alpine AS builder + +WORKDIR /app + +# Installation des dépendances système +RUN apk update && apk add --no-cache \ + git \ + build-base \ + python3 \ + make \ + g++ + +# Copie des fichiers de dépendances +COPY package*.json ./ + +# Installation des dépendances +RUN npm ci --only=production + +# Copie du code source +COPY . . + +# Build de l'application +RUN npm run build + +# Image de production +FROM nginx:alpine + +# Installation de Node.js pour les scripts de démarrage +RUN apk update && apk add --no-cache nodejs npm + +# Copie des fichiers buildés +COPY --from=builder /app/dist /usr/share/nginx/html +COPY --from=builder /app/package*.json /app/ + +# Copie de la configuration nginx optimisée pour 4NK_node +COPY nginx.4nk-node.conf /etc/nginx/conf.d/default.conf + +# Script de démarrage +COPY start-4nk-node.sh /start-4nk-node.sh +RUN chmod +x /start-4nk-node.sh + +# Exposition des ports +EXPOSE 80 3003 + +# Variables d'environnement pour 4NK_node +ENV SDK_RELAY_WS_URL=ws://sdk_relay_1:8090 +ENV SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091 +ENV BITCOIN_RPC_URL=http://bitcoin:18443 +ENV BLINDBIT_URL=http://blindbit:8000 + +# Point d'entrée +CMD ["/start-4nk-node.sh"] diff --git a/ihm_client/index.html b/ihm_client/index.html new file mode 100755 index 00000000..f7f60fb4 --- /dev/null +++ b/ihm_client/index.html @@ -0,0 +1,26 @@ + + +
+ + + + + + + +-${value.previous_value}+
+${value.new_value}+
Are you sure you want to delete your account? This action cannot be undone.
+ + `; + + this.shadowRoot?.appendChild(modal); + modal.style.display = 'block'; + + const cancelBtn = modal.querySelector('.cancel-btn'); + const confirmBtn = modal.querySelector('.confirm-btn'); + + cancelBtn?.addEventListener('click', () => { + modal.remove(); + }); + + confirmBtn?.addEventListener('click', () => { + this.deleteAccount(); + modal.remove(); + }); +} + +private deleteAccount(): void { + localStorage.clear(); + window.location.href = '/login.html'; +} + +private updateNavbarBanner(imageUrl: string): void { + const navbarSection = this.shadowRoot?.querySelector('.nav-wrapper .avatar-section'); + if (!navbarSection) return; + + let bannerImg = navbarSection.querySelectorAre you sure you want to delete this device?
+ +No notifications
'; + } + + modal.innerHTML = ` +Date: ${contract.date}
+Parties: ${contract.parties.join(', ')}
+Terms:
+Content: ${contract.content}
+Device Name | +SP Emojis | +QR Code | +Actions | +
---|
Label | +Wallet | +Type | +
---|
Name | +Visibility | +Role | +Duration | +Legal | +Contract | +
---|