diff --git a/www/i18n/locale-ca.json b/www/i18n/locale-ca.json index 614bf90f9bb9156f65196b8c4a10c9863db1f2fe..66161115314b64e0d29a25d313f450dd85606c75 100644 --- a/www/i18n/locale-ca.json +++ b/www/i18n/locale-ca.json @@ -922,6 +922,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Cambios no registrados", "LOGOUT": "¿Desea desconectarse?", "USE_FALLBACK_NODE": "Nodo <b>{{old}}</b> inalcanzable o dirección inválida.<br/><br/>¿Desea utilizar temporalmente el nodo <b>{{new}}</b>?", + "USE_SYNC_FALLBACK_NODE": "El node <b>{{old}}</b> sembla desincronitzat.<br/><br/>Vols utilitzar temporalment el node sincronitzat <b>{{new}}</b>?", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Advertència:</b> Vols <b>canviar manualment</b> el node Duniter?<br/><br/>Si continues:<ul><li> - S'activarà el <b>modo experto</b>;</li><li> - Podrà s tornar a la selecció automà tica de nodes simplement <b>desactivant el modo experto</b>.</li></ul>" }, "DOWNLOAD": { diff --git a/www/i18n/locale-de-DE.json b/www/i18n/locale-de-DE.json index f21d2ad9d2e34883c6bf874babea41860ec24c74..703bafd4c585c0755f4d060e6beec16d5a518bdb 100644 --- a/www/i18n/locale-de-DE.json +++ b/www/i18n/locale-de-DE.json @@ -854,6 +854,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Änderungen nicht speichern", "LOGOUT": "Sicher, dass du dich abmelden möchtest?", "USE_FALLBACK_NODE": "Knoten <b>{{old}}</b> ist nicht erreichbar.<br/><br/>Möchtest du temporär den Knoten <b>{{new}}</b> verwenden?", + "USE_SYNC_FALLBACK_NODE": "Knoten <b>{{old}}</b> scheint nicht synchronisiert zu sein.<br/><br/>Möchten Sie vorübergehend den synchronisierten Knoten <b>{{new}}</b> verwenden?", "ISSUE_524_SEND_LOG": "Die Transaktion wurde aufgrund eines bekannten Problems (issue #524) zurückgewiesen. Die Ursache ist bisher unbekannt.<br/>Akzeptierst du <b>die Ãœbertragung deiner Logdaten</b> als Nachricht, um den Entwicklern bei der Korrektur zu helfen?<br/><small>(Dies beinhaltet keine vertraulichen Daten)</small><br/>", "LICENCE": "Ich habe die die Lizenz des G1 gelesen und akzeptiert", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Warnung:</b> Möchten Sie den Knoten <b>manuell ändern</b>?<br/><br/>Wenn Sie fortfahren:<ul><li> - Der <b>Expertenmodus</b> wird aktiviert;</li><li> - Sie können zur automatischen Knotenauswahl zurückkehren, indem Sie einfach den <b>Expertenmodus deaktivieren</b>.</li></ul>" diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 4828ae9dd27f17dcaeea8353d4224594df8b5953..c779e179af4c33f7a2e1f25561a27278aeee79e0 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -857,6 +857,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Changes not saved", "LOGOUT": "Are you sure you want to logout?", "USE_FALLBACK_NODE": "Peer <b>{{old}}</b> unreachable or invalid address.<br/><br/>Do you want to temporarily use the <b>{{new}}</b> node?", + "USE_SYNC_FALLBACK_NODE": "Node <b>{{old}}</b> seems to be out of sync.<br/><br/>Do you want to temporarily use the synchronised node <b>{{new}}</b>?", "ISSUE_524_SEND_LOG": "The transaction was rejected because of a known problem (issue #524) but not reproduced.<br/><br/>To help developers correct this error, do you accept <b>the transmission of your logs</b> per message?<br/><small>(No confidential data is sent)</small>", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Warning:</b> Do you want to <b>manually change</b> the peer?<br/><br/>If you proceed:<ul><li> - <b>Expert mode</b> will be activated;</li><li> - You can return to automatic peer selection by simply <b>deactivating expert mode</b>.</li></ul>" }, diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index f90658a63bc48d6065a89f392398e335850bce1a..1de1e6f453a8de60a4e1899c90fa8d0c02b01af2 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -857,6 +857,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Changes not saved", "LOGOUT": "Are you sure you want to logout?", "USE_FALLBACK_NODE": "Peer <b>{{old}}</b> unreachable or invalid address.<br/><br/>Do you want to temporarily use the <b>{{new}}</b> node?", + "USE_SYNC_FALLBACK_NODE": "Node <b>{{old}}</b> seems to be out of sync.<br/><br/>Do you want to temporarily use the synchronized node <b>{{new}}</b>?", "ISSUE_524_SEND_LOG": "The transaction was rejected because of a known problem (issue #524) but not reproduced.<br/><br/>To help developers correct this error, do you accept <b>the transmission of your logs</b> per message?<br/><small>(No confidential data is sent)</small>", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Warning:</b> Do you want to <b>manually change</b> the Duniter node?<br/><br/>If you continue:<ul><li> - <b>Expert mode</b> will be activated;</li><li> - You can return to automatic node selection by simply <b>deactivating expert mode</b>.</li></ul>" }, diff --git a/www/i18n/locale-eo-EO.json b/www/i18n/locale-eo-EO.json index 59f801e2a5e3279ac71ef57ec7b0a6998d2095c7..0a34e3f5af3eb1383f782c378b48e53f0b99f392 100644 --- a/www/i18n/locale-eo-EO.json +++ b/www/i18n/locale-eo-EO.json @@ -838,6 +838,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Modifoj ne registritaj", "LOGOUT": "Ĉu vi certas, ke vi volas malkonektiÄi?", "USE_FALLBACK_NODE": "Nodo <b>{{old}}</b> neatingebla aÅ adreso nevalida.<br/><br/>Ĉu vi volas provizore uzi la nodon <b>{{new}}</b> ?", + "USE_SYNC_FALLBACK_NODE": "Åœajnas, ke nodo <b>{{old}}</b> ne estas sinkronigita.<br/><br/>Ĉu vi volas provizore uzi la sinkronigitan nodon <b>{{new}}</b>?", "ISSUE_524_SEND_LOG": "La spezo estis forĵetita, pro konata anomalio (petslipo #524) sed <b>ne ripetita</b>.<br/><br/>Por helpi la programistojn korekti tiun eraron, <b>ĉu vi akceptas la sendadon de viaj protokolaj dosieroj</b> per mesaÄo?<br/><small>(neniu konfidenca dateno estas sendita)</small>.", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Averto:</b> Ĉu vi volas <b>mane ÅanÄi</b> la nodon?<br/><br/>Se vi daÅrigas:<ul><li> - La <b>eksperta reÄimo</b> estos aktivigita;</li><li> - Vi povos reveni al aÅtomata nodo-selekto simple <b>malaktivigante la ekspertan reÄimon</b>.</li></ul>" }, diff --git a/www/i18n/locale-es-ES.json b/www/i18n/locale-es-ES.json index 3e1f79846355d96bb4abb0d4c22b098a35fec97e..fd4bd02c90b2a84e81efc551e3a44c4bd1df836e 100644 --- a/www/i18n/locale-es-ES.json +++ b/www/i18n/locale-es-ES.json @@ -924,6 +924,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Cambios no registrados", "LOGOUT": "¿Desea desconectarse?", "USE_FALLBACK_NODE": "Nodo <b>{{old}}</b> inalcanzable o dirección inválida.<br/><br/>¿Desea utilizar temporalmente el nodo <b>{{new}}</b>?", + "USE_SYNC_FALLBACK_NODE": "El nodo <b>{{old}}</b> parece estar desincronizado.<br/><br/>¿Quieres utilizar temporalmente el nodo sincronizado <b>{{new}}</b>?", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Advertencia:</b> ¿Quieres <b>cambiar manualmente</b> el nodo?<br/><br/>Si continúas:<ul><li> - Se activará el <b>modo experto</b>;</li><li> - Podrás volver a la selección automática de nodos simplemente <b>desactivando el modo experto</b>.</li></ul>" }, "DOWNLOAD": { diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 631ac79f618c94a3be9623a486f2048a178b8607..0d8a422cf206b176dac3401b7dea005ffd31107a 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -312,6 +312,7 @@ "BMAS": "Interface sécurisée (SSL)", "BMATOR": "Interface réseau TOR", "WS2P": "Interface WS2P", + "GVA": "Interface GVA", "ES_USER_API": "NÅ“ud de données Cesium+" } }, @@ -857,6 +858,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Modifications non enregistrées", "LOGOUT": "Êtes-vous sûr de vouloir vous déconnecter ?", "USE_FALLBACK_NODE": "NÅ“ud <b>{{old}}</b> injoignable ou adresse invalide.<br/><br/>Voulez-vous temporairement utiliser le nÅ“ud <b>{{new}}</b> ?", + "USE_SYNC_FALLBACK_NODE": "NÅ“ud <b>{{old}}</b> semble désynchronisé.<br/><br/>Voulez-vous temporairement utiliser le nÅ“ud <b>{{new}}</b> ?", "ISSUE_524_SEND_LOG": "La transaction a été rejetée, à cause d'une anomalie connue (ticket #524) mais <b>non reproduite</b>.<br/><br/>Pour aider les développeurs à corriger cette erreur, <b>acceptez-vous la transmission de vos logs</b> par message ?<br/><small>(aucune donnée confidentielle n'est envoyée)</small>.", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Avertissement :</b> Voulez-vous <b>changer manuellement</b> le nÅ“ud ?<br/><br/>Si vous continuez :<ul><li> - Le <b>mode expert</b> sera activé;</li><li> - Vous pourrez revenir à la sélection automatique du nÅ“ud, simplement <b>en désactivant le mode expert</b>.</li></ul>" }, diff --git a/www/i18n/locale-it-IT.json b/www/i18n/locale-it-IT.json index c75e106232bdc7e9b81646a8eb6e085d010e0ae9..50e2ebbf41394dba49bc88b2d5417da18f2740cb 100644 --- a/www/i18n/locale-it-IT.json +++ b/www/i18n/locale-it-IT.json @@ -839,6 +839,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Modifiche non salvate", "LOGOUT": "Sei sicuro di voler chiudere la sessione?", "USE_FALLBACK_NODE": "Nodo <b>{{old}}</b> indisponibile o indirizzo errato.<br/><br/>Vuoi utilizzare temporanemante il <b>{{new}}</b> nodo?", + "USE_SYNC_FALLBACK_NODE": "Il nodo <b>{{old}}</b> sembra non essere sincronizzato.<br/><br/>Vuoi usare temporaneamente il nodo sincronizzato <b>{{new}}</b>?", "ISSUE_524_SEND_LOG": "La transazione è stata annullata a causa di un errore conosciuto (issue #524) ma non riprodotto. <br/><br/>Per aiutare gli sviluppatori a risolvere questo errore, acconsenti all'<b>invio dei tuoi logs</b> per messaggio?<br/><small>(Non viene inviato nessun dato confidenziale)</small>", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Avviso:</b> Vuoi <b>cambiare manualmente</b> il nodo?<br/><br/>Se continui:<ul><li> - Verrà attivata la <b>modalità esperto</b>;</li><li> - Potrai tornare alla selezione automatica del nodo semplicemente <b>disattivando la modalità esperto</b>.</li></ul>" }, diff --git a/www/i18n/locale-nl-NL.json b/www/i18n/locale-nl-NL.json index f6dd50d4207040ba847b64061cfbeebdd8188c5d..6cddd34135385052d1f1db42b0466fb8c9cfd665 100644 --- a/www/i18n/locale-nl-NL.json +++ b/www/i18n/locale-nl-NL.json @@ -20,6 +20,7 @@ "BTN_RELATIVE_UNIT": "Gebruik relatieve eenheid", "BTN_BACK": "Terug", "BTN_NEXT": "Volgende", + "BTN_IMPORT": "Importeren", "BTN_CANCEL": "Annuleer", "BTN_CLOSE": "Sluit", "BTN_LATER": "Later", @@ -32,8 +33,10 @@ "BTN_ADD": "Toevoegen", "BTN_SEARCH": "Zoeken", "BTN_REFRESH": "Verwezenlijken", + "BTN_RETRY": "Opnieuw proberen", "BTN_START": "Beginnen", "BTN_CONTINUE": "Doorgaan", + "BTN_CREATE": "Creëren", "BTN_UNDERSTOOD": "Ik heb het begrepen", "BTN_OPTIONS": "Opties", "BTN_HELP_TOUR": "Rondleiding", @@ -41,6 +44,7 @@ "BTN_DOWNLOAD": "Downloaden", "BTN_DOWNLOAD_ACCOUNT_STATEMENT": "Downloaden het rekeningoverzicht", "BTN_MODIFY": "Bewerken", + "CHOOSE_FILE": "Sleep uw bestand hier <br/>of klik om het te selecteren", "DAYS": "dagen", "NO_ACCOUNT_QUESTION": "Nog geen lid? Registreer nu!", "SEARCH_NO_RESULT": "Geen resultaten", @@ -86,8 +90,8 @@ "HOME": "Welkom", "WOT": "Register", "CURRENCY": "Valuta", - "CURRENCIES": "Valuta's", "ACCOUNT": "Mijn rekening", + "WALLETS": "Mijn portefeuilles", "SETTINGS": "Instellingen", "NETWORK": "Netwerk", "TRANSACTIONS": "Mijn transacties" @@ -111,14 +115,23 @@ "BTN_CURRENCY": "Verken valuta", "BTN_ABOUT": "over", "BTN_HELP": "Help", + "BTN_NETWORK": "Netwerkstatus", + "FREE_SOFTWARE": "Vrije software", + "FORK_ME": "Kloon mij!", + "SHOW_LICENSE": "Bekijk de applicatielicentie", "REPORT_ISSUE": "Meld een probleem", "NOT_YOUR_ACCOUNT_QUESTION" : "Is rekening <b><i class=\"ion-key\"></i> {{pubkey|formatPubkey}}</b> niet van jou?", "BTN_CHANGE_ACCOUNT": "Dze rekening ontkoppelen", - "CONNECTION_ERROR": "Node <b>{{server}}</b> onbereikbaar of ongeldig adres.<br/><br/>Controleer de internetverbinding, of schakel knooppunt <a class=\"positive\" ng-click=\"doQuickFix('settings')\">in de instellingen</a>.", - "NETWORK_CONNECTION_ERROR": "Netwerk is niet bereikbaar.<br/><br/>Controleer uw internetverbinding, of selecteer een node handmatig <a class=\"positive\" ng-click=\"doQuickFix('settings')\">in de instellingen</a>." + "PEER_CONNECTION_ERROR": "Node <b>{{server}}</b> is onbereikbaar of het adres is ongeldig.<br/><br/>Controleer uw internetverbinding, of verander de node <a class=\"positive\" ng-click=\"doQuickFix('settings')\">in de instellingen</a>.", + "NETWORK_CONNECTION_ERROR": "Netwerk is niet bereikbaar.<br/><br/>Controleer uw internetverbinding, of selecteer een node handmatig <a class=\"positive\" ng-click=\"doQuickFix('settings')\">in de instellingen</a>.", + "SHOW_ALL_FEED": "Alles weergeven", + "READ_MORE": "Lees meer", + "FEED_SOURCE": "Bron" }, "SETTINGS": { "TITLE": "Instellingen", + "DISPLAY_DIVIDER": "Weergave", + "STORAGE_DIVIDER": "Opslag", "NETWORK_SETTINGS": "Netwerk", "PEER": "Duniter knooppunt", "PEER_CHANGED_TEMPORARY": "Adres tijdelijk worden gebruikt", @@ -126,19 +139,48 @@ "NETWORK_ANALYZE_TIMEOUT": "Maximale wachttijd (time-out)", "NETWORK_ANALYZE_TIMEOUT_HELP": "Maximale wachttijd voor netwerkanalyse", "NETWORK_ANALYZE_TIMEOUT_AUTO": "Auto", + "PERSIST_CACHE": "Bewaar navigatiegegevens (experimenteel)", + "PERSIST_CACHE_HELP": "Maakt snellere navigatie mogelijk door lokaal ontvangen gegevens te bewaren om ze van sessie tot sessie te gebruiken.", "USE_LOCAL_STORAGE": "Lokale opslag inschakelen", "USE_LOCAL_STORAGE_HELP": "Laat je instellingen opslaan", + "WALLETS_SETTINGS": "Mijn portefeuilles", + "USE_WALLETS_ENCRYPTION": "Lijst beveiligen?", + "USE_WALLETS_ENCRYPTION_HELP": "Hiermee kun je de lijst van je portefeuilles beveiligen (door encryptie) en wordt er authenticatie vereist om er toegang toe te krijgen.", "ENABLE_HELPTIP": "Contextgebonden hulp inschakelen", + "DISABLE_HELPTIP": "Contextuele hulpballonnen uitschakelen", "ENABLE_UI_EFFECTS": "Schakel visuele effecten", + "ENABLE_UI_EFFECTS_HELP": "Overgang tussen pagina's, animaties van lijsten, etc.", "HISTORY_SETTINGS": "Mijn rekening", "DISPLAY_UD_HISTORY": "Toon geproduceerde dividenden?", + "TX_HISTORY_AUTO_REFRESH": "Automatisch vernieuwen", + "TX_HISTORY_AUTO_REFRESH_HELP": "Vernieuwt het saldo en de transacties automatisch bij elk nieuw blok in het netwerk.", "AUTHENTICATION_SETTINGS": "Authentificatie", + "KEEP_AUTH": "Automatische afmelding", + "KEEP_AUTH_SHORT": "Afmelding", + "KEEP_AUTH_HELP": "Bepaalt wanneer de authenticatie uit het geheugen wordt gewist.", + "KEEP_AUTH_OPTION": { + "NEVER": "Na elke transactie", + "SECONDS": "Na {{value}}s van inactiviteit", + "MINUTE": "Na {{value}} min van inactiviteit", + "MINUTES": "Na {{value}} min van inactiviteit", + "HOUR": "Na {{value}} uur van inactiviteit", + "ALWAYS": "Aan het einde van de sessie" + }, + "KEYRING_FILE": "Sleutelhangerbestand", + "KEYRING_FILE_HELP": "Hiermee kunt u zich bij elk opstarten <b>automatisch aanmelden</b> en zelfs <b>authenticeren</b> (alleen als 'Authenticatieverval' is ingesteld op 'aan het einde van de sessie').", "REMEMBER_ME": "Onthoud mij", "REMEMBER_ME_HELP": "Hiermee kunt u blijven altijd aangesloten (niet aanbevolen).", "PLUGINS_SETTINGS": "Uitbreidingen", "BTN_RESET": "Herstel standaardinstellingen", "EXPERT_MODE": "Geavanceerde modus inschakelen", "EXPERT_MODE_HELP": "Toon meer details", + "BLOCK_VALIDITY_WINDOW": "Onzekerheidsperiode van blokken", + "BLOCK_VALIDITY_WINDOW_SHORT": "Onzekerheidsperiode", + "BLOCK_VALIDITY_WINDOW_HELP": "Tijd voordat informatie als gevalideerd wordt beschouwd", + "BLOCK_VALIDITY_OPTION": { + "NONE": "Geen vertraging", + "N": "{{time | formatDuration}} ({{count}} blokken)" + }, "POPUP_PEER": { "TITLE" : "Duniter Knooppunt", "HOST" : "Adres", @@ -237,6 +279,8 @@ "ENDPOINTS": { "BMAS": "Endpoint (SSL)", "BMATOR": "Endpoint TOR", + "WS2P": "Endpoint WS2P", + "GVA": "Endpoint GVA", "ES_USER_API": "Knoop Cesium+" } }, @@ -328,14 +372,62 @@ }, "LOGIN": { "TITLE": "<i class=\"icon ion-locked\"></i> Inloggen", - "SALT": "Beveiligingszin", - "SALT_HELP": "Zin ter beveiliging van je rekening", - "SHOW_SALT": "Toon de beveiligingszin", + "SCRYPT_FORM_HELP": "Voer uw inloggegevens in.<br>Controleer of de openbare sleutel die van uw account is.", + "PUBKEY_FORM_HELP": "Voer een openbare accountsleutel in:", + "FILE_FORM_HELP": "Kies het sleutelbestand dat u wilt gebruiken:", + "SCAN_FORM_HELP": "Scan de QR-code van een portemonnee.", + "SALT": "Geheime identificatie", + "SALT_HELP": "Geheime identificatie", + "SHOW_SALT": "Geheime identificatie weergeven?", "PASSWORD": "Wachtwoord", - "PASSWORD_HELP": "Wachtwoord ter beveiliging van je rekening", - "NO_ACCOUNT_QUESTION": "Nog geen rekening?", - "CREATE_ACCOUNT": "Open een rekening", - "FORGOTTEN_ID": "Wachtwoord vergeten?" + "PASSWORD_HELP": "Wachtwoord", + "PUBKEY_HELP": "Openbare sleutel of bijnaam", + "NO_ACCOUNT_QUESTION": "Heeft u nog geen rekening?", + "HAVE_ACCOUNT_QUESTION": "Heeft u al een rekening?", + "CREATE_ACCOUNT": "Maak een rekening aan...", + "CREATE_FREE_ACCOUNT": "Maak gratis een account aan", + "FORGOTTEN_ID": "Wachtwoord vergeten?", + "ASSOCIATED_PUBKEY": "Openbare sleutel van de sleutelring:", + "BTN_METHODS": "Andere methoden", + "BTN_METHODS_DOTS": "Verander van methode...", + "METHOD_POPOVER_TITLE": "Methoden", + "MEMORIZE_AUTH_FILE": "Onthoud deze sleutelring voor de duur van de browsersessie", + "SCRYPT_PARAMETERS": "Parameters (Scrypt):", + "AUTO_LOGOUT": { + "TITLE": "Informatie", + "MESSAGE": "<i class=\"ion-android-time\"></i> U bent <b>automatisch uitgelogd</b> na een periode van inactiviteit.", + "BTN_RELOGIN": "Opnieuw inloggen", + "IDLE_WARNING": "U wordt uitgelogd... {{countdown}}" + }, + "METHOD": { + "SCRYPT_DEFAULT": "Geheime identificatie en wachtwoord", + "SCRYPT_ADVANCED": "Geavanceerde zoutvorming", + "FILE": "Sleutelbestand", + "PUBKEY": "Openbare sleutel of bijnaam", + "SCAN": "Scan een QR-code" + }, + "SCRYPT": { + "SIMPLE": "Lichte zoutvorming", + "DEFAULT": "Standaard zoutvorming", + "SECURE": "Veilige zoutvorming", + "HARDEST": "Veiligste zoutvorming", + "EXTREME": "Extreme zoutvorming", + "USER": "Aangepaste zoutvorming", + "N": "N (Loop):", + "r": "r (RAM):", + "p": "p (CPU):" + }, + "FILE": { + "HELP": "Verwacht bestandsformaat: <b>.yml</b> of <b>.dunikey</b> (type PubSec, WIF of EWIF)." + }, + "AUTH": { + "TITLE": "<i class=\"icon ion-locked\"></i> Authenticatie", + "BTN_AUTH": "Authenticeren", + "GENERAL_HELP": "Gelieve u te authenticeren:", + "EXPECTED_UID_HELP": "Gelieve in te loggen op het account <i class=\"ion-person\"></i> {{uid}}:", + "EXPECTED_PUBKEY_HELP": "Gelieve in te loggen op de portemonnee <br class=\"visible-xs\"/><i class=\"ion-key\"></i> {{pubkey|formatPubkey}}:", + "SCAN_FORM_HELP": "Scan de QR-code van de <b>privésleutel</b> van de portemonnee." + } }, "ACCOUNT": { "TITLE": "Mijn rekening", @@ -347,14 +439,20 @@ "SHOW_ALL_TX": "Show all", "TX_FROM_DATE": "(huidige limiet op {{fromTime|medianFromNowShort}})", "PENDING_TX": "Transacties in afwachting", + "VALIDATING_TX": "Verwerkte, niet-gevalideerde transacties", "ERROR_TX": "Niet uitgevoerde transacties", "ERROR_TX_SENT": "Verzonden transacties", - "ERROR_TX_RECEIVED": "Ontvangen transacties", + "PENDING_TX_RECEIVED": "In afwachting van transacties", "EVENTS": "Gebeurtenissen", + "OUT_DISTANCED": "Uw huidige certificeringen komen van een te geïsoleerde groep in het <a ng-click=\"showHelpModal('wot')\">Web van Vertrouwen</a> (WoT): de <a ng-click=\"showHelpModal('distance_rule')\">maximale afstandsregel</a> wordt niet nageleefd. <br/> U moet certificeringen krijgen van andere sectoren van de WoT, of wachten tot deze dichter bij elkaar komt.", "WAITING_MEMBERSHIP": "Lidmaatschapsverzoek verzonden. In afwachting van validatie.", "WAITING_CERTIFICATIONS": "Je hebt {{needCertificationCount}} certificatie(s) nodig om lid te worden", + "WAITING_CERTIFICATIONS_HELP": "Om uw certificeringen te verkrijgen, vraag alleen leden <b>die u voldoende kennen</b>, zoals vereist door <a ng-click=\"showLicenseModal()\">de munteenheid licentie</a> die u hebt geaccepteerd.<br/> Als u nog niet genoeg leden kent, ga dan naar bijeenkomsten of stel ze voor op <a ng-click=\"openLink($event, $root.settings.userForumUrl)\">het gebruikersforum</a>.", "WILL_MISSING_CERTIFICATIONS": "Je heeft binnenkort <b>onvoldoende certificaties</b> (ten minste {{willNeedCertificationCount}} benodigd)", "WILL_NEED_RENEW_MEMBERSHIP": "Je lidmaatschap <b>gaat verlopen op {{membershipExpiresIn|formatDurationTo}}</b>. Vergeet niet <a ng-click=\"doQuickFix('renew')\">je lidmaatschap te vernieuwen</a> voor die tijd.", + "NEED_RENEW_MEMBERSHIP": "U bent niet langer lid van de munteenheid, omdat <b>uw lidmaatschap is verlopen</b>. Vergeet niet om <a ng-click=\"doQuickFix('renew')\">uw lidmaatschap te vernieuwen</a>.", + "NEED_RENEW_MEMBERSHIP_AFTER_CANCELLED": "U bent niet langer lid van de munteenheid, <b>vanwege een gebrek aan certificeringen</b>. Vergeet niet om <a ng-click=\"doQuickFix('renew')\">uw lidmaatschap te vernieuwen</a>.", + "NO_WAITING_MEMBERSHIP": "Geen aanvraag voor lidmaatschap in behandeling. Als u <b>lid wilt worden</b>, vergeet dan niet om <a ng-click=\"doQuickFix('membership')\">de aanvraag voor lidmaatschap</a> te verzenden.", "CERTIFICATION_COUNT": "Aantal certificaties", "CERTIFICATION_COUNT_SHORT": "Certificaties", "SIG_STOCK": "Voorraad uit te geven certificaties", @@ -520,7 +618,9 @@ "NOT_NEED_RENEW_MEMBERSHIP": "Je lidmaatschap hoeft niet verlengd te worden (het zal pas verlopen na {{membershipExpiresIn|formatDuration}}).<br/></br/><b>Weet je zeker</b> dat je een verlengingsaanvraag wil versturen?", "SAVE_BEFORE_LEAVE": "Wil je <b>je wijzigingen opslaan</b> voor je de pagina verlaat?", "SAVE_BEFORE_LEAVE_TITLE": "Wijzigingen niet opgeslagen", - "LICENCE": "Ik heb gelezen en geaccepteerd de voorwaarden van de vergunning G1", + "LOGOUT": "Weet u zeker dat u wilt uitloggen?", + "USE_FALLBACK_NODE": "Node <b>{{old}}</b> is onbereikbaar of het adres is ongeldig.<br/><br/>Wilt u tijdelijk de node <b>{{new}}</b> gebruiken?", + "USE_SYNC_FALLBACK_NODE": "Node <b>{{old}}</b> lijkt niet gesynchroniseerd te zijn.<br/><br/>Wilt u tijdelijk de gesynchroniseerde node <b>{{new}}</b> gebruiken?", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Waarschuwing:</b> Wil je het knooppunt <b>handmatig wijzigen</b>?<br/><br/>Als je doorgaat:<ul><li> - De <b>expertmodus</b> wordt geactiveerd;</li><li> - Je kunt terugkeren naar automatische knooppuntselectie door eenvoudigweg de <b>expertmodus uit te schakelen</b>.</li></ul>" }, "DOWNLOAD": { diff --git a/www/i18n/locale-pt-PT.json b/www/i18n/locale-pt-PT.json index 66f2f4d00754fcf419b35d2f9915c88af842272d..abea393eda66affc2e4df72776957d36b3070315 100644 --- a/www/i18n/locale-pt-PT.json +++ b/www/i18n/locale-pt-PT.json @@ -923,6 +923,7 @@ "SAVE_BEFORE_LEAVE_TITLE": "Alterações não guardadas", "LOGOUT": "Deseja desconectar-se?", "USE_FALLBACK_NODE": "Nó <b>{{old}}</b> indisponÃvel ou endereço inválido.<br/><br/>Deseja utilizar temporalmente o nó <b>{{new}}</b>?", + "USE_SYNC_FALLBACK_NODE": "Nó <b>{{old}}</b> parece estar dessincronizado.<br/><br/>Quer usar temporariamente o nó sincronizado <b>{{new}}</b>?", "ENABLE_EXPERT_MODE_TO_CHANGE_NODE": "<b class=\"assertive\">Aviso:</b> Queres <b>alterar manualmente</b> o nó Duniter?<br/><br/>Se continuares:<ul><li> - Será ativado o <b>modo perito</b>;</li><li> - Poderás voltar à seleção automática do nó, simplesmente <b>desativando o modo perito</b>.</li></ul>" }, "DOWNLOAD": { diff --git a/www/js/controllers/blockchain-controllers.js b/www/js/controllers/blockchain-controllers.js index e9dc0a5457d274c47a9b427fc25bdd460d2392d9..0b548696154317dd74df5b46971c2bd2d27417fb 100644 --- a/www/js/controllers/blockchain-controllers.js +++ b/www/js/controllers/blockchain-controllers.js @@ -30,7 +30,7 @@ angular.module('cesium.blockchain.controllers', ['cesium.services']) }) .state('app.server_blockchain', { - url: "/network/peer/:server/blockchain?ssl&tor", + url: "/network/peer/:server/blockchain?ssl&tor&path", views: { 'menuContent': { templateUrl: "templates/blockchain/lookup.html", @@ -43,7 +43,7 @@ angular.module('cesium.blockchain.controllers', ['cesium.services']) }) .state('app.server_blockchain_lg', { - url: "/network/peer/:server/blockchain/lg?ssl&tor", + url: "/network/peer/:server/blockchain/lg?ssl&tor&path", views: { 'menuContent': { templateUrl: "templates/blockchain/lookup_lg.html", @@ -73,7 +73,7 @@ angular.module('cesium.blockchain.controllers', ['cesium.services']) }) .state('app.view_server_block_hash', { - url: "/network/peer/:server/block/:number/:hash?ssl&tor", + url: "/network/peer/:server/block/:number/:hash?ssl&tor&path", views: { 'menuContent': { templateUrl: "templates/blockchain/view_block.html", @@ -127,18 +127,23 @@ function BlockLookupController($scope, $timeout, $focus, $filter, $state, $ancho if (state && state.stateParams && state.stateParams.server) { var useSsl = state.stateParams.ssl == "true"; var useTor = state.stateParams.tor == "true"; + var path = state.stateParams.path || ''; var node = { server: state.stateParams.server, host: state.stateParams.server, + path: path, useSsl: useSsl, useTor: useTor }; - var serverParts = state.stateParams.server.split(':'); + var serverParts = state.stateParams.server.split(':', 2); if (serverParts.length === 2) { node.host = serverParts[0]; node.port = serverParts[1]; } + else { + node.port = node.port || (node.useSsl ? 443 : 80); + } if (BMA.node.same(node)) { $scope.node = BMA; @@ -146,8 +151,8 @@ function BlockLookupController($scope, $timeout, $focus, $filter, $state, $ancho else { $scope.node = useTor ? // For TOR, use a web2tor to access the endpoint - BMA.instance(node.host + ".to", 443, true/*ssl*/, 600000 /*long timeout*/) : - BMA.instance(node.host, node.port, node.useSsl); + BMA.instance(node.host + ".to", 443, node.path, true/*ssl*/, 600000 /*long timeout*/) : + BMA.instance(node.host, node.port, node.path, node.useSsl); return $scope.node.blockchain.parameters() .then(function(json) { $scope.currency = json.currency; @@ -521,18 +526,23 @@ function BlockViewController($scope, $ionicPopover, $state, UIUtils, BMA, csCurr if (state.stateParams && state.stateParams.server) { var useSsl = state.stateParams.ssl == "true"; var useTor = state.stateParams.tor == "true"; + var path = state.stateParams.path || ''; var node = { server: state.stateParams.server, host: state.stateParams.server, + path: path, useSsl: useSsl, useTor: useTor }; - var serverParts = state.stateParams.server.split(':'); + var serverParts = state.stateParams.server.split(':', 2); if (serverParts.length == 2) { node.host = serverParts[0]; node.port = serverParts[1]; } + else { + node.port = node.port || (node.useSsl ? 443 : 80); + } if (BMA.node.same(node)) { $scope.node = BMA; @@ -540,8 +550,8 @@ function BlockViewController($scope, $ionicPopover, $state, UIUtils, BMA, csCurr else { $scope.node = useTor ? // For TOR, use a web2tor to access the endpoint - BMA.instance(node.host + ".to", 443, true/*ssl*/, 600000 /*long timeout*/) : - BMA.instance(node.host, node.port, node.useSsl); + BMA.instance(node.host + ".to", 443, node.path, true/*ssl*/, 600000 /*long timeout*/) : + BMA.instance(node.host, node.port, node.path, node.useSsl); return $scope.node.blockchain.parameters() .then(function (json) { $scope.currency = json.currency; diff --git a/www/js/controllers/network-controllers.js b/www/js/controllers/network-controllers.js index 02c74a56a7701f611b7187dd4bd09fa2ad4c7987..d44cb333285e3eb26651fa6fb8db91659752593a 100644 --- a/www/js/controllers/network-controllers.js +++ b/www/js/controllers/network-controllers.js @@ -21,7 +21,7 @@ angular.module('cesium.network.controllers', ['cesium.services']) }) .state('app.view_peer', { - url: "/network/peer/:server?ssl&tor", + url: "/network/peer/:server?ssl&tor&path", cache: false, views: { 'menuContent': { @@ -95,7 +95,7 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win if (currency) { var isDefaultNode = BMA.node.same(currency.node); $scope.node = isDefaultNode ? BMA : - BMA.instance(currency.node.host, currency.node.port); + BMA.instance(currency.node.host, currency.node.port, currency.node.path || ''); if (state && state.stateParams) { if (state.stateParams.type && ['mirror', 'member', 'offline'].indexOf(state.stateParams.type) != -1) { $scope.search.type = state.stateParams.type; @@ -295,6 +295,9 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win if (peer.isTor()) { stateParams.tor = true; } + if (peer.getPath()) { + stateParams.path = peer.getPath(); + } $state.go('app.view_peer', stateParams); }; @@ -576,10 +579,11 @@ function PeerViewController($scope, $q, $window, $state, UIUtils, csWot, BMA) { $scope.$on('$ionicView.enter', function(e, state) { var isDefaultNode = !state.stateParams || !state.stateParams.server; var server = state.stateParams && state.stateParams.server || BMA.server; + var path = state.stateParams && state.stateParams.path || (isDefaultNode ? BMA.path : ''); var useSsl = state.stateParams && state.stateParams.ssl == "true" || (isDefaultNode ? BMA.useSsl : false); var useTor = state.stateParams.tor == "true" || (isDefaultNode ? BMA.useTor : false); - return $scope.load(server, useSsl, useTor) + return $scope.load(server, path, useSsl, useTor) .then(function() { return $scope.$broadcast('$csExtension.enter', e, state); }) @@ -591,24 +595,31 @@ function PeerViewController($scope, $q, $window, $state, UIUtils, csWot, BMA) { }); }); - $scope.load = function(server, useSsl, useTor) { + $scope.load = function(server, path, useSsl, useTor) { + var port, host; + var serverParts = server.split(':', 2); + if (serverParts.length === 2) { + host = serverParts[0]; + port = serverParts[1]; + } + else { + host = server; + port = useSsl ? 443 : 80; + } var node = { server: server, - host: server, + host: host, + port: port, + path: path, useSsl: useSsl, useTor: useTor }; - var serverParts = server.split(':'); - if (serverParts.length === 2) { - node.host = serverParts[0]; - node.port = serverParts[1]; - } angular.merge($scope.node, useTor ? // For TOR, use a web2tor to access the endpoint - BMA.lightInstance(node.host + ".to", 443, true/*ssl*/, 60000 /*long timeout*/) : - BMA.lightInstance(node.host, node.port, node.useSsl), + BMA.lightInstance(node.host + ".to", 443, node.path, true/*ssl*/, 60000 /*long timeout*/) : + BMA.lightInstance(node.host, node.port, node.path, node.useSsl), node); $scope.isReachable = !$scope.isHttps || useSsl; @@ -619,16 +630,19 @@ function PeerViewController($scope, $q, $window, $state, UIUtils, csWot, BMA) { // find the current peer var peers = (res && res.peers || []).reduce(function(res, json) { var peer = new Peer(json); - return (peer.getEndpoints('BASIC_MERKLED_API') || []).reduce(function(res, ep) { - var bma = BMA.node.parseEndPoint(ep); - if((bma.dns === node.host || bma.ipv4 === node.host || bma.ipv6 === node.host) && ( - bma.port == node.port)) { - peer.bma = bma; - return res.concat(peer); - } - return res; - }, res); - }, []); + return (peer.getEndpoints('BASIC_MERKLED_API') || []) + .concat((peer.getEndpoints('BMAS') || [])) + .reduce(function(res, ep) { + var bma = BMA.node.parseEndPoint(ep); + if ((bma.dns === node.host || bma.ipv4 === node.host || bma.ipv6 === node.host) && + (bma.port == node.port) && + (bma.path == node.path)) { + peer.bma = bma; + return res.concat(peer); + } + return res; + }, res); + }, []); var peer = peers.length && peers[0]; // Current node found @@ -708,6 +722,9 @@ function PeerViewController($scope, $q, $window, $state, UIUtils, csWot, BMA) { if (peer.isTor()) { stateParams.tor = true; } + if (peer.getPath()) { + stateParams.path = peer.getPath(); + } $state.go('app.view_peer', stateParams); }; diff --git a/www/js/controllers/settings-controllers.js b/www/js/controllers/settings-controllers.js index 37173985f11a1078315aeb3d3d77e5644e178b0f..c3c93cc35bd4d33cca1ea7bd1ded3682c551b3ea 100644 --- a/www/js/controllers/settings-controllers.js +++ b/www/js/controllers/settings-controllers.js @@ -217,19 +217,33 @@ function SettingsController($scope, $q, $window, $ionicHistory, $ionicPopup, $ti }); } - var port = !!$scope.formData.node.port && $scope.formData.node.port != 80 && $scope.formData.node.port != 443 ? $scope.formData.node.port : undefined; - node = node || { - host: $scope.formData.node.host, + // If not given, get node from settings data + if (!node || !node.host) { + var host = $scope.formData.node.host; + if (!host) return; // Should never occur + + var useSsl = angular.isDefined($scope.formData.node.useSsl) ? + $scope.formData.node.useSsl : + ($scope.formData.node.port == 443); + var port = !!$scope.formData.node.port && $scope.formData.node.port != 80 && $scope.formData.node.port != 443 ? $scope.formData.node.port : undefined; + var path = $scope.formData.node.path || (host.indexOf('/') !== -1 ? host.substring(host.indexOf('/')) : ''); + if (path.endsWith('/')) path = path.substring(0, path.length - 1); // Remove trailing slash + host = host.indexOf('/') !== -1 ? host.substring(0, host.indexOf('/')) : host; // Remove path from host + node = { + host: host, port: port, - useSsl: angular.isDefined($scope.formData.node.useSsl) ? - $scope.formData.node.useSsl : - ($scope.formData.node.port == 443) + path: path, + useSsl: useSsl }; + } + $scope.showNodePopup(node) .then(function(newNode) { if (newNode.host === $scope.formData.node.host && - newNode.port === $scope.formData.node.port && - newNode.useSsl === $scope.formData.node.useSsl && !$scope.formData.node.temporary) { + newNode.port == $scope.formData.node.port && + newNode.path === $scope.formData.node.path && + newNode.useSsl === $scope.formData.node.useSsl && + !$scope.formData.node.temporary) { return; // same node = nothing to do } @@ -277,11 +291,15 @@ function SettingsController($scope, $q, $window, $ionicHistory, $ionicPopup, $ti .then(function (peer) { if (peer) { var bma = peer.getBMA(); + var host = (bma.dns ? bma.dns : + (peer.hasValid4(bma) ? bma.ipv4 : bma.ipv6)); + var useSsl = bma.useSsl || bma.port == 443 + var port = bma.port || (useSsl ? 443 : 80); return { - host: (bma.dns ? bma.dns : - (peer.hasValid4(bma) ? bma.ipv4 : bma.ipv6)), - port: bma.port || 80, - useSsl: bma.useSsl || bma.port == 443 + host: host, + port: port, + path: bma.path || '', + useSsl: useSsl }; } }) @@ -293,8 +311,11 @@ function SettingsController($scope, $q, $window, $ionicHistory, $ionicPopup, $ti // Show node popup $scope.showNodePopup = function(node) { return $q(function(resolve, reject) { - $scope.popupData.newNode = node.port ? [node.host, node.port].join(':') : node.host; - $scope.popupData.useSsl = node.useSsl; + var useSsl = node.useSsl || node.port == 443; + var host = (node.port && node.port != 80 && node.port != 443) ? [node.host, node.port].join(':') : node.host; + if (node.path && node.path.length && node.path !== '/') host += node.path; + $scope.popupData.newNode = host; + $scope.popupData.useSsl = useSsl; if (!!$scope.popupForm) { $scope.popupForm.$setPristine(); } @@ -317,7 +338,7 @@ function SettingsController($scope, $q, $window, $ionicHistory, $ionicPopup, $ti e.preventDefault(); } else { return { - server: $scope.popupData.newNode, + host: $scope.popupData.newNode, useSsl: $scope.popupData.useSsl }; } @@ -326,16 +347,23 @@ function SettingsController($scope, $q, $window, $ionicHistory, $ionicPopup, $ti ] }) .then(function(res) { - if (!res) { // user cancel + if (!res || !res.host) { // user cancel UIUtils.loading.hide(); + reject('CANCELLED'); return; } - var parts = res.server.split(':'); - parts[1] = parts[1] ? parts[1] : 80; + var host = res.host; + var path = host.indexOf('/') !== -1 ? host.substring(host.indexOf('/')) : ''; + host = host.indexOf('/') !== -1 ? host.substring(0, host.indexOf('/')) : host; + var parts = host.split(':', 2); + host = parts[0]; + var port = parts[1] ? parts[1] : (res.useSsl ? 443 : 80); + var useSsl = res.useSsl || port == 443; resolve({ - host: parts[0], - port: parts[1], - useSsl: res.useSsl + host: host, + port: port, + path: path, + useSsl: useSsl }); }); }); diff --git a/www/js/entities/peer.js b/www/js/entities/peer.js index 18296f218a95ea41bed6be0d1a5ccd56490b4049..abd8ad4e96e84ce25e02cc018b5e35a3d0c974fb 100644 --- a/www/js/entities/peer.js +++ b/www/js/entities/peer.js @@ -16,9 +16,12 @@ Peer.prototype.regexp = { BMA: /^BASIC_MERKLED_API[ ]?/, BMAS: /^BMAS[ ]?/, WS2P: /^WS2P[ ]?/, - BMA_REGEXP: /^BASIC_MERKLED_API([ ]+([a-z_][a-z0-9-_.ÄŸÄž]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))$/, - BMAS_REGEXP: /^BMAS([ ]+([a-z_][a-z0-9-_.ÄŸÄž]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))$/, - WS2P_REGEXP: /^WS2P[ ]+([a-z0-9]+)([ ]+([a-z_][a-z0-9-_.ÄŸÄž]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))([ ]+([a-z0-9/.&#!]+))?$/, + GVA: /^GVA(:? S)?[ ]?/, + BMA_REGEXP: /^BASIC_MERKLED_API( ([a-z_][a-z0-9-_.ÄŸÄž]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( ([a-z0-9/.&#!]+))?$/, + BMAS_REGEXP: /^BMAS( ([a-z_][a-z0-9-_.ÄŸÄž]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( ([a-z0-9/.&#!]+))?$/, + GVA_REGEXP: /^GVA( ([a-z_][a-z0-9-_.ÄŸÄž]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( ([a-z0-9/.&#!]+))?$/, + GVAS_REGEXP: /^GVA S( ([a-z_][a-z0-9-_.ÄŸÄž]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( ([a-z0-9/.&#!]+))?$/, + WS2P_REGEXP: /^WS2P ([a-z0-9]+)( ([a-z_][a-z0-9-_.ÄŸÄž]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( ([a-z0-9/.&#!]+))?$/, LOCAL_IP_ADDRESS: /^127[.]0[.]0.|192[.]168[.]|10[.]0[.]0[.]|172[.]16[.]/ }; Peer.prototype.regex = Peer.prototype.regexp; // for backward compat @@ -28,6 +31,9 @@ Peer.prototype.keyID = function () { if (bma.useBma) { return [this.pubkey || "Unknown", bma.dns, bma.ipv4, bma.ipv6, bma.port, bma.useSsl, bma.path].join('-'); } + if (bma.useGva) { + return [this.pubkey || "Unknown", bma.dns, bma.ipv4, bma.ipv6, bma.port, bma.useSsl, bma.path].join('-'); + } return [this.pubkey || "Unknown", bma.ws2pid, bma.path].join('-'); }; @@ -59,27 +65,34 @@ Peer.prototype.json = function() { Peer.prototype.getBMA = function() { if (this.bma) return this.bma; var bma = null; + var path = null; var bmaRegex = this.regexp.BMA_REGEXP; var bmasRegex = this.regexp.BMAS_REGEXP; this.endpoints.forEach(function(ep){ var matches = !bma && bmaRegex.exec(ep); if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; // Fix path (add starting slash) bma = { "dns": matches[2] || '', "ipv4": matches[4] || '', "ipv6": matches[6] || '', "port": matches[8] || 80, "useSsl": matches[8] == 443, + "path": path || '', "useBma": true }; } matches = !bma && bmasRegex.exec(ep); if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; // Fix path (add starting slash) bma = { "dns": matches[2] || '', "ipv4": matches[4] || '', "ipv6": matches[6] || '', "port": matches[8] || 80, + "path": path || '', "useSsl": true, "useBma": true }; @@ -131,6 +144,11 @@ Peer.prototype.getHost = function(bma) { (bma.ipv6 ? '[' + bma.ipv6 + ']' :''))); }; +Peer.prototype.getPath = function() { + var bma = this.bma || this.getBMA(); + return bma.path ? bma.path : ''; +}; + Peer.prototype.getURL = function(bma) { bma = bma || this.bma || this.getBMA(); var host = this.getHost(bma); diff --git a/www/js/functions.js b/www/js/functions.js index b773f31f41c2f43c9a13417bbcef12d228e8146b..d5ef39bf5096df6baa89454c74fc46b8808cf52f 100644 --- a/www/js/functions.js +++ b/www/js/functions.js @@ -35,3 +35,21 @@ if (typeof String.prototype.format !== 'function') { }); }; } + +// Workaround to add "".endsWith() if not present +if (typeof String.prototype.startsWith !== 'function') { + console.debug("Adding String.prototype.endsWith() -> was missing on this platform"); + String.prototype.startsWith = function() { + var args = arguments; + return this.indexOf(args[0]) === 0; + }; +} + +// Workaround to add "".endsWith() if not present +if (typeof String.prototype.endsWith !== 'function') { + console.debug("Adding String.prototype.endsWith() -> was missing on this platform"); + String.prototype.endsWith = function() { + var args = arguments; + return this.lastIndexOf(args[0]) === this.length - 1; + }; +} diff --git a/www/js/platform.js b/www/js/platform.js index 419308e2c5ff6313ed561c7621050539f293f4a4..180f2d7009b03ae8e2d2e4a50cb697cea0ce4fad 100644 --- a/www/js/platform.js +++ b/www/js/platform.js @@ -175,6 +175,7 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] var node = { host: fallbackNode.host, port: fallbackNode.port, + path: fallbackNode.path, useSsl: fallbackNode.useSsl, }; csSettings.data.node = node; @@ -221,6 +222,7 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] return BMA.node.same({ host: peer.getHost(), port: peer.getPort(), + path: peer.getPath(), useSsl: peer.isSsl() }); }); @@ -231,7 +233,10 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] return true; } + // Peer is not well synchronized! var consensusBlockNumber = peers.length ? peers[0].currentNumber : undefined; + console.warn("[platform] Default peer [{0}] not synchronized with consensus block #{1}".format(BMA.server, consensusBlockNumber)); + return csCurrency.blockchain.current() .then(function(block) { @@ -245,12 +250,14 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] var synchronizedNode = new Peer({ host: randomPeer.getHost(), port: randomPeer.getPort(), - useSsl: randomPeer.isSsl() + useSsl: randomPeer.isSsl(), + path: randomPeer.getPath(), + endpoints: randomPeer.endpoints }); // If Expert mode: ask user to select a node if (askUserConfirmation) { - return askUseFallbackNode(synchronizedNode); + return askUseFallbackNode(synchronizedNode, 'CONFIRM.USE_SYNC_FALLBACK_NODE'); } return synchronizedNode; @@ -264,19 +271,19 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] console.info("[platform] Switching to synchronized fallback peer {{0}:{1}}".format(node.host, node.port)); // Only change BMA node in settings - csSettings.data.node = node; - - // Add a marker, for UI - csSettings.data.node.temporary = true; + angular.merge(csSettings.data.node, node, {endpoints: undefined, temporary: true}); return BMA.copy(node); }); }); } - function askUseFallbackNode(fallbackNode) { + function askUseFallbackNode(fallbackNode, messageKey) { // Ask user to confirm, before switching to fallback node var server = fallbackNode.server || (typeof fallbackNode.getServer === 'function' ? fallbackNode.getServer() : new Peer(fallbackNode).getServer()); + + server += fallbackNode.path || ''; + var confirmMsgParams = {old: BMA.server, new: server}; // Force to show port/ssl, if this is the only difference @@ -288,7 +295,9 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services'] } } - return $translate('CONFIRM.USE_FALLBACK_NODE', confirmMsgParams) + messageKey = messageKey || 'CONFIRM.USE_FALLBACK_NODE'; + + return $translate(messageKey, confirmMsgParams) .then(UIUtils.alert.confirm) .then(function (confirm) { if (!confirm) return; // Stop diff --git a/www/js/services/bma-services.js b/www/js/services/bma-services.js index 1f546fb378dd07fe39640aef9e13b2abfd3ce794..8c3ff241cd485074d84d4d18d94189c84484f8aa 100644 --- a/www/js/services/bma-services.js +++ b/www/js/services/bma-services.js @@ -5,10 +5,10 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. .factory('BMA', function($q, $window, $rootScope, $timeout, csCrypto, Api, Device, UIUtils, csConfig, csSettings, csCache, csHttp) { 'ngInject'; - function BMA(host, port, useSsl, useCache, timeout) { + function BMA(host, port, path, useSsl, useCache, timeout) { var - id = (!host ? 'default' : '{0}:{1}'.format(host, (port || (useSsl ? '443' : '80')))), // Unique id of this instance + id = (!host ? 'default' : '{0}:{1}'.format(host, (port || (useSsl ? '443' : '80')))), // Unique id of this instance cachePrefix = "BMA-", pubkey = "[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}", // TX output conditions @@ -101,10 +101,10 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. console.debug('[BMA] Enable SSL (forced by config or detected in URL)'); } - if (host) init(host, port, useSsl); + if (host) init(host, port, path, useSsl); that.useCache = angular.isDefined(useCache) ? useCache : true; // need here because used in get() function - function init(host, port, useSsl) { + function init(host, port, path, useSsl) { if (that.started) that.stop(); that.alive = false; @@ -113,17 +113,22 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. if (node) { host = host || node.host; port = port || node.port; + path = path || node.path; useSsl = angular.isDefined(useSsl) ? useSsl : (port == 443 || node.useSsl || that.forceUseSsl); } if (!host) return; // could not init yet + path = path && path.length ? path : (host.indexOf('/') !== -1 ? host.substring(host.indexOf('/')) : ''); + if (path.endsWith('/')) path = path.substring(0, path.length -1); // Remove trailing slash + host = host.indexOf('/') !== -1 ? host.substring(0, host.indexOf('/')) : host; // Remove path from host that.host = host; that.port = port || 80; + that.path = path || ''; that.useSsl = angular.isDefined(useSsl) ? useSsl : (that.port == 443 || that.forceUseSsl); - that.server = csHttp.getServer(host, port); - that.url = csHttp.getUrl(host, port, ''/*path*/, useSsl); + that.server = csHttp.getServer(that.host, that.port); + that.url = csHttp.getUrl(that.host, that.port, that.path, that.useSsl); } function exact(regexpContent) { @@ -159,7 +164,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. cacheTime = that.useCache && cacheTime || 0 /* no cache*/ ; forcedTimeout = forcedTimeout || timeout; - var requestKey = path + (cacheTime ? ('#'+cacheTime) : ''); + var cacheKey = path + (cacheTime ? ('#'+cacheTime) : ''); var getRequestFn = function(params) { @@ -172,15 +177,15 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. }); } - var request = that.raw.getByPath[requestKey]; + var request = that.raw.getByPath[cacheKey]; if (!request) { if (cacheTime) { - request = csHttp.getWithCache(that.host, that.port, path, that.useSsl, cacheTime, null/*autoRefresh*/, forcedTimeout, cachePrefix); + request = csHttp.getWithCache(that.host, that.port, that.path + path, that.useSsl, cacheTime, null/*autoRefresh*/, forcedTimeout, cachePrefix); } else { - request = csHttp.get(that.host, that.port, path, that.useSsl, forcedTimeout); + request = csHttp.get(that.host, that.port, that.path + path, that.useSsl, forcedTimeout); } - that.raw.getByPath[requestKey] = request; + that.raw.getByPath[cacheKey] = request; } var execCount = 1; return request(params) @@ -221,7 +226,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. var request = that.raw.postByPath[path]; if (!request) { - request = csHttp.post(that.host, that.port, path, that.useSsl); + request = csHttp.post(that.host, that.port, that.path + path, that.useSsl); that.raw.postByPath[path] = request; } return request(obj, params); @@ -234,7 +239,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. return function() { var sock = that.raw.wsByPath[path]; if (!sock || sock.isClosed()) { - sock = csHttp.ws(that.host, that.port, path, that.useSsl); + sock = csHttp.ws(that.host, that.port, that.path + path, that.useSsl); // When close, remove from cache sock.onclose = function() { @@ -253,7 +258,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. // - Cannot use previous get() function, because // node can be !=that, or not be started yet // - Do NOT use cache here - return csHttp.get(node.host, node.port, '/node/summary', node.useSsl || that.forceUseSsl, timeout)() + return csHttp.get(node.host, node.port, (node.path || '') + '/node/summary', node.useSsl || that.forceUseSsl, timeout)() .then(function(json) { var software = json && json.duniter && json.duniter.software; var isCompatible = true; @@ -261,8 +266,8 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. // Check duniter min version if (software === 'duniter' && json.duniter.version) { isCompatible = csHttp.version.isCompatible(csSettings.data.minVersion, json.duniter.version); + // TODO check storage transaction ? } - // TODO: check version of other software (DURS, Juniter, etc.) else { console.debug('[BMA] Unknown node software [{0} v{1}]: could not check compatibility.'.format(software || '?', json.duniter.version || '?')); } @@ -278,13 +283,16 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. function isSameNode(node2) { node2 = node2 || {}; - node2.useSsl = angular.isDefined(node2.useSsl) ? node2.useSsl : (node2.port && node2.port == 443); + var useSsl = angular.isDefined(node2.useSsl) ? node2.useSsl : (node2.port && node2.port == 443); + var port = node2.port || (useSsl ? 443 : 80); // Same host return that.host === node2.host && + // Same path + ((!that.path && !node2.path) || (that.path == node2.path||'')) && // Same port - ((!that.port && !node2.port2) || (that.port == node2.port2||80)) && + ((!that.port && !node2.port) || (that.port == port)) && // Same useSsl - (that.useSsl === node2.useSsl); + (that.useSsl === useSsl); } function removeListeners() { @@ -334,14 +342,14 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. }); } - console.debug("[BMA] [{0}] Starting {ssl: {1})...".format(that.server, that.useSsl)); + console.debug("[BMA] Starting from [{0}{1}] {ssl: {2})...".format(that.server, that.path, that.useSsl)); var now = Date.now(); that._startPromise = that.isAlive() .then(function(alive) { that.alive = alive; if (!that.alive) { - console.error("[BMA] Could not start using peer {{0}}: unreachable".format(that.server)); + console.error("[BMA] Could not start using peer [{0}{1}]: unreachable".format(that.server, that.path)); that.started = true; delete that._startPromise; return false; // Not alive @@ -667,29 +675,35 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. }; exports.node.parseEndPoint = function(endpoint, epPrefix) { + var path = null; + // Try BMA var matches = exports.regexp.BMA_ENDPOINT.exec(endpoint); if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; // Fix path return { "dns": matches[2] || '', "ipv4": matches[4] || '', "ipv6": matches[6] || '', "port": matches[8] || 80, "useSsl": matches[8] && matches[8] == 443, - "path": matches[10], + "path": path || '', "useBma": true }; } // Try BMAS matches = exports.regexp.BMAS_ENDPOINT.exec(endpoint); if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; // Fix path return { "dns": matches[2] || '', "ipv4": matches[4] || '', "ipv6": matches[6] || '', "port": matches[8] || 80, "useSsl": true, - "path": matches[10], + "path": path || '', "useBma": true }; } @@ -701,12 +715,51 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. "port": matches[2] || 80, "useSsl": false, "useTor": true, - "useBma": true + "useBma": true, + "useWs2p": false, + "useGva": false + }; + } + + // Try GVA + matches = exports.regexp.GVA_ENDPOINT.exec(endpoint); + if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; // Add starting slash + return { + "dns": matches[2] || '', + "ipv4": matches[4] || '', + "ipv6": matches[6] || '', + "port": matches[8] || 80, + "useSsl": matches[8] && matches[8] == 443, + "path": path || '', + "useBma": false, + "useWs2p": false, + "useGva": true, + }; + } + // Try GVAS + matches = exports.regexp.GVAS_ENDPOINT.exec(endpoint); + if (matches) { + path = matches[10]; + if (!path.startsWith('/')) path = '/' + path; // Fix GVA path + return { + "dns": matches[2] || '', + "ipv4": matches[4] || '', + "ipv6": matches[6] || '', + "port": matches[8] || 443, + "useSsl": true, + "path": path || '', + "useBma": false, + "useWs2p": false, + "useGva": true, }; } // Try WS2P matches = exports.regexp.WS2P_ENDPOINT.exec(endpoint); if (matches) { + path = matches[11]; + if (path && !path.startsWith('/')) path = '/' + path; return { "ws2pid": matches[1] || '', "dns": matches[3] || '', @@ -714,47 +767,25 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. "ipv6": matches[7] || '', "port": matches[9] || 80, "useSsl": matches[9] && matches[9] == 443, - "path": matches[11] || '', - "useWs2p": true + "path": path || '', + "useWs2p": true, + "useBma": false }; } // Try WS2PTOR matches = exports.regexp.WS2PTOR_ENDPOINT.exec(endpoint); if (matches) { + path = matches[4]; + if (path && !path.startsWith('/')) path = '/' + path; return { "ws2pid": matches[1] || '', "dns": matches[2] || '', "port": matches[3] || 80, - "path": matches[4] || '', + "path": path || '', "useSsl": false, "useTor": true, - "useWs2p": true - }; - } - // Try GVA - matches = exports.regexp.GVA_ENDPOINT.exec(endpoint); - if (matches) { - return { - "dns": matches[2] || '', - "ipv4": matches[4] || '', - "ipv6": matches[6] || '', - "port": matches[8] || 80, - "useSsl": false, - "path": matches[10], - "useGva": true - }; - } - // Try GVAS - matches = exports.regexp.GVAS_ENDPOINT.exec(endpoint); - if (matches) { - return { - "dns": matches[2] || '', - "ipv4": matches[4] || '', - "ipv6": matches[6] || '', - "port": matches[8] || 443, - "useSsl": true, - "path": matches[10], - "useGva": true + "useWs2p": true, + "useBma": false }; } @@ -762,13 +793,15 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. if (epPrefix) { matches = exact(epPrefix + REGEX_ENDPOINT_PARAMS).exec(endpoint); if (matches) { + path = matches[10]; + if (path && !path.startsWith('/')) path = '/' + path; return { "dns": matches[2] || '', "ipv4": matches[4] || '', "ipv6": matches[6] || '', "port": matches[8] || 80, "useSsl": matches[8] && matches[8] == 443, - "path": matches[10], + "path": path || '', "useBma": false }; } @@ -778,12 +811,12 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. exports.copy = function(otherNode) { - var server = csHttp.getUrl(otherNode.host, otherNode.port, ''/*path*/, otherNode.useSsl); - var hasChanged = (server !== that.url); + var url = csHttp.getUrl(otherNode.host, otherNode.port, otherNode.path || '', otherNode.useSsl); + var hasChanged = (url !== that.url); if (hasChanged) { var wasStarted = that.started; if (wasStarted) that.stop(); - that.init(otherNode.host, otherNode.port, otherNode.useSsl, that.useCache/*keep original value*/); + that.init(otherNode.host, otherNode.port, otherNode.path || '', otherNode.useSsl); if (wasStarted) { return $timeout(function () { return that.start() @@ -1067,33 +1100,39 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. var service = new BMA(); - service.instance = function(host, port, useSsl, useCache, timeout) { + service.instance = function(host, port, path, useSsl, useCache, timeout) { useCache = angular.isDefined(useCache) ? useCache : false; // No cache by default - return new BMA(host, port, useSsl, useCache, timeout); + return new BMA(host, port, path, useSsl, useCache, timeout); }; - service.lightInstance = function(host, port, useSsl, timeout) { + service.lightInstance = function(host, port, path, useSsl, timeout) { port = port || 80; useSsl = angular.isDefined(useSsl) ? useSsl : (port == 443); timeout = timeout || csSettings.data.timeout; + path = path || (host.indexOf('/') !== -1 ? host.substring(host.indexOf('/')) : ''); + if (!path.startsWith('/')) path = '/' + path; // Add starting slash + if (path.endsWith('/')) path = path.substring(0, path.length - 1); // Remove trailing slash + host = host.indexOf('/') !== -1 ? host.substring(0, host.indexOf('/')) : host; return { host: host, port: port, + path: path, useSsl: useSsl, - url: csHttp.getUrl(host, port, ''/*no path*/, useSsl), + server: csHttp.getServer(host, port), + url: csHttp.getUrl(host, port, path, useSsl), node: { - summary: csHttp.getWithCache(host, port, '/node/summary', useSsl, csCache.constants.MEDIUM, false/*autoRefresh*/, timeout) + summary: csHttp.getWithCache(host, port, path + '/node/summary', useSsl, csCache.constants.MEDIUM, false/*autoRefresh*/, timeout) }, network: { peering: { - self: csHttp.get(host, port, '/network/peering', useSsl, timeout) + self: csHttp.get(host, port, path + '/network/peering', useSsl, timeout) }, - peers: csHttp.get(host, port, '/network/peers', useSsl, timeout) + peers: csHttp.get(host, port, path + '/network/peers', useSsl, timeout) }, blockchain: { - current: csHttp.get(host, port, '/blockchain/current', useSsl, timeout), + current: csHttp.get(host, port, path + '/blockchain/current', useSsl, timeout), stats: { - hardship: csHttp.get(host, port, '/blockchain/hardship/:pubkey', useSsl, timeout) + hardship: csHttp.get(host, port, path + '/blockchain/hardship/:pubkey', useSsl, timeout) } } }; diff --git a/www/js/services/http-services.js b/www/js/services/http-services.js index a9fa1afa2d7b95bb06c1c44323276de87c82ca55..60ea5fcf907bfc2b3e54541f301b04861c32542e 100644 --- a/www/js/services/http-services.js +++ b/www/js/services/http-services.js @@ -554,8 +554,9 @@ angular.module('cesium.http.services', ['cesium.cache.services']) } function isVersionCompatible(minVersion, actualVersion) { - console.debug('[http] Checking actual version [{0}] is compatible with min expected version [{1}]'.format(actualVersion, minVersion)); - return compareVersionNumbers(minVersion, actualVersion) <= 0; + var result = compareVersionNumbers(minVersion, actualVersion) <= 0; + console.debug('[http] Is actual version [{0}] compatible with min expected version [{1}] ? => {2}'.format(actualVersion, minVersion, result)); + return result; } function clearCache(cachePrefix) { diff --git a/www/js/services/network-services.js b/www/js/services/network-services.js index 8809c01ea173c862196c6bc04518a6ed8809b1f1..1e8133e0974709cbe8f8abb725378a17ac5528db 100644 --- a/www/js/services/network-services.js +++ b/www/js/services/network-services.js @@ -392,6 +392,14 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', return jobs.concat( refreshPeer(peer) .then(function (refreshedPeer) { + var api = refreshedPeer + && refreshedPeer.bma + && ( + (refreshedPeer.bma.useBma && 'BMA') + || (refreshedPeer.bma.useGva && 'GVA') + || (refreshedPeer.bma.useWs2p && 'WS2P') + ) || 'null' + if (existingPeer) { // remove existing peers, when reject or offline if (!refreshedPeer || (refreshedPeer.online !== data.filter.online && data.filter.online !== 'all')) { @@ -404,26 +412,26 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', } else if (refreshedPeer.buid !== existingMainBuid){ console.debug('[network] {0} endpoint [{1}] new current block'.format( - refreshedPeer.bma && (refreshedPeer.bma.useBma ? 'BMA' : 'WS2P') || 'null', + api, refreshedPeer.server)); hasUpdates = true; } else if (existingOnline !== refreshedPeer.online){ console.debug('[network] {0} endpoint [{1}] is now {2}'.format( - refreshedPeer.bma && (refreshedPeer.bma.useBma ? 'BMA' : 'WS2P') || 'null', + api, refreshedPeer.server, refreshedPeer.online ? 'UP' : 'DOWN')); hasUpdates = true; } else { console.debug("[network] {0} endpoint [{1}] unchanged".format( - refreshedPeer.bma && (refreshedPeer.bma.useBma ? 'BMA' : 'WS2P') || 'null', + api, refreshedPeer.server)); } } else if (refreshedPeer && (refreshedPeer.online === data.filter.online || data.filter.online === 'all')) { console.debug("[network] {0} endpoint [{1}] is {2}".format( - refreshedPeer.bma && (refreshedPeer.bma.useBma ? 'BMA' : 'WS2P') || 'null', + api, refreshedPeer.server, refreshedPeer.online ? 'UP' : 'DOWN' )); @@ -504,7 +512,7 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', } // Cesium running in SSL: Do not try to access not SSL node, - if (!peer.bma.useWs2p && isHttpsMode && !peer.bma.useSsl) { + if (peer.bma.useBma && isHttpsMode && !peer.bma.useSsl) { peer.online = (peer.status === 'UP'); peer.buid = constants.UNKNOWN_BUID; delete peer.version; @@ -516,8 +524,8 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', return $q.when(peer); } - // Do not try to access TOR or WS2P endpoints - if (peer.bma.useTor || peer.bma.useWs2p) { + // Do not try to access TOR, WS2P or GVA endpoints + if (peer.bma.useTor || peer.bma.useWs2p || peer.bma.useGva) { peer.online = (peer.status === 'UP'); peer.buid = constants.UNKNOWN_BUID; delete peer.version; @@ -529,7 +537,7 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', } var timeout = Math.max(500, remainingTime()); // >= 500ms - peer.api = peer.api || BMA.lightInstance(peer.getHost(), peer.getPort(), peer.isSsl(), timeout); + peer.api = peer.api || BMA.lightInstance(peer.getHost(), peer.getPort(), peer.getPath(), peer.isSsl(), timeout); // Get current block return peer.api.blockchain.current(false/*no cache*/) @@ -554,13 +562,15 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', } if (!peer.secondTry) { var bma = peer.bma || peer.getBMA(); + + // Retry using DNS (instead of IP v4 or v6) if (bma.dns && peer.server.indexOf(bma.dns) === -1) { var secondTryTimeout = remainingTime(); // try again, using DNS instead of IPv4 / IPV6 if (secondTryTimeout > 0) { peer.secondTry = true; - peer.api = BMA.lightInstance(bma.dns, bma.port, bma.useSsl, secondTryTimeout); + peer.api = BMA.lightInstance(bma.dns, bma.port, bma.path, bma.useSsl, secondTryTimeout); return refreshPeer(peer); // recursive call } } @@ -832,13 +842,13 @@ angular.module('cesium.network.services', ['ngApi', 'cesium.currency.services', }) .then(function() { var now = Date.now(); - console.info('[network] Starting from [{0}]'.format(bma.server)); + console.info('[network] Starting from [{0}{1}] {ssl: {2})'.format(bma.server, bma.path, bma.useSsl)); addListeners(); return loadPeers() .then(function(peers){ - if (peers) console.debug('[network] Started in {0}ms, {1} peers found'.format(Date.now() - now, peers.length)); + if (peers) console.debug('[network] Started in {0}ms, {1} peer(s) found'.format(Date.now() - now, peers.length)); return data; }); }); diff --git a/www/js/services/settings-services.js b/www/js/services/settings-services.js index e0854cde989e77536fcac5001377ceeb72e51823..2e9059ba16f1997d78a565d9e7dfd75cf5689fed 100644 --- a/www/js/services/settings-services.js +++ b/www/js/services/settings-services.js @@ -60,7 +60,7 @@ angular.module('cesium.settings.services', ['ngApi', 'cesium.config']) cacheTimeMs: 60000, /*1 min*/ timeWarningExpireMembership: 2592000 * 2 /*=2 mois*/, timeWarningExpire: 2592000 * 3 /*=3 mois*/, - minVersion: '1.1.0', + minVersion: '1.1.0', // TODO change into 1.8.7 sourceUrl: 'https://git.duniter.org/clients/cesium-grp/cesium', sourceLicenseUrl: 'https://git.duniter.org/clients/cesium-grp/cesium/-/raw/master/LICENSE', newIssueUrl: "https://git.duniter.org/clients/cesium-grp/cesium/issues/new", @@ -235,7 +235,7 @@ angular.module('cesium.settings.services', ['ngApi', 'cesium.config']) // If need select a random peer, from the config if (!data.node && !newData.node && _.size(csConfig.fallbackNodes) > 0) { newData.node = _.sample(csConfig.fallbackNodes); - console.info('[settings] Random selected peer: [{0}:{1}]'.format(newData.node.host, newData.node.port||80)); + console.info('[settings] Random selected peer [{0}]'.format(newData.node.host)); newData.node.temporary = true; } diff --git a/www/templates/network/view_peer.html b/www/templates/network/view_peer.html index aa096e35fbb9e94bedbe3bfa496793af315d05e8..357a8d2ee6ec2eb864cef8c956331ac0648328d0 100644 --- a/www/templates/network/view_peer.html +++ b/www/templates/network/view_peer.html @@ -84,7 +84,7 @@ <a class="item item-icon-left item-icon-right item-text-wrap ink" ng-if="isReachable" - ui-sref="app.view_server_block_hash({server: node.server, ssl: node.useSsl, tor: node.useTor, number: current.number, hash: current.hash})"> + ui-sref="app.view_server_block_hash({server: node.server, path: node.path, ssl: node.useSsl, tor: node.useTor, number: current.number, hash: current.hash})"> <i class="icon ion-cube"></i> <span translate>BLOCKCHAIN.VIEW.TITLE_CURRENT</span> <div class="badge badge-calm" ng-if="!loading"> @@ -95,7 +95,7 @@ <a class="item item-icon-left item-icon-right item-text-wrap ink" ng-if="isReachable" - ui-sref="app.server_blockchain({server: node.server, ssl: node.useSsl, tor: node.useTor})"> + ui-sref="app.server_blockchain({server: node.server, path: node.path, ssl: node.useSsl, tor: node.useTor})"> <i class="icon ion-cube" style="font-size: 25px;"></i> <i class="icon-secondary ion-clock" style="font-size: 18px; left: 33px; top: -12px;"></i> <span translate>PEER.VIEW.LAST_BLOCKS</span>