mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-19 17:26:34 +00:00
Merge pull request #4002 from balena-io/aethernet/remove-getconfig
Remove configuration remote update
This commit is contained in:
commit
10e2da2c00
@ -138,7 +138,8 @@ const translation = {
|
||||
autoUpdate: 'Auto-updates enabled',
|
||||
settings: 'Settings',
|
||||
systemInformation: 'System Information',
|
||||
trimExtPartitions: 'Trim unallocated space on raw images (in ext-type partitions)',
|
||||
trimExtPartitions:
|
||||
'Trim unallocated space on raw images (in ext-type partitions)',
|
||||
},
|
||||
menu: {
|
||||
edit: 'Edit',
|
||||
|
@ -17,10 +17,10 @@
|
||||
import { Dictionary } from 'lodash';
|
||||
|
||||
type BalenaTag = {
|
||||
id: number,
|
||||
name: string,
|
||||
value: string
|
||||
}
|
||||
id: number;
|
||||
name: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export class EtcherPro {
|
||||
private supervisorAddr: string;
|
||||
|
@ -26,7 +26,6 @@ import './app/i18n';
|
||||
|
||||
import { packageType, version } from '../../package.json';
|
||||
import * as EXIT_CODES from '../shared/exit-codes';
|
||||
import { delay, getConfig } from '../shared/utils';
|
||||
import * as settings from './app/models/settings';
|
||||
import { buildWindowMenu } from './menu';
|
||||
import * as i18n from 'i18next';
|
||||
@ -206,32 +205,6 @@ async function createMainWindow() {
|
||||
)}`,
|
||||
);
|
||||
|
||||
const page = mainWindow.webContents;
|
||||
|
||||
page.once('did-frame-finish-load', async () => {
|
||||
console.log('packageUpdatable', packageUpdatable);
|
||||
autoUpdater.on('error', (err) => {
|
||||
logMainProcessException(err);
|
||||
});
|
||||
if (packageUpdatable) {
|
||||
try {
|
||||
const configUrl = await settings.get('configUrl');
|
||||
const onlineConfig = await getConfig(configUrl);
|
||||
const autoUpdaterConfig: AutoUpdaterConfig = onlineConfig?.autoUpdates
|
||||
?.autoUpdaterConfig ?? {
|
||||
autoDownload: false,
|
||||
};
|
||||
for (const [key, value] of Object.entries(autoUpdaterConfig)) {
|
||||
autoUpdater[key as keyof AutoUpdaterConfig] = value;
|
||||
}
|
||||
const checkForUpdatesTimer =
|
||||
onlineConfig?.autoUpdates?.checkForUpdatesTimer ?? 300000;
|
||||
checkForUpdates(checkForUpdatesTimer);
|
||||
} catch (err) {
|
||||
logMainProcessException(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
|
@ -32,16 +32,6 @@ export function percentageToFloat(percentage: any) {
|
||||
return percentage / 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Get etcher configs stored online
|
||||
* @param {String} - url where config.json is stored
|
||||
*/
|
||||
export async function getConfig(configUrl?: string): Promise<Dictionary<any>> {
|
||||
configUrl = configUrl ?? 'https://balena.io/etcher/static/config.json';
|
||||
const response = await axios.get(configUrl, { responseType: 'json' });
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function delay(duration: number): Promise<void> {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, duration);
|
||||
|
@ -23,7 +23,11 @@ import * as path from 'path';
|
||||
import { env } from 'process';
|
||||
import * as SimpleProgressWebpackPlugin from 'simple-progress-webpack-plugin';
|
||||
import * as TerserPlugin from 'terser-webpack-plugin';
|
||||
import { BannerPlugin, IgnorePlugin, NormalModuleReplacementPlugin } from 'webpack';
|
||||
import {
|
||||
BannerPlugin,
|
||||
IgnorePlugin,
|
||||
NormalModuleReplacementPlugin,
|
||||
} from 'webpack';
|
||||
import * as PnpWebpackPlugin from 'pnp-webpack-plugin';
|
||||
|
||||
import * as tsconfigRaw from './tsconfig.webpack.json';
|
||||
@ -327,7 +331,7 @@ const commonConfig = {
|
||||
// See https://github.com/aws/aws-sdk-js-v3/issues/3025
|
||||
new IgnorePlugin({
|
||||
resourceRegExp: /^aws-crt$/,
|
||||
})
|
||||
}),
|
||||
],
|
||||
resolveLoader: {
|
||||
plugins: [PnpWebpackPlugin.moduleLoader(module)],
|
||||
|
Loading…
x
Reference in New Issue
Block a user