Skip to content

Commit

Permalink
Fix: if you can't use imported server configuration, it is related to
Browse files Browse the repository at this point in the history
default template issue.(Fixed)

Chore: packages upgraded
  • Loading branch information
shaonhuang committed Feb 20, 2024
1 parent 42efce8 commit 4acdf67
Show file tree
Hide file tree
Showing 8 changed files with 601 additions and 575 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "v2rayx",
"version": "0.4.4",
"version": "0.4.5",
"description": "An all-platform (Macos Windows Linux) V2ray client build with electron.",
"main": "./out/main/index.js",
"author": "shaonhuang",
Expand Down Expand Up @@ -31,31 +31,31 @@
"@electron-toolkit/preload": "^3.0.0",
"@electron-toolkit/utils": "^3.0.0",
"@monaco-editor/react": "^4.6.0",
"@mui/system": "^5.15.6",
"@mui/x-data-grid": "^6.19.2",
"@mui/x-date-pickers": "^6.19.2",
"@sentry/electron": "^4.17.0",
"@tanstack/react-query": "^5.18.0",
"@mui/system": "^5.15.9",
"@mui/x-data-grid": "^6.19.4",
"@mui/x-date-pickers": "^6.19.4",
"@sentry/electron": "^4.18.0",
"@tanstack/react-query": "^5.22.2",
"adm-zip": "^0.5.10",
"animate.css": "^4.1.1",
"buffer": "^6.0.3",
"chalk": "^5.3.0",
"chokidar": "^3.5.3",
"chokidar": "^3.6.0",
"compare-versions": "^6.1.0",
"cron": "^3.1.6",
"desktop-screenshot": "^0.1.1",
"electron-progressbar": "^2.2.0",
"electron-updater": "6.1.8",
"electron-progressbar": "^2.2.1",
"electron-updater": "6.1.9",
"eventemitter3": "^5.0.1",
"jsqr": "^1.4.0",
"lodash": "^4.17.21",
"lowdb": "^7.0.1",
"material-react-table": "^2.10.0",
"material-react-table": "^2.11.3",
"monaco-editor": "^0.45.0",
"net": "^1.0.2",
"object-hash": "^3.0.0",
"qrcode": "^1.5.3",
"react-router-dom": "^6.21.3",
"react-router-dom": "^6.22.1",
"redux-logger": "^3.0.6",
"rxjs": "^7.8.1",
"tapable": "^2.2.1",
Expand All @@ -64,11 +64,11 @@
},
"devDependencies": {
"@electron-toolkit/tsconfig": "^1.0.1",
"@electron/notarize": "^2.2.1",
"@electron/notarize": "^2.3.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.6",
"@mui/material": "^5.15.6",
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@reduxjs/toolkit": "^1.9.7",
"@types/adm-zip": "^0.5.5",
"@types/electron-progressbar": "^1.2.6",
Expand All @@ -78,22 +78,22 @@
"@types/node": "^18.17.14",
"@types/object-hash": "^3.0.6",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@types/react-router-dom": "^5.3.3",
"@types/redux-logger": "^3.0.13",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"@wdio/cli": "^8.29.3",
"@wdio/local-runner": "^8.29.3",
"@wdio/mocha-framework": "^8.29.3",
"@wdio/spec-reporter": "^8.29.3",
"@wdio/types": "^8.29.1",
"@wdio/cli": "^8.32.2",
"@wdio/local-runner": "^8.32.2",
"@wdio/mocha-framework": "^8.32.2",
"@wdio/spec-reporter": "^8.32.2",
"@wdio/types": "^8.32.2",
"autoprefixer": "^10.4.17",
"cross-env": "^7.0.3",
"electron": "^28.2.0",
"electron-builder": "24.12.0",
"electron": "^28.2.3",
"electron-builder": "24.13.1",
"electron-vite": "^2.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -103,18 +103,18 @@
"express": "^4.18.2",
"html-to-text": "^9.0.5",
"js-base64": "^3.7.6",
"postcss": "^8.4.33",
"prettier": "^3.2.4",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.1.3",
"tailwindcss": "^3.4.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"wdio-electron-service": "^6.2.0",
"webdriverio": "^8.29.3"
"vite": "^5.1.3",
"wdio-electron-service": "^6.3.1",
"webdriverio": "^8.32.2"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: v2rayx # you probably want to 'snapcraft register <name>'
base: core20 # the base snap is the execution environment for this snap
version: '0.4.4' # just for humans, typically '1.2+git' or '1.3.2'
version: '0.4.5' # just for humans, typically '1.2+git' or '1.3.2'
summary: V2ray client for v2ray services # 79 char long summary
description: |
An all platform (Macos Windows Linux) V2ray client build with electron.
Expand Down
2 changes: 1 addition & 1 deletion src/main/lib/lowdb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LowWithLodash<T> extends Low<T> {

const userData = app.getPath('userData');
const dbPathOld = join(userData, 'lowdb', 'dbv2.json');
const dbPath = join(userData, 'lowdb', 'dbv4.json');
const dbPath = join(userData, 'lowdb', 'dbv5.json');
const parentDir = join(userData, 'lowdb');
if (existsSync(dbPathOld)) {
// Use the unlink method to delete the file
Expand Down
6 changes: 3 additions & 3 deletions src/main/services/core/listener/v2ray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import logger from '@lib/logs';
import db from '@lib/lowdb';
import { ipcMain } from 'electron';
import emitter from '@lib/event-emitter';
import { find, flattenDeep, uniqBy } from 'lodash';
import { find, flattenDeep, uniqBy, cloneDeep } from 'lodash';

import ProxyService from '@main/services/core/proxy';
import V2rayService from '@main/services/core/v2ray';
Expand All @@ -19,7 +19,7 @@ const listeners = () => {
.map((i) => i.subServers),
]);
const outbound = find(outbounds, { id: currentServerId ?? '' })?.outbound;
const template = db.chain.get('serverTemplate').value();
const template = cloneDeep(db.chain.get('serverTemplate').value());
template.inbounds = uniqBy(
[...template.inbounds, ...db.chain.get('management.v2rayConfigure.inbounds').value()],
'tag',
Expand Down Expand Up @@ -76,7 +76,7 @@ const listeners = () => {
.map((i) => i.subServers),
]);
const outbound = find(outbounds, { id: currentServerId ?? '' })?.outbound;
const template = db.chain.get('serverTemplate').value();
const template = cloneDeep(db.chain.get('serverTemplate').value());
const v2rayLogsFolder = db.chain.get('management.generalSettings.v2rayLogsFolder').value();
const dns = JSON.parse(db.chain.get('management.v2rayConfigure.dns').value());
template.log = {
Expand Down
4 changes: 2 additions & 2 deletions src/main/services/hooks/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ProxyService from '@main/services/core/proxy';
import { existsSync } from 'node:fs';
import Window from '@main/services/browser';
import { app } from 'electron';
import { find, flattenDeep } from 'lodash';
import { find, flattenDeep, cloneDeep } from 'lodash';
import { Mode } from '@main/lib/constant/types';
import { isWindows } from '@main/lib/constant';

Expand All @@ -32,7 +32,7 @@ const autoStartProxy = (electronApp: ElectronApp) => {
}),
);
const outbound = find(outbounds, { id: currentServerId ?? '' })?.outbound;
const template = db.chain.get('serverTemplate').value();
const template = cloneDeep(db.chain.get('serverTemplate').value());
const dns = JSON.parse(db.chain.get('management.v2rayConfigure.dns').value());
template.log = {
error: v2rayLogsFolder.concat('error.log'),
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GernalSettings from '@renderer/pages/Home';
import Servers from '@renderer/pages/servers';
import About from '@renderer/pages/About';
import Logs from '@renderer/pages/Logs';
import Settings from '@renderer/pages/settings/';
import Settings from '@renderer/pages/settings';
import QRcode from '@renderer/pages/qrcode';
import Subscriptions from '@renderer/pages/subscriptions';
import PACSettings from '@renderer/pages/pac';
Expand Down
Loading

0 comments on commit 4acdf67

Please sign in to comment.