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
Added env var for disabling update checks #3986
base: master
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -25,6 +25,7 @@ ONE_SESSION_PER_USER=<If users are only allowed to be logged in on one browser, | |||
CLASSIFICATION_BANNER_TEXT=<If a sensitivity classification banner should be shown to users, for example FOUO (if nothing is provided, no banner is shown)> | |||
CLASSIFICATION_BANNER_TEXT_COLOR=<The color of the text on the sensitivity classification banner, if enabled (defaults to white)> | |||
CLASSIFICATION_BANNER_COLOR=<The color of the sensitivity classification banner, if enabled (defaults to red)> | |||
DISABLE_UPDATE_CHECK=<Disable checking GitHub for an updated version of Heimdall2 (defaults to false)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please match other variable names
DISABLE_UPDATE_CHECK=<Disable checking GitHub for an updated version of Heimdall2 (defaults to false)> | |
UPDATE_CHECK_DISABLED=<Disable checking GitHub for an updated version of Heimdall2 (defaults to false)> |
@@ -56,7 +56,8 @@ export class ConfigService { | |||
oidcName: this.get('OIDC_NAME') || '', | |||
ldap: this.get('LDAP_ENABLED')?.toLocaleLowerCase() === 'true' || false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ldap: this.get('LDAP_ENABLED')?.toLocaleLowerCase() === 'true' || false, | |
ldap: this.get('LDAP_ENABLED')?.toLowerCase() === 'true', |
@@ -56,7 +56,8 @@ export class ConfigService { | |||
oidcName: this.get('OIDC_NAME') || '', | |||
ldap: this.get('LDAP_ENABLED')?.toLocaleLowerCase() === 'true' || false, | |||
registrationEnabled: this.isRegistrationAllowed(), | |||
localLoginEnabled: this.isLocalLoginAllowed() | |||
localLoginEnabled: this.isLocalLoginAllowed(), | |||
disableUpdateCheck: !!this.get('DISABLE_UPDATE_CHECK') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only check if there's a non-empty string. Also please propagate moving the 'disable' part to the end of the name.
$ node
Welcome to Node.js v18.12.1.
Type ".help" for more information.
> false
false
> 'false'
'false'
> !'false'
false
> !!'false'
true
disableUpdateCheck: !!this.get('DISABLE_UPDATE_CHECK') | |
updateCheckDisabled: this.get('UPDATE_CHECK_DISABLED')?.toLowerCase() === 'true' |
@@ -54,7 +55,7 @@ export class AppInfo extends VuexModule implements IAppInfoState { | |||
|
|||
@Action | |||
public async CheckForUpdates() { | |||
if (this.checkedForUpdates === false) { | |||
if (!ServerModule.disableUpdateCheck && this.checkedForUpdates === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this into its own guard clause where we can set 'SET_VERSION' to the deployed instance's version and 'SET_CHECKED_FOR_UPDATES' to true.
This PR adds an environment config item for disabling checks for Heimdall2 updates.
This is useful in cases where Heimdall2 is being used as a component of a larger system, and that system's maintainers do not wish this update banner to appear for end users.
It also is useful in airgapped usecases where Heimdall2 may not have access to GitHub to check for a newer version.