Skip to content

Commit

Permalink
Merge pull request #940 from simatec/dev
Browse files Browse the repository at this point in the history
(simatec) Beta 2.6.20
  • Loading branch information
simatec authored May 2, 2023
2 parents ccac06b + 5642a1e commit 69dcbe0
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 53 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ When the adapter crashes or another Code error happens, this error message that

## Changelog
<!-- ### **WORK IN PROGRESS** -->
### **WORK IN PROGRESS**
* (simatec) FTP self signed Certificates added
* (simatec) dependencies updated

### 2.6.19 (2023-04-20)
* (simatec) small fix for js-controller 5

Expand Down
4 changes: 4 additions & 0 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,10 @@ <h6 class="translate title" style="background-color:#174475; font-size: 0.9rem;
<input class="value" id="ftpOwnDir" type="checkbox"/>
<label for="ftpOwnDir" class="translate">Extra path for backup types</label>
</div>
<div class="input-field col s12 m6 l4 ftpCert">
<input class="value" id="ftpSignedCertificates" type="checkbox"/>
<label for="ftpSignedCertificates" class="translate">Allow only signed certificates</label>
</div>
</div>
<div class="row ftp ftp-extra">
<div class="input-field col s12 m6 l4">
Expand Down
5 changes: 5 additions & 0 deletions admin/index_m.js
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,11 @@ function showHideSettings(settings) {
} else {
$('.ccuCert').hide();
}
if ($('#ftpSecure').prop('checked')) {
$('.ftpCert').show();
} else {
$('.ftpCert').hide();
}
$('#grafanaProtocol').on('change', function () {
if ($(this).val() === 'https') {
$('.grafanaCert').show();
Expand Down
1 change: 1 addition & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
"ftpHost": "",
"ftpPort": 21,
"ftpSecure": false,
"ftpSignedCertificates": true,
"ftpDir": "/backupDir",
"ftpUser": "",
"ftpPassword": "",
Expand Down
4 changes: 4 additions & 0 deletions lib/list/ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function list(restoreSource, options, types, log, callback) {
const ftp_pass = options.pass !== undefined ? options.pass : options.ftp && options.ftp.pass !== undefined ? options.ftp.pass : '';
const ftp_port = options.port !== undefined ? options.port : options.ftp && options.ftp.port !== undefined ? options.ftp.port : 21;
const ftp_secure = options.secure !== undefined ? options.secure : options.ftp && options.ftp.secure !== undefined ? options.ftp.secure : false;
const ftp_signedCertificates = options.signedCertificates !== undefined ? options.signedCertificates : options.ftp && options.ftp.signedCertificates !== undefined ? options.ftp.signedCertificates : true;
const ftp_dir = options.dir !== undefined ? options.dir : options.ftp && options.ftp.dir !== undefined ? options.ftp.dir : '/';
const ftp_ownDir = options.ownDir !== undefined ? options.ownDir : options.ftp && options.ftp.ownDir !== undefined ? options.ftp.ownDir : false;
const ftp_dirMinimal = options.dirMinimal !== undefined ? options.dirMinimal : options.ftp && options.ftp.dirMinimal !== undefined ? options.ftp.dirMinimal : '/';
Expand Down Expand Up @@ -70,6 +71,7 @@ function list(restoreSource, options, types, log, callback) {
host: ftp_host,
port: ftp_port || 21,
secure: ftp_secure || false,
secureOptions: { rejectUnauthorized: ftp_signedCertificates || true },
user: ftp_user,
password: ftp_pass
};
Expand All @@ -87,6 +89,7 @@ function getFile(options, fileName, toStoreName, log, callback) {
const ftp_pass = options.pass !== undefined ? options.pass : options.ftp && options.ftp.pass !== undefined ? options.ftp.pass : '';
const ftp_port = options.port !== undefined ? options.port : options.ftp && options.ftp.port !== undefined ? options.ftp.port : 21;
const ftp_secure = options.secure !== undefined ? options.secure : options.ftp && options.ftp.secure !== undefined ? options.ftp.secure : false;
const ftp_signedCertificates = options.signedCertificates !== undefined ? options.signedCertificates : options.ftp && options.ftp.signedCertificates !== undefined ? options.ftp.signedCertificates : true;
const ftp_dir = options.dir !== undefined ? options.dir : options.ftp && options.ftp.dir !== undefined ? options.ftp.dir : '/';
const ftp_ownDir = options.ownDir !== undefined ? options.ownDir : options.ftp && options.ftp.ownDir !== undefined ? options.ftp.ownDir : false;
const ftp_dirMinimal = options.dirMinimal !== undefined ? options.dirMinimal : options.ftp && options.ftp.dirMinimal !== undefined ? options.ftp.dirMinimal : '/';
Expand Down Expand Up @@ -162,6 +165,7 @@ function getFile(options, fileName, toStoreName, log, callback) {
host: ftp_host,
port: ftp_port || 21,
secure: ftp_secure || false,
secureOptions: { rejectUnauthorized: ftp_signedCertificates || true },
user: ftp_user,
password: ftp_pass
};
Expand Down
1 change: 1 addition & 0 deletions lib/scripts/50-ftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function command(options, log, callback) {
host: options.host,
port: options.port || 21,
secure: options.secure || false,
secureOptions: { rejectUnauthorized: options.signedCertificates || true },
user: options.user,
password: options.pass
};
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ function initConfig(secret) {
pass: adapter.config.ftpPassword ? decrypt(secret, adapter.config.ftpPassword) : '', // password for FTP Server
port: adapter.config.ftpPort || 21, // FTP port
secure: adapter.config.ftpSecure || false, // secure FTP connection
signedCertificates: adapter.config.ftpSignedCertificates || true,
ignoreErrors: adapter.config.ignoreErrors
};

Expand Down
100 changes: 50 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
"@googleapis/drive": "^5.0.2",
"node-wol": "^0.1.1",
"request": "^2.88.2",
"google-auth-library": "^8.7.0",
"google-auth-library": "^8.8.0",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"axios": "^1.3.5",
"axios": "^1.4.0",
"tar-fs": "^2.1.1",
"onedrive-api": "^1.0.8"
"onedrive-api": "^1.0.9"
},
"devDependencies": {
"@alcalzone/release-script": "^3.5.9",
Expand Down

0 comments on commit 69dcbe0

Please sign in to comment.