-
-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Option to add apikeys to the DB instead of api.json. #2783
Feature: Option to add apikeys to the DB instead of api.json. #2783
Conversation
# Conflicts: # packages/server/src/controllers/chatflows/index.ts # packages/server/src/database/migrations/mariadb/index.ts # packages/server/src/database/migrations/mysql/index.ts # packages/server/src/database/migrations/postgres/index.ts # packages/server/src/database/migrations/sqlite/index.ts
packages/server/src/AppConfig.ts
Outdated
@@ -0,0 +1,3 @@ | |||
export const APIKEYS_STORAGE_JSON = !process.env.APIKEY_STORAGE_TYPE || process.env.APIKEY_STORAGE_TYPE === 'json' | |||
export const APIKEYS_STORAGE_DB = | |||
process.env.APIKEY_STORAGE_TYPE === 'db' || process.env.APIKEY_STORAGE_TYPE === 'DB' || process.env.APIKEY_STORAGE_TYPE === 'Db' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we make this more generic?
export const appConfig = {
apiKeys: {
storageType: process.env.APIKEY_STORAGE_TYPE ? process.env.APIKEY_STORAGE_TYPE.toLowerCase() : 'json',
}
// todo: add more config options here like database, log, storage, credential and allow modification from UI
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this new env variable needed to add at other places like start.ts
, env.example
, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this new env variable needed to add at other places like
start.ts
,env.example
, etc
changes pushed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes pushed!!!
} | ||
} else { | ||
const newKey = new ApiKey() | ||
newKey.id = key.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HenryHengZJ I have an edge case, lets discuss!
# Conflicts: # docker/.env.example # packages/server/.env.example
CONTRIBUTING.md
Outdated
@@ -121,7 +121,7 @@ Flowise has 3 different modules in a single mono repository. | |||
Flowise support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder. Read [more](https://docs.flowiseai.com/environment-variables) | |||
|
|||
| Variable | Description | Type | Default | | |||
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- | | |||
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- | --- | --- | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this last few lines redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and a few other lines needed fixing, pushed changes.
No description provided.