Ver código fonte

added names to peers

psy 2 anos atrás
pai
commit
69e20e48bc
6 arquivos alterados com 518 adições e 163 exclusões
  1. 291 3
      package-lock.json
  2. 30 28
      package.json
  3. 5 11
      src/index.js
  4. 151 0
      src/supports.js
  5. 20 12
      src/views/i18n.js
  6. 21 109
      src/views/index.js

+ 291 - 3
package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "@krakenslab/oasis",
-  "version": "0.2.6",
+  "version": "0.2.7",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -1648,6 +1648,11 @@
       "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
       "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw=="
     },
+    "await-exec": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/await-exec/-/await-exec-0.1.2.tgz",
+      "integrity": "sha512-BQUiyBLScS0+YPnnCZZGjb78mZ8sQ8aKgxarDPNw05rpbaCS7VIQSLy2tgjZKct9Dn1xLbKMXOpA98OWei90zA=="
+    },
     "aws-sign2": {
       "version": "0.7.0",
       "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
@@ -2197,6 +2202,11 @@
         }
       }
     },
+    "boolbase": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+      "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
+    },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -2473,6 +2483,124 @@
       "resolved": "https://registry.npmjs.org/charwise/-/charwise-3.0.1.tgz",
       "integrity": "sha512-RcdumNsM6fJZ5HHbYunqj2bpurVRGsXour3OR+SlLEHFhG6ALm54i6Osnh+OvO7kEoSBzwExpblYFH8zKQiEPw=="
     },
+    "cheerio": {
+      "version": "1.0.0-rc.12",
+      "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz",
+      "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
+      "requires": {
+        "cheerio-select": "^2.1.0",
+        "dom-serializer": "^2.0.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.0.1",
+        "htmlparser2": "^8.0.1",
+        "parse5": "^7.0.0",
+        "parse5-htmlparser2-tree-adapter": "^7.0.0"
+      },
+      "dependencies": {
+        "dom-serializer": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+          "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+          "requires": {
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.2",
+            "entities": "^4.2.0"
+          }
+        },
+        "domelementtype": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+          "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="
+        },
+        "domhandler": {
+          "version": "5.0.3",
+          "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+          "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+          "requires": {
+            "domelementtype": "^2.3.0"
+          }
+        },
+        "domutils": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz",
+          "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==",
+          "requires": {
+            "dom-serializer": "^2.0.0",
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.1"
+          }
+        },
+        "entities": {
+          "version": "4.4.0",
+          "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
+          "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
+        },
+        "htmlparser2": {
+          "version": "8.0.1",
+          "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz",
+          "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==",
+          "requires": {
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.2",
+            "domutils": "^3.0.1",
+            "entities": "^4.3.0"
+          }
+        }
+      }
+    },
+    "cheerio-select": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz",
+      "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==",
+      "requires": {
+        "boolbase": "^1.0.0",
+        "css-select": "^5.1.0",
+        "css-what": "^6.1.0",
+        "domelementtype": "^2.3.0",
+        "domhandler": "^5.0.3",
+        "domutils": "^3.0.1"
+      },
+      "dependencies": {
+        "dom-serializer": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+          "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+          "requires": {
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.2",
+            "entities": "^4.2.0"
+          }
+        },
+        "domelementtype": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+          "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="
+        },
+        "domhandler": {
+          "version": "5.0.3",
+          "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+          "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+          "requires": {
+            "domelementtype": "^2.3.0"
+          }
+        },
+        "domutils": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz",
+          "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==",
+          "requires": {
+            "dom-serializer": "^2.0.0",
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.1"
+          }
+        },
+        "entities": {
+          "version": "4.4.0",
+          "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
+          "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
+        }
+      }
+    },
     "chloride": {
       "version": "2.4.1",
       "resolved": "https://registry.npmjs.org/chloride/-/chloride-2.4.1.tgz",
@@ -3118,6 +3246,63 @@
         }
       }
     },
+    "css-select": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
+      "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==",
+      "requires": {
+        "boolbase": "^1.0.0",
+        "css-what": "^6.1.0",
+        "domhandler": "^5.0.2",
+        "domutils": "^3.0.1",
+        "nth-check": "^2.0.1"
+      },
+      "dependencies": {
+        "dom-serializer": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
+          "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==",
+          "requires": {
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.2",
+            "entities": "^4.2.0"
+          }
+        },
+        "domelementtype": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+          "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="
+        },
+        "domhandler": {
+          "version": "5.0.3",
+          "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+          "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+          "requires": {
+            "domelementtype": "^2.3.0"
+          }
+        },
+        "domutils": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz",
+          "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==",
+          "requires": {
+            "dom-serializer": "^2.0.0",
+            "domelementtype": "^2.3.0",
+            "domhandler": "^5.0.1"
+          }
+        },
+        "entities": {
+          "version": "4.4.0",
+          "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
+          "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
+        }
+      }
+    },
+    "css-what": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz",
+      "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw=="
+    },
     "cssesc": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
@@ -8237,6 +8422,14 @@
       "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz",
       "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg=="
     },
+    "node-iframe": {
+      "version": "1.8.5",
+      "resolved": "https://registry.npmjs.org/node-iframe/-/node-iframe-1.8.5.tgz",
+      "integrity": "sha512-9UzM0COEhosQe4OsLXxQQ1q5fvyf7GH5S8ns/kfah5iPImZuoDBB++k2JYRrDTodxv9jBxPD86PUEfYiiuTJIg==",
+      "requires": {
+        "cheerio": "^1.0.0-rc.3"
+      }
+    },
     "node-modules-regexp": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz",
@@ -8494,6 +8687,14 @@
         }
       }
     },
+    "nth-check": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
+      "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
+      "requires": {
+        "boolbase": "^1.0.0"
+      }
+    },
     "num2fraction": {
       "version": "1.2.2",
       "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz",
@@ -9076,6 +9277,45 @@
       "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
       "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="
     },
+    "parse5": {
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz",
+      "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==",
+      "requires": {
+        "entities": "^4.4.0"
+      },
+      "dependencies": {
+        "entities": {
+          "version": "4.4.0",
+          "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
+          "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
+        }
+      }
+    },
+    "parse5-htmlparser2-tree-adapter": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz",
+      "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==",
+      "requires": {
+        "domhandler": "^5.0.2",
+        "parse5": "^7.0.0"
+      },
+      "dependencies": {
+        "domelementtype": {
+          "version": "2.3.0",
+          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
+          "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="
+        },
+        "domhandler": {
+          "version": "5.0.3",
+          "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz",
+          "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==",
+          "requires": {
+            "domelementtype": "^2.3.0"
+          }
+        }
+      }
+    },
     "parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -15657,7 +15897,8 @@
         },
         "ini": {
           "version": "1.3.5",
-          "resolved": ""
+          "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+          "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
         },
         "int53": {
           "version": "1.0.0",
@@ -17397,7 +17638,8 @@
         },
         "path-parse": {
           "version": "1.0.6",
-          "resolved": ""
+          "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
+          "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
         },
         "path-type": {
           "version": "3.0.0",
@@ -19013,6 +19255,52 @@
             "ssb-client": "^4.9.0",
             "ssb-keys": "^7.2.2",
             "ssb-ref": "^2.14.0"
+          },
+          "dependencies": {
+            "abstract-leveldown": {
+              "version": "6.2.3",
+              "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz",
+              "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==",
+              "requires": {
+                "buffer": "^5.5.0",
+                "immediate": "^3.2.3",
+                "level-concat-iterator": "~2.0.0",
+                "level-supports": "~1.0.0",
+                "xtend": "~4.0.0"
+              }
+            },
+            "level": {
+              "version": "6.0.1",
+              "resolved": "https://registry.npmjs.org/level/-/level-6.0.1.tgz",
+              "integrity": "sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==",
+              "requires": {
+                "level-js": "^5.0.0",
+                "level-packager": "^5.1.0",
+                "leveldown": "^5.4.0"
+              }
+            },
+            "level-js": {
+              "version": "5.0.2",
+              "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz",
+              "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==",
+              "requires": {
+                "abstract-leveldown": "~6.2.3",
+                "buffer": "^5.5.0",
+                "inherits": "^2.0.3",
+                "ltgt": "^2.1.2"
+              }
+            },
+            "ssb-ref": {
+              "version": "2.16.0",
+              "resolved": "https://registry.npmjs.org/ssb-ref/-/ssb-ref-2.16.0.tgz",
+              "integrity": "sha512-ylyrfz9NLxwTCbeDDAdLo++O3elhNs6/gUqMhZ22F+gSOIjwXy2X7dpg5Q1YTH7uALOSu307Rpo1UfK9sj7Sjw==",
+              "requires": {
+                "ip": "^1.1.3",
+                "is-canonical-base64": "^1.1.1",
+                "is-valid-domain": "~0.0.1",
+                "multiserver-address": "^1.0.1"
+              }
+            }
           }
         },
         "ssb-keys": {

+ 30 - 28
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@krakenslab/oasis",
-  "version": "0.2.6",
+  "version": "0.2.7",
   "description": "SNH-Oasis Project Network GUI",
   "repository": {
     "type": "git",
@@ -26,11 +26,16 @@
   "dependencies": {
     "@fraction/base16-css": "^1.1.0",
     "@koa/router": "^10.0.0",
+    "await-exec": "^0.1.2",
+    "broadcast-stream": "^0.2.1",
     "debug": "^4.3.1",
     "env-paths": "^2.2.0",
+    "epidemic-broadcast-trees": "^9.0.4",
     "file-type": "^16.0.1",
+    "has-network": "0.0.1",
     "highlight.js": "^11.0.0",
     "hyperaxe": "^1.3.0",
+    "ip": "^1.1.5",
     "is-svg": "^4.2.1",
     "koa": "^2.7.0",
     "koa-body": "^4.1.0",
@@ -39,48 +44,57 @@
     "lodash": "^4.17.11",
     "lodash.shuffle": "^4.2.0",
     "markdown-it": "^12.0.2",
-    "broadcast-stream": "^0.2.1",
-    "has-network": "0.0.1",
-    "ip": "^1.1.5",
-    "epidemic-broadcast-trees": "^9.0.4",
-    "packet-stream": "^2.0.6",
-    "packet-stream-codec": "^1.2.0",
     "mdmanifest": "^1.0.8",
     "minimist": "^1.1.3",
     "mkdirp": "^1.0.4",
     "multiblob": "^1.13.0",
     "multiserver": "^3.3.1",
     "multiserver-address": "^1.0.1",
+    "muxrpc": "^6.7.3",
     "muxrpc-validation": "^3.0.2",
     "muxrpcli": "^3.1.2",
-    "muxrpc": "^6.7.3",
+    "node-iframe": "^1.8.5",
     "open": "^8.0.1",
+    "packet-stream": "^2.0.6",
+    "packet-stream-codec": "^1.2.0",
     "piexifjs": "^1.0.4",
     "pretty-ms": "^7.0.1",
+    "pull-abortable": "^4.1.1",
     "pull-cat": "~1.1.5",
     "pull-file": "^1.0.0",
     "pull-many": "~1.0.6",
-    "pull-pushable": "^2.2.0",
-    "pull-abortable": "^4.1.1",
     "pull-paramap": "^1.2.2",
+    "pull-pushable": "^2.2.0",
     "pull-sort": "^1.0.2",
     "pull-stream": "^3.6.12",
     "request": "^2.88.1",
     "require-style": "^1.1.0",
+    "scuttle-poll": "^1.5.1",
     "secret-stack": "^6.4.1",
     "ssb-about": "^2.0.1",
     "ssb-backlinks": "^2.1.1",
     "ssb-blobs": "^2.0.1",
+    "ssb-box": "^1.0.1",
     "ssb-caps": "^1.0.1",
     "ssb-client": "^4.9.0",
     "ssb-config": "^3.4.4",
     "ssb-conn": "^6.0.3",
+    "ssb-conn-db": "^1.0.5",
+    "ssb-conn-hub": "^1.2.0",
+    "ssb-conn-query": "^1.2.2",
+    "ssb-conn-staging": "^1.0.0",
     "ssb-db": "^20.3.0",
+    "ssb-db2": "^6.1.1",
+    "ssb-device-address": "^1.1.6",
     "ssb-ebt": "^8.1.2",
+    "ssb-friend-pub": "^1.0.7",
     "ssb-friends": "^5.0.0",
+    "ssb-gossip": "^1.1.1",
     "ssb-invite": "^3.0.1",
+    "ssb-invite-client": "^1.3.3",
     "ssb-keys": "^8.0.0",
     "ssb-lan": "^1.0.0",
+    "ssb-legacy-conn": "^2.0.0",
     "ssb-links": "^3.0.10",
     "ssb-local": "^1.0.0",
     "ssb-logging": "^1.0.0",
@@ -92,35 +106,23 @@
     "ssb-no-auth": "^1.0.0",
     "ssb-onion": "^1.0.0",
     "ssb-ooo": "^1.3.3",
+    "ssb-partial-replication": "^3.0.1",
     "ssb-plugins": "^1.0.2",
     "ssb-private1": "^1.0.1",
     "ssb-query": "^2.4.5",
     "ssb-ref": "^2.16.0",
-    "ssb-tribes": "^3.1.1",
+    "ssb-replication-scheduler": "^2.0.2",
     "ssb-room": "^1.3.0",
     "ssb-search": "^1.3.0",
+    "ssb-search2": "^2.1.3",
     "ssb-server": "^15.3.0",
     "ssb-tangle": "^1.0.1",
     "ssb-thread-schema": "^1.1.1",
+    "ssb-threads": "^10.0.4",
+    "ssb-tribes": "^3.1.1",
+    "ssb-tunnel": "^2.0.0",
     "ssb-unix-socket": "^1.0.0",
     "ssb-ws": "^6.2.3",
-    "ssb-gossip": "^1.1.1",
-    "ssb-tunnel": "^2.0.0",
-    "ssb-legacy-conn": "^2.0.0",
-    "ssb-db2": "^6.1.1",
-    "ssb-box": "^1.0.1",
-    "ssb-threads": "^10.0.4",
-    "ssb-conn-db": "^1.0.5",
-    "ssb-search2": "^2.1.3",
-    "ssb-friend-pub": "^1.0.7",
-    "ssb-invite-client": "^1.3.3",
-    "ssb-conn-query": "^1.2.2",
-    "ssb-conn-hub": "^1.2.0",
-    "ssb-conn-staging": "^1.0.0",
-    "ssb-device-address": "^1.1.6",
-    "scuttle-poll": "^1.5.1",
-    "ssb-replication-scheduler": "^2.0.2",
-    "ssb-partial-replication": "^3.0.1",
     "yargs": "^17.0.0"
   },
   "devDependencies": {

+ 5 - 11
src/index.js

@@ -430,7 +430,7 @@ router
     return next();
   })
   .get("/", async (ctx) => {
-    ctx.redirect("/public/latest");
+    ctx.redirect("/mentions");
   })
   .get("/robots.txt", (ctx) => {
     ctx.body = "User-agent: *\nDisallow: /";
@@ -544,7 +544,6 @@ router
   })
   .get("/imageSearch", async (ctx) => {
     const { query } = ctx.query;
-
     const blobs = query ? await blob.search({ query }) : {};
 
     ctx.body = await imageSearchView({ blobs, query });
@@ -552,7 +551,6 @@ router
   .get("/inbox", async (ctx) => {
     const inbox = async () => {
       const messages = await post.inbox();
-
       return privateView({ messages });
     };
     ctx.body = await inbox();
@@ -577,7 +575,6 @@ router
   })
   .get("/profile", async (ctx) => {
     const myFeedId = await meta.myFeedId();
-
     const gt = Number(ctx.request.query["gt"] || -1);
     const lt = Number(ctx.request.query["lt"] || -1);
 
@@ -757,10 +754,10 @@ router
      value.name = await about.name(value.key);
      return [key, value];
      }))
-      return peersView({
-       peers: peersWithNames,
-      });
-    };
+    return peersView({
+      peers: peersWithNames,
+    });
+   };
     ctx.body = await getMeta({ theme });
    })
   .get("/invites", async (ctx) => {
@@ -804,17 +801,14 @@ router
       debug("got %i messages", messages.length);
       return threadView({ messages });
     };
-
     ctx.body = await thread(message);
   })
   .get("/subtopic/:message", async (ctx) => {
     const { message } = ctx.params;
     const rootMessage = await post.get(message);
     const myFeedId = await meta.myFeedId();
-
     debug("%O", rootMessage);
     const messages = [rootMessage];
-
     ctx.body = await subtopicView({ messages, myFeedId });
   })
   .get("/publish", async (ctx) => {

+ 151 - 0
src/supports.js

@@ -0,0 +1,151 @@
+#!/usr/bin/env node
+
+const fs = require("fs");
+const path = require("path");
+const homedir = require('os').homedir();
+const supportingPath = path.join(homedir, ".ssb/flume/contacts2.json");
+const {
+  a,
+  br,
+  li,
+} = require("hyperaxe");
+
+const envPaths = require("env-paths");
+const cli = require("./cli");
+const ssb = require("./ssb");
+const defaultConfig = {};
+const defaultConfigFile = path.join(
+  envPaths("oasis", { suffix: "" }).config,
+  "/default.json"
+);
+
+const config = cli(defaultConfig, defaultConfigFile);
+if (config.debug) {
+  process.env.DEBUG = "oasis,oasis:*";
+}
+const cooler = ssb({ offline: config.offline });
+const { about} = require("./models")({
+  cooler,
+  isPublic: config.public,
+});
+
+async function getNameByIdSupported(supported){
+  name_supported = await about.name(supported);
+  return name_supported
+}
+
+async function getNameByIdBlocked(blocked){
+  name_blocked = await about.name(blocked);
+  return name_blocked
+}
+
+async function getNameByIdRecommended(recommended){
+  name_recommended = await about.name(recommended);
+  return name_recommended
+}
+
+  try{
+      var supporting = JSON.parse(fs.readFileSync(supportingPath, {encoding:'utf8', flag:'r'})).value;
+    }catch{
+      var supporting = undefined;
+    }
+    if (supporting == undefined) {
+        var supportingValue = "false";
+    }else{
+        var keys = Object.keys(supporting);
+        if (keys[0] === undefined){
+          var supportingValue = "false";
+        }else{
+          var supportingValue = "true";
+        }
+    }
+    if (supportingValue === "true") {
+      var arr = [];
+      var keys = Object.keys(supporting);
+        var data = Object.entries(supporting[keys[0]]);
+        Object.entries(data).forEach(([key, value]) => {
+         if (value[1]===1){
+          var supported = (value[0])
+           if (!arr.includes(supported)) {
+              getNameSupported(supported);
+              async function getNameSupported(supported){
+                 name_supported = await getNameByIdSupported(supported);
+              arr.push(
+               li(
+                 name_supported,br,
+                 a(
+                  { href: `/author/${encodeURIComponent(supported)}` }, 
+                  supported
+                 )
+               ), br
+              );
+             }
+           }
+         }
+      });
+    }else{
+      var arr = [];
+    }
+    var supports = arr;
+
+    if (supportingValue === "true") {
+      var arr2 = [];
+      var keys = Object.keys(supporting);
+      var data = Object.entries(supporting[keys[0]]);
+       Object.entries(data).forEach(([key, value]) => {
+         if (value[1]===-1){
+          var blocked = (value[0])
+           if (!arr2.includes(blocked)) {
+              getNameBlocked(blocked);
+              async function getNameBlocked(blocked){
+                 name_blocked = await getNameByIdBlocked(blocked);
+              arr2.push(
+               li(
+                 name_blocked,br,
+                 a( 
+                  { href: `/author/${encodeURIComponent(blocked)}` },
+                  blocked
+                 )
+               ), br
+              );
+             }
+           }
+         }
+      });
+    }else{
+      var arr2 = [];
+    }
+    var blocks = arr2;
+
+    if (supportingValue === "true") {
+      var arr3 = [];
+      var keys = Object.keys(supporting);
+      var data = Object.entries(supporting[keys[0]]);
+       Object.entries(data).forEach(([key, value]) => {
+         if (value[1]===-2){
+          var recommended = (value[0])
+           if (!arr3.includes(recommended)) {
+              getNameRecommended(recommended);
+              async function getNameRecommended(recommended){
+                 name_recommended = await getNameByIdRecommended(recommended);
+              arr3.push(
+               li(
+                 name_recommended,br,
+                 a( 
+                  { href: `/author/${encodeURIComponent(recommended)}` },
+                  recommended
+                 )
+               ), br
+              );
+             }
+           }
+         }
+      });
+    }else{
+      var arr3 = [];
+    }
+    var recommends = arr3;
+
+module.exports.supporting = supports;
+module.exports.blocking = blocks;
+module.exports.recommending = recommends;

+ 20 - 12
src/views/i18n.js

@@ -3,7 +3,7 @@ const { a, em, strong } = require("hyperaxe");
 const i18n = {
   en: {
     // navbar items
-    extended: "Extended",
+    extended: "Multiverse",
     extendedDescription: [
       "When you support someone you may download posts from the inhabitants they support, and those posts show up here, sorted by recency.",
     ],
@@ -35,7 +35,7 @@ const i18n = {
     threads: "Threads",
     threadsDescription: [
       strong("Posts that have comments"),
-      " from inhabitants you support and your extended network, sorted by recency. Select the timestamp of any post to see the rest of the thread.",
+      " from inhabitants you support and your multiverse, sorted by recency. Select the timestamp of any post to see the rest of the thread.",
     ],
     profile: "Avatar",
     inhabitants: "Inhabitants", 
@@ -55,6 +55,9 @@ const i18n = {
     search: "Search",
     imageSearch: "Image Search",
     settings: "Settings",
+    continueReading: "continue reading",
+    moreComments: "more comment",
+    readThread: "read the rest of the thread",
     // post actions
     comment: "Comment",
     subtopic: "Subtopic",
@@ -88,8 +91,9 @@ const i18n = {
     attachFiles: "Attach files",
     mentionsMatching: "Matching mentions",
     preview: "Preview",
-    publish: "Publish",
+    publish: "Write",
     contentWarningPlaceholder: "Add a subject to the post (optional)",
+    privateWarningPlaceholder: "Add inhabitants to send a private post (ex: @bob @alice) (optional)",
     publishWarningPlaceholder: "...",
     publishCustomDescription: [
       "REMEMBER: Due to blockchain technology, once a post is published it cannot be edited or deleted.",
@@ -109,15 +113,15 @@ const i18n = {
     ],
     publishCustomInfo: ({ href }) => [
       "If you have experience, you can also ",
-      a({ href }, "publish an advanced post"),
+      a({ href }, "write an advanced post"),
       ".",
     ],
     publishBasicInfo: ({ href }) => [
       "If you have not experience, you should ",
-      a({ href }, "publish a post"),
+      a({ href }, "write a post"),
       ".",
     ],
-    publishCustom: "Publish advanced post",
+    publishCustom: "Write advanced post",
     subtopicLabel: ({ markdownUrl }) => [
       "Create a ",
       strong("public subtopic"),
@@ -203,8 +207,11 @@ const i18n = {
     search: "Buscar",
     imageSearch: "Buscar Imágenes",
     settings: "Configuración",
+    continueReading: "continuar leyendo",
+    moreComments: "comentario",
+    readThread: "leer el resto del hilo",
     // navbar items
-    extended: "Extendida",
+    extended: "Multiverso",
     extendedDescription: [
       "Cuando apoyes a alguien, podrás descargar publicaciones de habitantes que apoye, y esas publicaciones aparecerán aquí, ordenadas por las más recientes.",
     ],
@@ -235,7 +242,7 @@ const i18n = {
     threads: "Hilos",
     threadsDescription: [
       strong("Posts que tienen comentarios"),
-      " de habitantes que apoyas y de tu red extendida, ordenados por los más recientes. Selecciona la hora de publicación para leer el hilo completo.",
+      " de habitantes que apoyas y de tu multiverso, ordenados por los más recientes. Selecciona la hora de publicación para leer el hilo completo.",
     ],
     manualMode: "Modo manual",
     mentions: "Menciones",
@@ -284,8 +291,9 @@ const i18n = {
     attachFiles: "Agregar archivos",
     mentionsMatching: "Menciones coincidentes",
     preview: "Vista previa",
-    publish: "Publicar",
+    publish: "Escribir",
     contentWarningPlaceholder: "Añade un asunto al post (opcional)",
+    privateWarningPlaceholder: "Añade habitantes para enviar un post privado (ej: @bob @alice) (opcional)",
     publishWarningPlaceholder: "...",
     publishCustomDescription: [
       "RECUERDA: Debido a la tecnología blockchain, una vez publicado un post, no podrá ser editado o borrado.",
@@ -302,15 +310,15 @@ const i18n = {
     ],
     publishCustomInfo: ({ href }) => [
       "Si tienes experiencia, también puedes ",
-      a({ href }, "publicar un post avanzado"),
+      a({ href }, "escribir un post avanzado"),
       ".",
     ],
     publishBasicInfo: ({ href }) => [
       "Si no tienes experiencia, lo mejor es ",
-      a({ href }, "publicar un post normal"),
+      a({ href }, "escribir un post normal"),
       ".",
     ],
-    publishCustom: "Publicar post avanzado",
+    publishCustom: "Escribir post avanzado",
     replyLabel: ({ markdownUrl }) => [
       "RECUERDA: Debido a la tecnología blockchain, una vez publicados los posts, no podrán ser editados o borrados.",
     ],

+ 21 - 109
src/views/index.js

@@ -3,19 +3,19 @@
 const path = require("path");
 const envPaths = require("env-paths");
 const fs = require("fs");
-
 const homedir = require('os').homedir();
-
-const supportingPath = path.join(homedir, ".ssb/flume/contacts2.json");
-const offsetPath = path.join(homedir, ".ssb/gossip.json");
-
+const gossipPath = path.join(homedir, ".ssb/gossip.json");
 const debug = require("debug")("oasis");
 const highlightJs = require("highlight.js");
-
 const MarkdownIt = require("markdown-it");
 const prettyMs = require("pretty-ms");
 
 const updater = require("../updater.js");
+
+const supports = require("../supports.js").supporting;
+const blocks = require("../supports.js").blocking;
+const recommends = require("../supports.js").recommending;
+
 global.updaterequired = "";
 global.ck = updater.getRemoteVersion(async function(checkversion){
   if (checkversion === "required"){
@@ -61,8 +61,6 @@ const {
   ul,
 } = require("hyperaxe");
 
-const { about, blob, vote } = require("../models")({});
-
 const lodash = require("lodash");
 const markdown = require("./markdown");
 
@@ -142,10 +140,10 @@ const template = (titlePrefix, ...elements) => {
           navLink({ href: "/mentions", emoji: "✺", text: i18n.mentions }),
           navLink({ href: "/public/latest", emoji: "☄", text: i18n.latest }),
           navLink({ href: "/public/latest/summaries", emoji: "※", text: i18n.summaries }),
-          navLink({ href: "/public/latest/topics", emoji: "ϟ", text: i18n.topics }), 
+          navLink({ href: "/public/latest/topics", emoji: "ϟ", text: i18n.topics }),
           navLink({ href: "/public/latest/extended", emoji: "∞", text: i18n.extended }),
-          navLink({ href: "/public/latest/threads", emoji: "♺", text: i18n.threads }),
           navLink({ href: "/public/popular/day", emoji: "⌘", text: i18n.popular }),
+          navLink({ href: "/public/latest/threads", emoji: "♺", text: i18n.threads }),
         )
       ),
       main({ id: "content" }, elements),
@@ -288,11 +286,11 @@ const continueThreadComponent = (thread, isComment) => {
     continueLink = `/thread/${encoded.parent}#${encoded.next}`;
     return a(
       { href: continueLink },
-      `continue reading ${left} more comment${left === 1 ? "" : "s"}`
+      i18n.continueReading, ` ${left} `, i18n.moreComments+`${left === 1 ? "" : "s"}`
     );
   } else {
     continueLink = `/thread/${encoded.parent}`;
-    return a({ href: continueLink }, "read the rest of the thread");
+    return a({ href: continueLink }, i18n.readThread);
   }
 };
 
@@ -896,9 +894,6 @@ exports.publishView = (preview, text, contentWarning) => {
 
 const generatePreview = ({ previewData, contentWarning, action }) => {
   const { authorMeta, text, mentions } = previewData;
-
-  // craft message that looks like it came from the db
-  // cb: this kinda fragile imo? this is for getting a proper post styling ya?
   const msg = {
     key: "%non-existent.preview",
     value: {
@@ -949,8 +944,13 @@ const generatePreview = ({ previewData, contentWarning, action }) => {
                   relationship.emoji = "⚼";
                   relationship.desc = i18n.relationshipTheyFollow;
                 } else {
-                  relationship.emoji = "❓";
-                  relationship.desc = i18n.relationshipNotFollowing;
+                  if (m.rel.me = true){
+                    relationship.emoji = "#";
+                    relationship.desc = i18n.relationshipYou;
+                  } else {
+                    relationship.emoji = "❓";
+                    relationship.desc = i18n.relationshipNotFollowing;
+                  }
                 }
                 return div(
                   { class: "mentions-container" },
@@ -1058,93 +1058,6 @@ exports.peersView = async ({ peers }) => {
       );
    });
 
-  try{
-      var supporting = JSON.parse(fs.readFileSync(supportingPath, {encoding:'utf8', flag:'r'})).value;
-  }catch{
-      var supporting = undefined;
-  }
-  if (supporting == undefined) {
-        var supportingValue = "false";
-  }else{
-        var keys = Object.keys(supporting);
-        if (keys[0] === undefined){
-          var supportingValue = "false";
-        }else{
-          var supportingValue = "true";
-        }
-  }
-  if (supportingValue === "true") {
-    var arr = [];
-    var keys = Object.keys(supporting);
-        var data = Object.entries(supporting[keys[0]]);
-        Object.entries(data).forEach(([key, value]) => {
-         if (value[1]===1){
-          var supported = (value[0])
-           if (!arr.includes(supported)) {
-              arr.push(
-               li(
-                 a(
-                  { href: `/author/${encodeURIComponent(supported)}` }, 
-                  supported
-                 )
-               )
-              );
-           }
-         }
-      });
-  }else{
-    var arr = [];
-  }
-  var supports = arr;
-
-  if (supportingValue === "true") {
-    var arr = [];
-    var keys = Object.keys(supporting);
-      var data = Object.entries(supporting[keys[0]]);
-       Object.entries(data).forEach(([key, value]) => {
-         if (value[1]===-1){
-          var blocked = (value[0])
-           if (!arr.includes(blocked)) {
-              arr.push(
-               li(
-                 a(
-                  { href: `/author/${encodeURIComponent(blocked)}` }, 
-                  blocked
-                 )
-               )
-              );
-           }
-         }
-      });
-  }else{
-    var arr = [];
-  }
-  var blocks = arr;
-
-  if (supportingValue === "true") {
-    var arr = [];
-    var keys = Object.keys(supporting);
-      var data = Object.entries(supporting[keys[0]]);
-       Object.entries(data).forEach(([key, value]) => {
-         if (value[1]===-2){
-          var recommended = (value[0])
-           if (!arr.includes(recommended)) {
-              arr.push(
-               li(
-                 a(
-                  { href: `/author/${encodeURIComponent(recommended)}` }, 
-                  recommended
-                 )
-               )
-              );
-           }
-         }
-      });
-  }else{
-    var arr = [];
-  }
-  var recommends = arr;
-
  return template(
   i18n.peers,
     section(
@@ -1154,13 +1067,13 @@ exports.peersView = async ({ peers }) => {
       h1(i18n.online, " (", peerList.length, ")"),
       peerList.length > 0 ? ul(peerList) : i18n.noConnections,
       p(i18n.connectionActionIntro),
-      h1(i18n.supported, " (", supports.length, ")"),
+      h1(i18n.supported, " (", supports.length/2, ")"),
       supports.length > 0 ? ul(supports): i18n.noSupportedConnections,
       p(i18n.connectionActionIntro),
-      h1(i18n.recommended, " (", recommends.length, ")"),
+      h1(i18n.recommended, " (", recommends.length/2, ")"),
       recommends.length > 0 ? ul(recommends): i18n.noRecommendedConnections,
       p(i18n.connectionActionIntro),
-      h1(i18n.blocked, " (", blocks.length, ")"),
+      h1(i18n.blocked, " (", blocks.length/2, ")"),
       blocks.length > 0 ? ul(blocks): i18n.noBlockedConnections,
       p(i18n.connectionActionIntro),
       )
@@ -1169,7 +1082,7 @@ exports.peersView = async ({ peers }) => {
 
 exports.invitesView = ({ invites }) => {
   try{
-    var pubs = fs.readFileSync(offsetPath, "utf8");
+    var pubs = fs.readFileSync(gossipPath, "utf8");
   }catch{
       var pubs = undefined;
   }
@@ -1184,7 +1097,6 @@ exports.invitesView = ({ invites }) => {
         }
   }
   if (pubsValue === "true") {
-    var pubs = fs.readFileSync(offsetPath, "utf8");
     var pubs = JSON.parse(pubs);
     const arr2 = [];
     const arr3 = [];