Merge pull request #204 from FlowiseAI/feature/Authorization

Feature/Add authrorization to npx and docker installation
This commit is contained in:
Henry Heng
2023-05-27 17:38:30 +01:00
committed by GitHub
5 changed files with 55 additions and 2 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
import { Command } from '@oclif/core'
import { Command, Flags } from '@oclif/core'
import path from 'path'
import * as Server from '../index'
import * as DataSource from '../DataSource'
@@ -14,6 +14,10 @@ let processExitCode = EXIT_CODE.SUCCESS
export default class Start extends Command {
static args = []
static flags = {
USERNAME: Flags.string(),
PASSWORD: Flags.string()
}
async stopProcess() {
console.info('Shutting down Flowise...')
@@ -43,6 +47,10 @@ export default class Start extends Command {
console.error('uncaughtException: ', err)
})
const { flags } = await this.parse(Start)
if (flags.USERNAME) process.env.USERNAME = flags.USERNAME
if (flags.PASSWORD) process.env.PASSWORD = flags.PASSWORD
await (async () => {
try {
this.log('Starting Flowise...')