Skip to content

Commit

Permalink
Revert "Fixed formatting"
Browse files Browse the repository at this point in the history
This reverts commit fb819ec.
  • Loading branch information
githubsaturn committed Apr 28, 2024
1 parent fb819ec commit eaf6ba8
Show file tree
Hide file tree
Showing 13 changed files with 2,744 additions and 2,977 deletions.
5,535 changes: 2,662 additions & 2,873 deletions package-lock.json

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,67 @@
"test": "jest"
},
"dependencies": {
"axios": "^1.6.8",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.2",
"body-parser": "^1.19.0",
"configstore": "^5.0.1",
"cookie-parser": "~1.4.6",
"debug": "~4.3.4",
"dockerode": "^4.0.2",
"ejs": "^3.1.10",
"express": "^4.19.2",
"fs-extra": "^11.2.0",
"cookie-parser": "~1.4.5",
"debug": "~4.3.2",
"dockerode": "^3.3.0",
"ejs": "^3.1.6",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"http-proxy": "^1.18.1",
"is-valid-path": "^0.1.1",
"js-base64": "^3.7.7",
"js-base64": "^3.6.1",
"jsonwebtoken": "^8.5.1",
"moment": "^2.30.1",
"moment": "^2.29.1",
"morgan": "^1.10.0",
"multer": "^1.4.4",
"on-finished": "^2.4.1",
"prettier": "3.2.5",
"public-ip": "^6.0.2",
"recursive-readdir": "^2.2.3",
"multer": "^1.4.3",
"on-finished": "^2.3.0",
"prettier": "2.3.2",
"public-ip": "^4.0.4",
"recursive-readdir": "^2.2.2",
"request": "^2.88.2",
"require-from-string": "^2.0.2",
"serve-favicon": "~2.5.0",
"simple-git": "3.24.0",
"ssh2": "^1.15.0",
"tar": "^7.0.1",
"typescript": "4.x",
"uuid": "^9.0.1",
"validator": "^13.11.0",
"yaml": "^2.4.2"
"simple-git": "^2.45.0",
"ssh2": "^1.4.0",
"tar": "^6.1.11",
"typescript": "^4.3.5",
"uuid": "^8.3.2",
"validator": "^13.6.0",
"yaml": "^1.10.2"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/bcryptjs": "^2.4.2",
"@types/configstore": "^5.0.1",
"@types/cookie-parser": "^1.4.7",
"@types/debug": "^4.1.12",
"@types/dockerode": "^3.3.28",
"@types/ejs": "^3.1.5",
"@types/express": "^4.17.21",
"@types/fs-extra": "^11.0.4",
"@types/http-proxy": "^1.17.14",
"@types/is-valid-path": "^0.1.2",
"@types/jest": "^29.5.12",
"@types/cookie-parser": "^1.4.2",
"@types/debug": "^4.1.7",
"@types/dockerode": "^3.2.7",
"@types/ejs": "^3.1.0",
"@types/express": "^4.17.13",
"@types/fs-extra": "^9.0.12",
"@types/http-proxy": "^1.17.7",
"@types/is-valid-path": "^0.1.0",
"@types/jest": "^27.0.1",
"@types/js-base64": "^3.3.1",
"@types/jsonwebtoken": "^9.0.6",
"@types/morgan": "^1.9.9",
"@types/multer": "^1.4.11",
"@types/on-finished": "^2.3.4",
"@types/request": "^2.48.12",
"@types/require-from-string": "^1.2.3",
"@types/serve-favicon": "^2.5.7",
"@types/ssh2": "^1.15.0",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.8",
"@types/validator": "^13.11.9",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"madge": "^7.0.0",
"ts-jest": "^29.1.2"
"@types/jsonwebtoken": "^8.5.5",
"@types/morgan": "^1.9.3",
"@types/multer": "^1.4.7",
"@types/on-finished": "^2.3.1",
"@types/request": "^2.48.7",
"@types/require-from-string": "^1.2.1",
"@types/serve-favicon": "^2.5.3",
"@types/ssh2": "^0.5.47",
"@types/tar": "^4.0.5",
"@types/uuid": "^8.3.1",
"@types/validator": "^13.6.3",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"eslint": "^7.32.0",
"jest": "^27.1.0",
"madge": "^5.0.1",
"ts-jest": "^27.0.5"
}
}
5 changes: 1 addition & 4 deletions src/api/BaseApi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
class BaseApi {
public data: any

constructor(
public status: number,
public description: string
) {
constructor(public status: number, public description: string) {
this.data = {}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/datastore/AppsDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ function isPortValid(portNumber: number) {
class AppsDataStore {
private encryptor: CaptainEncryptor

constructor(
private data: configstore,
private namepace: string
) {}
constructor(private data: configstore, private namepace: string) {}

setEncryptor(encryptor: CaptainEncryptor) {
this.encryptor = encryptor
Expand Down
5 changes: 1 addition & 4 deletions src/datastore/RegistriesDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const DEFAULT_DOCKER_REGISTRY_ID = 'defaultDockerRegId'
class RegistriesDataStore {
private encryptor: CaptainEncryptor

constructor(
private data: configstore,
public namepace: string
) {}
constructor(private data: configstore, public namepace: string) {}

setEncryptor(encryptor: CaptainEncryptor) {
this.encryptor = encryptor
Expand Down
16 changes: 8 additions & 8 deletions src/docker/DockerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1685,14 +1685,14 @@ const connectionParams: Docker.DockerOptions =
socketPath: CaptainConstants.dockerSocketPath,
}
: dockerApiAddressSplited.length === 2
? {
host: dockerApiAddressSplited[0],
port: Number(dockerApiAddressSplited[1]),
}
: {
host: `${dockerApiAddressSplited[0]}:${dockerApiAddressSplited[1]}`,
port: Number(dockerApiAddressSplited[2]),
}
? {
host: dockerApiAddressSplited[0],
port: Number(dockerApiAddressSplited[1]),
}
: {
host: `${dockerApiAddressSplited[0]}:${dockerApiAddressSplited[1]}`,
port: Number(dockerApiAddressSplited[2]),
}

connectionParams.version = CaptainConstants.configs.dockerApiVersion

Expand Down
5 changes: 1 addition & 4 deletions src/user/DockerRegistryHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import BuildLog from './BuildLog'

class DockerRegistryHelper {
private registriesDataStore: RegistriesDataStore
constructor(
dataStore: DataStore,
private dockerApi: DockerApi
) {
constructor(dataStore: DataStore, private dockerApi: DockerApi) {
this.registriesDataStore = dataStore.getRegistriesDataStore()
}

Expand Down
9 changes: 3 additions & 6 deletions src/user/FeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ export default class FeatureFlags {
Logger.e(error)
})
.then(function () {
setTimeout(
() => {
self.refreshFeatureFlags()
},
1000 * 3600 * 19.3
) // some random hour to avoid constant traffic
setTimeout(() => {
self.refreshFeatureFlags()
}, 1000 * 3600 * 19.3) // some random hour to avoid constant traffic
})
}
}
5 changes: 1 addition & 4 deletions src/user/pro/OtpAuthenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { TwoFactorAuthResponse } from '../../models/IProFeatures'
import ProManager from './ProManager'

export default class OtpAuthenticator {
constructor(
private dataStore: DataStore,
private proManager: ProManager
) {}
constructor(private dataStore: DataStore, private proManager: ProManager) {}

set2fa(
doEnable: boolean,
Expand Down
17 changes: 7 additions & 10 deletions src/user/system/BackupManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,16 +717,13 @@ export default class BackupManager {
)}-${now.valueOf()}`}${`-ip-${mainIP}.tar`}`
fs.moveSync(tarFilePath, newName)

setTimeout(
() => {
try {
fs.removeSync(newName)
} catch (err) {
// nom nom
}
},
1000 * 3600 * 2
)
setTimeout(() => {
try {
fs.removeSync(newName)
} catch (err) {
// nom nom
}
}, 1000 * 3600 * 2)

return Authenticator.getAuthenticator(
namespace
Expand Down
15 changes: 6 additions & 9 deletions src/user/system/LoadBalancerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,15 +819,12 @@ class LoadBalancerManager {
// this random schedule helps to avoid retrying at the same time of
// the day in case if that's our super high traffic time

setTimeout(
function () {
self.renewAllCertsAndReload(dataStore) //
.catch((err) => {
Logger.e(err)
})
},
1000 * 3600 * 20.3
)
setTimeout(function () {
self.renewAllCertsAndReload(dataStore) //
.catch((err) => {
Logger.e(err)
})
}, 1000 * 3600 * 20.3)

return self.certbotManager
.renewAllCerts() //
Expand Down
2 changes: 1 addition & 1 deletion src/utils/CaptainInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export function install() {
return EnvVar.MAIN_NODE_IP_ADDRESS
}

return externalIp.publicIpv4()
return externalIp.v4()
})
.then(function (ip4) {
if (!ip4) {
Expand Down
4 changes: 3 additions & 1 deletion src/utils/GitHelper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as childProcess from 'child_process'
import * as fs from 'fs-extra'
import * as path from 'path'
import git from 'simple-git'
import * as git from 'simple-git/promise'
import * as util from 'util'
import * as uuid from 'uuid'
import CaptainConstants from './CaptainConstants'
Expand All @@ -28,6 +28,7 @@ export default class GitHelper {

static getLastHash(directory: string) {
return git(directory) //
.silent(true) //
.raw(['rev-parse', 'HEAD']) //
}

Expand Down Expand Up @@ -98,6 +99,7 @@ export default class GitHelper {
const remote = `${SCHEME}://${USER}:${PASS}@${REPO_PATH}`
Logger.dev(`Cloning HTTPS ${remote}`)
return git() //
.silent(true) //
.raw([
'clone',
'--recurse-submodules',
Expand Down

0 comments on commit eaf6ba8

Please sign in to comment.