Sign inSign up

bothubit/bothub-engine

By bothubit

•Updated about 2 years ago

Image
0

50K+

bothubit/bothub-engine repository overview

BLACK LIVES MATTER

⁠BLACK LIVES MATTER

Black Lives Matter⁠ · Supporting the cause⁠ ·


Bothub

⁠Bothub

Build Status Coverage Status Code Climate Python Version License GPL-3.0

⁠Development

Use make commands to check_environment, install_requirements, lint, test, migrate, start, migrations and collectstatic.

CommandDescription
make helpShow make commands help
make check_environmentCheck if all dependencies was installed
make install_requirementsInstall pip dependencies
make lintShow lint warnings and errors
make testRun unit tests and show coverage report
make migrateUpdate DB shema, apply migrations
make startStart development web server
make start_celeryStart celery service
make migrationsCreate DB migrations files
make collectstaticCollects the static files into STATIC_ROOT
⁠Fill database using fake data

Run pipenv run python ./manage.py fill_db_using_fake_data to fill database using fake data. This can help you to test Bothub Webapp⁠.

⁠Migrate all training for aws

Run pipenv run python ./manage.py transfer_train_aws Migrate all trainings to an aws bucket defined in project settings.

⁠Enable all repository to train

Run pipenv run python ./manage.py enable_all_train

⁠Start Train in all repositories

Run pipenv run python ./manage.py start_all_repository_train

⁠Fake users infos:
nicknameemailpasswordis superuser
admin[email protected]⁠adminyes
user[email protected]⁠userno

⁠Production

Docker images available in Bothub's Docker Hub repository⁠.

⁠Deployment

⁠Heroku

Host your own Bothub Engine with [One-Click Deploy] (https://heroku.com/deploy⁠).

Deploy

⁠Environment Variables

You can set environment variables in your OS, write on .env file or pass via Docker config.

VariableTypeDefaultDescription
SECRET_KEYstringNoneA secret key for a particular Django installation. This is used to provide cryptographic signing, and should be set to a unique, unpredictable value.
DEBUGbooleanFalseA boolean that turns on/off debug mode.
BASE_URLstringhttp://api.bothub.itURL Base Bothub Engine Backend.
ALLOWED_HOSTSstring*A list of strings representing the host/domain names that this Django site can serve.
DEFAULT_DATABASEstringsqlite:///db.sqlite3Read dj-database-url⁠ to configure the database connection.
LANGUAGE_CODEstringen-usA string representing the language code for this installation.This should be in standard language ID format⁠.
TIME_ZONEstringUTCA string representing the time zone for this installation. See the list of time zones⁠.
STATIC_URLstring/static/URL to use when referring to static files located in STATIC_ROOT.
EMAIL_HOSTstringNoneThe host to use for sending email. When setted to None or empty string, the EMAIL_BACKEND setting is setted to django.core.mail.backends.console.EmailBackend
EMAIL_PORTint25Port to use for the SMTP server defined in EMAIL_HOST.
DEFAULT_FROM_EMAILstringwebmaster@localhostDefault email address to use for various automated correspondence from the site manager(s).
SERVER_EMAILstringroot@localhostThe email address that error messages come from, such as those sent to ADMINS and MANAGERS.
EMAIL_HOST_USERstring''Username to use for the SMTP server defined in EMAIL_HOST.
EMAIL_HOST_PASSWORDstring''Password to use for the SMTP server defined in EMAIL_HOST.
EMAIL_USE_SSLbooleanFalseWhether to use an implicit TLS (secure) connection when talking to the SMTP server.
EMAIL_USE_TLSbooleanFalseWhether to use a TLS (secure) connection when talking to the SMTP server.
ADMINSstring''A list of all the people who get code error notifications. Follow the pattern: [email protected]|Admin 1,[email protected]|Admin 2
CSRF_COOKIE_DOMAINstringNoneThe domain to be used when setting the CSRF cookie.
CSRF_COOKIE_SECUREbooleanFalseWhether to use a secure cookie for the CSRF cookie.
BOTHUB_WEBAPP_BASE_URLstringhttp://localhost:8080/The bothub-webapp production application URL. Used to refer and redirect user correctly.
SUPPORTED_LANGUAGESstring```enpt```
BOTHUB_NLP_BASE_URLstringhttp://localhost:2657/The bothub-blp production application URL. Used to proxy requests.
CHECK_ACCESSIBLE_API_URLstringhttp://localhost/api/repositories/URL used by bothub.health.check.check_accessible_api to make a HTTP request. The response status code must be 200.
SEND_EMAILSbooleanTrueSend emails flag.
BOTHUB_ENGINE_AWS_S3_BUCKET_NAMEstringNoneSpecify the bucket name to send to s3
BOTHUB_ENGINE_AWS_ACCESS_KEY_IDstringNoneSpecify the access key to send to s3
BOTHUB_ENGINE_AWS_SECRET_ACCESS_KEYstringNoneSpecify the secret access key to send to s3
BOTHUB_ENGINE_AWS_REGION_NAMEstringNoneSpecify the region to send to s3
BOTHUB_ENGINE_AWS_ENDPOINT_URLstringNoneSpecify the endpoint to send to s3, if sending to amazon s3, there is no need to specify a value
BOTHUB_ENGINE_AWS_SENDboolFalseAuthorize sending to s3
BOTHUB_BOT_EMAILstring[email protected]Email that the system will automatically create for existing repositories that the owner deleted the account
BOTHUB_BOT_NAMEstringBot RepositoryName that the system will use to create the account
BOTHUB_BOT_NICKNAMEstringbot_repositoryNickname that the system will use to create the account
BOTHUB_ENGINE_USE_SENTRYboolFalseEnable Support Sentry
BOTHUB_ENGINE_SENTRYstringNoneURL Sentry
BOTHUB_NLP_RASA_VERSIONstring1.4.3Specify the version of rasa used in the nlp worker
TOKEN_SEARCH_REPOSITORIESstringNoneSpecify the token to be used in the search_repositories_examples route, if not specified, the route is available without authentication
GOOGLE_API_TRANSLATION_KEYstringNoneSpecify the Google Translation API passkey, used in machine translation
APM_DISABLE_SENDboolFalseDisable sending Elastic APM
APM_SERVICE_DEBUGboolFalseEnable APM debug mode
APM_SERVICE_NAMEstring''APM Service Name
APM_SECRET_TOKENstring''APM Secret Token
APM_SERVER_URLstring''APM URL
APM_SERVICE_ENVIRONMENTstring''Environment that APM is running on
ENVIRONMENTstringproductionSpecify the environment you are going to run, it is also used for sentry
SUGGESTION_LANGUAGESstring```enpt_br```
N_WORDS_TO_GENERATEint4Specify the number of suggestions that will be returned for word suggestions
N_SENTENCES_TO_GENERATEint10Specify the number of suggestions that will be returned for intent suggestions
REDIS_TIMEOUTint3600Specify a systemwide Redis keys life time
SECRET_KEY_CHECK_LEGACY_USERstringNoneEnables and specifies the token to use for the legacy user endpoint.
OIDC_ENABLEDboolFalseEnable using OIDC.
OIDC_RP_CLIENT_IDstringNoneOpenID Connect client ID provided by your OP.
OIDC_RP_CLIENT_SECRETstringNoneOpenID Connect client secret provided by your OP.
OIDC_OP_AUTHORIZATION_ENDPOINTstringNoneURL of your OpenID Connect provider authorization endpoint.
OIDC_OP_TOKEN_ENDPOINTstringNoneURL of your OpenID Connect provider token endpoint.
OIDC_OP_USER_ENDPOINTstringNoneURL of your OpenID Connect provider userinfo endpoint.
OIDC_OP_JWKS_ENDPOINTstringNoneURL of your OpenID Connect provider JWKS endpoint.
OIDC_RP_SIGN_ALGOstringRS256Sets the algorithm the IdP uses to sign ID tokens.
OIDC_DRF_AUTH_BACKENDstringbothub.authentication.authorization.WeniOIDCAuthenticationBackendDefine the authentication middleware for the django rest framework.
OIDC_RP_SCOPESstringopenid emailThe OpenID Connect scopes to request during login.
CONNECT_GRPC_SERVER_URLstringlocalhost:8002Define grpc connect server url
CONNECT_CERTIFICATE_GRPC_CRTstringNoneAbsolute certificate path for secure grpc communication
RECAPTCHA_SECRET_KEYstring''Token of the recaptcha used in the validation of a user's registration.
REPOSITORY_NLP_LOG_LIMITint10000Limit of query size to repository log
REPOSITORY_RESTRICT_ACCESS_NLP_LOGSlist[]Restricts log access to a particular or multiple intelligences

⁠Roadmap

See the open issues⁠ for a list of proposed features (and known issues).

⁠License

Distributed under the GPL-3.0 License. See LICENSE for more information.

⁠Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Tag summary

Content type

Image

Digest

sha256:61ed328a9…

Size

826.9 MB

Last updated

about 2 years ago

docker pull bothubit/bothub-engine:6.16.0