Commit graph

3384 commits

Author SHA1 Message Date
John McLear
8deac52c84 tests: include mocha froth in package lock and better syntax for package.json 2020-06-01 16:35:38 +00:00
John McLear
dc11b85e62
tests: fuzzing, binary imports 2020-06-01 17:26:55 +01:00
Chocobozzz
59b1a2d5e0
performance: add template cache for quicker page renders 2020-06-01 15:00:47 +01:00
John McLear
7273778e5f doh, recommit package-lock 2020-05-30 18:40:44 +00:00
John McLear
add3b23f66 tests: load testing into core 2020-05-30 18:17:33 +00:00
John McLear
2011c24f57
editor: Don't restrict plugins from being able to bring in newline content
#2412 broke this, it was discovered in https://github.com/JohnMcLear/ep_copy_paste_images/issues/20.

The limitation means that images can't be pasted within lists which IMHO is fine.  I could refine this down to OL only but I think images within lists would be fine not to include.
2020-05-29 16:53:08 +01:00
John McLear
00b6a1d9fe
Remove top console logs to stop hosted iFrames being broken. 2020-05-29 12:56:03 +01:00
John McLear
b2a723e57f
editor: Don't allow edits during reconnecting
Not the best fix but better than the current status quo.
2020-05-29 12:35:00 +01:00
John McLear
40f36d7eb5
Tests: ShowChat fix (#4049)
Resolves https://github.com/ether/etherpad-lite/issues/3541
2020-05-28 15:18:13 +01:00
John McLear
bcdb331c79
tests: Embed test fix (#4020)
* quick fix for iframe code wihch someone broke

* Also fix cookie test
2020-05-27 16:54:20 +01:00
translatewiki.net
66a43646a7 Localisation updates from https://translatewiki.net. 2020-05-26 17:05:30 +02:00
Daniel Krol
f79b50d311
Remove superfluous semicolon (#4037) 2020-05-21 16:43:15 +01:00
Daniel Krol
61c7bb9699
feat(i18n) Custom i18n strings (#4000)
* Custom i18n strings (and some code formatting)

* Documentation for per-instance l10n overwrites
2020-05-19 13:21:31 +01:00
translatewiki.net
170f471299 Localisation updates from https://translatewiki.net. 2020-05-18 16:03:29 +02:00
Richard Hansen
901a3f396e Revert "SessionStore: replace password with PASSWORD_HIDDEN when storing in db"
This reverts commit 53f126082a, which
broke user authentication.

Fixes issue #4016.
Reopens issue #3421.
2020-05-17 13:00:17 +02:00
muxator
4644e7a127 dependencies: update cookie-parser 1.4.4 -> 1.4.5 2020-05-15 13:09:56 +02:00
muxator
7ea85cbb03 dependencies: update wd 1.11.4 -> 1.12.1
This is a dev dependency. No impact in production.
2020-05-15 13:09:56 +02:00
muxator
026675170d dependencies: update mocha 7.1.1 -> 7.1.2
This is a dev dependency. No impact in production.
2020-05-15 13:09:56 +02:00
muxator
9da53707e4 dependencies: update nyc 15.0.0 -> 15.0.1
This is a dev dependency. No impact in production.
2020-05-15 13:09:56 +02:00
muxator
b5cf3cf718 dependencies: update request 2.88.0 -> 2.88.2 2020-05-15 13:09:56 +02:00
muxator
14b0c3a7bd dependencies: update express-session 1.17.0 -> 1.17.1 2020-05-15 13:09:56 +02:00
muxator
3e9def7017 dependencies: update graceful-fs 4.2.2 -> 4.2.4 2020-05-15 13:09:56 +02:00
muxator
738d573cc3 package-lock: regenerated with integrity-checked dependencies 2020-05-15 13:09:56 +02:00
muxator
7403a46d2e dependencies: update npm 6.14.4 -> 6.14.5 2020-05-15 13:09:56 +02:00
muxator
4365598658 release: prepare for 1.8.4 2020-05-15 02:09:18 +02:00
muxator
37abb21a55 minify: rebase relative urls in imported files.
4177b3f943 moved the font-face declarations from src/static/css/pad.css to two
imported files (src/static/css/pad/fonts.css, src/static/css/pad/toolbar.css)
in a different directory.

This results in the font files being invoked from CSSes residing in different
directories in the minified and un-minified case. URLs in the src attribute are
relative to the stylesheet path [0], and so we have to start requiring clean-css
to rebase them.

Before this change, the non minified casse worked by chance, because there were
a lot of "..", which ended up resolving to the root of the site anyways.

Fixes #3956

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src
2020-05-15 01:29:13 +02:00
muxator
6dd9e9adc8 assets: also use cache busting via query string in files imported from acs.js
Before this change, a client would require two versions of the same assets (with
and without randomVersionString), wasting resources and triggering all sorts of
hard to debug inconsistencies.

This change should have been part of 95fd5ce2a4 and completes it.
2020-05-15 01:29:13 +02:00
Sebastian Castro
d1d8a0ad6d gritter: remove close button added by external plugin
We now already have a functional close button
2020-05-15 01:08:40 +02:00
Sebastian Castro
17d09d2466 css: add missing text color for editorcontainer
Now the content inside the editorcontainer will be correctly colored, like for
example table of content.
2020-05-15 01:08:40 +02:00
Sebastian Castro
c8bf643c4e colibris: adds minimum height for scrollbar
Otherwise when there is a lot of content, the scrollbar thumb is too small
2020-05-15 01:08:40 +02:00
Sebastian Castro
ac850bfd47 css: fix wrapping, using normal white space and break-word
Wrong config was causing copy paste to lose style attributes, and ep_align
justify to not work properly.
2020-05-15 01:08:40 +02:00
Sebastian Castro
08930fae05 ui: add margin for titles
No margin-top, because as title tags are contained inside magic-dom divs, all
the margin apply (they are not merged as usual).

Move some colibris rules into the skin independent rules.
2020-05-15 01:08:40 +02:00
Sebastian Castro
373932a1df ui: prevent select value to overflow container 2020-05-15 01:08:40 +02:00
Sebastian Castro
4c8f60634e ui: use gritter to display error messages nicely (instead of loading box) 2020-05-15 01:08:40 +02:00
Sebastian Castro
95fd5ce2a4 assets: add random string to query string to bust cache on restart and deploys
After each Eterpad restart, the clients will request a new version of the
static assets, even if they are not modified. This is the price we pay for
knowing that no stale files are going to be served ever again. We could also
have used a salted hash of the Etherpad version, but we chose the simpler way.

For the rationale behind using a random string at each restart, see #3958.

ACHTUNG: this may prevent caching HTTP proxies to work.

Closes #3955.
2020-05-13 18:58:26 +02:00
Alex
fda0d2884e iframe attribute: move quote 2020-05-13 18:51:09 +02:00
translatewiki.net
253545712e Localisation updates from https://translatewiki.net. 2020-05-11 17:36:12 +02:00
translatewiki.net
77b64bc4bc Localisation updates from https://translatewiki.net. 2020-05-07 17:08:23 +02:00
muxator
5f686a8acb
ueberdb: update 0.4.5 -> 0.4.9 to fix a performance regression (#3975) 2020-05-07 11:57:42 +01:00
Sebastian Castro
82d1179f24 timeslider: important fix pad content was cropped when bigger than screen size 2020-05-05 12:54:11 +02:00
translatewiki.net
c7e86d38ff Localisation updates from https://translatewiki.net. 2020-05-04 15:50:46 +02:00
Sebastian Castro
88dccfe7ce ui: remove no more needed css code for ep_author_neat
This is the last change in PR #3957.
Closes #3954.
2020-05-03 22:36:14 +02:00
Sebastian Castro
9587c1c673 ui: change a bit the architecture of sidediv line number
So we can easily customize with plugins, such as ep_author_neat
2020-05-03 22:36:14 +02:00
Sebastian Castro
a522db3ef4 colibris: do not color link with primary color when author color are on
Change link color to blue
Still color the link the authorship have been cleared
closes #3960
2020-05-03 22:36:14 +02:00
Sebastian Castro
ff1191d24a toolbar: display the "+" icon to show all buttons only on mobile layout
Otherwise the "+" button is displayed on top of the menu_right toolbar
2020-05-03 22:36:14 +02:00
Sebastian Castro
f768e32373 ui: apply mobile layout if screen width < 800px instead of < 720px
Some mobile get large screen now, and also if using a small window on desktop better adapt the visual using mobile layout
2020-05-03 22:36:14 +02:00
Sebastian Castro
01c59b3b88 colibris: apply skin variants to set_title_on_pad 2020-05-03 22:36:14 +02:00
Sebastian Castro
15af63b0f8 ui: display editor only when it is ready
so it avoid strange ui effect when div get positioned
2020-05-03 22:36:14 +02:00
Sebastian Castro
d5020f53ab colibris: Fix index page font and colors 2020-05-03 22:36:14 +02:00
Sebastian Castro
af67f02da2 select: remove nice-select for safari because of a known bug with fixed position and overflow
Make the safari select looks the same than for other browser
Only the dropdown will be different
2020-05-03 22:36:14 +02:00
Sebastian Castro
23307d14d5 share: change default iframe size, and remove border
From 600*400 to 100%*600
2020-05-03 22:36:14 +02:00
Sebastian Castro
3ac816da2b colibris: gritter color always in white 2020-05-03 22:36:14 +02:00
Sebastian Castro
bd443a7f58 colibris: remove old styling for titles inside editor. Leave ep_headings manage it 2020-05-03 22:36:14 +02:00
muxator
9abc70e389 package-lock: update version field
This was reported in
5e6af287a5 (r38792267)
and should have been part of 5e6af287a5.
2020-05-02 00:16:35 +02:00
translatewiki.net
fe6828338b Localisation updates from https://translatewiki.net. 2020-04-30 16:48:33 +02:00
translatewiki.net
6f56830347 Localisation updates from https://translatewiki.net. 2020-04-27 16:45:06 +02:00
muxator
5e6af287a5 release: prepare for 1.8.3 2020-04-27 03:24:23 +02:00
John McLear
452db293b0 changeset.js: do not lose sync in the timeslider if another user deletes text
If a user deleted text/attributes while another one had the timeslider open,
the timeslider lost sync and spit out errors.

Fixes #3932.
2020-04-27 02:12:17 +02:00
muxator
7bdc9d8a57 dependencies: update npm 6.14.3 -> 6.14.4
For the first time in a VERY long time, we now have exactly 0 vulnerabilities
reported by npm audit.

=====
BEFORE:
$ npm audit

                       === npm audit security report ===

┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
    [...]
found 4 low severity vulnerabilities in 13796 scanned packages
  4 vulnerabilities require manual review. See the full report for details.

=====
AFTER:
$ npm audit

                       === npm audit security report ===

found 0 vulnerabilities
 in 13796 scanned packages
2020-04-26 23:13:10 +02:00
Chocobozzz
6cb78e51b0 pad.js: wait write callback instead of buffer callback 2020-04-26 04:14:19 +02:00
Chocobozzz
53003d4471 pad.js: fix freeze on pad deletion when it has many revisions 2020-04-26 04:14:19 +02:00
John McLear
09ddfb9e20 pad_impexp: close modal on succesful import 2020-04-21 15:03:09 +00:00
John McLear
de09b9a410 ace2_inner: reformatting, no functional changes 2020-04-21 15:02:58 +00:00
John McLear
c9a9b7ae42 pad.js: in switchToPad() remove the first iframe before loading the pad
This is an old bug: after an import there were always two iframes with
duplicated content, and the last one was simply on top of the old one.

This bug was there since forever, and became evident when the layout was
migrated to Flexbox.
2020-04-26 03:31:02 +02:00
Luke Williams
a471dbeebf html10n: do a lax match between the Accept-Language header and available locales
Before this change, we simply generated an error.

For example:
- if the browser sent 'ru-RU', but Etherpad has 'ru' available, select 'ru';
- if the browser sent 'zh', but we have 'zh-hans' available, use 'zh-hans'.

Fixes #3882.
2020-04-26 03:07:01 +02:00
Sebastian Castro
e8cd83286d
css: fix timeslider toolbar on mobile when multiple authors are displayed (#3933) 2020-04-24 20:56:30 +01:00
muxator
01497aa399 SecurityManager: clarify the role of the token parameter (and cookie)
"token" is a random token representing the author, of the form
t.randomstring_of_lenght_20. The random string is generated by the client. The
cookie is used for every pad in the web UI, and is not used for HTTP API.

This comes from the discussion at https://github.com/ether/etherpad-lite/issues/3563
2020-04-24 02:55:20 +02:00
muxator
1bd595fdc7 ace2_inner: prefix all logging statements: "console.*" -> "top.console.*"
For reference, see:
https://github.com/ether/etherpad-lite/pull/3915#issuecomment-617681463
2020-04-22 22:19:40 +02:00
Sebastian Castro
789dd7acd6 skin builder: add coma at the end of the generated code
Closes #3919
2020-04-22 22:02:25 +02:00
John McLear
208c7a849c pad.html: UI telling the user that a contribution is required before importing
This commit is an integration to 24ee37a38f.
2020-04-22 21:12:49 +02:00
John McLear
c6cb253f76 ImportHandler: UI for showing maxFileSize error on import
This commit is an integration to f4418149cb.
2020-04-14 10:02:21 +00:00
John McLear
53d8e32ecb messages: "install AbiWord" -> "install AbiWord or LibreOffice" 2020-04-14 09:43:21 +00:00
John McLear
ffa7244e81 ace2_inner: close all gritters when hitting escape key 2020-04-22 01:51:59 +02:00
Sebastian Castro
51d924c1f8
css: Fix last commit overflow should not apply to inner-editors (#3914)
* css: Fix last commit overflow should not apply to inner-editors

* css: hide toolbar popup and nice-select when clicking on pad
2020-04-21 22:46:54 +01:00
Luke Williams
7ec3be640b specialpages: do not set a language cookie if the browser did not send one
In this way, if the browser sends a list of preferred languages via
Accept-Language HTTP header, Etherpad will honor that.

Before this change, Etherpad always forced on the user the language from
padOptions.lang in settings.json.

This reverts a feature that was introduced in 295672f598.
2020-04-19 19:56:16 +02:00
Sebastian Castro
cb785590bc
css: some fix for browser compatibility refs #3907 (#3913) 2020-04-21 14:33:53 +01:00
muxator
9882362e2e settings: clarify that null defaults are supported, using the syntax "${VAR_NAME}"
Using "${VAR_NAME:null}", instead, would define the literal string "null".
2020-04-21 04:44:56 +02:00
translatewiki.net
68ff6d497d Localisation updates from https://translatewiki.net. 2020-04-20 16:52:37 +02:00
Sebastian Castro
84d82b506b
css: Fix some problems with new UI refs #3907 (#3908)
* css: Fix sidedivinner padding  creating ui problems refs #3907

* css: Fix colorpicker for mobile
2020-04-20 14:51:02 +01:00
Sebastian Castro
4ceb42603e
css: Fixes #3900 innerdocbodyu Layout broken for safari (#3906) and other browsers 2020-04-20 09:47:52 +01:00
Gabriel Augusto Almeida
da0ea3a29d tests: avoid ERR_TOO_MANY_REDIRECTS on frontend tests under Windows
If Etherpad is hosted on Windows the frontend test URI needs to be
/tests/frontend/index.html (docs say .../frontend/), otherwise there is this
error: ERR_TOO_MANY_REDIRECTS.

Fixes #3804.
2020-04-20 01:48:23 +02:00
John McLear
51e40ddbc9 ace2_inner: when atext.text is "", replace with "\n"
The server is fine with atext.text being an empty string, but the front end is
not, and crashes.

It is not clear if this is a problem in the server or in the client code, and
this is a client-side hack fix. The underlying problem needs to be
investigated.

See for reference:
- https://github.com/ether/etherpad-lite/issues/3861
2020-04-20 00:49:50 +02:00
Sebastian Castro
70990afd66 Change favicon to be closer to new style 2020-04-19 18:20:21 +02:00
muxator
48b0290977 AbsolutePaths: be able to read the git commit version independently on CWD
--HG--
branch : absolute-paths
2020-04-19 04:51:50 +02:00
muxator
72ccb28382 AbsolutePaths: initial work to allow Etherpad to be run without changing CWD
With this change, it is no longer necessary to "cd" to the Etherpad base
directory to start it: Etherpad runs from everywhere.

Known issues:
- unless the program is started as before (CWD == base directory) it is still
  not possible to install & uninstall plugins via the web interface

--HG--
branch : absolute-paths
2020-04-19 04:51:50 +02:00
muxator
be3d158402 pad.html: use TLS for the "Powered by" link: http://etherpad.org -> https://etherpad.org 2020-04-19 03:24:47 +02:00
Sebastian Castro
03227e526f css: fix toolbar overlay so it cover only toolbar and not the whole screen
This allows to copy & paste the pad text even when disconnected.
2020-04-19 03:03:44 +02:00
Sebastian Castro
4593c4be7c users: remove hardcoded color for editempty. Use opacity instead 2020-04-19 03:03:44 +02:00
Sebastian Castro
cbd9378908 colibris: full-width-editor fix padding property which was overwritten 2020-04-19 03:03:44 +02:00
Sebastian Castro
22f7e1fd36 colibris: small improvement on chat and sidediv 2020-04-19 03:03:44 +02:00
Sebastian Castro
b06324ad80 css: improve gritters
- have two containers, one of the top, on of the bottom;
- remove gritting chat message when opening the chat.
2020-04-19 03:03:44 +02:00
Sebastian Castro
3e12b6d132 chat: fix coloring with dark background, and scrolling chattext when new message come in 2020-04-19 03:03:44 +02:00
Sebastian Castro
780eaad573 no-skin: fix toolbar icons position 2020-04-19 03:03:44 +02:00
Sebastian Castro
705b6c5e2e colibris: adds toolbar border when editor is scrolling 2020-04-19 03:03:44 +02:00
Sebastian Castro
f650d3a35a colibris: fixs skin variants background 2020-04-19 03:03:44 +02:00
Sebastian Castro
e2e5c7695b colibris: Fix skin variant builder after introducing nice-select 2020-04-19 03:03:44 +02:00
Sebastian Castro
621448b92f css: add default color/variable for browsers non supporting css variables 2020-04-19 03:03:44 +02:00
Sebastian Castro
6de996c973 css: various improvements 2020-04-19 03:03:44 +02:00
Sebastian Castro
02769bee44 css: simplify new theme and variants
make design simpler so it's less complex to implement
remove light-soft-color and dark-soft-color
2020-04-19 03:03:44 +02:00
Sebastian Castro
ca12287a26 pad_editor: fix manage show authorship on both pad and chat 2020-04-19 03:03:44 +02:00
Sebastian Castro
c5fdc6129e colibris: adjust commented text color 2020-04-19 03:03:44 +02:00
Sebastian Castro
2193875292 colibris: fix coloring text when authorship background color is activated #3641 2020-04-19 03:03:44 +02:00
Sebastian Castro
5e6ceb071e prevent sticky chat and chatAndUsers for mobile 2020-04-19 03:03:44 +02:00
Sebastian Castro
c945c57a87 css: use default cursor 2020-04-19 03:03:44 +02:00
Sebastian Castro
8a4de6c366 css: fix comment style 2020-04-19 03:03:44 +02:00
Sebastian Castro
0cbd178f95 css: small fixes 2020-04-19 03:03:44 +02:00
Sebastian Castro
8b6cfba639 css: simplify input coloring 2020-04-19 03:03:44 +02:00
Sebastian Castro
12da4f751f colibris: style ep_comments 2020-04-19 03:03:44 +02:00
Sebastian Castro
ce1e9672f9 css: style select with nice-select library 2020-04-19 03:03:44 +02:00
Sebastian Castro
21de2bf4a0 css: fix default skin after all the changes made to Colibris 2020-04-19 03:03:44 +02:00
Sebastian Castro
7fb086edbe css: Still some adjustements to handle all variants properly 2020-04-19 03:03:44 +02:00
Sebastian Castro
c6f5ced23c css: adds UI skin variants builder (only for colibris skin) 2020-04-19 03:03:44 +02:00
Sebastian Castro
cbc6304243 css: add chat animation on opening 2020-04-19 03:03:44 +02:00
Sebastian Castro
f5685f45c7 css: various improvements 2020-04-19 03:03:44 +02:00
Sebastian Castro
709e5d2233 colibris: introduce skin variants, in order to customize the rendering
This provide a nice way to change the colors of main containers from settings file. See comment inside settings for how it works
2020-04-19 03:03:44 +02:00
Sebastian Castro
913d5fd0d9 colibris: Improve table of content
Display it on the left to balance with comments and chat and user that can go on the right
2020-04-19 03:03:44 +02:00
Sebastian Castro
99d9752b0a css: introduce css variables in Colibris skin 2020-04-19 03:03:44 +02:00
Sebastian Castro
a89503a4dd css: style scroll bars 2020-04-19 03:03:44 +02:00
Sebastian Castro
71a3579ae7 css: fix broken popup colorpicker chatAndUsers 2020-04-19 03:03:44 +02:00
Sebastian Castro
eb0d8839c2 css: minor improvements 2020-04-19 03:03:44 +02:00
Sebastian Castro
281b7a2ab0 css: style checkboxes 2020-04-19 03:03:44 +02:00
Sebastian Castro
9497db89c9 css: fix popup broken by new animation
fix connectivity
fix chat and users
2020-04-19 03:03:44 +02:00
Sebastian Castro
9b60bb4d55 gritter: Improve animations
fix recently introduced bug by myself where all gritter were removed when first removed.
Display container at the top
2020-04-19 03:03:44 +02:00
Sebastian Castro
559a48221e css: Clear old comments code, we gonna write it from scratch 2020-04-19 03:03:44 +02:00
Sebastian Castro
6a5c35b651 css: layout, restrict innerdoc width instead of outerdoc width 2020-04-19 03:03:44 +02:00
Sebastian Castro
51b857ad1a css: minor improvements 2020-04-19 03:03:44 +02:00
Sebastian Castro
a5164dad43 fonts: improve default fonts & font picker
- change default font for colibris and for no-skin
- add roboto and quicksand font files
- simplify font picker: directly use the name of the font, and reduce their
  number
2020-04-19 03:03:44 +02:00
Sebastian Castro
fb5a65c5fc css: add normalizer, and fix previous rules
Some old rules was build with box-sizing: content-box. Switching now to border-box change how containers are calculated
2020-04-19 03:03:44 +02:00
Sebastian Castro
ae1a2531f8 css: upgrade icons to fontawesome 5 2020-04-19 03:03:44 +02:00
Sebastian Castro
8a9300866b css: make box-sizing border-box by default everywhere 2020-04-19 03:03:44 +02:00
Sebastian Castro
2dc4cfdfe1 css: improve popup opening animation 2020-04-19 03:03:44 +02:00
Sebastian Castro
a5d461f25f css: minor improvements 2020-04-19 03:03:44 +02:00
Sebastian Castro
6d586a21b3 colibris: clean no more used code since refactor 2020-04-19 03:03:44 +02:00
Sebastian Castro
b5543d65be mobile: fix colibris skin 2020-04-19 03:03:44 +02:00
Sebastian Castro
d3d8cca947 mobile: timeslider and small adjustements 2020-04-19 03:03:44 +02:00
Sebastian Castro
146bece0f1 css: fix colorpicker 2020-04-19 03:03:44 +02:00
Sebastian Castro
b94019e99e mobile: fix toolbar popup 2020-04-19 03:03:44 +02:00
Sebastian Castro
1d927854a4 mobile: ability to display hidden toolbar buttons 2020-04-19 03:03:44 +02:00
Sebastian Castro
d6aec95684 colibris: improve toolbar 2020-04-19 03:03:44 +02:00
Sebastian Castro
c79ad1e504 css: fix Colibris timeslider 2020-04-19 03:03:44 +02:00
Sebastian Castro
f3fcbf2653 css: refactor timeslider
- simplify template
- use flexboxes
- simplify javascript code
- remove some obsolete code adjusting a background-position when using steppers buttons
- add comments and remove old code
2020-04-19 03:03:44 +02:00
Sebastian Castro
41d67b9fa3 css: disable changing opacity of chatbox when writing on bottom of page 2020-04-19 03:03:44 +02:00
Sebastian Castro
e041099d1b fix colibris skin after refactor 2020-04-19 03:03:44 +02:00
Sebastian Castro
a482a94fb8 css: improve gritter
- rename DOM wrapper because is was blacklisted by some ad blocker
- make the template and the lib to add gritter more simple (remove unused
  option, make template simpler)
- add style for gritter error message
2020-04-19 03:03:44 +02:00
muxator
c0d9797d0f formatting: remove trailing whitespaces on files Sebastian is going to modify
In the following commits Sebastian is going to edit three files. This change is
necessary make evident what he is going to modify, because some of them are old
vendorized libraries whose history we might want to reconstruct.

No functional changes.

Command:
    sed --in-place 's/[[:space:]]*$//' src/static/js/farbtastic.js
    sed --in-place 's/[[:space:]]*$//' src/static/js/gritter.js
    sed --in-place 's/[[:space:]]*$//' tests/frontend/specs/change_user_color.js
2020-04-19 03:03:44 +02:00
Sebastian Castro
082906ace2 css: Improve toolbar icon positionning 2020-04-19 03:03:44 +02:00
Sebastian Castro
8e467ce9aa css: add new icons (mic, video, mic slash, video slash, cancel)
Fix icon spin animation for popup "reconnecting to your pad"
2020-04-19 03:03:44 +02:00
Sebastian Castro
0923cd3f21 css: make all editor containers use the same background color 2020-04-19 03:03:44 +02:00
Sebastian Castro
e0f63a4a14 css: add skin scrollbar 2020-04-19 03:03:44 +02:00
Sebastian Castro
5fd6aeeea6 css: refactor element positioning
No more javascript to change css properties
Remove a number of useless tables
Try to stop positioning elements with absolute, but use flex-boxes instead

Adds comment to pad template, and move popups and chatbox inside editorcontainerbox (so absolute positioning is straightforward)

Make the design more consistent: always use base color, font-family and font-size. USe relative font size if necessary (.9rem instead of 11px for example)

Remove two columns in the popups, just use one column

Remove css meant to support old browser (like -webkit-box-shadow, -moz-box-shadow). Those css rules are quite common now, and If we want to support very old browser, we should use clean-css or other tools to add them automatically
2020-04-19 03:03:44 +02:00
Sebastian Castro
0603bf8097 css: remove no more used element
#nootherusers, #chatthrob, #focusprotector, #mystatusform, .hotrect, .throbbold
2020-04-19 03:03:44 +02:00
Sebastian Castro
4177b3f943 css: split base CSS code into subfiles (without modifications) 2020-04-19 03:03:44 +02:00
muxator
0b0608d7d4 skins: use "colibris" as default, even when no settings.json is present
Starting with Etherpad 1.8.3 we decided to use Colibris as default skin for new
installs. Without this change, when starting with no settings.json file,
Etherpad would (wrongly) use "no-skin".

This change should have been part of 70bc71c0c3.
2020-04-19 02:58:35 +02:00
translatewiki.net
b2aa0881af Localisation updates from https://translatewiki.net. 2020-04-16 17:06:58 +02:00
Christian Schröder
f0fdb94eb0 PadMessageHandler: fix for scoping error hiding original error
`r` is undefined outside of the for loop, but used in the catch block of the try
statement
2020-04-16 02:58:47 +02:00
translatewiki.net
4ddcaefed2 Localisation updates from https://translatewiki.net. 2020-04-14 05:23:20 +02:00
John McLear
c9d55c81a3 import/export: always rate limit import and exports
This is a departure from previous versions, which did not limit import/export
requests. Now such requests are ALWAYS rate limited. The default is 10 requests
per IP each 90 seconds, and also applies to old instances upgraded to 1.8.3.

Administrators can tune the parameters via settings.importExportRateLimiting.
2020-04-14 03:36:13 +02:00
John McLear
24ee37a38f import: do not allow importing into a pad from the web UI if the user is not on that pad
Importing to a pad is allowed only if an author has a session estabilished and
has already contributed to that specific pad. This means that as long as the
user is on the pad (via the browser) then import is possible.

Note that an author session is NOT the same as a group session, which is not
required.

This setting does not apply to API requests, only to /p/$PAD$/import

This change of behaviour is introduced in Etherpad 1.8.3, and cannot be
disabled.
2020-04-14 03:36:13 +02:00
John McLear
f4418149cb import: introduce importMaxFileSize setting. Defaults to 50 MB
From Etherpad 1.8.3 onwards, the maximum allowed size for a single imported
file will always be bounded.

The maximum allowed size can be configured via importMaxFileSize.
2020-04-14 03:36:13 +02:00
muxator
d1ad29a3d1 importexport: improved logging
This is in preparation to the next activities about import/export securization.
2020-04-14 03:36:13 +02:00
muxator
44186edbc5 tests: remove loadSettings.js for backend tests.
The old loadSettings.js was a way of customizing settings upon load, because
the Settings module did not offer this functionality. But it did not work well,
since all the default settings were not loaded.

Let's get rid of loadSettings.js for the bulk of the tests (the "backend"
specs). For the "container" specs, we'll keep it in place until/if we rewrite
Settings.js making it less brittle.
2020-04-14 03:36:13 +02:00
muxator
419f17371c dependencies: upgrade openapi 2.4.0 -> 2.4.1 2020-04-14 03:05:39 +02:00
muxator
02211cb670 dependencies: updated package-lock.json
No changes at all on our side: this is the churn of all the transitive
dependencies that are not pinned, and bubble up here.
2020-04-14 03:04:22 +02:00
muxator
cd28643604 express: document the effect of settings.trustProxy 2020-04-14 01:10:19 +02:00
muxator
83d72d27a4 scroll: replace absolute import with relative one
Fixing this will be useful when we'll want to get rid of require-kernel.

This was introduced by f1fcd16894 ("Add settings to scroll on edition out of
viewport") in 2018-01-03.
2020-04-09 21:09:40 +02:00
translatewiki.net
4699c3e22e Localisation updates from https://translatewiki.net. 2020-04-09 16:00:27 +02:00
muxator
684f374ece runtime: require node >= 10.13.0 LTS
At the moment, NodeJS 10.x is the lowest supported LTS version. NodeJS 8.x is no
longer supported upstream.

Implements #3835.
Planned in #3650.
2020-04-09 04:43:37 +02:00
Chocobozzz
963d12e614 PadManager: use a set instead of an array in padlist
Avoid looping on the array, especially useful if you have many pads.

--HG--
branch : padlist-use-set
2020-04-09 03:39:32 +02:00
Chocobozzz
94ff21e25c PadManager: anchor the addPad regex to the start of the string
This improves the performance a bit, and is more adherent to the logic of the
application.

--HG--
branch : padlist-use-set
2020-04-09 03:39:32 +02:00
Marcin Cieślak
df08883a00 SecurityManager: remove double quotes from session cookie content
Sometimes, RFC 6265-compliant [0] web servers may send back a cookie whose value
is enclosed in double quotes, such as:

    Set-Cookie: sessionCookie="s.37cf5299fbf981e14121fba3a588c02b,s.2b21517bf50729d8130ab85736a11346"; Version=1; Path=/; Domain=localhost; Discard

Where the double quotes at the start and the end of the header value are just
delimiters. This is perfectly legal: Etherpad parsing logic should cope with
that, and remove the quotes early in the request phase.

Somehow, this does not happen, and in such cases the actual value that
sessionCookie ends up having is:

    sessionCookie = '"s.37cf5299fbf981e14121fba3a588c02b,s.2b21517bf50729d8130ab85736a11346"'

As quick measure, let's strip the double quotes (when present).
Note that here we are being minimal, limiting ourselves to just removing quotes
at the start and the end of the string.

Fixes #3819.
Also, see #3820.


[0] https://tools.ietf.org/html/rfc6265
2020-04-09 01:14:51 +02:00
John McLear
08b83ae358 LibreOffice: use "html:XHTML Writer File:UTF8" export method
This yields better conversion results, but requires the previous change,
otherwise there would have been difficulties in locating the temporary file
name.
2020-04-08 22:51:25 +02:00
John McLear
b2ccd0a191 LibreOffice: decouple the extension of the temporary file from its type
In the next commit, we are going to change the conversion method to
"html:XHTML Writer File:UTF8". Without this change, that conversion method name
would end up in the extension of the temporary file that is created as an
intermediate step. In this way, the file extensione will always stay ".html".

No functional changes, hopefully. Only the extension of the temporary file
should change.
2020-04-08 22:51:25 +02:00
John McLear
f6907c5fad contentcollector: remove weird stuff LibreOffice adds to DOM before importing 2020-04-08 22:51:25 +02:00
John McLear
a371deb9d1 ImportHandler: quick & dirty way of being more lax when matching <title>
This change is meant to ease using LibreOffice as converter. When LibreOffice
converts a file, it adds some classes to the <title> tag.
This is a quick & dirty way of matching the <title> and comment it out
independently on the classes that are set on it.
2020-04-08 22:51:25 +02:00
John McLear
babf67175c undomodule: disallow undoing "clear authorship colors"
Clearing the authorship colors of a document with at least two authors, and then
undoing that action caused a disconnect from the pad.
This change disallows undoing clearing authorship colors in order to prevent
the problem from affecting users, and adds the relative test coverage.

This is a change of behaviour, and is documented in the changelog.

Fixes #2802 (sidestepping it).
2020-04-08 15:20:37 +02:00
Paul Tiedtke
79406051fa Settings.js: support newlines in default values when using variable substitution
This allows, among other things, to correctly support the configuration of
defaultPadText in Docker via an environment variable.
2020-04-07 04:32:37 +02:00
John McLear
3872690715
ace2_inner: remove Chrome specific hack
This code was specific for older Chrome versions. It can be simplified now.

Fixes #3487
2020-04-07 03:47:46 +02:00
John McLear
8987c5d813 dependencies: upgrade uglify-js 2.6.2 -> 3.8.1 and adapt Minify
This was a major update that required code changes.
2020-04-03 00:05:15 +00:00
muxator
a286f32c2a dependencies: remove object.values
This should have been part of 09949c242a ("node8: we no longer need to use a
shim for Object.values in stats.js")
2020-04-07 03:15:10 +02:00
muxator
a5ed0b524b dependencies: use fixed versions in package.json
We want to track dependencies as explicitly as possible.
2020-04-07 03:04:23 +02:00
Viljami Kuosmanen
3edd727a94 customError: rewrite the module using class syntax
The previous syntax caused a deprecation warning on Node 10.
However, due to the very old version of log4js Etherpad is currently using,
customError objects are going to be displayed as { inspect: [Function: inspect] }.

This needs to be addressed later, updating log4js.

Fixes #3834.
2020-04-07 02:03:17 +02:00
muxator
4ef59bbda0 api: in getStats(), directly rewrote activePads as an expression
Instead of creating an empty Set and then mutate it.
2020-04-04 22:03:46 +02:00
Chocobozzz
82b919fc65 api: add getStats() function 2020-04-04 22:03:46 +02:00
John McLear
eb45934788 remove noise 2020-04-03 11:32:14 +01:00
John McLear
4e212d12b2 patch fix for 3825 2020-04-03 11:32:14 +01:00
Chocobozzz
0889a1313d referer: do not send referrer when opening a link
This change augments what was already done in 54e0f2de5b20 (PR with discussion
at #3636).

For documentation about the meaning of "noopener, noreferrer", see:
https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Window_functionality_features
2020-03-31 10:02:46 +02:00
John McLear
c2ea2b3a6d webaccess: do not resave session
Before this change, the database was spammed with session values.
Modern express-session has this baked in.
See https://www.npmjs.com/package/express-session#resave for docs.
2020-04-03 02:55:33 +02:00
John McLear
1f0058dd6f interesting discovery RE 3612 and 2802 2020-04-03 02:40:59 +02:00
muxator
3a46e010ce dependencies: bump ueberdb2 0.4.3 -> 0.4.5
Original message from John McLear (PR #3817):
  We now include BINARY in the MySQL WHERE select clause.
  Test coverage might be desirable?

Fixes #2877
2020-04-03 01:27:49 +02:00
Viljami Kuosmanen
ccf406708e openapi: support standard http error codes
API errors are now handled at the end of the request heap by
throwing exceptions from the handler
2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
3742fdfb04 openapi: disable cors headers for /api/** paths
Still enabled for /rest/** and **/openapi.json
2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
6aa30f213a openapi: add jsonp support + test 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
e821bbcad8 openapi: add documentation, small optimisation 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
c2cca39c7d openapi: minor improvements 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
172da1483e openapi: add commented out version of response processors
For some weird reason, these seem to be part of the original swagger
implementation but tests assume they're turned off.

Perhaps a difference between /rest and /api?
2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
5792f7224a openapi: add response objects 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
03d8964a7a openapi: upgrade to openapi-backend 2.4.0 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
f9d24f5a39 openapi: remove swagger-node-express 2020-04-03 01:03:11 +02:00
Viljami Kuosmanen
25e081ac89 openapi: implement API handler with openapi-backend
- Tests pass 
- Added openapi-backend hook
- Generating OpenAPI v3 definitions for each API version
- Definitions served /api/openapi.json /api/{version}/openapi.json
2020-04-03 01:03:11 +02:00
John McLear
dbab4ad13a dont pass empty author info to edit 2020-04-02 23:29:03 +01:00
muxator
3e3b0dec97 package-lock: restore baseline package-lock.json after 4db91cb2ed
This amends the previous commit, ans should have been part of 4db91cb2ed.
2020-04-02 22:58:38 +02:00
John McLear
0a606de44a bump package lock for ueber 2020-04-01 15:24:24 +00:00
John McLear
4db91cb2ed
Bump Ueber to 0.4.3 2020-04-01 11:49:41 +01:00
muxator
b7ac0f7991 Settings: allow the existence of "password" and "hash" attributes for users.
This brings back compatibility with ep_hash_auth, which was inadvertently broken
with 28a3bba4c1.
Based on work by John McLear.

Fixes #3681.
2020-04-01 04:13:21 +02:00
John McLear
53f126082a SessionStore: replace password with PASSWORD_HIDDEN when storing in db
Fixes #3421.
2020-04-01 03:39:05 +02:00
Daniel Krol
3e8b426847 ui: initialize color picker with the user's color
Initialize the color picker with user's current color.
Was previously initialized with grey in Farbtastic library.

Fixes #3617
2020-04-01 02:34:56 +02:00
muxator
4ee5ddb496 caching_midleware: also run when nodejs does not have crypto module
According to the nodejs docs [0] the `crypto` module might be unavailable on
some platforms:

> It is possible for Node.js to be built without including support for the
> crypto module. In such cases, calling require('crypto') will result in an
> error being thrown

A description of such scenarios can be found here [1].

> * running non-standard node in a resource- or security-constrained
>   environment
> * running in emulated environment (browserify, webpack etc.)
> * building node from source and omitting openssl/crypto for random reason

TypeScript guys dealt with this same issue and they resolved it in an elegant
way in [2].

We copy that approach here: if importing crypto fails at runtime, we replace
sha256 with djb2 [3], which is weaker, but works for our case.

The djb2 story is fun: see this Stack Overflow post [4], and the original
mailing list post from 1991 [5] by Daniel J. Bernstein [6].

He was 20 at the time!

[0] https://nodejs.org/docs/latest-v10.x/api/crypto.html#crypto_determining_if_crypto_support_is_unavailable
[1] https://github.com/microsoft/TypeScript/issues/19100#issuecomment-335871998
[2] 9677b0641c
[3] http://www.cse.yorku.ca/~oz/hash.html#djb2
[4] https://stackoverflow.com/questions/1579721/why-are-5381-and-33-so-important-in-the-djb2-algorithm
[5] https://groups.google.com/forum/#!msg/comp.lang.c/lSKWXiuNOAk/zstZ3SRhCjgJ
[6] https://en.wikipedia.org/wiki/Daniel_J._Bernstein
2020-03-31 04:09:49 +02:00
Tom Hudson
fc754c9a1d Switches cacheKey from base64 of path to sha256 of path; fixes #3502 2020-03-31 02:42:58 +02:00
John McLear
25bf460ac6 chat: in addMessage(), be tolerant when userId is missing
For whatever reason (a bug, a database corruption, ...) the userId field in
"msg" can sometimes be missing.

In this case, let's be defensive, use "unknown" as userId and issue a warning
in the console, instead of crashing the client.

Fixes #3731 (really a patch, the underlying issue is still present)
2020-03-30 22:15:51 +02:00
John McLear
fa3e4b146a settings: document the possibility of using Unix sockets
We have been supporting Unix sockets by ages, because express.listen()
(http://expressjs.com/en/4x/api.html#app.listen_path_callback) re-exposes
net.server.listen() (https://nodejs.org/api/net.html#net_server_listen), which
in turn supports Unix sockets.

The only remaining thing to do was documenting it.

Fixes #3312
2020-03-30 03:36:55 +02:00
John McLear
85217b55e0 contentcollector: pasting an OL in Chrome inserted an additional line break. Fixed.
This comments out some code that was probably a quirk from ie6 era.
See PR: https://github.com/ether/etherpad-lite/issues/2412

Fixes #2412.
2020-03-30 02:28:08 +02:00
John McLear
8b2fe75867 toolbar: don't show the "saved revision" button in timeslider
The saved revision "star" button appeared in the timeslider toolbar too.

This change introduces a second flag "page" in toolbar.menu(), which controls
whether the toolbar is being drawn for a pad or in the timeslider page.

Fixes #3767.
2020-03-30 01:59:49 +02:00
John McLear
0d2854571d toolbar: show the "save revision" button only on the right toolbar.
Revision b480416375 fixed a bug, but introduced a regression, and the "save
revision" "star" button started to appear both on the left and the right
toolbar.

This change introduces a flag "whichMenu" in toolbar.menu(), that controls
whether the left, the right or the timeslider toolbar is being drawn.
2020-03-30 01:59:49 +02:00
muxator
463d7fb163 timeslider: always pass the "isReadOnly" parameter to toolbar.menu()
This argument was missing since since b662d5c618 ("dont show editing buttons
in R/O view"), 2015-05-19.
2020-03-30 01:59:49 +02:00
muxator
2360c33629 toolbar: formatting, no functional changes.
In preparation for the next commits by John.
2020-03-30 01:59:49 +02:00
muxator
2b753f13ea package-lock.json: resync. This should have been part of 06d961f2b6 ("Checks MySQL for charset")
When changing something in package.json, it is necessary to also commit an
associated package-lock.json generated from a clean install.
2020-03-29 01:35:30 +01:00
John McLear
1ad6e9c288 Settings: when restarting via UI, tell the admins to ignore a warning about sessionKey
Fixes #3770.
2020-03-28 19:09:22 +01:00
Neil Oosten
7a999ee398 hooks: allow to set the duration of the gritter notification when a new chat message arrives
This is done adding a new "duration" parameter to the chatNewMessage() client
side hook.
2020-03-27 02:39:29 +01:00
John McLear
06d961f2b6 Checks MySQL for charset
Helps fix 3733
2020-03-27 01:31:23 +01:00
John McLear
6fd2bf4472 hooks: introduce goToRevisionEvent(), a new client-side hook
This hook gets fired both on timeslider load (as timeslider shows a new
revision) and when the new revision is showed to a user.
2020-03-24 23:46:17 +01:00
muxator
39f271bfed DB.js: remove else clause, since we are already exiting early
No functional changes.
2020-03-24 23:26:19 +01:00
John McLear
4eec68fbdd tests: ignore vim swap files
This helps during plugin development, which otherwise which break when a
developer is editing a test.
2020-03-24 23:24:38 +01:00
Chocobozzz
43ca44e444 minify: make conditional requests work. No HTTP/304 was ever generated and file were reminified uselessly.
By specification [0], the if-modified-since HTTP header sent by browsers does
not include milliseconds.

Before this patch, let's say a file was generate at time:
    t_real-file         = 2020-03-22T02:15:53.548Z (note the fractional seconds)

When issuing a conditional request, the browser would truncate the fractional
part, and only request an if-modified-since with this contents:
    t_if-modified-since = 2020-03-22T02:15:53.000Z

The minify() function would return HTTP/304 only if
t_if-modified-since >= t_real-file, but this would never be true unless, by
chance, a file was generated at XX.000Z.

This resulted in that file being minified/compressed again and resent to the
client for no reason. After this patch, the server correctly responds with
HTTP/304 without doing any computation, and the browser uses the cached file.

[0] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since
2020-03-23 11:34:01 +01:00
translatewiki.net
2bce9f5c38 Localisation updates from https://translatewiki.net. 2020-03-23 14:58:30 +01:00
John McLear
71fa852dfb dependencies: update cheerio 0.20.0 -> 0.22.0
No variation in # of security vulnerabilities.

The output of `npm audit` goes from this:
  found 7 vulnerabilities (5 low, 2 high) in 13881 scanned packages
    7 vulnerabilities require manual review. See the full report for details.

To this:
  found 7 vulnerabilities (5 low, 2 high) in 13795 scanned packages
    7 vulnerabilities require manual review. See the full report for details.
2020-03-15 14:36:42 +00:00
muxator
b075d1fd7c dependencies: update mocha 5.2.0 -> 7.1.1
This is a dev dependency. No impact in production.
After this upgrade the backend tests ("cd src; npm test") still pass.

This fixes 2 reported security vulnerabilities.

The output of `npm audit` goes from this:
  found 9 vulnerabilities (7 low, 2 high) in 13707 scanned packages
    run `npm audit fix` to fix 1 of them.
    1 vulnerability requires semver-major dependency updates.
    7 vulnerabilities require manual review. See the full report for details.

To this:
  found 7 vulnerabilities (5 low, 2 high) in 13881 scanned packages
    7 vulnerabilities require manual review. See the full report for details.
2020-03-22 00:33:22 +01:00
muxator
dabc1cae56 dependencies: update nyc 14.1.0 -> 15.0.0
This is a dev dependency. No impact in production.
After this upgrade the backend tests ("cd src; npm test") still pass.

This fixes 1 reported security vulnerability.

The output of `npm audit` goes from this:
  found 10 vulnerabilities (8 low, 2 high) in 13390 scanned packages
    run `npm audit fix` to fix 2 of them.
    1 vulnerability requires semver-major dependency updates.
    7 vulnerabilities require manual review. See the full report for details.

To this:
  found 9 vulnerabilities (7 low, 2 high) in 13707 scanned packages
    run `npm audit fix` to fix 1 of them.
    1 vulnerability requires semver-major dependency updates.
    7 vulnerabilities require manual review. See the full report for details.
2020-03-22 00:33:22 +01:00
muxator
4cbbf9893f dependencies: update supertest 3.0.0 -> 4.0.2
This is a dev dependency. No impact in production. After this upgrade the
backend tests ("cd src; npm test") still pass.
2020-03-22 00:33:22 +01:00
muxator
6a55e7e03f dependencies: upgrade npm 6.13.4 -> 6.14.3
This fixes 107 reported security vulnerabilites.

The output of `npm audit` goes from this:
  found 117 vulnerabilities (115 low, 2 high) in 13365 scanned packages
    run `npm audit fix` to fix 6 of them.
    1 vulnerability requires semver-major dependency updates.
    110 vulnerabilities require manual review. See the full report for details.

To this:
  found 10 vulnerabilities (8 low, 2 high) in 13390 scanned packages
    run `npm audit fix` to fix 2 of them.
    1 vulnerability requires semver-major dependency updates.
    7 vulnerabilities require manual review. See the full report for details.

The changelog for npm can be read at https://github.com/npm/cli/releases
2020-03-22 00:33:22 +01:00
muxator
40d3d400a1 fonts: remove the execution bit from the font files
Monsterrat was added in 8bd8be97b9
Roboto Mono was added in 7029248a76
2020-03-22 00:33:22 +01:00
muxator
ca35488273 minify: upgrade clean-css 3.4.19 -> 4.2.3. Adapt to the semver major change
CleanCSS 3.4.19 had a Regex Denial of Service vulnerability and has to be
updated. The major version bump requires the following changes:

1. Disabling rebase is necessary because otherwise the URLs for the web fonts
   become wrong;

   EXAMPLE 1:
       /static/css/src/static/font/fontawesome-etherpad.woff
     instead of
       /static/font/fontawesome-etherpad.woff

   EXAMPLE 2 (this is more surprising):
       /p/src/static/font/opendyslexic.otf
     instead of
       /static/font/opendyslexic.otf

2. CleanCSS.minify() can either receive a string containing the CSS, or an array
   of strings. In that case each array element is interpreted as an absolute
   local path from which the CSS file is read.

   In version 4.x, CleanCSS API was simplified, eliminating the relativeTo
   parameter, and thus we cannot use our already loaded "content" argument, but
   we have to wrap the absolute path to the CSS in an array and ask the library
   to read it by itself.

Fixes #3616.
2020-03-22 00:33:22 +01:00
muxator
2c44a0f71e package-lock: preliminary recomputation before updating a dependency
The next commit will update a dependency in package.json. This commit only
refreshes package-lock.json recalculating it at the current date.
In this way we will be sure that any modifications in package-lock.json in the
next commit will be only due to the package.json change.

Should this commit introduce any regression, we would know for certain that one
of our dependencies is not correctly honoring their semver promises.
2020-03-22 00:00:45 +01:00
muxator
a1978d2245 Minify: on errors, generate logs instead of simply silencing them
This will help when we'll have to update clean-css.
2020-03-20 22:46:39 +01:00
John McLear
c316402d86 PadMessageHandler: use a predefined color when authorInfo.colorId is not defined
For some reason authorInfo is sometimes null, and therefore it is not possible
to get colorId from it.

This resulted in the following stack trace:
    [2020-03-16 09:27:17.291] [ERROR] console - (node:1746) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'colorId' of null
    at <BASEDIR>/src/node/handler/PadMessageHandler.js:1199:37
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
    at async handleClientReady (<BASEDIR>/src/node/handler/PadMessageHandler.js:1171:5)
    [2020-03-16 09:27:17.291] [ERROR] console - (node:1746) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 76)
    [2020-03-16 09:27:19.034] [WARN] message - Dropped message, USERINFO_UPDATE Session not ready.[object Object]

Which is due to a bug in Etherpad that we are not going to solve now.

As a workaround, when this happens, let's set the username to "Anonymous" (if
it is not already set), and colorId to the fixed value "#daf0b2". Warning
messages are written in the logs to signal this condition.

This is no definitive solution, but fixes #3612 (via a workaround).
2020-03-20 22:32:06 +01:00
John McLear
b480416375 toolbar: the "star" button no longer disappears when visiting a read-only pad
Before this patch, visiting the read-only URL for a random pad would remove
the "Save Revision" (the "star" icon) from all the other RW pads. The only way
to make it appear again was to restart the server.

This change does not fix the underlying bug: after visiting a read only link
the "star" button would still disapper, but it is explictly reinserted via an
ad-hoc condition.

Fixes #3702
2020-03-19 22:42:22 +01:00
muxator
840b4a0988 contentcollector: backed out changeset 3292429ab3
That commit (merged recently with PR #3622) was part of an effort to fix #3620,
but introduced a very bad bug that broke the cursor behaviour when pressing
space, making the program unusable.

This commit completes the revert of PR #3622 and fixes #3728.

--HG--
branch : revert-3622
2020-03-19 02:53:41 +01:00
John McLear
8261229323 pass file ending 2020-03-17 13:08:46 +00:00
Tudor Constantin
28102d8e1f ImportHandler: importing files with unknown extension work again when allowUnknownFileEnds is true
By specification, when settings.allowUnknownFileEnds is true and the user tries
to import a file with an unknown extension (this includes no extension),
Etherpad tries to import it as txt.

This broke in Etherpad 1.8.0, that abruptly terminates the processing with an
UnhandledPromiseRejectionWarning.

This patch restores the intended behaviour, and allows to import as text a file
with an unknown extension (on no extension).

In order to catch the UnhandledPromiseRejectionWarning we had to use
fsp_rename(), which is declared earlier in the code and is promised based
instead of fs.rename(), which is callback based.

Fixes #3710.
2020-03-17 12:41:18 +01:00
John McLear
a0579c90db APIHandler: return HTTP/404 when non existing API methods are invoked
Before this change, invoking a non existing API method would return an HTTP/200
response with a JSON payload {"code":3,"message":"no such function"}.

This commit changes the HTTP status code to 404, leaving the payload as-is.

Before:
   curl --verbose "http://localhost:9001/api/1/notExisting?apikey=ABCDEF"
  < HTTP/1.1 200 OK
  < X-Powered-By: Express
  [...]
  {"code":3,"message":"no such function","data":null}

After:
   curl --verbose "http://localhost:9001/api/1/notExisting?apikey=ABCDEF"

   < HTTP/1.1 404 OK
   < X-Powered-By: Express
   [...]
   {"code":3,"message":"no such function","data":null}

Fixes #3546.
2020-03-15 09:26:44 +00:00
Sebastian Castro
0d61d6bb13 ui: on mobile, move the right toolbar to the bottom and make the top toolbar scrollable
Before this change there was always a single toolbar on the top, with both
Colibris and the legacy skin. When the screen size was reduced:

- the legacy skin would compact the icons in the toolbar (this was fine,
  indeed);
- Colibris would hide some formatting icons. This would hamper the functionality
  for mobile users.

After this change both the skins work in the same way, which is the following:
- when the screen gets smaller the right toolbar (the one with "export",
  "timeslider", and other buttons) goes to the bottom of the screen;
- when there are many icons, the toolbar keeps all of them, and to see them the
  user must drag the toolbar.

This behaviour will probably be changed before release, opting instead to show
a "+" button when there is an overflow, since this appears to be more
discoverable (see the discusison in #3697).

Do not tested with custom toolbar elements (toolbar.left and toolbar.right
configuration items in settings.json).

Fixes #3697.
2020-03-12 18:47:12 +01:00
translatewiki.net
6323f59c3a Localisation updates from https://translatewiki.net. 2020-03-16 15:41:54 +01:00
Tom Briles
3292429ab3 trim text entries upon import. Fixes: #3620 2020-03-15 11:35:08 +00:00
John McLear
467fc11b72 fix 2020-03-14 21:58:26 +01:00
translatewiki.net
bb868beb9c Localisation updates from https://translatewiki.net. 2020-02-24 15:39:25 +01:00
translatewiki.net
5773e6cea0 Localisation updates from https://translatewiki.net. 2020-02-20 15:58:56 +01:00
translatewiki.net
7950d336eb Localisation updates from https://translatewiki.net. 2020-02-10 14:50:52 +01:00
translatewiki.net
ffcf22e4ac Localisation updates from https://translatewiki.net. 2020-01-30 15:49:13 +01:00
translatewiki.net
de3a677df5 Localisation updates from https://translatewiki.net. 2020-01-20 11:32:11 +01:00
translatewiki.net
bac58a7391 Localisation updates from https://translatewiki.net. 2020-01-13 16:08:24 +01:00
Sebastian Castro
6d4ea36646 skin colibris: Fix table of content with ep_resizable_bar 2020-01-03 15:35:12 -03:00