Last active
August 9, 2022 15:22
-
-
Save jfqd/a6250b051a3aeb44b8ddf7ad062f0a9c to your computer and use it in GitHub Desktop.
Remove "Go fully featured" admin option as long it is not GDPR complient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 162ff8353b9cf299b8b0673f7f45d981712fbb23 Mon Sep 17 00:00:00 2001 | |
From: jfqd <jfqd@blun.org> | |
Date: Tue, 9 Aug 2022 17:13:09 +0200 | |
Subject: [PATCH] remove upgrade option | |
--- | |
client/sidebar/header/UserDropdown.tsx | 2 +- | |
client/views/admin/AdministrationRouter.tsx | 2 +- | |
client/views/admin/routes.js | 5 ----- | |
client/views/admin/sidebar/AdminSidebarPages.tsx | 4 ---- | |
4 files changed, 2 insertions(+), 11 deletions(-) | |
diff --git a/client/sidebar/header/UserDropdown.tsx b/client/sidebar/header/UserDropdown.tsx | |
index 775241eaba..a4973dfb5e 100644 | |
--- a/client/sidebar/header/UserDropdown.tsx | |
+++ b/client/sidebar/header/UserDropdown.tsx | |
@@ -97,7 +97,7 @@ const UserDropdown = ({ user, onClose }: UserDropdownProps): ReactElement => { | |
}); | |
const handleAdmin = useMutableCallback(() => { | |
- adminRoute.push(); | |
+ dminRoute.push({ group: 'info' }); | |
sidebar.toggle(); | |
onClose(); | |
}); | |
diff --git a/client/views/admin/AdministrationRouter.tsx b/client/views/admin/AdministrationRouter.tsx | |
index 132704acc8..16617a2f85 100644 | |
--- a/client/views/admin/AdministrationRouter.tsx | |
+++ b/client/views/admin/AdministrationRouter.tsx | |
@@ -10,7 +10,7 @@ const AdministrationRouter = ({ renderRoute }: { renderRoute: () => ReactElement | |
const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
const [routeName] = useCurrentRoute(); | |
const defaultRoute = useRoute('admin-info'); | |
- const upgradeRoute = useRoute('upgrade'); | |
+ const upgradeRoute = useRoute('admin-info'); | |
useEffect(() => { | |
if (isLoading || routeName !== 'admin-index') { | |
diff --git a/client/views/admin/routes.js b/client/views/admin/routes.js | |
index 9cb8775569..853098ffee 100644 | |
--- a/client/views/admin/routes.js | |
+++ b/client/views/admin/routes.js | |
@@ -137,8 +137,3 @@ registerAdminRoute('/chatpal', { | |
appLayout.renderMainLayout({ center: 'ChatpalAdmin' }); | |
}, | |
}); | |
- | |
-registerAdminRoute('/upgrade/:type?', { | |
- name: 'upgrade', | |
- lazyRouteComponent: () => import('./upgrade/UpgradePage'), | |
-}); | |
diff --git a/client/views/admin/sidebar/AdminSidebarPages.tsx b/client/views/admin/sidebar/AdminSidebarPages.tsx | |
index ae920d1b91..2be075b959 100644 | |
--- a/client/views/admin/sidebar/AdminSidebarPages.tsx | |
+++ b/client/views/admin/sidebar/AdminSidebarPages.tsx | |
@@ -3,9 +3,7 @@ import React, { memo, FC } from 'react'; | |
import { useSubscription } from 'use-subscription'; | |
import Sidebar from '../../../components/Sidebar'; | |
-import { useUpgradeTabParams } from '../../hooks/useUpgradeTabParams'; | |
import { itemsSubscription } from '../sidebarItems'; | |
-import UpgradeTab from './UpgradeTab'; | |
type AdminSidebarPagesProps = { | |
currentPath: string; | |
@@ -13,11 +11,9 @@ type AdminSidebarPagesProps = { | |
const AdminSidebarPages: FC<AdminSidebarPagesProps> = ({ currentPath }) => { | |
const items = useSubscription(itemsSubscription); | |
- const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
return ( | |
<Box display='flex' flexDirection='column' flexShrink={0} pb='x8'> | |
- {!isLoading && tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />} | |
<Sidebar.ItemsAssembler items={items} currentPath={currentPath} /> | |
</Box> | |
); | |
-- | |
2.37.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 3501906dd35c6c328d26d2efd66dc245fda829f5 Mon Sep 17 00:00:00 2001 | |
From: jfqd <jfqd@blun.org> | |
Date: Tue, 9 Aug 2022 17:17:30 +0200 | |
Subject: [PATCH] remove upgrade option | |
--- | |
apps/meteor/client/sidebar/header/UserDropdown.tsx | 2 +- | |
apps/meteor/client/views/admin/AdministrationRouter.tsx | 2 +- | |
apps/meteor/client/views/admin/routes.js | 5 ----- | |
apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | 4 ---- | |
4 files changed, 2 insertions(+), 11 deletions(-) | |
diff --git a/apps/meteor/client/sidebar/header/UserDropdown.tsx b/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
index d74898a8e1..37185b1607 100644 | |
--- a/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
+++ b/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
@@ -93,7 +93,7 @@ const UserDropdown = ({ user, onClose }: UserDropdownProps): ReactElement => { | |
}); | |
const handleAdmin = useMutableCallback(() => { | |
- adminRoute.push(); | |
+ adminRoute.push({ group: 'info' }); | |
sidebar.toggle(); | |
onClose(); | |
}); | |
diff --git a/apps/meteor/client/views/admin/AdministrationRouter.tsx b/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
index 6a9095a836..1db738532e 100644 | |
--- a/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
+++ b/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
@@ -10,7 +10,7 @@ const AdministrationRouter = ({ renderRoute }: { renderRoute: () => ReactElement | |
const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
const [routeName] = useCurrentRoute(); | |
const defaultRoute = useRoute('admin-info'); | |
- const upgradeRoute = useRoute('upgrade'); | |
+ const upgradeRoute = useRoute('admin-info'); | |
useEffect(() => { | |
if (isLoading || routeName !== 'admin-index') { | |
diff --git a/apps/meteor/client/views/admin/routes.js b/apps/meteor/client/views/admin/routes.js | |
index 1af09369ee..cdfc88dc8e 100644 | |
--- a/apps/meteor/client/views/admin/routes.js | |
+++ b/apps/meteor/client/views/admin/routes.js | |
@@ -128,8 +128,3 @@ registerAdminRoute('/chatpal', { | |
appLayout.renderMainLayout({ center: 'ChatpalAdmin' }); | |
}, | |
}); | |
- | |
-registerAdminRoute('/upgrade/:type?', { | |
- name: 'upgrade', | |
- lazyRouteComponent: () => import('./upgrade/UpgradePage'), | |
-}); | |
diff --git a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
index ae920d1b91..2be075b959 100644 | |
--- a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
+++ b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
@@ -3,9 +3,7 @@ import React, { memo, FC } from 'react'; | |
import { useSubscription } from 'use-subscription'; | |
import Sidebar from '../../../components/Sidebar'; | |
-import { useUpgradeTabParams } from '../../hooks/useUpgradeTabParams'; | |
import { itemsSubscription } from '../sidebarItems'; | |
-import UpgradeTab from './UpgradeTab'; | |
type AdminSidebarPagesProps = { | |
currentPath: string; | |
@@ -13,11 +11,9 @@ type AdminSidebarPagesProps = { | |
const AdminSidebarPages: FC<AdminSidebarPagesProps> = ({ currentPath }) => { | |
const items = useSubscription(itemsSubscription); | |
- const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
return ( | |
<Box display='flex' flexDirection='column' flexShrink={0} pb='x8'> | |
- {!isLoading && tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />} | |
<Sidebar.ItemsAssembler items={items} currentPath={currentPath} /> | |
</Box> | |
); | |
-- | |
2.37.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 9081732ab89782784bc4484062ef708f04b74210 Mon Sep 17 00:00:00 2001 | |
From: jfqd <jfqd@blun.org> | |
Date: Tue, 9 Aug 2022 17:20:27 +0200 | |
Subject: [PATCH] remove upgrade option | |
--- | |
apps/meteor/client/sidebar/header/UserDropdown.tsx | 2 +- | |
apps/meteor/client/views/admin/AdministrationRouter.tsx | 2 +- | |
apps/meteor/client/views/admin/routes.tsx | 5 ----- | |
apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | 5 ----- | |
4 files changed, 2 insertions(+), 12 deletions(-) | |
diff --git a/apps/meteor/client/sidebar/header/UserDropdown.tsx b/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
index 56e4862594..79091bb628 100644 | |
--- a/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
+++ b/apps/meteor/client/sidebar/header/UserDropdown.tsx | |
@@ -93,7 +93,7 @@ const UserDropdown = ({ user, onClose }: UserDropdownProps): ReactElement => { | |
}); | |
const handleAdmin = useMutableCallback(() => { | |
- adminRoute.push(); | |
+ adminRoute.push({ group: 'info' }); | |
sidebar.toggle(); | |
onClose(); | |
}); | |
diff --git a/apps/meteor/client/views/admin/AdministrationRouter.tsx b/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
index 1d4050d852..a4a0825629 100644 | |
--- a/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
+++ b/apps/meteor/client/views/admin/AdministrationRouter.tsx | |
@@ -14,7 +14,7 @@ const AdministrationRouter = ({ children }: AdministrationRouterProps): ReactEle | |
const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
const [routeName] = useCurrentRoute(); | |
const defaultRoute = useRoute('admin-info'); | |
- const upgradeRoute = useRoute('upgrade'); | |
+ const upgradeRoute = useRoute('admin-info'); | |
useEffect(() => { | |
if (isLoading || routeName !== 'admin-index') { | |
diff --git a/apps/meteor/client/views/admin/routes.tsx b/apps/meteor/client/views/admin/routes.tsx | |
index b00a8dfcc7..7c370bf2ec 100644 | |
--- a/apps/meteor/client/views/admin/routes.tsx | |
+++ b/apps/meteor/client/views/admin/routes.tsx | |
@@ -140,8 +140,3 @@ registerAdminRoute('/chatpal', { | |
); | |
}, | |
}); | |
- | |
-registerAdminRoute('/upgrade/:type?', { | |
- name: 'upgrade', | |
- component: lazy(() => import('./upgrade/UpgradePage')), | |
-}); | |
diff --git a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
index 664c18838c..a37e993e45 100644 | |
--- a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
+++ b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx | |
@@ -3,9 +3,7 @@ import React, { memo, FC } from 'react'; | |
import { useSyncExternalStore } from 'use-sync-external-store/shim'; | |
import SidebarItemsAssembler from '../../../components/Sidebar/SidebarItemsAssembler'; | |
-import { useUpgradeTabParams } from '../../hooks/useUpgradeTabParams'; | |
import { subscribeToAdminSidebarItems, getAdminSidebarItems } from '../sidebarItems'; | |
-import UpgradeTab from './UpgradeTab'; | |
type AdminSidebarPagesProps = { | |
currentPath: string; | |
@@ -14,11 +12,8 @@ type AdminSidebarPagesProps = { | |
const AdminSidebarPages: FC<AdminSidebarPagesProps> = ({ currentPath }) => { | |
const items = useSyncExternalStore(subscribeToAdminSidebarItems, getAdminSidebarItems); | |
- const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); | |
- | |
return ( | |
<Box display='flex' flexDirection='column' flexShrink={0} pb='x8'> | |
- {!isLoading && tabType && <UpgradeTab type={tabType} currentPath={currentPath} trialEndDate={trialEndDate} />} | |
<SidebarItemsAssembler items={items} currentPath={currentPath} /> | |
</Box> | |
); | |
-- | |
2.37.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use a ubuntu vm for building Rocket.Chat | |
apt-get install gcc g++ build-essential make git | |
curl https://install.meteor.com/ | sh | |
set -x | |
set -euvo pipefail | |
IFS=$'\n\t' | |
# Requires Node.js version 4.x | |
# Do not run as root | |
git clone https://github.com/RocketChat/Rocket.Chat.git | |
cd Rocket.Chat | |
git pull --tags | |
git checkout 4.6.4 | |
mkdir patches | |
curl https://gist.githubusercontent.com/jfqd/a6250b051a3aeb44b8ddf7ad062f0a9c/raw/caa829ebb2340f0defd6ec3e5f2d4d4623bdcb80/0001-remove-upgrade-option.v4.6.x.patch > patches/0001-remove-upgrade-option.patch | |
git am patches/0001-remove-upgrade-option.patch | |
DEPLOY_DIR=/var/www/rocket/rc_build | |
### BUILD | |
meteor npm install | |
meteor npm run postinstall | |
# on the very first build, meteor build command should fail due to a bug on emojione package (related to phantomjs installation) | |
# the command below forces the error to happen before build command (not needed on subsequent builds) | |
set +e | |
meteor add rocketchat:lib | |
set -e | |
meteor build --server-only --directory $DEPLOY_DIR | |
### RUN | |
(cd $DEPLOY_DIR/bundle/programs/server ; npm install) | |
cd $DEPLOY_DIR/bundle | |
NODE_ENV=production \ | |
PORT=3000 \ | |
ROOT_URL=http://localhost:3000 \ | |
MONGO_URL=mongodb://localhost:27017/rocketchat \ | |
MONGO_OPLOG_URL=mongodb://localhost:27017/local \ | |
node main.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment