Support disabling version check (#2648)

* Support disabling version check

* Update docs

* Move the bypass logic back to update checking function

* fix linting

* fix linting (again)
This commit is contained in:
minhducsun2002
2026-06-03 19:42:15 +07:00
committed by GitHub
parent bc95a2851f
commit d0566a1df9
3 changed files with 15 additions and 6 deletions
@@ -5,11 +5,12 @@ title: Optional Configuration
You can set these environment variables to configure the container. They are not required, but can be useful in some cases. You can set these environment variables to configure the container. They are not required, but can be useful in some cases.
| Env | Default | Example | Description | | Env | Default | Example | Description |
| -------------- | --------- | ----------- | ---------------------------------- | | ----------------------- | --------- | ----------- | --------------------------------------- |
| `PORT` | `51821` | `6789` | TCP port for Web UI. | | `PORT` | `51821` | `6789` | TCP port for Web UI. |
| `HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. | | `HOST` | `0.0.0.0` | `localhost` | IP address web UI binds to. |
| `INSECURE` | `false` | `true` | If access over http is allowed | | `INSECURE` | `false` | `true` | If access over http is allowed |
| `DISABLE_IPV6` | `false` | `true` | If IPv6 support should be disabled | | `DISABLE_IPV6` | `false` | `true` | If IPv6 support should be disabled |
| `DISABLE_VERSION_CHECK` | `false` | `true` | If wg-easy should check for new updates |
/// note | IPv6 Caveats /// note | IPv6 Caveats
+1
View File
@@ -38,6 +38,7 @@ export const WG_ENV = {
/** If IPv6 should be disabled */ /** If IPv6 should be disabled */
DISABLE_IPV6: process.env.DISABLE_IPV6 === 'true', DISABLE_IPV6: process.env.DISABLE_IPV6 === 'true',
WG_EXECUTABLE: await detectAwg(), WG_EXECUTABLE: await detectAwg(),
DISABLE_VERSION_CHECK: process.env.DISABLE_VERSION_CHECK === 'true',
}; };
export const WG_INITIAL_ENV = { export const WG_INITIAL_ENV = {
+7
View File
@@ -4,6 +4,13 @@ type GithubRelease = {
}; };
async function fetchLatestRelease() { async function fetchLatestRelease() {
if (WG_ENV.DISABLE_VERSION_CHECK) {
return {
version: RELEASE,
changelog: '',
};
}
try { try {
const response = await $fetch<GithubRelease>( const response = await $fetch<GithubRelease>(
'https://api.github.com/repos/wg-easy/wg-easy/releases/latest', 'https://api.github.com/repos/wg-easy/wg-easy/releases/latest',