Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-update #160

Open
Revadike opened this issue Dec 9, 2021 · 10 comments
Open

Auto-update #160

Revadike opened this issue Dec 9, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@Revadike
Copy link
Owner

Revadike commented Dec 9, 2021

Current Behavior (if any)

Only notifies of new version.

Desired Behavior

Add a setting, such that epicgames-freebies-claimer will auto-update.

Motivation / Use Case for Changing the Behavior

If a breaking bug occurs, fixes can be automatically retrieved and operation can continue normally.

@Revadike Revadike added the enhancement New feature or request label Dec 9, 2021
@jackblk
Copy link
Contributor

jackblk commented Dec 10, 2021

Currently if user uses Docker image, it already has auto update via latest tag. Docker user will want to disable this option as default, but non-docker user will want it to be enabled as default.

If we use config file to disable/enable this option, it will cause a problem. Normally people will run the docker image without providing config.json file, so it will copy from the example config (enabled as default for non-docker user). Can be done, but not nice to use.

So in order to avoid conflict with docker users, I suggest that we have check for an environment variable like EFC_DISABLE_AUTO_UPDATE. If this env var is true, then we will disable auto update. This is very easy to config in Dockerfile, we will disable auto update module in Docker image as default.

If Docker user wants to have autoupdate, they can also override the env var. Win-win for docker or non-docker user.

@Revadike
Copy link
Owner Author

Maybe this latest tag can override the config value, if we can detect it somehow for docker.

@jackblk
Copy link
Contributor

jackblk commented Dec 13, 2021

Hmm then maybe we can have both? EFC will check for the:

  • Auto update behavior in config.json
  • Env var EFC_DISABLE_AUTO_UPDATE

Something like: if (!process.env.EFC_DISABLE_AUTO_UPDATE && config.autoUpdateFlag)

This way, even if we use default config, we can still disable it on docker image via env var EFC_DISABLE_AUTO_UPDATE.

@Revadike
Copy link
Owner Author

Is it not safe to assume people with the latest tag want auto-update enabled?

@jackblk
Copy link
Contributor

jackblk commented Dec 13, 2021

If user uses latest tag on docker, it will automatically update to new version when I publish the new version (docker behavior). So they don't need to check or use the auto update module. If user wants to use a specific version (v1.5.6 for example), then they want to pin the version and do not want to update.

My suggestion for EFC_DISABLE_AUTO_UPDATE env var is for the docker user convenience (they can use default config file and disable via env var, which is easy to do in docker). It will not affect normal user.

I hope this makes sense 🤔

@Revadike
Copy link
Owner Author

How about we just disable any auto-update features if the user uses docker, since they have their own system anyway?

@jackblk
Copy link
Contributor

jackblk commented Dec 13, 2021

Yeah that's what I'm suggesting. And the easiest way to do it is via checking env var EFC_DISABLE_AUTO_UPDATE .

@Revadike
Copy link
Owner Author

@jackblk
Copy link
Contributor

jackblk commented Dec 14, 2021

https://github.com/sindresorhus/is-docker/blob/main/index.js maybe

It just checks for docker env & group, just like what we are trying to do by checking env var EFC_DISABLE_AUTO_UPDATE.

if (!process.env.EFC_DISABLE_AUTO_UPDATE && config.autoUpdateFlag) is enough for us, only docker user will have that specific env var to disable autoupdate module.

@ffuubarbuzz
Copy link
Contributor

My 5 cents: I'm using docker in DSM (Synology's OS) and it doesn't auto-update containers built with the latest tag, I'd need to download new image and reset the container manually. Some other containers I run do auto-update the software they run inside and I find it extremely useful!

@Revadike Revadike mentioned this issue Jan 1, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants