Browse Source

Support disabling version check

pull/2648/head
minhducsun2002 2 days ago
committed by Bernd Storath
parent
commit
87cf9e96f9
  1. 8
      src/server/api/information.get.ts
  2. 1
      src/server/utils/config.ts

8
src/server/api/information.get.ts

@ -1,7 +1,13 @@
import { gt } from 'semver';
export default defineEventHandler(async () => {
const latestRelease = await cachedFetchLatestRelease();
let latestRelease: Awaited<ReturnType<typeof cachedFetchLatestRelease>>;
if (WG_ENV.DISABLE_VERSION_CHECK) {
latestRelease = { version: RELEASE, changelog: '' };
} else {
latestRelease = await cachedFetchLatestRelease();
}
const updateAvailable = gt(latestRelease.version, RELEASE);
const insecure = WG_ENV.INSECURE;
const isAwg = WG_ENV.WG_EXECUTABLE === 'awg';

1
src/server/utils/config.ts

@ -38,6 +38,7 @@ export const WG_ENV = {
/** If IPv6 should be disabled */
DISABLE_IPV6: process.env.DISABLE_IPV6 === 'true',
WG_EXECUTABLE: await detectAwg(),
DISABLE_VERSION_CHECK: process.env.DISABLE_VERSION_CHECK === 'true'
};
export const WG_INITIAL_ENV = {

Loading…
Cancel
Save