change USERNAME and PASSWORD to FLOWISE_USERNAME and FLOWISE_PASSWORD to prevent conflict with machine env variables
This commit is contained in:
parent
dc4fe13b12
commit
0f0d887f78
|
|
@ -4,9 +4,6 @@
|
|||
# Run image
|
||||
# docker run -d -p 3000:3000 flowise
|
||||
|
||||
# Run image with authorization
|
||||
# docker run -d -e USERNAME=user -e PASSWORD=1234 -p 3000:3000 flowise
|
||||
|
||||
FROM node:18-alpine
|
||||
RUN apk add --update libc6-compat
|
||||
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -22,7 +22,7 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
|
|||
With username & password
|
||||
|
||||
```bash
|
||||
npx flowise start --USERNAME=user --PASSWORD=1234
|
||||
npx flowise start --FLOWISE_USERNAME=user --FLOWISE_PASSWORD=1234
|
||||
```
|
||||
|
||||
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
|
|||
docker run -d --name flowise -p 3000:3000 flowise
|
||||
```
|
||||
|
||||
With username & password
|
||||
|
||||
```bash
|
||||
docker run -d -e USERNAME=user -e PASSWORD=1234 --name flowise -p 3000:3000 flowise
|
||||
```
|
||||
|
||||
3. Stop image:
|
||||
```bash
|
||||
docker stop flowise
|
||||
|
|
@ -119,11 +113,11 @@ Flowise has 3 different modules in a single mono repository.
|
|||
|
||||
## 🔒 Authentication
|
||||
|
||||
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file in `packages/server`:
|
||||
To enable app level authentication, add `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `.env` file in `packages/server`:
|
||||
|
||||
```
|
||||
USERNAME=user
|
||||
PASSWORD=1234
|
||||
FLOWISE_USERNAME=user
|
||||
FLOWISE_PASSWORD=1234
|
||||
```
|
||||
|
||||
## 📖 Documentation
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
PORT=3000
|
||||
USERNAME=user
|
||||
PASSWORD=1234
|
||||
# FLOWISE_USERNAME=user
|
||||
# FLOWISE_PASSWORD=1234
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ Starts Flowise from [DockerHub Image](https://hub.docker.com/repository/docker/f
|
|||
|
||||
## With Authrorization
|
||||
|
||||
1. Create `.env` file and specify the `PORT`, `USERNAME`, and `PASSWORD` (refer to `.env.example`)
|
||||
2. Pass `USERNAME` and `PASSWORD` to the `docker-compose.yml` file:
|
||||
1. Create `.env` file and specify the `PORT`, `FLOWISE_USERNAME`, and `FLOWISE_PASSWORD` (refer to `.env.example`)
|
||||
2. Pass `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `docker-compose.yml` file:
|
||||
```
|
||||
environment:
|
||||
- PORT=${PORT}
|
||||
- USERNAME=${USERNAME}
|
||||
- PASSWORD=${PASSWORD}
|
||||
- FLOWISE_USERNAME=${FLOWISE_USERNAME}
|
||||
- FLOWISE_PASSWORD=${FLOWISE_PASSWORD}
|
||||
```
|
||||
3. `docker-compose up -d`
|
||||
4. Open [http://localhost:3000](http://localhost:3000)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ services:
|
|||
restart: always
|
||||
environment:
|
||||
- PORT=${PORT}
|
||||
- FLOWISE_USERNAME=${FLOWISE_USERNAME}
|
||||
- FLOWISE_PASSWORD=${FLOWISE_PASSWORD}
|
||||
ports:
|
||||
- '${PORT}:${PORT}'
|
||||
volumes:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import dotenv from 'dotenv'
|
|||
import path from 'path'
|
||||
|
||||
const envPath = path.join(__dirname, '..', '..', '.env')
|
||||
dotenv.config({ path: envPath })
|
||||
dotenv.config({ path: envPath, override: true })
|
||||
|
||||
export * from './Interface'
|
||||
export * from './utils'
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
})
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ apiClient.interceptors.request.use(function (config) {
|
|||
|
||||
if (username && password) {
|
||||
config.auth = {
|
||||
username: username.toLocaleLowerCase(),
|
||||
password: password.toLocaleLowerCase()
|
||||
username,
|
||||
password
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue