env DISABLE_UPDATE

Massimo Melina committed Jan 8, 2025 at 17:45 UTC a4fc06b36cff1ed57cf9b3589997a5e5f13ea68e
2 files changed +3 -2
config.md
+2 -1
@@ -4,7 +4,7 @@ This file contains details about the configuration files.
4
5 Configuration is stored in the file `config.yaml`, exception made for custom HTML which is stored in `custom.html`.
6
7 -These files are kept in the Current Working Directory (cwd), which is by default the same folder of `hfs.exe`.
7 +These files are kept in the Current Working Directory (cwd), which is by default the same folder of `hfs.exe`
8 if you are using this kind of distribution on Windows, or `USER_FOLDER/.hfs` on other systems.
9 Many things are stored in the CWD, like the plugins you install.
10 You can decide a different CWD passing `--cwd SOME_FOLDER` parameter at command line.
@@ -35,6 +35,7 @@ Configuration can be done in several ways
35 `echo "port: 1080" >> config.yaml`
36 - after HFS has started you can enter console command in the form `config NAME VALUE`
37 - setting special env `HFS_ENV_BOOTSTRAP=true` will disable other envs when file config.yaml already exists.
38 +- env `DISABLE_UPDATE` (designed for containers) will disable updating, but check-for-update will still be possible.
39
40 `NAME` stands for the property name that you want to change. See the complete list below.
41
src/update.ts
+1 -1
@@ -98,7 +98,7 @@ export function localUpdateAvailable() {
98 }
99
100 export async function updateSupported() {
101 - return argv.forceupdate || IS_BINARY && !await RUNNING_AS_SERVICE
101 + return process.env.DISABLE_UPDATE ? false : (argv.forceupdate || IS_BINARY && !await RUNNING_AS_SERVICE)
102 }
103
104 export async function update(tagOrUrl: string='') {