diff --git a/CHANGELOG.md b/CHANGELOG.md index beb551644..d227edc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +# Xenops release (v2.23.0) + +## Goals + +For this release we wanted to focus on releasing a small set of features built on top of some foundations established in our last release. Since we were able to complete this feature set in less than a week, we decided to bundle them together so users could take benefit from them sooner. + +This work is being funded by the grant we received from NLnet foundation as a part of their PET (Privacy Enhancing Technology) fund. You can read all about this grant on our latest blog post (https://blog.cryptpad.fr/2019/05/27/Our-future-is-collaborative/). + +## Update notes + +* This update only uses clientside dependencies. Fetch the latest code for the core repository, and depending on when you last updated you may need to `bower update` as well. +* User data is "pinned" on CryptPad instances to keep track of what encrypted data can be safely removed. At one point this system was optional and could be disabled by setting `enablePinning = false` in `customize/application_config.js`. At some point we stopped testing whether CryptPad could actually work without pinning enabled, and at this point it is definitely broken. As such, we've decided to drop support for this configuration. + +## Features + +* Some of our multilingual contributors have contributed translations in the German, Russian, and Italian. The history of their contributions is available on our weblate instance (https://weblate.cryptpad.fr/projects/cryptpad/app/). +* This release introduces a practical use-case of the encrypted mailbox infrastructure which we developed in our last release. Registered users are now able to use this system to accept friend requests and review the status of friend requests that have been accepted or declined. Unlike our previous friend request system, our usage of encrypted mailboxes allows for users to send friend requests from other user's profiles whether or not they are online. +* We've also put some time towards improving user profiles as well. When you change your display name from anywhere within CryptPad the name used in your profile will be updated as well. We've also made updates to other users' profiles render in real-time, since the rest of CryptPad generally updates instantly. + +## Bug fixes + +* Some small components of CryptPad time out if they don't work within a set amount of time, and apparently this timeout was causing problems in the newest Tor browser version. We've drastically increased the timeout to make it less likely to cause problems when loading very large documents. +* We realized that Weblate was committing "empty strings" to our translation files. Our internationalization system was configured to fall back to the English translation if no translation was available in the user's preferred language, but these empty strings fooled the system into displaying nothing instead. We addressed the issue by checking whether a string was really present, and not just whether a value existed. + # Wolf release (v2.22.0) ## Goals diff --git a/Dockerfile b/Dockerfile index 974c10928..7378b14ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,26 @@ -# 6-stretch is the ONLY node 6 release supported by arm32v7, arm64v8 and x86-64 docker hub labels -FROM node:6-stretch +# We use multi stage builds +FROM node:6-stretch-slim AS build + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq git jq python +RUN npm install -g bower + +# install tini in this stage to avoid the need of jq and python +# in the final image +ADD docker-install-tini.sh /usr/local/bin/docker-install-tini.sh +RUN /usr/local/bin/docker-install-tini.sh + +COPY . /cryptpad +WORKDIR /cryptpad + +RUN npm install --production \ + && npm install -g bower \ + && bower install --allow-root + +FROM node:6-stretch-slim # You want USE_SSL=true if not putting cryptpad behind a proxy ENV USE_SSL=false -ENV STORAGE=\'./storage/file\' +ENV STORAGE="'./storage/file'" ENV LOG_TO_STDOUT=true # Persistent storage needs @@ -17,36 +34,14 @@ VOLUME /cryptpad/block VOLUME /cryptpad/blob VOLUME /cryptpad/blobstage -# Required packages -# jq is a build only dependency, removed in cleanup stage -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - git jq python - -# Install tini for faux init -# sleep 1 is to ensure overlay2 can catch up with the copy prior to running chmod -COPY ./docker-install-tini.sh / -RUN chmod a+x /docker-install-tini.sh \ - && sleep 1 \ - && /docker-install-tini.sh \ - && rm /docker-install-tini.sh - -# Cleanup apt -RUN apt-get remove -y --purge jq python \ - && apt-get auto-remove -y \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -# Install cryptpad -COPY . /cryptpad +# Copy cryptpad and tini from the build container +COPY --from=build /sbin/tini /sbin/tini +COPY --from=build /cryptpad /cryptpad + WORKDIR /cryptpad -RUN npm install --production \ - && npm install -g bower \ - && bower install --allow-root # Unsafe / Safe ports EXPOSE 3000 3001 # Run cryptpad on startup -CMD ["/sbin/tini", "--", "/cryptpad/container-start.sh"] - +CMD ["/sbin/tini", "--", "/cryptpad/container-start.sh"] \ No newline at end of file diff --git a/bower.json b/bower.json index 1021dbf62..b362c0a5f 100644 --- a/bower.json +++ b/bower.json @@ -45,7 +45,7 @@ "localforage": "^1.5.2", "html2canvas": "^0.4.1", "croppie": "^2.5.0", - "sortablejs": "#^1.6.0", + "sortablejs": "^1.6.0", "saferphore": "^0.0.1", "jszip": "Stuk/jszip#^3.1.5", "requirejs-plugins": "^1.0.3" diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 60c261f84..80fffddd0 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -71,10 +71,25 @@ define(req, function(Util, AppConfig, Default, Language) { }); } - Util.extend(messages, Default); + var extend = function (a, b) { + for (var k in b) { + if (Util.isObject(b[k])) { + a[k] = Util.isObject(a[k]) ? a[k] : {}; + extend(a[k], b[k]); + continue; + } + if (Array.isArray(b[k])) { + a[k] = b[k].slice(); + continue; + } + a[k] = b[k] || a[k]; + } + }; + + extend(messages, Default); if (Language && language !== defaultLanguage) { // Add the translated keys to the returned object - Util.extend(messages, Language); + extend(messages, Language); } messages._languages = map; diff --git a/customize.dist/translations/README.md b/customize.dist/translations/README.md index 05ddc2b34..66bacffea 100644 --- a/customize.dist/translations/README.md +++ b/customize.dist/translations/README.md @@ -17,7 +17,7 @@ Translations can now be made using [Weblate](https://weblate.cryptpad.fr). We ma ## Translate an existing language -* All translations can be done using the Weblate UI. For better help about how to use the tool, please check the [Weblate documentation](https://docs.weblate.org/en/latest/user/index.html). +* All translations can be done using the Weblate UI. For better help about how to use the tool, please check the [Weblate documentation](https://docs.weblate.org/en/latest/). * Our Weblate instance is configured to always require approval for changes. ### Update an existing translation diff --git a/docs/cryptpad-docker.md b/docs/cryptpad-docker.md index 2647da319..12018902e 100644 --- a/docs/cryptpad-docker.md +++ b/docs/cryptpad-docker.md @@ -21,7 +21,7 @@ Run from the cryptpad source directory, keeping instance state in `/var/cryptpad docker build -t xwiki/cryptpad . docker run --restart=always -d --name cryptpad -p 3000:3000 -p 3001:3001 \ -v /var/cryptpad/files:/cryptpad/datastore \ --v /var/cryptpad/customize:/cryptpad/customize +-v /var/cryptpad/customize:/cryptpad/customize \ -v /var/cryptpad/blob:/cryptpad/blob \ -v /var/cryptpad/blobstage:/cryptpad/blobstage \ -v /var/cryptpad/pins:/cryptpad/pins \ diff --git a/lib/load-config.js b/lib/load-config.js index 7b9f73251..80f4706dc 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -1,11 +1,14 @@ +/* jslint node: true */ +"use strict"; var config; +var configPath = process.env.CRYPTPAD_CONFIG || "../config/config"; try { - config = require("../config/config"); + config = require(configPath); if (config.adminEmail === 'i.did.not.read.my.config@cryptpad.fr') { console.log("You can configure the administrator email (adminEmail) in your config/config.js file"); } } catch (e) { - console.log("You can customize the configuration by copying config/config.example.js to config/config.js"); + console.log("Config not found, loading the example config. You can customize the configuration by copying config/config.example.js to " + configPath); config = require("../config/config.example"); } module.exports = config; diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 39aac9b54..ad9982030 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1816,8 +1816,8 @@ define([ // Ping clients regularly to make sure one tab was not closed without sending a removeClient() // command. This allow us to avoid phantom viewers in pads. - var PING_INTERVAL = 30000; - var MAX_PING = 5000; + var PING_INTERVAL = 120000; + var MAX_PING = 30000; var MAX_FAILED_PING = 2; setInterval(function () { diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 3399b5fd3..ef3689faa 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -304,8 +304,10 @@ MessengerUI, Messages) { } else if (Common.isLoggedIn() && data.curvePublic && !friends[data.curvePublic] && !priv.readOnly) { if (pendingFriends[data.curvePublic] && pendingFriends[data.curvePublic] > friendTo) { - $('', {'class': 'cp-toolbar-userlist-friend'}).text(Messages.userlist_pending) - .appendTo($rightCol); + $('