Browse Source

refactor: change env name

pull/2102/head
cany748 1 month ago
parent
commit
aa91e7a2d5
  1. 6
      src/server/utils/config.ts
  2. 4
      src/server/utils/wgHelper.ts

6
src/server/utils/config.ts

@ -20,10 +20,10 @@ 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',
/** Override automatic detection */ /** Override automatic detection */
AWG: OVERRIDE_AUTO_AWG:
process.env.AWG === 'true' process.env.OVERRIDE_AUTO_AWG === 'true'
? true ? true
: process.env.AWG === 'false' : process.env.OVERRIDE_AUTO_AWG === 'false'
? false ? false
: undefined, : undefined,
/** TODO: delete on next major version */ /** TODO: delete on next major version */

4
src/server/utils/wgHelper.ts

@ -12,8 +12,8 @@ type Options = {
let wgExecutable: 'awg' | 'wg' = 'wg'; let wgExecutable: 'awg' | 'wg' = 'wg';
if (WG_ENV.EXPERIMENTAL_AWG) { if (WG_ENV.EXPERIMENTAL_AWG) {
if (WG_ENV.AWG !== undefined) { if (WG_ENV.OVERRIDE_AUTO_AWG !== undefined) {
wgExecutable = WG_ENV.AWG ? 'awg' : 'wg'; wgExecutable = WG_ENV.OVERRIDE_AUTO_AWG ? 'awg' : 'wg';
} else { } else {
wgExecutable = await exec('modinfo amneziawg') wgExecutable = await exec('modinfo amneziawg')
.then(() => 'awg' as const) .then(() => 'awg' as const)

Loading…
Cancel
Save