mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
change USERNAME and PASSWORD to FLOWISE_USERNAME and FLOWISE_PASSWORD to prevent conflict with machine env variables
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
PORT=3000
|
||||
# USERNAME=user
|
||||
# PASSWORD=1234
|
||||
# FLOWISE_USERNAME=user
|
||||
# FLOWISE_PASSWORD=1234
|
||||
# EXECUTION_MODE=child or main
|
||||
@@ -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
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
"dist",
|
||||
"npm-shrinkwrap.json",
|
||||
"oclif.manifest.json",
|
||||
"oauth2.html",
|
||||
".env"
|
||||
"oauth2.html"
|
||||
],
|
||||
"oclif": {
|
||||
"bin": "flowise",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user