Skip to content

Commit 0f0d887

Browse files
committed
change USERNAME and PASSWORD to FLOWISE_USERNAME and FLOWISE_PASSWORD to prevent conflict with machine env variables
1 parent dc4fe13 commit 0f0d887

File tree

12 files changed

+29
-37
lines changed

12 files changed

+29
-37
lines changed

Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
# Run image
55
# docker run -d -p 3000:3000 flowise
66

7-
# Run image with authorization
8-
# docker run -d -e USERNAME=user -e PASSWORD=1234 -p 3000:3000 flowise
9-
107
FROM node:18-alpine
118
RUN apk add --update libc6-compat
129

README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
2222
With username & password
2323

2424
```bash
25-
npx flowise start --USERNAME=user --PASSWORD=1234
25+
npx flowise start --FLOWISE_USERNAME=user --FLOWISE_PASSWORD=1234
2626
```
2727

2828
3. Open [http://localhost:3000](http://localhost:3000)
@@ -49,12 +49,6 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
4949
docker run -d --name flowise -p 3000:3000 flowise
5050
```
5151

52-
With username & password
53-
54-
```bash
55-
docker run -d -e USERNAME=user -e PASSWORD=1234 --name flowise -p 3000:3000 flowise
56-
```
57-
5852
3. Stop image:
5953
```bash
6054
docker stop flowise
@@ -119,11 +113,11 @@ Flowise has 3 different modules in a single mono repository.
119113

120114
## 🔒 Authentication
121115

122-
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file in `packages/server`:
116+
To enable app level authentication, add `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `.env` file in `packages/server`:
123117

124118
```
125-
USERNAME=user
126-
PASSWORD=1234
119+
FLOWISE_USERNAME=user
120+
FLOWISE_PASSWORD=1234
127121
```
128122
129123
## 📖 Documentation

docker/.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PORT=3000
2-
USERNAME=user
3-
PASSWORD=1234
2+
# FLOWISE_USERNAME=user
3+
# FLOWISE_PASSWORD=1234

docker/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Starts Flowise from [DockerHub Image](https://hub.docker.com/repository/docker/f
1111

1212
## With Authrorization
1313

14-
1. Create `.env` file and specify the `PORT`, `USERNAME`, and `PASSWORD` (refer to `.env.example`)
15-
2. Pass `USERNAME` and `PASSWORD` to the `docker-compose.yml` file:
14+
1. Create `.env` file and specify the `PORT`, `FLOWISE_USERNAME`, and `FLOWISE_PASSWORD` (refer to `.env.example`)
15+
2. Pass `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `docker-compose.yml` file:
1616
```
1717
environment:
1818
- PORT=${PORT}
19-
- USERNAME=${USERNAME}
20-
- PASSWORD=${PASSWORD}
19+
- FLOWISE_USERNAME=${FLOWISE_USERNAME}
20+
- FLOWISE_PASSWORD=${FLOWISE_PASSWORD}
2121
```
2222
3. `docker-compose up -d`
2323
4. Open [http://localhost:3000](http://localhost:3000)

docker/docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
restart: always
77
environment:
88
- PORT=${PORT}
9+
- FLOWISE_USERNAME=${FLOWISE_USERNAME}
10+
- FLOWISE_PASSWORD=${FLOWISE_PASSWORD}
911
ports:
1012
- '${PORT}:${PORT}'
1113
volumes:

packages/components/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import dotenv from 'dotenv'
22
import path from 'path'
33

44
const envPath = path.join(__dirname, '..', '..', '.env')
5-
dotenv.config({ path: envPath })
5+
dotenv.config({ path: envPath, override: true })
66

77
export * from './Interface'
88
export * from './utils'

packages/server/.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
PORT=3000
2-
# USERNAME=user
3-
# PASSWORD=1234
2+
# FLOWISE_USERNAME=user
3+
# FLOWISE_PASSWORD=1234
44
# EXECUTION_MODE=child or main

packages/server/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
2222

2323
## 🔒 Authentication
2424

25-
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file:
25+
To enable app level authentication, add `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `.env` file:
2626

2727
```
28-
USERNAME=user
29-
PASSWORD=1234
28+
FLOWISE_USERNAME=user
29+
FLOWISE_PASSWORD=1234
3030
```
3131
3232
## 📖 Documentation

packages/server/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"dist",
1414
"npm-shrinkwrap.json",
1515
"oclif.manifest.json",
16-
"oauth2.html",
17-
".env"
16+
"oauth2.html"
1817
],
1918
"oclif": {
2019
"bin": "flowise",

packages/server/src/commands/start.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as Server from '../index'
44
import * as DataSource from '../DataSource'
55
import dotenv from 'dotenv'
66

7-
dotenv.config({ path: path.join(__dirname, '..', '..', '.env') })
7+
dotenv.config({ path: path.join(__dirname, '..', '..', '.env'), override: true })
88

99
enum EXIT_CODE {
1010
SUCCESS = 0,
@@ -15,8 +15,8 @@ let processExitCode = EXIT_CODE.SUCCESS
1515
export default class Start extends Command {
1616
static args = []
1717
static flags = {
18-
USERNAME: Flags.string(),
19-
PASSWORD: Flags.string()
18+
FLOWISE_USERNAME: Flags.string(),
19+
FLOWISE_PASSWORD: Flags.string()
2020
}
2121

2222
async stopProcess() {
@@ -48,8 +48,8 @@ export default class Start extends Command {
4848
})
4949

5050
const { flags } = await this.parse(Start)
51-
if (flags.USERNAME) process.env.USERNAME = flags.USERNAME
52-
if (flags.PASSWORD) process.env.PASSWORD = flags.PASSWORD
51+
if (flags.FLOWISE_USERNAME) process.env.FLOWISE_USERNAME = flags.FLOWISE_USERNAME
52+
if (flags.FLOWISE_PASSWORD) process.env.FLOWISE_PASSWORD = flags.FLOWISE_PASSWORD
5353

5454
await (async () => {
5555
try {

packages/server/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ export class App {
8383
// Allow access from *
8484
this.app.use(cors())
8585

86-
if (process.env.USERNAME && process.env.PASSWORD) {
87-
const username = process.env.USERNAME.toLocaleLowerCase()
88-
const password = process.env.PASSWORD.toLocaleLowerCase()
86+
if (process.env.FLOWISE_USERNAME && process.env.FLOWISE_PASSWORD) {
87+
const username = process.env.FLOWISE_USERNAME
88+
const password = process.env.FLOWISE_PASSWORD
8989
const basicAuthMiddleware = basicAuth({
9090
users: { [username]: password }
9191
})

packages/ui/src/api/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ apiClient.interceptors.request.use(function (config) {
1414

1515
if (username && password) {
1616
config.auth = {
17-
username: username.toLocaleLowerCase(),
18-
password: password.toLocaleLowerCase()
17+
username,
18+
password
1919
}
2020
}
2121

0 commit comments

Comments
 (0)