Skip to content

Commit

Permalink
Merge upstream 2.2.4 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek authored Sep 17, 2024
1 parent 19020bb commit 5112328
Show file tree
Hide file tree
Showing 31 changed files with 2,218 additions and 1,224 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
types: [published]
push:
branches:
- 'merge-upstream-2.2.2-dev'
- 'merge-upstream-2.2.4'

env:
REGISTRY: ghcr.io
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 2.2.4

### Notable enhancements and fixes

- Switched to new SQLite backend
- Fixed rusty-store-kv module not found


# 2.2.3

### Notable enhancements and fixes

- Introduced a new in process database `rustydb` that represents a fast key value store written in Rust.
- Readded window._ as a shortcut for getting text
- Added support for migrating any ueberdb database to another. You can now switch as you please. See here: https://docs.etherpad.org/cli.html
- Further Typescript movements
- A lot of security issues fixed and reviewed in this release. Please update.


# 2.2.2

### Notable enhancements and fixes
Expand Down
18 changes: 9 additions & 9 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "admin",
"private": true,
"version": "2.2.2",
"version": "2.2.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -16,25 +16,25 @@
"devDependencies": {
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-toast": "^1.2.1",
"@types/react": "^18.3.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.2.25",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.9.0",
"eslint": "^9.9.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.10",
"eslint-plugin-react-refresh": "^0.4.11",
"i18next": "^23.14.0",
"i18next-browser-languagedetector": "^8.0.0",
"lucide-react": "^0.429.0",
"lucide-react": "^0.439.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.52.2",
"react-hook-form": "^7.53.0",
"react-i18next": "^15.0.1",
"react-router-dom": "^6.26.1",
"socket.io-client": "^4.7.5",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite": "^5.4.3",
"vite-plugin-static-copy": "^1.0.6",
"vite-plugin-svgr": "^4.2.0",
"zustand": "^4.5.5"
Expand Down
83 changes: 83 additions & 0 deletions bin/migrateDB.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// DB migration
import {readFileSync} from 'node:fs'
import {Database, DatabaseType} from "ueberdb2";
import path from "node:path";
const settings = require('ep_etherpad-lite/node/utils/Settings');


// file1 = source, file2 = target
// pnpm run migrateDB --file1 <db1.json> --file2 <db2.json>
const arg = process.argv.slice(2);

if (arg.length != 4) {
console.error('Wrong number of arguments!. Call with pnpm run migrateDB --file1 source.json target.json')
process.exit(1)
}

type SettingsConfig = {
dbType: string,
dbSettings: any
}

/*
{
"dbType": "<your-db-type>",
"dbSettings": {
<your-db-settings>
}
}
*/

let firstDBSettingsFile: string
let secondDBSettingsFile: string


if (arg[0] == "--file1") {
firstDBSettingsFile = arg[1]
} else if (arg[0] === "--file2") {
secondDBSettingsFile = arg[1]
}

if (arg[2] == "--file1") {
firstDBSettingsFile = arg[3]
} else if (arg[2] === "--file2") {
secondDBSettingsFile = arg[3]
}



const settingsfile = JSON.parse(readFileSync(path.join(settings.root,firstDBSettingsFile!)).toString()) as SettingsConfig
const settingsfile2 = JSON.parse(readFileSync(path.join(settings.root,secondDBSettingsFile!)).toString()) as SettingsConfig

console.log(settingsfile2)
if ("filename" in settingsfile.dbSettings) {
settingsfile.dbSettings.filename = path.join(settings.root, settingsfile.dbSettings.filename)
console.log(settingsfile.dbType + " location is "+ settingsfile.dbSettings.filename)
}

if ("filename" in settingsfile2.dbSettings) {
settingsfile2.dbSettings.filename = path.join(settings.root, settingsfile2.dbSettings.filename)
console.log(settingsfile2.dbType + " location is "+ settingsfile2.dbSettings.filename)
}

const ueberdb1 = new Database(settingsfile.dbType as DatabaseType, settingsfile.dbSettings)
const ueberdb2 = new Database(settingsfile2.dbType as DatabaseType, settingsfile2.dbSettings)

const handleSync = async ()=>{
await ueberdb1.init()
await ueberdb2.init()

const allKeys = await ueberdb1.findKeys('*','')
for (const key of allKeys) {
const foundVal = await ueberdb1.get(key)!
await ueberdb2.set(key, foundVal)
}
}

handleSync().then(()=>{
console.log("Done syncing dbs")
}).catch(e=>{
console.log(`Error syncing db ${e}`)
})


13 changes: 7 additions & 6 deletions bin/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "bin",
"version": "2.2.2",
"version": "2.2.4",
"description": "",
"main": "checkAllPads.js",
"directories": {
"doc": "doc"
},
"dependencies": {
"axios": "^1.7.5",
"axios": "^1.7.7",
"ep_etherpad-lite": "workspace:../src",
"log4js": "^6.9.1",
"semver": "^7.6.3",
"tsx": "^4.17.0",
"ueberdb2": "^4.2.93"
"tsx": "^4.19.0",
"ueberdb2": "^4.2.103"
},
"devDependencies": {
"@types/node": "^22.4.2",
"@types/node": "^22.5.4",
"@types/semver": "^7.5.8",
"typescript": "^5.5.4"
},
Expand All @@ -34,7 +34,8 @@
"stalePlugins": "node --import tsx ./plugins/stalePlugins.ts",
"checkPlugin": "node --import tsx ./plugins/checkPlugin.ts",
"plugins": "node --import tsx ./plugins.ts",
"generateChangelog": "node --import tsx generateReleaseNotes.ts"
"generateChangelog": "node --import tsx generateReleaseNotes.ts",
"migrateDB": "node --import tsx migrateDB.ts"
},
"author": "",
"license": "ISC"
Expand Down
1 change: 0 additions & 1 deletion bin/push-after-release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#!/bin/bash

# Specify the path to your package.json file
Expand Down
18 changes: 5 additions & 13 deletions doc/api/editbar.adoc
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Editbar

Located in `src/static/js/pad_editbar.js`
== Editbar
src/static/js/pad_editbar.js

=== isEnabled()

If the editorbar contains the class `enabledtoolbar`, it is enabled.


## disable()

Disables the editorbar. This is done by adding the class `disabledtoolbar` and removing the enabledtoolbar

## toggleDropDown(dropdown)
=== disable()

=== toggleDropDown(dropdown)
Shows the dropdown `div.popup` whose `id` equals `dropdown`.

## registerCommand(cmd, callback)

=== registerCommand(cmd, callback)
Register a handler for a specific command. Commands are fired if the corresponding button is clicked or the corresponding select is changed.

=== registerAceCommand(cmd, callback)
Expand Down
44 changes: 22 additions & 22 deletions doc/api/embed_parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,65 @@ Cut and paste the following code into any webpage to embed a pad. The parameters
<iframe src='http://pad.test.de/p/PAD_NAME#L4?showChat=false&showLineNumbers=false' width=600 height=400></iframe>
----

## showLineNumbers
* Boolean
=== showLineNumbers
* Boolean

Default: true

## showControls
* Boolean
=== showControls
* Boolean

Default: true

## showChat
* Boolean
=== showChat
* Boolean

Default: true

## useMonospaceFont
* Boolean
=== useMonospaceFont
* Boolean

Default: false

## userName
* String
=== userName
* String

Default: "unnamed"

Example: `userName=Etherpad%20User`

## userColor
* String (css hex color value)
=== userColor
* String (css hex color value)

Default: randomly chosen by pad server

Example: `userColor=%23ff9900`

## noColors
* Boolean
=== noColors
* Boolean

Default: false

## alwaysShowChat
* Boolean
=== alwaysShowChat
* Boolean

Default: false

## lang
* String
=== lang
* String

Default: en

Example: `lang=ar` (translates the interface into Arabic)

## rtl
* Boolean
=== rtl
* Boolean

Default: true
Displays pad text from right to left.

## #L
* Int
=== #L
* Int

Default: 0
Focuses pad at specific line number and places caret at beginning of this line
Expand Down
Loading

0 comments on commit 5112328

Please sign in to comment.