Commit Graph

39 Commits

Author SHA1 Message Date
Richard Hansen 2facf3a0c5 ExportEtherpad: New `importEtherpad`, `exportEtherpad` hooks 2022-05-06 02:54:34 -04:00
Richard Hansen 44fd70491d ImportEtherpad: Batch database writes 2022-05-05 20:49:52 -04:00
Richard Hansen c1652fd695 ImportEtherpad: Process records in batches
This enables ueberdb to combine multiple queries into a single message
to the database backend.
2022-05-05 20:49:52 -04:00
Richard Hansen 10117bc988 ImportEtherpad: Use a real ueberdb object for the temp Pad
Now plugin authors have access to the full set of DB operations.
2022-05-05 20:49:52 -04:00
Richard Hansen 3b8549342a Pad: Plumb author ID through mutation operations 2022-02-19 14:55:42 -05:00
Richard Hansen 77bcb507b3 ImportEtherpad: Limit in-flight DB queries 2021-11-28 22:28:55 -05:00
Richard Hansen 5b3575acf0 ImportEtherpad: Use AttributePool to check attributes 2021-11-28 22:28:55 -05:00
Richard Hansen 19909eae53 ImportEtherpad: Rigorously check imported data 2021-11-28 22:28:55 -05:00
Richard Hansen ad78b24113 ImportEtherpad: Warn about unsupported attrib at encounter 2021-11-28 22:28:55 -05:00
Richard Hansen 23f8a12922 ImportEtherpad: Don't make any changes if data is bad 2021-11-28 22:28:55 -05:00
Richard Hansen a2e77a7128 ImportEtherpad: Enforce single-pad records 2021-11-28 22:28:54 -05:00
Richard Hansen 33778281b9 ImportEtherpad: Simplify attribute key iteration 2021-11-28 22:28:54 -05:00
Richard Hansen 00fc7c8e86 ImportEtherpad: Reject unknown DB records 2021-11-28 22:27:44 -05:00
Richard Hansen 8e9bc8d325 ImportEtherpad: Avoid false positives when checking apool 2021-11-28 19:00:44 -05:00
Richard Hansen 003e5cbd4b ImportEtherpad: Fix DB key pad ID transformation 2021-11-28 19:00:44 -05:00
Richard Hansen fea7948b05 ImportEtherpad: Fix author info processing 2021-11-28 19:00:44 -05:00
Richard Hansen 2f0561abc0 ImportEtherpad: Remove unnecessary variable 2021-11-25 18:39:07 -05:00
Richard Hansen 9bc90128cb ImportEtherpad: Fix async logic 2021-11-25 18:39:07 -05:00
Richard Hansen 91e99c84ca import: Reduce log spam from unsupported elements 2021-04-09 18:43:02 +02:00
Richard Hansen 09c349e2a1 import: Use a Set for supported elements 2021-04-09 18:43:02 +02:00
John McLear f95b09e0b6
Import: Import don't show warnings for supported elements 2021-03-02 17:14:47 +00:00
John McLear 7352dc7571 lint: ImportEtherpad.js 2021-02-21 21:09:02 -05:00
John McLear ee2b32281c
pluginfw: Warn plugins on missing plugin (#4826)
* pluginfw: Warn plugins on missing plugin

Add functionality to console.warn when a plugin is missing.  This will help admins know when people are trying to use plugins that are missing.  Resolves https://github.com/ether/etherpad-lite/issues/4730

* pluginfw: importing .etherpad can notify admins of missing plugins

Extending .etherpad imports to notify admins if a missing plugin is present

* Update ImportEtherpad.js
2021-02-21 11:07:13 +00:00
John McLear a41b4b8e45 lint: src/node/utils/ImportEtherpad.js 2021-01-25 22:53:11 -05:00
Richard Hansen 8e5fd19db2 lint: Run `eslint --fix` on `src/` 2020-11-24 20:06:12 +00:00
Richard Hansen 7df3ded66f lint: Put opening brace on same line as `function`
Normally I would let `eslint --fix` do this for me, but there's a bug
that causes:

    const x = function ()
    {
      // ...
    };

to become:

    const x = ()
    => {
      // ...
    };

which ESLint thinks is a syntax error. (It probably is; I don't know
enough about the automatic semicolon insertion rules to be confident.)
2020-11-24 20:06:12 +00:00
Richard Hansen 6a8563eeab import/export: Simplify exportEtherpadAdditionalContent processing
Also:
  * Improve parallelization
  * Refine the documentation
2020-11-10 23:02:43 +00:00
John McLear 3fa58efede
pluginfw: Export .etherpad hooks (#4466)
* export support

* proper prefix

* just a basic example, needs working on still

* docs

* comments shouldnt be hard coded
2020-11-06 13:48:25 +00:00
Ray Bellis 62345ac8f7 import/export: conversion to Promises/async
NB1: needs additional review and testing - no abiword available on my test bed
NB2: in ImportHandler.js, directly delete the file, and handle the eventual
     error later: checking before for existence is prone to race conditions,
     and does not handle any errors anyway.
2019-01-31 08:55:36 +00:00
Ray Bellis 5ef4a2d1d5 more thenify in node/utils/* 2019-01-22 17:30:33 +00:00
muxator 9497ee734f prepare to async: trivial reformatting
This change is only cosmetic. Its aim is do make it easier to understand the
async changes that are going to be merged later on. It was extracted from the
original work from Ray Bellis.

To verify that nothing has changed, you can run the following command on each
file touched by this commit:
  npm install uglify-es
  diff --unified <(uglify-js --beautify bracketize <BEFORE.js>) <(uglify-js --beautify bracketize <AFTER.js>)



This is a complete script that does the same automatically (works from a
mercurial clone):

```bash
#!/usr/bin/env bash

set -eu

REVISION=<THIS_REVISION>

PARENT_REV=$(hg identify --rev "${REVISION}" --template '{p1rev}')
FILE_LIST=$(hg status --no-status --change ${REVISION})
UGLIFYJS="node_modules/uglify-es/bin/uglifyjs"

for FILE_NAME in ${FILE_LIST[@]}; do
  echo "Checking ${FILE_NAME}"
  diff --unified \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${PARENT_REV}" "${FILE_NAME}")) \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${REVISION}"   "${FILE_NAME}"))
done
```
2019-02-08 23:20:57 +01:00
Tom Hunkapiller a896d67e8c make setPadRaw async; streamline .etherpad file import handling chain 2015-04-11 12:02:19 -05:00
John McLear d5bec1701e fix export of bad pads and also limit import to files 2015-02-21 12:33:30 +00:00
John McLear cb65224997 better logic for author handling 2015-01-21 00:28:00 +00:00
John McLear ac4f9eb4ce licensing 2014-12-30 00:12:26 +01:00
John McLear 0676d2fe24 working author import 2014-12-30 00:01:15 +01:00
John McLear 1e0de620be more author logic 2014-12-29 23:08:17 +01:00
John McLear a6400b3f61 allow only for pads less than 10 to be overwritten 2014-12-29 22:02:24 +01:00
John McLear 1081156f13 whoopsi, required files 2014-12-29 21:13:49 +01:00