Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion config/CN/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FLAT_SERVER_DOMAIN=flat-api-dev.whiteboard.agora.io
UPDATE_DOMAIN=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/versions
FLAT_WEB_DOMAIN=flat-web-dev.whiteboard.agora.io

FLAT_DOWNLOAD_URL=https://www.flat.shengwang.cn/#download
FLAT_DOWNLOAD_URL=https://www.flat.apprtc.cn/#download
FEEDBACK_URL=https://www.yuque.com/leooel/ec1kmm/vmsolg

CLOUD_RECORDING_DEFAULT_AVATAR=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/flat-resources/cloud-recording/default-avatar.jpg
Expand Down
6 changes: 3 additions & 3 deletions config/CN/.env.production
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FLAT_SERVER_DOMAIN=api.flat.shengwang.cn
FLAT_SERVER_DOMAIN=api.flat.apprtc.cn
UPDATE_DOMAIN=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/versions
FLAT_WEB_DOMAIN=web.flat.shengwang.cn
FLAT_WEB_DOMAIN=web.flat.apprtc.cn

FLAT_DOWNLOAD_URL=https://www.flat.shengwang.cn/#download
FLAT_DOWNLOAD_URL=https://www.flat.apprtc.cn/#download
FEEDBACK_URL=https://www.yuque.com/leooel/ec1kmm/vmsolg

CLOUD_RECORDING_DEFAULT_AVATAR=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/flat-resources/cloud-recording/default-avatar.jpg
Expand Down
4 changes: 2 additions & 2 deletions desktop/renderer-app/src/constants/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const FLAT_WEB_DOMAIN = process.env.FLAT_WEB_DOMAIN;

export const FLAT_WEB_BASE_URL = `https://${FLAT_WEB_DOMAIN}`;

export const PRIVACY_URL_CN = "https://www.flat.shengwang.cn/privacy.html";
export const PRIVACY_URL_CN = "https://www.flat.apprtc.cn/privacy.html";
export const PRIVACY_URL_EN = "https://flat.whiteboard.agora.io/en/privacy.html";

export const SERVICE_URL_CN = "https://www.flat.shengwang.cn/service.html";
export const SERVICE_URL_CN = "https://www.flat.apprtc.cn/service.html";
export const SERVICE_URL_EN = "https://flat.whiteboard.agora.io/en/service.html";
2 changes: 1 addition & 1 deletion packages/flat-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export * from "./components/Pmi";
export * from "./containers/CloudStorageContainer";
export * from "./theme/antd.mod";

export { message } from "antd";
export { message, Modal } from "antd";
10 changes: 9 additions & 1 deletion packages/flat-i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,5 +766,13 @@
"drop-to-board": "Drop file to whiteboard",
"mirror": "Mirror",
"mirror-mode": "Mirror Mode",
"edit-success": "Updated successfully"
"edit-success": "Updated successfully",
"cross-region-auth": {
"title":"Cross-border data exit authorization",
"desc":"Please note that you are joining a room created by Agora Flat Overseas users. We will strictly comply with applicable laws and regulations to conduct data exit security assessment, and adopt reasonable physical isolation and security protection measures to ensure that your data is only used under your authorization. See the {{serviceAgreement}} and {{privacyPolicy}} for details",
"serviceAgreement": "service agreement",
"privacyPolicy": "Privacy Policy",
"agree": "agree",
"disagree": "disagree"
}
}
10 changes: 9 additions & 1 deletion packages/flat-i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,5 +766,13 @@
"drop-to-board": "拖拽文件到白板",
"mirror": "镜像",
"mirror-mode": "镜像模式",
"edit-success": "修改成功"
"edit-success": "修改成功",
"cross-region-auth": {
"title":"跨境数据出镜授权",
"desc":"请注意,您正在加入 Agora Flat 海外版用户创建的房间。我们将严格遵守适用的法律法规要求进行数据出境安全评估,采用合理的物理隔离和安全防护措施,确保您的数据仅在您的授权许可下使用。具体内容参见{{serviceAgreement}}与{{privacyPolicy}}",
"serviceAgreement": "服务协议",
"privacyPolicy": "隐私政策",
"agree": "确定",
"disagree": "取消"
}
}
4 changes: 2 additions & 2 deletions packages/flat-pages/src/constants/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ export const NODE_ENV = process.env.NODE_ENV;

export const FLAT_DOWNLOAD_URL = process.env.FLAT_DOWNLOAD_URL;

export const PRIVACY_URL_CN = "https://www.flat.shengwang.cn/privacy.html";
export const PRIVACY_URL_CN = "https://www.flat.apprtc.cn/privacy.html";
export const PRIVACY_URL = "https://flat.whiteboard.agora.io/en/privacy.html";

export const SERVICE_URL_CN = "https://www.flat.shengwang.cn/service.html";
export const SERVICE_URL_CN = "https://www.flat.apprtc.cn/service.html";
export const SERVICE_URL = "https://flat.whiteboard.agora.io/en/service.html";

export const FLAT_WEB_BASE_URL = `https://${process.env.FLAT_WEB_DOMAIN}`;
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { RouteNameType } from "../utils/routes";
import { RouteNameType } from "./routes";
import { roomStore, globalStore } from "@netless/flat-stores";
import { RequestErrorCode, RoomType } from "@netless/flat-server-api";
import { errorTips, message } from "flat-components";
import { errorTips, message, Modal } from "flat-components";
import { FlatI18n } from "@netless/flat-i18n";
import React from "react";
import { PRIVACY_URL, PRIVACY_URL_CN, SERVICE_URL, SERVICE_URL_CN } from "../constants/process";
const { confirm } = Modal;

export enum Region {
CN_HZ = "CN",
SG = "SG",
}

export const joinRoomHandler = async (
roomUUID: string,
Expand All @@ -11,7 +19,54 @@ export const joinRoomHandler = async (
pushHistory: (routeName: any, data?: any) => void,
): Promise<void> => {
const formatRoomUUID = roomUUID.replace(/\s+/g, "");
const serverRegion = globalStore.serverRegionConfig?.server.region;
const promise = await new Promise<boolean>(resolve => {
if (serverRegion && checkCrossRegionAuth(formatRoomUUID, serverRegion)) {
const language = FlatI18n.getInstance().language;
const privacyURL = language.startsWith("zh") ? PRIVACY_URL_CN : PRIVACY_URL;
const serviceURL = language.startsWith("zh") ? SERVICE_URL_CN : SERVICE_URL;

const context = FlatI18n.t("cross-region-auth.desc", {
serviceAgreement: `<a href='${serviceURL}'>《${FlatI18n.t("cross-region-auth.serviceAgreement")}》</a>`,
privacyPolicy: `<a href='${privacyURL}'>《${FlatI18n.t("cross-region-auth.privacyPolicy")}》</a>`,
});
confirm({
title: (
<div
style={{
borderBottom: "1px solid #EEEEEE",
textAlign: "center",
lineHeight: "30px",
}}
>
{FlatI18n.t("cross-region-auth.title")}
</div>
),
closable: true,
icon: null,
content: (
<div
dangerouslySetInnerHTML={{
__html: context,
}}
></div>
),
okText: FlatI18n.t("cross-region-auth.agree"),
cancelText: FlatI18n.t("cross-region-auth.disagree"),
onOk() {
resolve(true);
},
onCancel() {
resolve(false);
},
});
} else {
resolve(true);
}
});
if (!promise) {
return;
}
try {
const roomInfo = roomStore.rooms.get(formatRoomUUID);
const periodicUUID = roomInfo?.periodicUUID;
Expand Down Expand Up @@ -84,3 +139,18 @@ export const joinRoomHandler = async (
errorTips(e);
}
};
export const checkCrossRegionAuth = (uuid: string, region: string): boolean => {
let RoomRegion: Region = Region.CN_HZ;
if (typeof uuid === "string") {
if ((uuid.length === 11 && uuid[0] === "1") || uuid.startsWith("CN-")) {
RoomRegion = Region.CN_HZ;
}
if ((uuid.length === 11 && uuid[0] === "2") || uuid.startsWith("SG-")) {
RoomRegion = Region.SG;
}
}
if (region !== RoomRegion) {
return true;
}
return false;
};