Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into imp/…
Browse files Browse the repository at this point in the history
…retention

* 'develop' of github.com:RocketChat/Rocket.Chat:
  fix: Not possible to edit room without proper permission with retention policy enabled (#32547)
  feat: Apps-Engine Deno Runtime update (#31821)
  feat: E2EE room setup header (#32446)
  fix: E2EE thread main message reactivity (#32381)
  chore: Add telemetry to CI so we can get a better understanding of resource usage (#32113)
  fix: Long katex strings breaking overflow in x axis (#32609)
  fix: Force highlighted code language registration (#32507)
  fix: sidebar last message E2EE (#32431)
  chore: remove message column on moderation console (#32432)
  fix: Accepted Media Types settings validation (#32478)
  • Loading branch information
gabriellsh committed Jun 18, 2024
2 parents 457e539 + 94b12ed commit 0cdccd8
Show file tree
Hide file tree
Showing 74 changed files with 1,112 additions and 276 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-toys-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed "File Upload > Accepted Media Types" setting to allow all type of files uploads
6 changes: 6 additions & 0 deletions .changeset/gold-flowers-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/i18n': minor
'@rocket.chat/meteor': minor
---

Added E2EE room setup header, with just limited functionality and room actions.
5 changes: 5 additions & 0 deletions .changeset/healthy-clouds-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/gazzodown": patch
---

Fixes long katex lines overflowing the message component
6 changes: 6 additions & 0 deletions .changeset/lastmessage-e2ee.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rocket.chat/meteor": patch
"@rocket.chat/model-typings": patch
---

Fixed last message preview in Sidebar for E2E Ecrypted channels
5 changes: 5 additions & 0 deletions .changeset/nervous-wolves-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes the issue not allowing users without edit-room-retention-policy permission try to edit the room with the retention policy enabled
41 changes: 41 additions & 0 deletions .changeset/tame-weeks-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
'@rocket.chat/omnichannel-services': minor
'rocketchat-services': minor
'@rocket.chat/omnichannel-transcript': minor
'@rocket.chat/authorization-service': minor
'@rocket.chat/web-ui-registration': minor
'@rocket.chat/stream-hub-service': minor
'@rocket.chat/uikit-playground': minor
'@rocket.chat/presence-service': minor
'@rocket.chat/fuselage-ui-kit': minor
'@rocket.chat/instance-status': minor
'@rocket.chat/account-service': minor
'@rocket.chat/mock-providers': minor
'@rocket.chat/api-client': minor
'@rocket.chat/ddp-client': minor
'@rocket.chat/pdf-worker': minor
'@rocket.chat/ui-theming': minor
'@rocket.chat/core-services': minor
'@rocket.chat/model-typings': minor
'@rocket.chat/ui-video-conf': minor
'@rocket.chat/core-typings': minor
'@rocket.chat/rest-typings': minor
'@rocket.chat/ddp-streamer': minor
'@rocket.chat/queue-worker': minor
'@rocket.chat/presence': minor
'@rocket.chat/ui-composer': minor
'@rocket.chat/ui-contexts': minor
'@rocket.chat/license': minor
'@rocket.chat/gazzodown': minor
'@rocket.chat/ui-avatar': minor
'@rocket.chat/ui-client': minor
'@rocket.chat/livechat': minor
'@rocket.chat/models': minor
'@rocket.chat/ui-kit': minor
'@rocket.chat/apps': minor
'@rocket.chat/cron': minor
'@rocket.chat/i18n': minor
'@rocket.chat/meteor': minor
---

New runtime for apps in the Apps-Engine based on the Deno platform
5 changes: 5 additions & 0 deletions .changeset/three-squids-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixed Encrypted thread main message reactivity issues. Earlier the encrypted thread main message was having some reactivity issues and flaky behavior.
5 changes: 5 additions & 0 deletions .changeset/weak-books-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Forces the highlight code language registration, preventing it to not being available when trying to use on the UI
8 changes: 8 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
install:
required: false
type: boolean
deno-dir:
required: false
type: string
default: ~/.deno-cache

outputs:
node-version:
Expand All @@ -19,13 +23,17 @@ runs:
using: composite

steps:
- run: echo 'DENO_DIR=${{ inputs.deno-dir }}' >> $GITHUB_ENV
shell: bash

- name: Cache Node Modules
if: inputs.cache-modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: |
node_modules
${{ env.DENO_DIR }}
apps/meteor/node_modules
apps/meteor/ee/server/services/node_modules
key: node-modules-${{ hashFiles('yarn.lock') }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'true' && ' [no watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }})${{ matrix.mongodb-version == '6.0' && ' - Alpine' || '' }}

steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
job_summary: true
comment_on_pr: false

- name: Login to GitHub Container Registry
if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop')
uses: docker/login-action@v2
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
name: Unit Tests

steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
job_summary: true
comment_on_pr: false
- uses: actions/checkout@v4

- name: Setup NodeJS
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
job_summary: true
comment_on_pr: false
- name: Github Info
run: |
echo "GITHUB_ACTION: $GITHUB_ACTION"
Expand All @@ -192,6 +198,12 @@ jobs:
runs-on: ubuntu-20.04

steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
job_summary: true
comment_on_pr: false
- name: Github Info
run: |
echo "GITHUB_ACTION: $GITHUB_ACTION"
Expand Down
25 changes: 14 additions & 11 deletions apps/meteor/.docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ RUN groupadd -g 65533 -r rocketchat \
# --chown requires Docker 17.12 and works only on Linux
ADD --chown=rocketchat:rocketchat . /app

# needs a mongoinstance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker \
NODE_ENV=production \
MONGO_URL=mongodb://mongo:27017/rocketchat \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads \
DENO_DIR=/usr/share/deno

RUN aptMark="$(apt-mark showmanual)" \
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates \
&& cd /app/bundle/programs/server \
&& npm install \
&& cd npm/node_modules/isolated-vm \
&& npm install \
&& cd npm/node_modules/isolated-vm \
&& npm install \
&& cd /app/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/deno-runtime \
&& ../../../deno-bin/bin/deno cache main.ts \
&& apt-mark auto '.*' > /dev/null \
&& apt-mark manual $aptMark > /dev/null \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
Expand All @@ -37,15 +49,6 @@ VOLUME /app/uploads

WORKDIR /app/bundle

# needs a mongoinstance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker \
NODE_ENV=production \
MONGO_URL=mongodb://mongo:27017/rocketchat \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads

EXPOSE 3000

CMD ["node", "main.js"]
73 changes: 61 additions & 12 deletions apps/meteor/.docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,13 +1,68 @@
FROM node:14.21.3-alpine3.16

RUN apk add --no-cache ttf-dejavu
ENV LANG=C.UTF-8

# Installing glibc deps required by Deno
# This replaces libc6-compat
# Copied from https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc, which denoland/deno:alpine-1.37.1 uses
# NOTE: Glibc 2.35 package is broken: https://github.com/sgerrand/alpine-pkg-glibc/issues/176, so we stick to 2.34 for now
RUN ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.34-r0" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
echo \
"-----BEGIN PUBLIC KEY-----\
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m\
y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu\
tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp\
m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY\
KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc\
Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m\
1QIDAQAB\
-----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && \
wget \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
mv /etc/nsswitch.conf /etc/nsswitch.conf.bak && \
apk add --no-cache --force-overwrite \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
\
mv /etc/nsswitch.conf.bak /etc/nsswitch.conf && \
rm "/etc/apk/keys/sgerrand.rsa.pub" && \
(/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true) && \
echo "export LANG=$LANG" > /etc/profile.d/locale.sh && \
\
apk del glibc-i18n && \
\
rm "/root/.wget-hsts" && \
apk del .build-dependencies && \
rm \
"$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" \
"$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && \
apk add --no-cache ttf-dejavu

ADD . /app

LABEL maintainer="[email protected]"

# needs a mongo instance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker \
NODE_ENV=production \
MONGO_URL=mongodb://mongo:27017/rocketchat \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads \
DENO_DIR=/usr/share/deno

RUN set -x \
&& apk add --no-cache --virtual .fetch-deps python3 make g++ libc6-compat \
&& apk add --no-cache --virtual .fetch-deps python3 make g++ \
&& cd /app/bundle/programs/server \
&& npm install --production \
# Start hack for sharp...
Expand All @@ -20,20 +75,14 @@ RUN set -x \
&& npm install [email protected] \
&& mv node_modules/isolated-vm npm/node_modules/isolated-vm \
# End hack for isolated-vm
&& cd npm \
# Cache Deno dependencies for Apps-Engine
&& cd npm/node_modules/@rocket.chat/apps-engine/deno-runtime \
&& /app/bundle/programs/server/npm/node_modules/deno-bin/bin/deno cache main.ts \
&& cd /app/bundle/programs/server/npm \
&& npm rebuild bcrypt --build-from-source \
&& npm cache clear --force \
&& apk del .fetch-deps

# needs a mongo instance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker \
NODE_ENV=production \
MONGO_URL=mongodb://mongo:27017/rocketchat \
HOME=/tmp \
PORT=3000 \
ROOT_URL=http://localhost:3000 \
Accounts_AvatarStorePath=/app/uploads

VOLUME /app/uploads

WORKDIR /app/bundle
Expand Down
8 changes: 2 additions & 6 deletions apps/meteor/app/apps/server/bridges/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export class AppCommandsBridge extends CommandBridge {
permission: command.permission,
callback: this._appCommandExecutor.bind(this),
providesPreview: command.providesPreview,
previewer: !command.previewer ? undefined : this._appCommandPreviewer.bind(this),
previewCallback: (!command.executePreviewItem ? undefined : this._appCommandPreviewExecutor.bind(this)) as
previewer: command.providesPreview ? this._appCommandPreviewer.bind(this) : undefined,
previewCallback: (command.providesPreview ? this._appCommandPreviewExecutor.bind(this) : undefined) as
| (typeof slashCommands.commands)[string]['previewCallback']
| undefined,
} as SlashCommand;
Expand Down Expand Up @@ -155,10 +155,6 @@ export class AppCommandsBridge extends CommandBridge {
if (typeof command.providesPreview !== 'boolean') {
throw new Error('Invalid Slash Command parameter provided, it must be a valid ISlashCommand object.');
}

if (typeof command.executor !== 'function') {
throw new Error('Invalid Slash Command parameter provided, it must be a valid ISlashCommand object.');
}
}

private async _appCommandExecutor({ command, message, params, triggerId, userId }: SlashCommandCallbackParams<string>): Promise<void> {
Expand Down
Loading

0 comments on commit 0cdccd8

Please sign in to comment.