This PR adds the ability to use Redis as cache, Celery for task
execution, Session management, async tasks for the API and some other
improvements.
Run the following command after setting up the .env file in `./deploy`
folder:
```bash
docker compose up --exit-code-from tests tests result_backend broker celeryworker db --build
```
ℹ️ The "guidelines/api" section is temporarily removed from the sidebar to prevent confusion and ensure consistency while it is being updated or revised.
The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application. This commit adds documentation for the login functionality, including information about the enhanced login mechanism introduced in version 0.5. It explains the environment variables that are crucial in configuring the login settings and provides instructions on how to set them securely. It also covers the command-line interface for managing superusers and provides details on the sign-up process and profile settings for users. Screenshots are included to illustrate the sign-up page, profile settings page, and admin page.
The getUsersPage function was being called with the incorrect index parameter. It was off by one, causing the wrong page of users to be fetched. This has been fixed by subtracting 1 from the index parameter before calling the function.
- Rename volume `./pgadmin` to `pgadmin-data` for better naming convention and clarity.
- Rename volumes for RabbitMQ:
- `./.docker/rabbitmq/etc/` to `rabbitmq_data` for consistency and clarity.
- `./.docker/rabbitmq/data/` to `rabbitmq_data` for consistency and clarity.
- `./.docker/rabbitmq/logs/` to `rabbitmq_log` for consistency and clarity.
No functional changes, only volume name updates.
📝 docs(login.mdx): explain the purpose of login functionality and introduce enhanced login mechanism in Langflow
📝 docs(login.mdx): document the crucial environment variables for configuring the login settings in Langflow
📝 docs(login.mdx): provide information on how to disable automatic login and enforce user authentication in Langflow
📝 docs(login.mdx): explain the usage of LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD environment variables for setting up a superuser in Langflow
📝 docs(login.mdx): document the usage of LANGFLOW_SECRET_KEY environment variable for encrypting the superuser's password in Langflow
📝 docs(login.mdx): explain the purpose of LANGFLOW_NEW_USER_IS_ACTIVE environment variable for automatically activating new users in Langflow
📝 docs(login.mdx): provide information on the command-line interface for managing superusers in Langflow
📝 docs(login.mdx): document the sign-up process in Langflow and provide an image of the sign-up page
📝 docs(login.mdx): explain how users can change their profile settings in Langflow and provide an image of the profile settings page
📝 docs(login.mdx): explain how the superuser can access the admin page in Langflow and provide an image of the admin page
📝 docs(superuser.mdx): add guide for superuser permissions in Langflow
🔧 fix(cache/manager.py): add warning log message to inform users that RedisCache is experimental and may not work as expected
🔧 fix(settings/auth.py): add NEW_USER_IS_ACTIVE setting to determine if new users should be active by default
🔧 refactor(schemas.py): make the backend field in ProcessResponse schema optional to handle cases where backend is not provided
🔧 refactor(utils.py): add type hint ignore comment to import statement for Celery to avoid type checking error
✨ feat(manager.py): add debug logs to check Celery availability and backend being used
🔧 fix(manager.py): move check_celery_availability function definition above its usage to improve code readability
✨ feat(manager.py): add debug logs to show task launch details and backend being used
The `add_super_user_for_testing_purposes_delete_me_before_merge_into_dev` endpoint was added for testing purposes and is no longer needed. It has been removed to clean up the codebase.
🔧 fix(endpoints.py): generate session ID if it is None to ensure a valid session ID is used
🔧 fix(endpoints.py): add backend information to the ProcessResponse to provide additional context
🔧 fix(schemas.py): add backend field to the ProcessResponse schema to match the changes in the endpoints.py file
🐛 fix(conftest.py): update LANGFLOW_REDIS_HOST and BROKER_URL environment variables to use "result_backend" instead of "queue" for better clarity and accuracy
- Update RabbitMQ configuration by setting the default username and password to "langflow"
- Add OpenAI API key for integration with OpenAI services
- Add superuser credentials for the Langflow application
🐛 fix(locustfile.py): remove unused import and fix incorrect variable name
✨ feat(locustfile.py): add support for authentication and flow creation in on_start method
🔧 fix(endpoints.py): move import statement to the top of the file for better organization and readability
🔧 fix(getters.py): change service type from DATABASE_MANAGER to DATABASE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from CACHE_MANAGER to CACHE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from SESSION_MANAGER to SESSION_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from TASK_MANAGER to TASK_SERVICE for consistency and clarity
🔧 fix(getters.py): remove unused function get_chat_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_settings_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_db_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_session() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function setup_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_services() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_settings_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_session_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_services() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function get_session_override() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function distributed_client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function test_user() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function active_user
🐛 fix(test_endpoints.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_login.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_setup_superuser.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_user.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics