mirror of
https://github.com/caprover/caprover
synced 2026-09-23 15:15:36 +00:00
Placeholder for phase 1 and 2
This commit is contained in:
@@ -62,6 +62,22 @@ export default class BackupManager {
|
||||
return !!this.longOperationInProgress
|
||||
}
|
||||
|
||||
startRestorationIfNeededPhase1() {
|
||||
// if (/captain/restore/restore-instructions.json does exist):
|
||||
// - Connect all extra nodes via SSH and get their NodeID
|
||||
// - Replace the nodeId in apps with the new nodeId based on restore-instructions.json
|
||||
// - Create a captain-salt secret using the data in restore
|
||||
// - Copy restore files to proper places
|
||||
}
|
||||
|
||||
startRestorationIfNeededPhase2() {
|
||||
// if (/captain/restore/restore.json exists) GO TO RESTORE MODE:
|
||||
// - Double check salt against "meta/captain-salt"
|
||||
// - Iterate over all APPs and make sure they are inited properly
|
||||
// - Delete /captain/restore
|
||||
// - Wait until things settle (1 minute...)
|
||||
}
|
||||
|
||||
checkAndPrepareRestoration() {
|
||||
const self = this
|
||||
return Promise.resolve() //
|
||||
|
||||
@@ -233,6 +233,9 @@ class CaptainManager {
|
||||
|
||||
return Promise.resolve(true)
|
||||
})
|
||||
.then(function() {
|
||||
return self.backupManager.startRestorationIfNeededPhase2()
|
||||
})
|
||||
.then(function() {
|
||||
self.inited = true
|
||||
|
||||
|
||||
@@ -195,6 +195,8 @@ function printTroubleShootingUrl() {
|
||||
let myIp4: string
|
||||
|
||||
export function install() {
|
||||
const backupManger = new BackupManager()
|
||||
|
||||
Promise.resolve()
|
||||
.then(function() {
|
||||
printTroubleShootingUrl()
|
||||
@@ -250,13 +252,16 @@ export function install() {
|
||||
return checkPortOrThrow(myIp4, 3000)
|
||||
})
|
||||
.then(function() {
|
||||
return new BackupManager().checkAndPrepareRestoration()
|
||||
return backupManger.checkAndPrepareRestoration()
|
||||
})
|
||||
.then(function() {
|
||||
return DockerApi.get().initSwarm(myIp4)
|
||||
})
|
||||
.then(function(swarmId: string) {
|
||||
console.log('Swarm started: ' + swarmId)
|
||||
return backupManger.startRestorationIfNeededPhase1()
|
||||
})
|
||||
.then(function() {
|
||||
return DockerApi.get().getLeaderNodeId()
|
||||
})
|
||||
.then(function(nodeId: string) {
|
||||
|
||||
Reference in New Issue
Block a user