rework app onboarding for beOS Pro

This commit is contained in:
2026-03-09 09:26:17 +01:00
parent 422bbf32df
commit ee31b19012
24 changed files with 171 additions and 86 deletions

View File

@@ -1,11 +1,11 @@
{
"name": "@olares/app",
"name": "@didvault/app",
"version": "1.6.25",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@olares/app",
"name": "@didvault/app",
"version": "1.6.25",
"dependencies": {
"@bytetrade/barcode-scanner": "^7.0.1",

View File

@@ -1,9 +1,9 @@
{
"name": "@didvault/app",
"version": "1.6.25",
"description": "An Open-Source Personal Cloud to Reclaim Your Data",
"productName": "Olares App",
"author": "Olares <billpengpeng@gmail.com>",
"description": "beOS Pro self-hosted application suite",
"productName": "beOS Pro",
"author": "beOS Pro",
"private": true,
"scripts": {
"build:vault": "APPLICATION=VAULT PLATFORM=WEB quasar build",

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>beOS Pro Privacy Policy</title>
</head>
<body>
<main>
<h1>beOS Pro Privacy Policy</h1>
<p>This installation is configured for self-hosted operation.</p>
<p>Review and replace this placeholder with your own privacy policy before distribution.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>beOS Pro 隐私政策</title>
</head>
<body>
<main>
<h1>beOS Pro 隐私政策</h1>
<p>当前安装以自托管方式运行。</p>
<p>在对外分发之前,请将此占位文件替换为你自己的隐私政策。</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>beOS Pro Service Agreement</title>
</head>
<body>
<main>
<h1>beOS Pro Service Agreement</h1>
<p>This installation is configured for self-hosted operation.</p>
<p>Review and replace this placeholder with your own service agreement before distribution.</p>
</main>
</body>
</html>

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>beOS Pro 服务协议</title>
</head>
<body>
<main>
<h1>beOS Pro 服务协议</h1>
<p>当前安装以自托管方式运行。</p>
<p>在对外分发之前,请将此占位文件替换为你自己的服务协议。</p>
</main>
</body>
</html>

View File

@@ -107,6 +107,4 @@ export interface NativeAppPlatform extends AppPlatform {
getQuasar(): QVueGlobals | undefined;
getRouter(): Router | undefined;
}

View File

@@ -83,11 +83,11 @@ export interface AppPlatform extends Platform, PlatformExtension {
facebook: {
appId: string;
clientToken: string;
},
};
google: {
webClientId: string;
iOSClientId: string;
androidClientId: string;
}
}
};
};
}

View File

@@ -3,5 +3,6 @@
font-family: 'Material Symbols Rounded';
font-style: normal;
font-weight: 100 700;
src: url('../assets/fonts/MaterialSymbolsRounded.woff2') format('woff2');
src: url('../apps/dashboard/assets/fonts/MaterialSymbolsRounded3.woff2')
format('woff2');
}

View File

@@ -1,11 +1,11 @@
export default {
wizard_welcome: 'Welcome to Olares',
wizard_welcome: 'Welcome to beOS Pro',
wizard_continue: 'Press any key to continue',
step_continue: 'Continue',
step_label_password: 'Password',
step_input_placeholder: 'Enter your Olares password',
step_input_placeholder: 'Enter your beOS Pro password',
err_cloud_admin:
'Incorrect password. Find your initial password in Olares Space.',
'Incorrect password. Find your initial password in the local installation output.',
err_cloud_sub: 'Incorrect password. Try again or contact your administrator.',
err_selfhosted_admin:
'Incorrect password. Check the end of the installation log for your initial password.',
@@ -15,33 +15,34 @@ export default {
step_select_language: 'Select language',
step_language: 'Language',
step_select_proxy: 'Select a reverse proxy',
step_proxy_text_1: 'Select a reverse proxy to access Olares on internet ',
step_proxy_text_1:
'Select a reverse proxy to access beOS Pro over the internet ',
step_proxy_text_2: 'Learn more about',
step_proxy_text_3: 'Olares Space reverse proxy',
step_proxy_text_3: 'external reverse proxy options',
step_select_region: 'Select region',
vault_title: 'Activate Olares',
vault_content_1: 'Scan the QR code with LarePass to complete the activation',
vault_title: 'Activate beOS Pro',
vault_content_1: 'Complete local setup to continue',
vault_content_2:
'Ensure your smartphone and Olares device are on the same network',
system_title: 'Initialize Olares',
system_content_1: 'Initializing Olares',
'Ensure your browser is connected to the same machine or local network',
system_title: 'Initialize beOS Pro',
system_content_1: 'Initializing beOS Pro',
network_title: 'Network setup',
network_content: 'Applying for and configuring HTTPS certificate',
network_failed_title: 'Configuration failed',
network_failed_content: 'Retry on LarePass',
network_failed_content: 'Retry locally',
dns_title: 'DNS resolution',
dns_content_1: 'Configuring DNS resolution...',
dns_content_2: 'Once complete, access Olares at',
dns_content_2: 'Once complete, access beOS Pro at',
dns_failed_title: 'DNS resolution failed',
dns_failed_content: 'Retry on LarePass',
dns_failed_content: 'Retry locally',
reset_password_title: 'Resetting password...',
reset_password_content:
'Create a new Olares login password in LarePass app. This will invalidate your initial password.',
'Create a new beOS Pro login password. This will invalidate your initial password.',
use_reverse_proxy: 'Use a reverse proxy',
use_not_reverse_proxy: 'No reverse proxy',
message_reverse_proxy:
'Reverse proxy is required to access Olares in a different network.',
'Reverse proxy is required to access beOS Pro from a different network.',
message_not_need_frp: 'If you have a public IP, no reverse proxy is needed.',
close: 'Close'
};

View File

@@ -1,10 +1,10 @@
export default {
wizard_welcome: '欢迎使用 Olares',
wizard_welcome: '欢迎使用 beOS Pro',
wizard_continue: '按任意键继续',
step_continue: '继续',
step_label_password: '密码',
step_input_placeholder: '输入 Olares 密码',
err_cloud_admin: '密码错误。请在 Olares Space 中查看初始密码。',
step_input_placeholder: '输入 beOS Pro 密码',
err_cloud_admin: '密码错误。请在本地安装输出中查看初始密码。',
err_cloud_sub: '密码不正确。请重试或联系您的管理员。',
err_selfhosted_admin: '密码错误。请在安装日志的末尾查看初始密码。',
err_selfhosted_sub: '密码不正确。请重试或联系您的管理员。',
@@ -12,31 +12,30 @@ export default {
step_select_language: '选择语言',
step_language: '语言',
step_select_proxy: '选择反向代理',
step_proxy_text_1: '选择一个反向代理以互联网访问 Olares ',
step_proxy_text_1: '选择一个反向代理以互联网访问 beOS Pro ',
step_proxy_text_2: '详细了解',
step_proxy_text_3: 'Olares Space 反向代理',
step_proxy_text_3: '外部反向代理选项',
step_select_region: '选择地区',
vault_title: '激活 Olares',
vault_content_1: '使用 LarePass 扫描二维码完成激活',
vault_content_2: '确保您的智能手机和 Olares 设备于同一网络',
system_title: '初始化 Olares',
system_content_1: '正在初始化 Olares',
vault_title: '激活 beOS Pro',
vault_content_1: '完成本地初始化以继续',
vault_content_2: '确保您的浏览器与设备于同一台机器或局域网中',
system_title: '初始化 beOS Pro',
system_content_1: '正在初始化 beOS Pro',
network_title: '网络配置',
network_content: '正在申请并配置 HTTPS 证书',
network_failed_title: '配置失败',
network_failed_content: '在 LarePass 上重试',
network_failed_content: '在本地重试',
dns_title: 'DNS 解析',
dns_content_1: '正在配置 DNS 解析……',
dns_content_2: '完成后,使用该网址访问 Olares',
dns_content_2: '完成后,使用该网址访问 beOS Pro',
dns_failed_title: 'DNS 解析失败',
dns_failed_content: '在 LarePass 上重试',
dns_failed_content: '在本地重试',
reset_password_title: '正在重置密码……',
reset_password_content:
'在 LarePass 应用中创建新的 Olares 登录密码。成功后初始密码失效。',
reset_password_content: '创建新的 beOS Pro 登录密码。成功后初始密码失效。',
use_reverse_proxy: '使用反向代理',
use_not_reverse_proxy: '不使用反向代理',
message_need_frp: '网络环境已变化。建议使用反向代理访问 Olares。',
message_need_frp: '网络环境已变化。建议使用反向代理访问 beOS Pro。',
message_not_need_frp: '如果您有固定 IP无需选择反向代理。',
close: '关闭'
};

View File

@@ -22,10 +22,8 @@ export async function googleLogin(
await LarePassSocialLogin.initialize({
google: {
webClientId:
getAppPlatform().socialKeys.google.webClientId,
iOSClientId:
getAppPlatform().socialKeys.google.iOSClientId,
webClientId: getAppPlatform().socialKeys.google.webClientId,
iOSClientId: getAppPlatform().socialKeys.google.iOSClientId,
mode: 'online'
}
});

View File

@@ -82,7 +82,10 @@ export class WebPlatform extends SubAppPlatform {
const userStore = useUserStore();
return this.getTerminusInfo()
.then((data) => {
if (data.olaresId && data.wizardStatus == 'completed') {
if (
((data as any).beosId || data.olaresId) &&
data.wizardStatus == 'completed'
) {
return userStore.load().then(() => {
userStore.currentUserSaveTerminusInfo(data);
if (userStore.isBooted) {
@@ -197,7 +200,7 @@ export class WebPlatform extends SubAppPlatform {
baseUrl = '';
}
const data: any = await axios.get(baseUrl + '/bfl/info/v1/olares-info');
const data: any = await axios.get(baseUrl + '/bfl/info/v1/beos-info');
return data;
}

View File

@@ -20,8 +20,7 @@ export class GoogleAuthService extends OperateIntegrationAuth<GoogleIntegrationA
await LarePassSocialLogin.initialize({
google: {
webClientId: getAppPlatform().socialKeys.google.webClientId,
iOSClientId:
getAppPlatform().socialKeys.google.iOSClientId,
iOSClientId: getAppPlatform().socialKeys.google.iOSClientId,
mode: getAppPlatform().getQuasar()?.platform.is?.android
? 'offline'
: 'online' // replaces grantOfflineAccess

View File

@@ -1185,6 +1185,10 @@ export const useMDNSStore = defineStore('mdnsStore', {
}
});
const baseURL = this.versionRequestBaseUrl();
if (!baseURL) {
return undefined;
}
const result = await axiosP.post('/getUpgradeableVersion', data);
if (result && result.status == 200 && result.data.code == 200) {
return result.data.data;
@@ -1199,11 +1203,11 @@ export const useMDNSStore = defineStore('mdnsStore', {
if (process.env.NODE_ENV == 'development') {
return '';
}
const userStore = useUserStore();
if (userStore.defaultDomain == 'cn') {
return 'https://api.olares.cn/upgrade';
}
return 'https://api.olares.com/upgrade';
return (
process.env.BEOS_UPGRADE_SERVICE ||
process.env.OLARES_UPGRADE_SERVICE ||
''
);
},
async getOlaresInfo() {

View File

@@ -33,7 +33,11 @@ export const useTokenStore = defineStore('token', {
},
getters: {
target_url(): string {
const name = this.user.olaresId.replace('@', '.');
const name = (
(this.user as any).beosId ||
this.user.olaresId ||
this.user.terminusName
).replace('@', '.');
const desktopURL = 'https://desktop.' + name;
const urlParams = new URLSearchParams(window.location.search);
let targetUrl = urlParams.get('redirect') || urlParams.get('rd');
@@ -48,13 +52,17 @@ export const useTokenStore = defineStore('token', {
return targetURL;
},
olaresId(): string {
return this.user.olaresId || this.user.terminusName;
return (
(this.user as any).beosId ||
this.user.olaresId ||
this.user.terminusName
);
}
},
actions: {
async loadData() {
const data: any = await axios.get(
this.url + '/bfl/info/v1/olares-info',
this.url + '/bfl/info/v1/beos-info',
{}
);
this.user = data;

View File

@@ -77,7 +77,12 @@ export const useTokenStore = defineStore('token', {
return this.wizard.step;
},
olaresId(): string {
return this.user?.olaresId || this.user?.terminusName || '';
return (
(this.user as any)?.beosId ||
this.user?.olaresId ||
this.user?.terminusName ||
''
);
},
get_terminus_url(): string | undefined {
if (!this.user) {
@@ -96,14 +101,12 @@ export const useTokenStore = defineStore('token', {
return res;
},
avatar_url(): string {
if (!this.user || !this.user.olaresId) {
return 'https://app.cdn.olares.com/avatar3/1.png';
if (!this.user || !this.olaresId) {
return '/account/nft_default_img.png';
}
if (!this.user.avatar) {
const id = stringToIntHash(this.user.olaresId, 1, 36);
return `https://app.cdn.olares.com/avatar3/${id}.png`;
return '/account/nft_default_img.png';
}
if (this.user.avatar.startsWith('http')) {
@@ -113,7 +116,7 @@ export const useTokenStore = defineStore('token', {
if (re.test(this.user.avatar)) {
console.log('re test true');
return 'https://app.cdn.olares.com/avatar3/' + this.user.avatar;
return '/account/' + this.user.avatar;
} else {
try {
const vp = JSON.parse(this.user.avatar);
@@ -139,11 +142,11 @@ export const useTokenStore = defineStore('token', {
console.log(imageUrl);
return imageUrl;
} else {
return 'https://app.cdn.olares.com/avatar3/1.png';
return '/account/nft_default_img.png';
}
} catch (e) {
console.log(e);
return 'https://app.cdn.olares.com/avatar3/1.png';
return '/account/nft_default_img.png';
}
}
}
@@ -154,7 +157,7 @@ export const useTokenStore = defineStore('token', {
async loadData(isDefault = false) {
try {
const data: any = await axios.get(
this.url + '/bfl/info/v1/olares-info',
this.url + '/bfl/info/v1/beos-info',
{}
);
if (data.wizardStatus) {
@@ -215,7 +218,7 @@ export const useTokenStore = defineStore('token', {
}
try {
const data: any = await axios.get(
this.get_auth_url + '/bfl/info/v1/olares-info'
this.get_auth_url + '/bfl/info/v1/beos-info'
);
if (data.wizardStatus) {
this.user = data;

View File

@@ -197,7 +197,7 @@ export const getOlaresInfo = async (
const res = await instance.get(
(baseURL.endsWith('/') ? baseURL : baseURL + '/') +
'bfl/info/v1/olares-info'
'bfl/info/v1/beos-info'
);
const terminusInfo: OlaresInfo = res.data.data;
return terminusInfo;

View File

@@ -250,15 +250,15 @@ export const defaultDomains: {
value: DefaultDomainValueType;
}[] = [
{
name: 'olares.com',
name: 'beos.local',
value: 'global'
},
{
name: 'olares.cn',
name: 'beos.internal',
value: 'cn'
}
];
export const getDomainNameByType = (value: DefaultDomainValueType) => {
return defaultDomains.find((e) => e.value == value)?.name || 'olares.com';
return defaultDomains.find((e) => e.value == value)?.name || 'beos.local';
};

View File

@@ -14,13 +14,12 @@ export const isPad = () => {
const services = {
en: {
serviceAgreement: 'https://cdn.bttcdn.com/os/en/LarePass-agreement.html',
privacyPolicy: 'https://cdn.bttcdn.com/os/en/LarePass-privacy.html'
serviceAgreement: '/legal/service-agreement.html',
privacyPolicy: '/legal/privacy-policy.html'
},
zh: {
serviceAgreement:
'https://cdn.api.jointerminus.cn/os/zh/LarePass-agreement.html',
privacyPolicy: 'https://cdn.api.jointerminus.cn/os/zh/LarePass-privacy.html'
serviceAgreement: '/legal/service-agreement.zh.html',
privacyPolicy: '/legal/privacy-policy.zh.html'
}
};

View File

@@ -1,6 +1 @@
export const commonInterceptValue = [
"<h1><a href='https://www.bytetradelab.io/'>Bytetrade</a></h1>",
"<h1><a href='https://www.bytetradelab.io/'>Olares</a></h1>",
"<h1><a href='https://olares.xyz/'>Olares</a></h1>",
"<h1><a href='https://www.olares.com/'>Olares</a></h1>"
];
export const commonInterceptValue = ['<h1>beOS Pro</h1>'];

View File

@@ -309,6 +309,7 @@ func (h *Handler) handleOlaresInfo(req *restful.Request, resp *restful.Response)
tInfo := OlaresInfo{}
tInfo.OlaresID = userOp.GetTerminusName(user)
tInfo.BeOSID = tInfo.OlaresID
status := userOp.GetTerminusStatus(user)
if status == "" {
@@ -327,8 +328,10 @@ func (h *Handler) handleOlaresInfo(req *restful.Request, resp *restful.Response)
tInfo.OsVersion = osVersion
tInfo.Olaresd = "0"
tInfo.BeOSd = "0"
if terminusd {
tInfo.Olaresd = "1"
tInfo.BeOSd = "1"
}
terminusId, err := userOp.GetTerminusID()

View File

@@ -44,6 +44,7 @@ type TerminusInfo struct {
}
type OlaresInfo struct {
BeOSID string `json:"beosId,omitempty"`
OlaresID string `json:"olaresId"`
WizardStatus constants.WizardStatus `json:"wizardStatus"`
EnableReverseProxy bool `json:"enableReverseProxy"`
@@ -53,6 +54,7 @@ type OlaresInfo struct {
Avatar string `json:"avatar"`
ID string `json:"id"`
UserDID string `json:"did"`
BeOSd string `json:"beosd,omitempty"`
Olaresd string `json:"olaresd"`
Style string `json:"style"`
}

View File

@@ -36,7 +36,13 @@ func AddContainer(c *restful.Container) error {
ws.Route(ws.GET("/olares-info").
To(handler.handleOlaresInfo).
Doc("olares information.").
Doc("system information.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(http.StatusOK, "", response.Response{}))
ws.Route(ws.GET("/beos-info").
To(handler.handleOlaresInfo).
Doc("beOS Pro system information.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(http.StatusOK, "", response.Response{}))
@@ -72,7 +78,13 @@ func AddContainer(c *restful.Container) error {
wsWizard.Route(wsWizard.GET("/olares-info").
To(handler.handleOlaresInfo).
Doc("olares information.").
Doc("system information.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(http.StatusOK, "", response.Response{}))
wsWizard.Route(wsWizard.GET("/beos-info").
To(handler.handleOlaresInfo).
Doc("beOS Pro system information.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Returns(http.StatusOK, "", response.Response{}))