27 Commits

Author SHA1 Message Date
c7f8d301d5 Improve HTML response detection in NIP-95 upload API
**Motivations:**
- Better error handling when endpoints return HTML error pages instead of JSON
- Provide clearer error messages to users

**Root causes:**
- Some NIP-95 endpoints (e.g., nostrimg.com) return HTML error pages instead of JSON
- Current error handling only catches JSON parse errors without detecting HTML responses
- Users get confusing error messages about JSON parsing when the real issue is an HTML response

**Correctifs:**
- Added HTML detection before JSON parsing
- Extract error message from HTML title or h1 tags when possible
- Provide clearer error message indicating HTML response instead of JSON
- Improved error logging with HTML body preview

**Evolutions:**
- None

**Pages affectées:**
- pages/api/nip95-upload.ts
2026-01-05 22:49:05 +01:00
32b33d56a1 Add translations for settings page (fr/en)
**Motivations:**
- Translate settings page and all its components to French and English
- Provide consistent multilingual experience

**Root causes:**
- Settings page and components were hardcoded in English
- No translation support for key management and NIP-95 configuration

**Correctifs:**
- None (new feature)

**Evolutions:**
- Added translations for settings page title
- Added translations for KeyManagementManager component:
  - Public keys display (npub and hex)
  - Import form and validation messages
  - Recovery phrase display
  - All buttons and warnings
- Added translations for Nip95ConfigManager component:
  - Endpoint list and management
  - Add/edit/remove actions
  - Error messages
- Updated both fr.txt and en.txt translation files
- All text now uses t() function for i18n support

**Pages affectées:**
- pages/settings.tsx
- components/KeyManagementManager.tsx
- components/Nip95ConfigManager.tsx
- public/locales/fr.txt
- public/locales/en.txt
- locales/fr.txt
- locales/en.txt
2026-01-05 22:43:11 +01:00
7791370b37 Add key management configuration page
**Motivations:**
- Provide a dedicated interface for managing Nostr keys
- Allow users to view public keys (npub and hex)
- Enable importing private keys via URL or text format
- Respect the existing two-level encryption system

**Root causes:**
- No dedicated interface for key management
- Users need to view their public keys easily
- Users need to import keys in various formats (nsec URL, nsec text, hex)

**Correctifs:**
- None (new feature)

**Evolutions:**
- Created KeyManagementManager component for key management
- Added public key display (npub and hex formats)
- Implemented private key import with support for:
  - nostr:// URLs with nsec
  - nsec text format (nsec1...)
  - hex format (64 characters)
- Automatic key extraction from URLs
- Account replacement warning and confirmation
- Recovery phrase display after import
- Individual copy buttons for each key format
- Integration in settings page

**Pages affectées:**
- components/KeyManagementManager.tsx (new)
- pages/settings.tsx (modified)
- features/key-management-configuration.md (new)
2026-01-05 22:13:40 +01:00
b5ec69624c Fix: NIP-95 upload 500 error 2026-01-05 22:07:11 +01:00
d8311078bc Fix: NIP-95 upload 500 error 2026-01-05 21:56:09 +01:00
a90b77cec3 Fix: NIP-95 upload 500 error 2026-01-05 21:22:49 +01:00
065ab30828 Fix: favicon 404 error and NIP-95 upload 500 error
**Motivations:**
- Corriger l'erreur 404 pour favicon.ico demandé par les navigateurs
- Corriger l'erreur 500 de l'API NIP-95 upload empêchant les uploads de fichiers

**Root causes:**
- Fichier favicon.ico manquant dans public/ causant des erreurs 404 répétées
- Incompatibilité entre form-data (npm) et fetch() natif de Node.js dans l'API NIP-95

**Correctifs:**
- Ajout de favicon.svg et mise à jour des références dans les pages
- Remplacement de fetch() par https/http natifs de Node.js dans nip95-upload.ts
- Amélioration de la gestion des erreurs et nettoyage des fichiers temporaires

**Evolutions:**
- Documentation des problèmes et solutions dans fixKnowledge/

**Pages affectées:**
- components/HomeView.tsx
- pages/docs.tsx
- pages/presentation.tsx
- pages/api/nip95-upload.ts
- features/account-creation-buttons-separation.md
- fixKnowledge/favicon-404-error.md (nouveau)
- fixKnowledge/nip95-upload-500-error.md (nouveau)
- public/favicon.svg (nouveau)
2026-01-05 01:34:55 +01:00
17aa64070e Change default NIP-95 endpoint to void.cat as nostr.build returns 405 2025-12-29 00:59:04 +01:00
35d4a94bb4 Change default NIP-95 endpoint back to nostr.build for proxy usage 2025-12-29 00:33:12 +01:00
a4820da2df Use proxy for all NIP-95 uploads to avoid CORS and endpoint issues, improve error logging 2025-12-29 00:30:54 +01:00
bafd8ca0bc Change default NIP-95 endpoint to picstr.build and fix proxy to accept endpoint parameter 2025-12-29 00:27:00 +01:00
7bab834f89 Fix multipart parsing in NIP-95 upload proxy by removing manual Content-Type header and improving error handling 2025-12-29 00:23:00 +01:00
970f8761ac Fix TypeScript syntax error in NIP-95 upload proxy endpoint by using interface 2025-12-29 00:20:26 +01:00
2b57b1d445 Add proxy API endpoint for NIP-95 upload to bypass CORS issues with nostr.build 2025-12-29 00:17:10 +01:00
b8daab2bcd Remove initializeCookieCleanup function and migration code 2025-12-28 22:38:34 +01:00
46d5f03fbe Remove connection button and replace with direct account creation/import options 2025-12-28 20:35:50 +01:00
a19b601205 Add image upload to presentation form and profile note
- Add ImageUploadField component for profile picture upload (NIP-95)
- Add pictureUrl field to AuthorPresentationDraft interface
- Store picture URL in Nostr event tags as 'picture'
- Display profile picture on author page
- Add discrete note indicating zapwall.fr profile differs from Nostr profile
- Update translations (FR/EN) for profile note
- All TypeScript checks pass
2025-12-28 16:11:54 +01:00
398b9506e6 Remove duplicate title and description from presentation page
- Remove title and description from pages/presentation.tsx
- Keep title with user name in AuthorPresentationEditor form
- Fix duplicate display issue
2025-12-27 23:56:31 +01:00
cb7ee0cfd4 Replace nos2x and NostrConnect with Alby authentication
- Remove nos2x and NostrConnect support
- Create new NostrAuthService using Alby (window.nostr NIP-07)
- Replace useNostrConnect with useNostrAuth in all components
- Update NostrRemoteSigner to use Alby for signing
- Delete NostrConnect-related files (nostrconnect.ts, handlers, etc.)
- Update documentation to reflect Alby-only authentication
- Remove NOSTRCONNECT_BRIDGE environment variable
- All TypeScript checks pass
2025-12-27 23:54:34 +01:00
fd26c42a17 Replace use.nsec.app with nos2x extension (NIP-07)
- Update NostrConnectService to use nos2x (window.nostr) by default
- Fallback to NostrConnect bridge only if nos2x is not available
- Update NostrRemoteSigner to use window.nostr.signEvent() for signing
- Add TypeScript definitions for NIP-07 window.nostr API
- Update documentation to reflect nos2x as primary authentication method
- Remove default use.nsec.app bridge URL
- All TypeScript checks pass
2025-12-27 23:48:16 +01:00
d3cae85b3d Update presentation page to dark theme and add language selector
- Update /presentation page to use dark theme (PageHeader, Footer, bg-cyber-darker)
- Add LanguageSelector component to PageHeader for all pages
- Update AuthorPresentationEditor to use dark theme styling
- Update ArticleField and ArticleFormButtons to use dark theme
- Add locale persistence in localStorage
- Update _app.tsx to load saved locale from localStorage
- All pages now support FR/EN language switching
2025-12-27 23:17:50 +01:00
5ea0ed21e1 Update /docs page with dark theme and modern styling
- Replace DocsHeader with PageHeader and Footer
- Update DocsSidebar with dark cyberpunk theme
- Update DocsContent with dark theme and styled prose
- Use i18n for page title
- All TypeScript checks pass
2025-12-27 23:01:34 +01:00
2a191f35f4 Fix all TypeScript errors and warnings
- Fix unused function warnings by renaming to _unusedExtractTags
- Fix type errors in nostrTagSystem.ts for includes() calls
- Fix type errors in reviews.ts for filter kinds array
- Fix ArrayBuffer type errors in articleEncryption.ts
- Remove unused imports (DecryptionKey, decryptArticleContent, extractTagsFromEvent)
- All TypeScript checks now pass without disabling any controls
2025-12-27 22:26:13 +01:00
90ff8282f1 feat: Implémentation système de commissions systématique et incontournable
- Création lib/platformCommissions.ts : configuration centralisée des commissions
  - Articles : 800 sats (700 auteur, 100 plateforme)
  - Avis : 70 sats (49 lecteur, 21 plateforme)
  - Sponsoring : 0.046 BTC (0.042 auteur, 0.004 plateforme)

- Validation des montants à chaque étape :
  - Publication : vérification du montant avant publication
  - Paiement : vérification du montant avant acceptation
  - Erreurs explicites si montant incorrect

- Tracking des commissions sur Nostr :
  - Tags author_amount et platform_commission dans événements
  - Interface ContentDeliveryTracking étendue
  - Traçabilité complète pour audit

- Logs structurés avec informations de commission
- Documentation complète du système

Les commissions sont maintenant systématiques, validées et traçables.
2025-12-27 21:11:09 +01:00
cf5ebeb6e9 \ 2025-12-23 02:20:57 +01:00
3000872dbc refactoring
- **Motivations :** Assurer passage du lint strict et clarifier la logique paiements/publications.

- **Root causes :** Fonctions trop longues, promesses non gérées et typages WebLN/Nostr incomplets.

- **Correctifs :** Refactor PaymentModal (handlers void), extraction helpers articlePublisher, simplification polling sponsoring/zap, corrections curly et awaits.

- **Evolutions :** Nouveau module articlePublisherHelpers pour présentation/aiguillage contenu privé.

- **Page affectées :** components/PaymentModal.tsx, lib/articlePublisher.ts, lib/articlePublisherHelpers.ts, lib/paymentPolling.ts, lib/sponsoring.ts, lib/nostrZapVerification.ts et dépendances liées.
2025-12-22 17:56:00 +01:00
40fe3e9389 Initial commit 2025-12-22 09:48:57 +01:00