diff --git a/CHANGELOG b/CHANGELOG index 2a6fee587c127e61230cfef009d186a16a27a22a..75c1a3ea5b4b88bf807fff10e4f4b1c604f2e2a1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2022-12-23 Data Liberation Network + * release: 0.3.4 version, backend and extension + * fix: solved bug that prevent new settings to be saved + * fix: handled lack of error message on personal page + * house keeping: moved website repository into `site` folder + 2022-11-18 Data Liberation Network * releasing version 0.3.3 as new burst of life in this project * supporting mobilizon-poster version 1.1.5 diff --git a/README.md b/README.md index d1e37ecd58c14f2daf582336fde1135a56b1232c..f24617baba61e40a24f7db66b8aa9b0ecdf71de3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ This repository contains: 2. the backend code running on libr.events 3. the browser exension code - ### Site ``` @@ -20,7 +19,7 @@ Content is in the 'content' directory; Remind the [typography](https://libr.even `# git submodule add https://github.com/queensferryme/hugo-theme-texify.git themes/hugo-theme-texify` -### Backend +### Backend and Extension You need: `node` and `mongodb` running on your computer. @@ -55,6 +54,8 @@ Then: 4. if the background is green: wow! click it, and liberate your first event 5. click on the extension icon to access a _personal page_ +--- + # about `Data Liberation Network` Data Liberation is the action of copying material out of corporate platform so peoole can find more content into the fediverse. It is a support on the migration between the centralized point of failure and the federated counterpart. @@ -64,9 +65,6 @@ It should not be seen as a simple and automated action, as it is not enough to s 1. it would likely downgrade the quality of the federated experience if the copy is mindless 2. woud not be an incentive for people to leave corporate platforms. -### Librevent focus in building a [bridge of support for people](https://libr.events/post/who-are-we-talking-to/#3-the-advocates) that wants to leave Facebook events. - -It include this software, the federated replacement for event management [mobilizon](https://joinmobilizon.org), and also a nodejs package developed named [mobilizon-poster](https://github.com/vecna/mobilizon-poster). ### Why matter ? @@ -76,7 +74,11 @@ Critical mass is the reason why Facebook remain dominan despite none of their re ### By liberating events from Facebook to Fediverse we might help migration on federated platform. -And that's all we're testing here! If you want to get more grasp of the actual impact please check out [libr.events/about]](https://libr.events/about), don't miss also [libr.events/privacy](https://libr.events/privacy) and please consider version **0.3.x as an ALPHA release**. +And that's all we're testing here! If you want to get more grasp of the actual impact please check out [libr.events/about](https://libr.events/about), don't miss also [libr.events/privacy](https://libr.events/privacy) and please consider version **0.3.x as an ALPHA release**. + +### Librevent focus in building a [bridge of support for people](https://libr.events/post/who-are-we-talking-to/#3-the-advocates) that wants to leave Facebook events. + +It include this software, the federated replacement for event management [mobilizon](https://joinmobilizon.org), and also a nodejs package developed named [mobilizon-poster](https://github.com/vecna/mobilizon-poster). ### What's interoperability ? diff --git a/backend/collector.js b/backend/collector.js index 235baf67b7aa6b054347bd55188cc78a84978199..c4a49e93c67af7ada80941a944517bc92b69a80d 100644 --- a/backend/collector.js +++ b/backend/collector.js @@ -1,5 +1,5 @@ const express = require('express'); - +const fs = require('fs'); const _ = require('lodash'); const { json, urlencoded } = require('body-parser'); const debug = require('debug')('librevent:server'); @@ -80,6 +80,19 @@ app.get('/api/v2/events/:eventId', cors(), async function(req, res) { }; }); +app.options('/api/version', cors()); +app.get('/api/version', cors(), async function(req, res) { + try { + const content = fs.readFileSync('package.json', 'utf-8'); + const info = JSON.parse(content); + res.json({ + version: info.version + }) + } catch(error) { + debug("iowrapper Trigger an Exception in 'personal' %s", error); + } +}); + app.options('/api/v2/personal/:publiKey', cors()); app.get('/api/v2/personal/:publicKey', cors(), async function(req, res) { try { diff --git a/backend/package.json b/backend/package.json index b7072011895630808ef31d9cd890108129fbec01..bb8e48cb76e8b1fac36c5ea9868459e1fef5ea04 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,10 +1,10 @@ { "name": "librevent-backend", - "version": "0.3.3", + "version": "0.3.4", "description": "https://libr.events is a way to liberate events from facebook and repost them in the fediverse", "scripts": { "prod": "DEBUG=librevent:*,-mobi:*,-lib:* node collector.js", - "watch": "DEBUG=librevent:*,mobi:*,lib:* nodemon collector.js --config ./nodemon.json", + "watch": "DEBUG=librevent:*,mobi:*,lib:*,-lib:mongo nodemon collector.js", "test": "jest" }, "license": "AGPL-3.0", diff --git a/extension/src/app.js b/extension/src/app.js index ac366e864dd06e3b9883b319d8c67b1726fb5043..1524ade3c7e6333d1ed5449cd49006575d44a65d 100644 --- a/extension/src/app.js +++ b/extension/src/app.js @@ -223,12 +223,19 @@ export function displayMessageOnHover (node) { if(currentPhase === 'second') { messagef.textContent= `Click the bordered buttons!`; } else if (currentPhase === 'third') { - messagef.textContent= `Event sent 🫶`; + messagef.textContent= `Click rocket to send! 🫶`; + } else if (currentPhase === null) { + messagef.textContent= `Not an event page!`; } else { messagef.textContent= `phase ${currentPhase}`; - } node.appendChild(messagef); + + window.setTimeout(() => { + const messs = document.querySelectorAll(".panel--message"); + _.each(messs, function(p) { p.remove(); }); + }, timeout); + } export function runPageAnalysis () { diff --git a/extension/src/chrome/api.js b/extension/src/chrome/api.js index f94aed209d0ae114ddffab7fe25724851b972eef..81dff876bf928885c3d53337b997e7f47af45c4e 100644 --- a/extension/src/chrome/api.js +++ b/extension/src/chrome/api.js @@ -7,7 +7,7 @@ import db from './db'; function post (apiUrl, data, cookieId) { return new Promise((resolve, reject) => { - db.get('librevent').then(keypair => { + db.get('local').then(keypair => { const xhr = new XMLHttpRequest(); const payload = JSON.stringify(data); const url = config.API_ROOT + "/" + apiUrl; @@ -49,7 +49,7 @@ function post (apiUrl, data, cookieId) { function get (apiUrl, version, userId) { /* not used in quintrex */ return new Promise((resolve, reject) => { - db.get('librevent').then(keypair => { + db.get('local').then(keypair => { const xhr = new XMLHttpRequest(); const url = config.API_ROOT + "/" + apiUrl; diff --git a/extension/src/chrome/db.js b/extension/src/chrome/db.js index 6873be1b8a62deb98ebfd921d4e320d5dd098631..f4f6735250d267da0219e85d04aa2bc100c048f2 100644 --- a/extension/src/chrome/db.js +++ b/extension/src/chrome/db.js @@ -12,10 +12,9 @@ function get (key, setIfMissing) { reject(bo.runtime.lastError); } else if (isEmpty(val) && !isEmpty(setIfMissing)) { var newVal = isFunction(setIfMissing) ? setIfMissing(key) : setIfMissing; - console.log("get is empty ", newVal); backend.set(newVal, () => resolve(newVal)); } else { - console.log("get returns", val, key, val[key]); + console.log(`get from ${val} of ${key} is ${_.get(val, key)}`); resolve(isEmpty(val[key]) ? null : val[key]); } });