Skip to content
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

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

vinodkiran
Copy link
Contributor

No description provided.

# 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
@@ -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'
Copy link
Contributor

@HenryHengZJ HenryHengZJ Jul 25, 2024

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
}

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor Author

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
@HenryHengZJ HenryHengZJ marked this pull request as ready for review July 26, 2024 16:35
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 |
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- | --- | --- |
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@HenryHengZJ HenryHengZJ merged commit 2dd1791 into FlowiseAI:main Jul 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants