Skip to content

Commit 41caa51

Browse files
committed
Merge branch 'better-process-handling'
2 parents 4420edf + ef8509f commit 41caa51

31 files changed

+484
-62
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
### Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.4.0] - 2019-02-26
5+
### Fixed
6+
- With multiple folders in the backup job the S3 paths were wrong
7+
### Changed
8+
- Now processes run in sequential order for better performance
9+
### Added
10+
- Stop backup button in job list view
11+
- Now the AWS CLI processes are killed on app exit
12+
- Now the current backup running process are killed after its done
13+
- Bucket info: size and number of objects are shown in S3 explorer view through AWS Cloudwatch
14+
- More app's icons for better rendering on Win 10 OS
15+
- Now you can limit S3 upload speed by adjust bandwidth and concurrent requests,
16+
to avoid excessive band consumption
17+
- Now you can set the backup max duration time, in order to stop the backup after a certain
18+
amount of time regardless the real time needed to complete the backup.
19+
420
## [1.3.0] - 2019-02-26
521
### Added
622
- Auto updater

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ You can find the AWS CLI installer here: [Download AWS CLI](https://aws.amazon.c
2626

2727
## Windows executable (portable and installer)
2828

29-
[Check releases](https://github.com/ulver2812/aws-s3-backup/releases)
29+
[Download here](https://github.com/ulver2812/aws-s3-backup/releases)
30+
31+
## Changelog
32+
33+
[Check changelog](https://github.com/ulver2812/aws-s3-backup/blob/master/CHANGELOG.md)
3034

3135
## Getting Started
3236

@@ -75,7 +79,7 @@ Don't forget to deactivate the "Developer Tools" by commenting `win.webContents.
7579
## AWS app settings
7680

7781
In order to use the app you need to set in the settings page an "AWS access key ID" and an "AWS secret access key" that you can create through the IAM service in the AWS console.
78-
The IAM user needs a programmatic access account with a correct read/write S3 policy attached. You can use any IAM S3 policy that grant access to the buckets that you want to use with the app.
82+
The IAM user needs a programmatic access account with a correct read/write S3 policy attached (e.g AmazonS3FullAccess) and CloudWatch Metrics (e.g CloudWatchReadOnlyAccess). You can use any IAM S3 policy that grant access to the buckets that you want to use with the app.
7983
Here an example policy: [IAM S3 example policy](https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html)
8084

8185
## To correctly quit the app

icons/favicon.128x128.png

19.4 KB
Loading

icons/favicon.16x16.png

1017 Bytes
Loading

icons/favicon.24x24.png

1.73 KB
Loading

icons/favicon.32x32.png

2.65 KB
Loading

icons/favicon.48x48.png

4.77 KB
Loading

icons/favicon.64x64.png

7.13 KB
Loading

icons/favicon.96x96.png

12.9 KB
Loading

main.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
import {app, BrowserWindow, BrowserWindowConstructorOptions, screen, Tray, Menu, nativeImage} from 'electron';
1+
import {
2+
app,
3+
BrowserWindow,
4+
BrowserWindowConstructorOptions,
5+
screen,
6+
Tray,
7+
Menu,
8+
nativeImage,
9+
ipcMain
10+
} from 'electron';
211
import * as path from 'path';
312
import * as url from 'url';
413
import * as Splashscreen from '@trodi/electron-splashscreen';
514
import * as contextMenuInternal from 'electron-context-menu';
15+
616
const {autoUpdater} = require('electron-updater');
17+
const sugar = require('sugar');
18+
const kill = require('tree-kill');
719

820
let win, serve, tray;
21+
const awsCliProcesses = [];
922
const args = process.argv.slice(1);
1023
serve = args.some(val => val === '--serve');
1124

@@ -71,7 +84,7 @@ function createWindow() {
7184
}
7285

7386
function createTray() {
74-
const trayIcon = path.join(__dirname, 'icons/favicon.png');
87+
const trayIcon = path.join(__dirname, 'icons/favicon.16x16.png');
7588
const nimage = nativeImage.createFromPath(trayIcon);
7689
tray = new Tray(nimage);
7790
const contextMenu = Menu.buildFromTemplate([
@@ -100,6 +113,16 @@ function checkForUpdate() {
100113
autoUpdater.checkForUpdatesAndNotify();
101114
}
102115

116+
function initIpc() {
117+
ipcMain.on('add-process-to-kill', (event, processPid) => {
118+
awsCliProcesses.push(processPid);
119+
});
120+
121+
ipcMain.on('remove-process-to-kill', (event, processPid) => {
122+
sugar.Array.remove(awsCliProcesses, processPid);
123+
});
124+
}
125+
103126
try {
104127

105128
// This method will be called when Electron has finished
@@ -113,6 +136,8 @@ try {
113136

114137
app.on('ready', checkForUpdate);
115138

139+
app.on('ready', initIpc);
140+
116141
// Quit when all windows are closed.
117142
app.on('window-all-closed', () => {
118143
// On OS X it is common for applications and their menu bar
@@ -130,6 +155,12 @@ try {
130155
}
131156
});
132157

158+
app.on('before-quit', function () {
159+
for (const process of awsCliProcesses) {
160+
kill(process);
161+
}
162+
});
163+
133164
} catch (e) {
134165
// Catch Error
135166
// throw e;

0 commit comments

Comments
 (0)