Skip to content

Commit

Permalink
Merge branch 'main' into feature/eng-892-cli-support-for-latest-runti…
Browse files Browse the repository at this point in the history
…me-v0015
  • Loading branch information
uditdc committed Aug 11, 2023
2 parents 5bafff8 + 2fc8829 commit e940354
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"form-data": "^4.0.0",
"js-yaml": "^4.1.0",
"lowdb": "^1.0.0",
"lowdb-encryption": "^0.1.0",
"open": "^8.4.0",
"pkg": "^5.8.0",
"portastic": "^1.0.1",
Expand Down
12 changes: 3 additions & 9 deletions src/store/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const getDb = () => {
if (!db) {
const lowdb = require("lowdb")
const FileSync = require("lowdb/adapters/FileSync")
const lowdbEncryption = require("lowdb-encryption")

const cliConfigFileName = "bls.cli.config.json"
const cliConfigFilePath = `${store.system.homedir}${store.system.appPath}`
Expand All @@ -31,13 +30,7 @@ export const getDb = () => {

const adapter = new FileSync(
`${store.system.homedir}${store.system.appPath}/bls.cli.config.json`,
{
defaultValue,
...lowdbEncryption({
secret: "s3cr3t",
iterations: 100_000,
}),
}
{ defaultValue }
)

db = lowdb(adapter);
Expand All @@ -58,7 +51,8 @@ export const getToken = () => {
export const getAuthUrl = (): { url: string, port: number } => {
const db = getDb();
const config = db.get("config").value();
const { authUrl, authPort } = config
if (!config) return { url: 'dashboard.blockless.network', port: 443 }

const { authUrl, authPort } = config
return { url: authUrl, port: authPort }
}

0 comments on commit e940354

Please sign in to comment.