mirror of
https://github.com/caprover/caprover
synced 2026-09-26 08:35:39 +00:00
Updated formatting
This commit is contained in:
@@ -181,15 +181,13 @@ class AppsDataStore {
|
||||
const appToSave: IAppDefSaved = <IAppDefSaved>app
|
||||
|
||||
if (passwordToBeEncrypted) {
|
||||
appToSave.appPushWebhook!.repoInfo!.passwordEncrypted = self.encryptor.encrypt(
|
||||
passwordToBeEncrypted
|
||||
)
|
||||
appToSave.appPushWebhook!.repoInfo!.passwordEncrypted =
|
||||
self.encryptor.encrypt(passwordToBeEncrypted)
|
||||
}
|
||||
|
||||
if (sshKeyToBeEncrypted) {
|
||||
appToSave.appPushWebhook!.repoInfo!.sshKeyEncrypted = self.encryptor.encrypt(
|
||||
sshKeyToBeEncrypted
|
||||
)
|
||||
appToSave.appPushWebhook!.repoInfo!.sshKeyEncrypted =
|
||||
self.encryptor.encrypt(sshKeyToBeEncrypted)
|
||||
}
|
||||
|
||||
return appToSave
|
||||
@@ -716,9 +714,8 @@ class AppsDataStore {
|
||||
appObj.appDeployTokenConfig.appDeployToken = undefined
|
||||
} else if (!appObj.appDeployTokenConfig.appDeployToken) {
|
||||
// App is supposed to have a token, but it doesn't have one yet. The first time use case.
|
||||
appObj.appDeployTokenConfig.appDeployToken = Utils.generateRandomString(
|
||||
32
|
||||
)
|
||||
appObj.appDeployTokenConfig.appDeployToken =
|
||||
Utils.generateRandomString(32)
|
||||
}
|
||||
|
||||
if (httpAuth && httpAuth.user) {
|
||||
|
||||
@@ -16,9 +16,7 @@ const dockerodeUtils = require('dockerode/lib/util')
|
||||
|
||||
const Base64 = Base64Provider.Base64
|
||||
|
||||
function safeParseChunk(
|
||||
chunk: string
|
||||
): {
|
||||
function safeParseChunk(chunk: string): {
|
||||
stream?: string
|
||||
error?: any
|
||||
errorDetail?: any
|
||||
@@ -159,7 +157,7 @@ class DockerApi {
|
||||
return self.dockerode.listServices()
|
||||
})
|
||||
.then(function (services) {
|
||||
return ((services || []) as unknown) as DockerService[]
|
||||
return (services || []) as unknown as DockerService[]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1275,7 +1273,8 @@ class DockerApi {
|
||||
}
|
||||
}
|
||||
newConstraints.push(`node.id == ${nodeId}`)
|
||||
updatedData.TaskTemplate.Placement.Constraints = newConstraints
|
||||
updatedData.TaskTemplate.Placement.Constraints =
|
||||
newConstraints
|
||||
}
|
||||
|
||||
if (arrayOfEnvKeyAndValue) {
|
||||
@@ -1437,7 +1436,8 @@ class DockerApi {
|
||||
// to restart once. Once rebooted, all changes start showing up.
|
||||
updatedData.TaskTemplate.ContainerSpec.Labels =
|
||||
updatedData.TaskTemplate.ContainerSpec.Labels || {}
|
||||
updatedData.TaskTemplate.ContainerSpec.Labels.randomLabelForceUpdate = uuid()
|
||||
updatedData.TaskTemplate.ContainerSpec.Labels.randomLabelForceUpdate =
|
||||
uuid()
|
||||
|
||||
updatedData.authconfig = authObject
|
||||
|
||||
@@ -1546,8 +1546,9 @@ class DockerApi {
|
||||
.logs({
|
||||
tail: tailCount,
|
||||
follow: false,
|
||||
timestamps: !!CaptainConstants.configs
|
||||
.enableDockerLogsTimestamp,
|
||||
timestamps:
|
||||
!!CaptainConstants.configs
|
||||
.enableDockerLogsTimestamp,
|
||||
stdout: true,
|
||||
stderr: true,
|
||||
})
|
||||
|
||||
@@ -25,8 +25,8 @@ router.post('/', function (req, res, next) {
|
||||
|
||||
let authToken: string
|
||||
|
||||
const namespace = InjectionExtractor.extractGlobalsFromInjected(res)
|
||||
.namespace
|
||||
const namespace =
|
||||
InjectionExtractor.extractGlobalsFromInjected(res).namespace
|
||||
|
||||
let loadedHashedPassword = ''
|
||||
|
||||
|
||||
@@ -96,10 +96,10 @@ router.use(function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/changepassword/', function (req, res, next) {
|
||||
const namespace = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.namespace
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const namespace =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.namespace
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
Promise.resolve() //
|
||||
.then(function (data) {
|
||||
|
||||
@@ -13,8 +13,8 @@ const upload = multer({
|
||||
|
||||
router.get('/:appName/logs', function (req, res, next) {
|
||||
let appName = req.params.appName
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -37,8 +37,8 @@ router.get('/:appName/logs', function (req, res, next) {
|
||||
|
||||
router.get('/:appName/', function (req, res, next) {
|
||||
let appName = req.params.appName
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -56,8 +56,8 @@ router.get('/:appName/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/:appName/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
let appName = req.params.appName
|
||||
|
||||
dataStore
|
||||
@@ -74,8 +74,8 @@ router.post(
|
||||
'/:appName/',
|
||||
upload.single('sourceFile'),
|
||||
function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res)
|
||||
.user.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
const appName = req.params.appName
|
||||
const isDetachedBuild = !!req.query.detached
|
||||
@@ -95,9 +95,8 @@ router.post(
|
||||
}
|
||||
|
||||
Promise.resolve().then(function () {
|
||||
const promiseToDeployNewVer = serviceManager.scheduleDeployNewVersion(
|
||||
appName,
|
||||
{
|
||||
const promiseToDeployNewVer =
|
||||
serviceManager.scheduleDeployNewVersion(appName, {
|
||||
uploadedTarPathSource: !!tarballSourceFilePath
|
||||
? {
|
||||
uploadedTarPath: tarballSourceFilePath,
|
||||
@@ -110,8 +109,7 @@ router.post(
|
||||
gitHash,
|
||||
}
|
||||
: undefined,
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
if (isDetachedBuild) {
|
||||
res.send(
|
||||
|
||||
@@ -18,8 +18,8 @@ const DEFAULT_APP_CAPTAIN_DEFINITION = JSON.stringify({
|
||||
|
||||
// unused images
|
||||
router.get('/unusedImages', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -41,8 +41,8 @@ router.get('/unusedImages', function (req, res, next) {
|
||||
|
||||
// delete images
|
||||
router.post('/deleteImages', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
let imageIds = req.body.imageIds || []
|
||||
|
||||
Promise.resolve()
|
||||
@@ -61,10 +61,10 @@ router.post('/deleteImages', function (req, res, next) {
|
||||
|
||||
// Get All App Definitions
|
||||
router.get('/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
let appsArray: IAppDef[] = []
|
||||
|
||||
dataStore
|
||||
@@ -103,8 +103,8 @@ router.get('/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/enablebasedomainssl/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
const appName = req.body.appName
|
||||
|
||||
@@ -121,8 +121,8 @@ router.post('/enablebasedomainssl/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/customdomain/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let appName = req.body.appName
|
||||
let customDomain = (req.body.customDomain || '').toLowerCase()
|
||||
@@ -143,8 +143,8 @@ router.post('/customdomain/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/removecustomdomain/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let appName = req.body.appName
|
||||
let customDomain = (req.body.customDomain || '').toLowerCase()
|
||||
@@ -162,8 +162,8 @@ router.post('/removecustomdomain/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/enablecustomdomainssl/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let appName = req.body.appName
|
||||
let customDomain = (req.body.customDomain || '').toLowerCase()
|
||||
@@ -184,10 +184,10 @@ router.post('/enablecustomdomainssl/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/register/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
const appName = req.body.appName as string
|
||||
const hasPersistentData = !!req.body.hasPersistentData
|
||||
@@ -208,7 +208,8 @@ router.post('/register/', function (req, res, next) {
|
||||
appName,
|
||||
{
|
||||
captainDefinitionContentSource: {
|
||||
captainDefinitionContent: DEFAULT_APP_CAPTAIN_DEFINITION,
|
||||
captainDefinitionContent:
|
||||
DEFAULT_APP_CAPTAIN_DEFINITION,
|
||||
gitHash: '',
|
||||
},
|
||||
}
|
||||
@@ -244,8 +245,8 @@ router.post('/register/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/delete/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let appName = req.body.appName
|
||||
let volumes = req.body.volumes || []
|
||||
@@ -284,8 +285,8 @@ router.post('/delete/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/rename/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let oldAppName = req.body.oldAppName + ''
|
||||
let newAppName = req.body.newAppName + ''
|
||||
@@ -306,8 +307,8 @@ router.post('/rename/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/update/', function (req, res, next) {
|
||||
const serviceManager = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.serviceManager
|
||||
const serviceManager =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.serviceManager
|
||||
|
||||
let appName = req.body.appName
|
||||
let nodeId = req.body.nodeId
|
||||
|
||||
@@ -45,9 +45,8 @@ function getPushedBranches(req: express.Request) {
|
||||
router.post('/triggerbuild', urlencodedParser, function (req, res, next) {
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
const extracted = InjectionExtractor.extractAppAndUserForWebhook(
|
||||
res
|
||||
)
|
||||
const extracted =
|
||||
InjectionExtractor.extractAppAndUserForWebhook(res)
|
||||
const { serviceManager, namespace } = extracted.user
|
||||
const { appName, app } = extracted
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ interface IOneClickAppIdentifier {
|
||||
}
|
||||
|
||||
router.post('/repositories/insert', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
let apiBaseUrl = `${req.body.repositoryUrl || ''}`
|
||||
if (apiBaseUrl.endsWith('/')) {
|
||||
apiBaseUrl = apiBaseUrl.substring(0, apiBaseUrl.length - 1)
|
||||
@@ -71,8 +71,8 @@ router.post('/repositories/insert', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.post('/repositories/delete', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
let apiBaseUrl = `${req.body.repositoryUrl || ''}`
|
||||
if (apiBaseUrl.endsWith('/')) {
|
||||
apiBaseUrl = apiBaseUrl.substring(0, apiBaseUrl.length - 1)
|
||||
@@ -103,8 +103,8 @@ router.post('/repositories/delete', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.get('/repositories/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
return Promise.resolve() //
|
||||
.then(function () {
|
||||
@@ -123,8 +123,8 @@ router.get('/repositories/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.get('/template/list', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
return Promise.resolve() //
|
||||
.then(function () {
|
||||
@@ -192,8 +192,8 @@ router.get('/template/list', function (req, res, next) {
|
||||
router.get('/template/app', function (req, res, next) {
|
||||
const baseDomain = req.query.baseDomain as string
|
||||
const appName = req.query.appName as string
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
return Promise.resolve() //
|
||||
.then(function () {
|
||||
|
||||
@@ -8,9 +8,10 @@ import Logger from '../../../utils/Logger'
|
||||
const router = express.Router()
|
||||
|
||||
router.get('/', function (req, res, next) {
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
let registries: IRegistryInfo[] = []
|
||||
|
||||
return Promise.resolve()
|
||||
@@ -40,9 +41,10 @@ router.post('/insert/', function (req, res, next) {
|
||||
let registryDomain = req.body.registryDomain + ''
|
||||
let registryImagePrefix = req.body.registryImagePrefix + ''
|
||||
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -70,9 +72,10 @@ router.post('/update/', function (req, res, next) {
|
||||
let registryDomain = req.body.registryDomain + ''
|
||||
let registryImagePrefix = req.body.registryImagePrefix + ''
|
||||
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -95,9 +98,10 @@ router.post('/update/', function (req, res, next) {
|
||||
// ERRORS if default push is this OR if it's local
|
||||
router.post('/delete/', function (req, res, next) {
|
||||
let registryId = req.body.registryId + ''
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -115,9 +119,10 @@ router.post('/delete/', function (req, res, next) {
|
||||
|
||||
router.post('/setpush/', function (req, res, next) {
|
||||
let registryId = req.body.registryId + ''
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
|
||||
@@ -119,8 +119,8 @@ router.post('/forcessl/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.get('/info/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -196,8 +196,8 @@ router.post('/versionInfo/', function (req, res, next) {
|
||||
})
|
||||
|
||||
router.get('/netdata/', function (req, res, next) {
|
||||
const dataStore = InjectionExtractor.extractUserFromInjected(res).user
|
||||
.dataStore
|
||||
const dataStore =
|
||||
InjectionExtractor.extractUserFromInjected(res).user.dataStore
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -294,9 +294,10 @@ router.get('/nodes/', function (req, res, next) {
|
||||
router.post('/nodes/', function (req, res, next) {
|
||||
const MANAGER = 'manager'
|
||||
const WORKER = 'worker'
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
let isManager: boolean
|
||||
|
||||
|
||||
@@ -14,9 +14,10 @@ const router = express.Router()
|
||||
router.post('/enableregistry/', function (req, res, next) {
|
||||
const captainManager = CaptainManager.get()
|
||||
const password = uuid()
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
@@ -64,9 +65,10 @@ router.post('/enableregistry/', function (req, res, next) {
|
||||
// ERRORS if default push is this
|
||||
router.post('/disableregistry/', function (req, res, next) {
|
||||
const captainManager = CaptainManager.get()
|
||||
const registryHelper = InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
const registryHelper =
|
||||
InjectionExtractor.extractUserFromInjected(
|
||||
res
|
||||
).user.serviceManager.getRegistryHelper()
|
||||
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
|
||||
@@ -272,13 +272,14 @@ class DockerRegistryHelper {
|
||||
return self.registriesDataStore.getAllRegistries()
|
||||
})
|
||||
.then(function (allRegs) {
|
||||
let promiseToAddRegistry = self.registriesDataStore.addRegistryToDb(
|
||||
registryUser,
|
||||
registryPassword,
|
||||
registryDomain,
|
||||
registryImagePrefix,
|
||||
registryType
|
||||
)
|
||||
let promiseToAddRegistry =
|
||||
self.registriesDataStore.addRegistryToDb(
|
||||
registryUser,
|
||||
registryPassword,
|
||||
registryDomain,
|
||||
registryImagePrefix,
|
||||
registryType
|
||||
)
|
||||
|
||||
// Product decision. We want to make the first added registry the default one,
|
||||
// this way, it's easier for new users to grasp the concept of default push registry.
|
||||
|
||||
@@ -501,10 +501,11 @@ export default class ImageMaker {
|
||||
.then(function (dockerfileExists) {
|
||||
if (!dockerfileExists) return false
|
||||
|
||||
const captainDefinitionDefault: ICaptainDefinition = {
|
||||
schemaVersion: 2,
|
||||
dockerfilePath: `./${DOCKER_FILE}`,
|
||||
}
|
||||
const captainDefinitionDefault: ICaptainDefinition =
|
||||
{
|
||||
schemaVersion: 2,
|
||||
dockerfilePath: `./${DOCKER_FILE}`,
|
||||
}
|
||||
|
||||
return fs
|
||||
.outputFile(
|
||||
|
||||
@@ -822,8 +822,8 @@ class ServiceManager {
|
||||
return {
|
||||
isAppBuilding: self.isAppBuilding(appName),
|
||||
logs: self.buildLogsManager.getAppBuildLogs(appName).getLogs(),
|
||||
isBuildFailed: self.buildLogsManager.getAppBuildLogs(appName)
|
||||
.isBuildFailed,
|
||||
isBuildFailed:
|
||||
self.buildLogsManager.getAppBuildLogs(appName).isBuildFailed,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,8 @@ class LoadBalancerManager {
|
||||
serverWithSubDomain.websocketSupport = websocketSupport
|
||||
const httpPort = webApp.containerHttpPort || 80
|
||||
serverWithSubDomain.containerHttpPort = httpPort
|
||||
serverWithSubDomain.nginxConfigTemplate = nginxConfigTemplate
|
||||
serverWithSubDomain.nginxConfigTemplate =
|
||||
nginxConfigTemplate
|
||||
serverWithSubDomain.httpBasicAuth = httpBasicAuth
|
||||
|
||||
servers.push(serverWithSubDomain)
|
||||
|
||||
@@ -37,9 +37,8 @@ export default class GitHelper {
|
||||
const REPO_GIT_PATH = sanitized.repoPath
|
||||
const SSH_PORT = sanitized.port
|
||||
|
||||
const DOMAIN = GitHelper.getDomainFromSanitizedSshRepoPath(
|
||||
REPO_GIT_PATH
|
||||
)
|
||||
const DOMAIN =
|
||||
GitHelper.getDomainFromSanitizedSshRepoPath(REPO_GIT_PATH)
|
||||
|
||||
Logger.d(`Cloning SSH ${REPO_GIT_PATH}`)
|
||||
|
||||
|
||||
@@ -250,7 +250,8 @@ export default class MigrateCaptainDuckDuck {
|
||||
return Promise.resolve()
|
||||
.then(function () {
|
||||
const customDomains = app.customDomain || []
|
||||
const hasDefaultSubDomainSsl = !!app.hasDefaultSubDomainSsl
|
||||
const hasDefaultSubDomainSsl =
|
||||
!!app.hasDefaultSubDomainSsl
|
||||
return appStore.addCustomDomainForAppForMigration(
|
||||
appName,
|
||||
hasDefaultSubDomainSsl,
|
||||
@@ -260,7 +261,8 @@ export default class MigrateCaptainDuckDuck {
|
||||
.then(function () {
|
||||
const oldVers: any[] = app.versions || []
|
||||
const newVers: IAppVersion[] = []
|
||||
const newVersOnlyDeployVersion: IAppVersion[] = []
|
||||
const newVersOnlyDeployVersion: IAppVersion[] =
|
||||
[]
|
||||
const deployedVersion = Number(
|
||||
app.deployedVersion
|
||||
)
|
||||
@@ -273,9 +275,10 @@ export default class MigrateCaptainDuckDuck {
|
||||
let deployedImageName = `img-captain--${appName}:${thisVersion}`
|
||||
|
||||
if (thisVersion === deployedVersion) {
|
||||
deployedImageName = findCurrentlyInUseImageForApp(
|
||||
appName
|
||||
)
|
||||
deployedImageName =
|
||||
findCurrentlyInUseImageForApp(
|
||||
appName
|
||||
)
|
||||
|
||||
// Only add the currently deployed version. Revert won't work for other versions as
|
||||
// it's impossible to guess their image name correct 100% due to the fact that
|
||||
|
||||
Reference in New Issue
Block a user