diff --git a/apps/cory/docs.json b/apps/cory/docs.json index 8fdfd60a..620a0f70 100644 --- a/apps/cory/docs.json +++ b/apps/cory/docs.json @@ -1 +1 @@ -{"type":"tildefriends-app","files":{"app.js":"&WCq6ssQedT5denXPXlz2BswPD6hmt++EmWIMIDUMurA=.sha256","index.md":"&XWx2BFiunp94ESm8w3TiEr4HcCtegVojYxMFLV8DSow=.sha256","todo.md":"&4ipkgEn0imigLYwIdSK3KuZY2/ERqfzrWlw9OocIJWc=.sha256","structure.md":"&T+CBfT9XP6ooKFvD1ZCI9hsutqsNIamfBxtAho0HtlU=.sha256","guide.md":"&SgnGL0+rjetY2o9A2+lVRbNvHIkqKwMnZr9gXWneIlc=.sha256"}} \ No newline at end of file +{"type":"tildefriends-app","files":{"app.js":"&WCq6ssQedT5denXPXlz2BswPD6hmt++EmWIMIDUMurA=.sha256","index.md":"&5EeOHUkDadC+lJsDsKXbfrVDQdePyOHZ7KwaJtR5mrs=.sha256","todo.md":"&U6hrQ6cfJ6+Uvg+wA7ahpCQaM2XiYXKjZUOz2iZDSGM=.sha256","structure.md":"&T+CBfT9XP6ooKFvD1ZCI9hsutqsNIamfBxtAho0HtlU=.sha256","guide.md":"&SgnGL0+rjetY2o9A2+lVRbNvHIkqKwMnZr9gXWneIlc=.sha256","id_refactor.md":"&RCGnByvk25SuPQ5wywVwgOhAFIxOeoUm17sD24XSSZw=.sha256"}} \ No newline at end of file diff --git a/apps/cory/docs/id_refactor.md b/apps/cory/docs/id_refactor.md new file mode 100644 index 00000000..3202aed6 --- /dev/null +++ b/apps/cory/docs/id_refactor.md @@ -0,0 +1,17 @@ +# ID Refactor +[Back to index](#index) + +## Goals + - no way to get private key in javascript + - ssb.c syncs/broadcasts/... efficiently for everybody + +## Schema + - separate table to discourage leakage + - `CREATE TABLE identities (user TEXT, public TEXT, secret TEXT);' + +## API + - `ssb.createIdentity()` -> `id` + - `ssb.getIdentities()` => `[id, ...]` + - `ssb.deleteIdentity(id)` + - `ssb.post(id, ...)` + - `ssb.appendMessage(id, ...)` \ No newline at end of file diff --git a/apps/cory/docs/index.md b/apps/cory/docs/index.md index f518d9c9..9b8b0cb8 100644 --- a/apps/cory/docs/index.md +++ b/apps/cory/docs/index.md @@ -7,4 +7,5 @@ and run code. - [Structure](#structure) - [Guide](#guide) -- [TODO](#todo) \ No newline at end of file +- [TODO](#todo) +- [ID Refactor](#id_refactor) \ No newline at end of file diff --git a/apps/cory/docs/todo.md b/apps/cory/docs/todo.md index e7eb5d5d..d5c3be8c 100644 --- a/apps/cory/docs/todo.md +++ b/apps/cory/docs/todo.md @@ -4,9 +4,7 @@ ## MVP2 - update README - update docs -- auto-populate data on initial launch - audit + document API exposed to apps -- installable apps - emoji reaction picker - logging to browser - fix weird HTTP warnings @@ -21,20 +19,23 @@ - expose loads of stats - package standalone executable - build for windows -- make the docker image good / test it / use it - make a better connections API - tf account timeout why - attribute blob wants to messages -- keep working on good error feedback - installable apps (bring back an app message?) - make a cool independent app - editor without app iframe - indicate when workspace differs from installed -- file upload widget - / => Something good. - administrators config -- leaking imports / exports - confirm posting all new messages +## Maybe Done +- auto-populate data on initial launch +- make the docker image good / test it / use it +- leaking imports / exports +- file upload widget +- keep working on good error feedback + ## Done - update LICENSE \ No newline at end of file diff --git a/apps/cory/index.json b/apps/cory/index.json index 7f49f4c1..4ef0b011 100644 --- a/apps/cory/index.json +++ b/apps/cory/index.json @@ -1 +1 @@ -{"type":"tildefriends-app","files":{"app.js":"&iqkvaTLEbxeintzHb07jiFncdg3N1aS8h8ZNUzy7MZI=.sha256","index.html":"&ko7qv1Ihzmw8ibXr0RinyzNBc2xNzcGDQDPO9X3JAAQ=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&DdJwZYEo7AqFyutYMvEjykoVXxdHVog0UXye6Sbo0TU=.sha256","tf-message.js":"&wp4y+HfumjPpbG19989uy4CoGh4telO0xv3zHaNp3sQ=.sha256","tf.js":"&/yKh5E/PLaK/M3tivdldiEDnpeYQYyuLHWjjdM/QpxE=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&+qPP3g4CAUlkt8K4iBCZ+F5Fy6N7fu6MggvSVss2juE=.sha256"}} \ No newline at end of file +{"type":"tildefriends-app","files":{"app.js":"&iqkvaTLEbxeintzHb07jiFncdg3N1aS8h8ZNUzy7MZI=.sha256","index.html":"&ko7qv1Ihzmw8ibXr0RinyzNBc2xNzcGDQDPO9X3JAAQ=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&DdJwZYEo7AqFyutYMvEjykoVXxdHVog0UXye6Sbo0TU=.sha256","tf-message.js":"&wyqn+8yC3O/m6LfZrR5RIfd6+g+rVCUaPCPT3FcQsPg=.sha256","tf.js":"&/yKh5E/PLaK/M3tivdldiEDnpeYQYyuLHWjjdM/QpxE=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&+qPP3g4CAUlkt8K4iBCZ+F5Fy6N7fu6MggvSVss2juE=.sha256"}} \ No newline at end of file diff --git a/apps/cory/index/tf-message.js b/apps/cory/index/tf-message.js index cd2c7e56..6954050e 100644 --- a/apps/cory/index/tf-message.js +++ b/apps/cory/index/tf-message.js @@ -16,7 +16,27 @@ Vue.component('tf-message', { } catch { return this.message.content; } - } + }, + timestamp_relative: function() { + var units = [ + {value: 1, name: 'milliseconds'}, + {value: 1000, name: 'seconds'}, + {value: 1000 * 60, name: 'minutes'}, + {value: 1000 * 60 * 60, name: 'hours'}, + {value: 1000 * 60 * 60 * 24, name: 'days'}, + {value: 1000 * 60 * 60 * 24 * 7, name: 'weeks'}, + {value: 1000 * 60 * 60 * 24 * 30, name: 'months'}, + {value: 1000 * 60 * 60 * 24 * 365, name: 'years'}, + ]; + var v = new Date().valueOf() - this.message.timestamp; + var result = null; + for (let unit of units) { + if (v >= unit.value) { + result = Math.round(v / unit.value) + ' ' + unit.name + ' ago'; + } + } + return result; + }, }, methods: { markdown: markdown, @@ -79,8 +99,11 @@ Vue.component('tf-message', {