change USERNAME and PASSWORD to FLOWISE_USERNAME and FLOWISE_PASSWORD to prevent conflict with machine env variables

This commit is contained in:
Henry
2023-05-27 20:23:18 +01:00
parent dc4fe13b12
commit 0f0d887f78
12 changed files with 29 additions and 37 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
PORT=3000
# USERNAME=user
# PASSWORD=1234
# FLOWISE_USERNAME=user
# FLOWISE_PASSWORD=1234
# EXECUTION_MODE=child or main
+3 -3
View File
@@ -22,11 +22,11 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
## 🔒 Authentication
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file:
To enable app level authentication, add `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `.env` file:
```
USERNAME=user
PASSWORD=1234
FLOWISE_USERNAME=user
FLOWISE_PASSWORD=1234
```
## 📖 Documentation
+1 -2
View File
@@ -13,8 +13,7 @@
"dist",
"npm-shrinkwrap.json",
"oclif.manifest.json",
"oauth2.html",
".env"
"oauth2.html"
],
"oclif": {
"bin": "flowise",
+5 -5
View File
@@ -4,7 +4,7 @@ import * as Server from '../index'
import * as DataSource from '../DataSource'
import dotenv from 'dotenv'
dotenv.config({ path: path.join(__dirname, '..', '..', '.env') })
dotenv.config({ path: path.join(__dirname, '..', '..', '.env'), override: true })
enum EXIT_CODE {
SUCCESS = 0,
@@ -15,8 +15,8 @@ let processExitCode = EXIT_CODE.SUCCESS
export default class Start extends Command {
static args = []
static flags = {
USERNAME: Flags.string(),
PASSWORD: Flags.string()
FLOWISE_USERNAME: Flags.string(),
FLOWISE_PASSWORD: Flags.string()
}
async stopProcess() {
@@ -48,8 +48,8 @@ export default class Start extends Command {
})
const { flags } = await this.parse(Start)
if (flags.USERNAME) process.env.USERNAME = flags.USERNAME
if (flags.PASSWORD) process.env.PASSWORD = flags.PASSWORD
if (flags.FLOWISE_USERNAME) process.env.FLOWISE_USERNAME = flags.FLOWISE_USERNAME
if (flags.FLOWISE_PASSWORD) process.env.FLOWISE_PASSWORD = flags.FLOWISE_PASSWORD
await (async () => {
try {
+3 -3
View File
@@ -83,9 +83,9 @@ export class App {
// Allow access from *
this.app.use(cors())
if (process.env.USERNAME && process.env.PASSWORD) {
const username = process.env.USERNAME.toLocaleLowerCase()
const password = process.env.PASSWORD.toLocaleLowerCase()
if (process.env.FLOWISE_USERNAME && process.env.FLOWISE_PASSWORD) {
const username = process.env.FLOWISE_USERNAME
const password = process.env.FLOWISE_PASSWORD
const basicAuthMiddleware = basicAuth({
users: { [username]: password }
})