mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-05 00:52:59 +01:00
🔨 Change config location
This commit is contained in:
parent
92fbb5fd4a
commit
c2d68232a5
@ -38,7 +38,9 @@ app.use(function(err, req, res, next) {
|
||||
res.render('error');
|
||||
});
|
||||
|
||||
|
||||
const fs = require('fs');
|
||||
if (!fs.existsSync('/data'))
|
||||
fs.mkdirSync('/data');
|
||||
const statusTools = require('./tools/status');
|
||||
statusTools.init();
|
||||
console.log("Satus : \x1b[32mGo !\x1b[0m")
|
||||
@ -68,4 +70,6 @@ const cronTools = require('./tools/cronTools');
|
||||
cronTools.startCron();
|
||||
|
||||
|
||||
|
||||
|
||||
module.exports = app;
|
||||
|
@ -53,6 +53,8 @@ router.get('/formated-backup-manual', function(req, res, next) {
|
||||
return -1;
|
||||
})
|
||||
res.render('backupSnaps',{backups: contents, moment: moment});
|
||||
}).catch(()=>{
|
||||
res.send();
|
||||
});
|
||||
|
||||
});
|
||||
@ -67,8 +69,9 @@ router.get('/formated-backup-auto', function(req, res, next) {
|
||||
return -1;
|
||||
})
|
||||
res.render('backupSnaps',{backups: contents, moment: moment});
|
||||
}).catch(()=>{
|
||||
res.send();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const settingsPath = "./backup_conf.json"
|
||||
const settingsPath = "/data/backup_conf.json"
|
||||
|
||||
|
||||
function getSettings(){
|
||||
|
@ -1,6 +1,6 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const statusPath = './status.json'
|
||||
const statusPath = '/data/status.json'
|
||||
|
||||
let baseStatus = {
|
||||
status: "idle",
|
||||
|
@ -4,7 +4,7 @@ const moment = require('moment');
|
||||
|
||||
const statusTools = require('./status');
|
||||
const endpoint = "/remote.php/webdav"
|
||||
const configPath = "./webdav_conf.json"
|
||||
const configPath = "/data/webdav_conf.json"
|
||||
const path = require('path');
|
||||
const settingsTools = require('./settingsTools');
|
||||
const pathTools = require('./pathTools');
|
||||
@ -221,6 +221,10 @@ class WebdavTools {
|
||||
|
||||
getFolderContent(path) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if(this.client == null){
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
this.client.getDirectoryContents(path)
|
||||
.then((contents) => {
|
||||
resolve(contents);
|
||||
|
Loading…
Reference in New Issue
Block a user