Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8bee8e0
add initial wrangler configuration for Cloudflare deployment
CandelR Jan 29, 2026
1ea55e4
Updated webpack config to fix automatic cloudflare deploy
CandelR Jan 30, 2026
151836f
Disabled sourcemaps in production build
CandelR Jan 30, 2026
b34f4fb
Disble modules concatenation in order to reduce ram for cloudflare de…
CandelR Jan 30, 2026
251bf31
Add splitChunks configuration to optimize bundle size and loading
CandelR Jan 30, 2026
700b6ac
Disabled minimification to test desployments
CandelR Jan 30, 2026
9241404
Reduce parallelism in Terser plugin configuration for improved compat…
CandelR Jan 30, 2026
9cee792
Removed postinstall script
CandelR Jan 30, 2026
8e67823
Update Webpack command to use webpack-cli
CandelR Jan 30, 2026
39ed3b4
Refactor Makefile and webpack.config.js for test deployment and confi…
CandelR Jan 30, 2026
aa08747
Update Makefile to use npx for webpack commands and simplify file cop…
CandelR Jan 30, 2026
17f804f
Fix formatting in wrangler.jsonc by correcting asset structure
CandelR Jan 30, 2026
c56a36a
Add Cloudflare deployment target and update asset directory in wrangl…
CandelR Jan 30, 2026
f9f6481
Remove splitChunks configuration from webpack.config.js
CandelR Jan 30, 2026
459092f
Added wrangler devdependency
CandelR Jan 30, 2026
a794c1c
Refactor environment variable handling in webpack config to selective…
CandelR Jan 30, 2026
3909d28
Refactor webpack configuration to enable module concatenation and min…
CandelR Jan 30, 2026
1367e2b
Fix deployment script to suppress errors when copying source maps
CandelR Feb 2, 2026
f5fa9eb
Updated login url to test in new cloudflare preview url
CandelR Feb 10, 2026
16d01e9
Allow preview url for testing purposes
CandelR Feb 11, 2026
f040e35
Merge branch 'main' into feature/PB-5353-migrate-to-automatic-cloudfl…
CandelR Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BUILD_DIR = build
CLEANCSS = ./node_modules/.bin/cleancss
DEPLOY_DIR = libs
DIST_DIR = dist
ONNX_DIR= node_modules/onnxruntime-web
LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet
TF_WASM_DIR = node_modules/@tensorflow/tfjs-backend-wasm/dist/
Expand All @@ -20,8 +21,8 @@ ifeq ($(OS),Windows_NT)
WEBPACK = .\node_modules\.bin\webpack --progress
WEBPACK_DEV_SERVER = .\node_modules\.bin\webpack serve --mode development --progress
else
WEBPACK = ./node_modules/.bin/webpack --progress
WEBPACK_DEV_SERVER = ./node_modules/.bin/webpack serve --mode development --progress
WEBPACK = npx webpack-cli --progress
WEBPACK_DEV_SERVER = npx webpack-cli serve --mode development --progress
endif

all: compile deploy
Expand All @@ -46,24 +47,8 @@ deploy-init:
$(DEPLOY_DIR)

deploy-appbundle:
cp \
$(BUILD_DIR)/app.bundle.min.js \
$(BUILD_DIR)/app.bundle.min.js.map \
$(BUILD_DIR)/external_api.min.js \
$(BUILD_DIR)/external_api.min.js.map \
$(BUILD_DIR)/alwaysontop.min.js \
$(BUILD_DIR)/alwaysontop.min.js.map \
$(BUILD_DIR)/face-landmarks-worker.min.js \
$(BUILD_DIR)/face-landmarks-worker.min.js.map \
$(BUILD_DIR)/noise-suppressor-worklet.min.js \
$(BUILD_DIR)/noise-suppressor-worklet.min.js.map \
$(BUILD_DIR)/screenshot-capture-worker.min.js \
$(BUILD_DIR)/screenshot-capture-worker.min.js.map \
$(DEPLOY_DIR)
cp \
$(BUILD_DIR)/close3.min.js \
$(BUILD_DIR)/close3.min.js.map \
$(DEPLOY_DIR) || true
cp $(BUILD_DIR)/*.min.js $(DEPLOY_DIR)
-cp $(BUILD_DIR)/*.min.js.map $(DEPLOY_DIR)

deploy-lib-jitsi-meet:
cp \
Expand Down Expand Up @@ -127,3 +112,17 @@ source-package:
cp css/all.css source_package/meet/css && \
(cd source_package ; tar cjf ../meet.tar.bz2 meet) && \
rm -rf source_package

deploy-cloudflare:
rm -rf $(DIST_DIR)
mkdir -p $(DIST_DIR)/css
cp index.html base.html body.html fonts.html head.html title.html plugin.head.html $(DIST_DIR)/
cp favicon.ico config.js interface_config.js manifest.json pwa-worker.js $(DIST_DIR)/
cp css/all.css $(DIST_DIR)/css/
cp -r libs $(DIST_DIR)/
cp -r images $(DIST_DIR)/
cp -r fonts $(DIST_DIR)/
cp -r sounds $(DIST_DIR)/
cp -r lang $(DIST_DIR)/
cp -r resources $(DIST_DIR)/
cp -r static $(DIST_DIR)/
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@
"webpack": "5.95.0",
"webpack-bundle-analyzer": "4.4.2",
"webpack-cli": "5.1.4",
"webpack-dev-server": "5.2.1"
"webpack-dev-server": "5.2.1",
"wrangler": "^4.0.0"
},
"overrides": {
"@xmldom/xmldom": "0.8.7"
Expand All @@ -256,7 +257,6 @@
"lint:lang": "for file in lang/*.json; do npx --yes jsonlint -q $file || exit 1; done",
"lang-sort": "./resources/lang-sort.sh",
"lint-fix": "eslint --ext .js,.ts,.tsx --max-warnings 0 --fix .",
"postinstall": "jetify",
"validate": "npm ls",
"tsc-test:web": "tsc --project tsconfig.web.json --listFilesOnly | grep -v node_modules | grep native",
"tsc-test:native": "tsc --project tsconfig.native.json --listFilesOnly | grep -v node_modules | grep web",
Expand Down
6 changes: 6 additions & 0 deletions react/features/base/meet/services/types/web-auth.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const WEB_AUTH_STORAGE_KEYS = {
NEW_TOKEN: "xNewToken",
} as const;

export const WEB_AUTH_VALID_ORIGINS = [
"internxt.com",
"localhost",
"pages.dev",
] as const;

export const WEB_AUTH_CONFIG: WebAuthConfig = {
popupWidth: 500,
popupHeight: 700,
Expand Down
15 changes: 6 additions & 9 deletions react/features/base/meet/services/web-auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
WEB_AUTH_CONFIG,
WEB_AUTH_MESSAGE_TYPES,
WEB_AUTH_STORAGE_KEYS,
WEB_AUTH_VALID_ORIGINS,
WebAuthMessage,
WebAuthParams,
} from './types/web-auth.types';
Expand All @@ -14,7 +15,7 @@ export class WebAuthService {

private readonly WEB_CLIENT_URL = ConfigService.instance.isDevelopment()
? "http://localhost:3000"
: "https://drive.internxt.com";
: "https://feature-pb-5353-migrate-meet.drive-web.pages.dev";

private authPopup: Window | null = null;
private messageListener: ((event: MessageEvent) => void) | null = null;
Expand Down Expand Up @@ -74,7 +75,7 @@ export class WebAuthService {
* Validate origin of postMessage event
*/
private isValidOrigin(origin: string): boolean {
return origin.includes("internxt.com") || origin.includes("localhost");
return WEB_AUTH_VALID_ORIGINS.some(valid => origin.includes(valid));
}

/**
Expand All @@ -91,7 +92,7 @@ export class WebAuthService {
data: WebAuthMessage,
resolve: (value: WebAuthParams) => void,
reject: (reason: Error) => void,
timeout: number
timeout: number,
) {
clearTimeout(timeout);
this.cleanup();
Expand All @@ -118,11 +119,7 @@ export class WebAuthService {
/**
* Setup popup closed checker interval
*/
private setupPopupClosedChecker(
popup: Window,
reject: (reason: Error) => void,
timeout: number
): number {
private setupPopupClosedChecker(popup: Window, reject: (reason: Error) => void, timeout: number): number {
return setInterval(() => {
if (popup.closed) {
clearInterval(this.popupCheckInterval!);
Expand Down Expand Up @@ -240,7 +237,7 @@ export class WebAuthService {
return this.buildLoginCredentials(user, mnemonic, newToken);
} catch (error) {
throw new Error(
`Web authentication processing failed: ${error instanceof Error ? error.message : "Unknown error"}`
`Web authentication processing failed: ${error instanceof Error ? error.message : "Unknown error"}`,
);
}
}
Expand Down
28 changes: 24 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getPerformanceHints(options, size) {
const { analyzeBundle, isProduction } = options;

return {
hints: isProduction && !analyzeBundle ? "error" : false,
hints: isProduction && !analyzeBundle ? 'warning' : false,
maxAssetSize: size,
maxEntrypointSize: size,
};
Expand Down Expand Up @@ -106,8 +106,11 @@ function devServerProxyBypass({ path }) {
function getConfig(options = {}) {
const { detectCircularDeps, isProduction } = options;

const parallelism = parseInt(process.env.WEBPACK_PARALLELISM, 10);

return {
devtool: isProduction ? "source-map" : "eval-source-map",
...(parallelism > 0 ? { parallelism } : {}),
devtool: isProduction ? false : "eval-source-map",
mode: isProduction ? "production" : "development",
module: {
rules: [
Expand Down Expand Up @@ -199,7 +202,7 @@ function getConfig(options = {}) {
loader: "ts-loader",
options: {
configFile: "tsconfig.web.json",
transpileOnly: !isProduction, // Skip type checking for dev builds.,
transpileOnly: true,
},
},
{
Expand Down Expand Up @@ -345,7 +348,24 @@ module.exports = (_env, argv) => {
process: "process/browser",
}),
new webpack.DefinePlugin({
"process.env": JSON.stringify(dotenv.config().parsed),
"process.env": (() => {
dotenv.config();
const keys = [
"DRIVE_NEW_API_URL",
"PAYMENTS_API_URL",
"MEET_API_URL",
"CRYPTO_SECRET",
"MAGIC_IV",
"MAGIC_SALT",
];
const env = {};
keys.forEach((key) => {
if (process.env[key]) {
env[key] = process.env[key];
}
});
return JSON.stringify(env);
})(),
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
Expand Down
8 changes: 8 additions & 0 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "meet-web",
"compatibility_date": "2026-01-29",
"assets": {
"directory": "./dist",
"not_found_handling": "single-page-application"
}
}
Loading
Loading