Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

weni-ai/weni-engine

Repository files navigation

Build StatusCoverage StatusPython VersionLicense: MPL 2.0

Index

Running locally

Environment Variables List

License

Contributing

Running

git clone https://github.com/weni-ai/weni-engine.git

Keycloak

Docs |Docker

docker run -p 8080:8080 -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> jboss/keycloak

Keycloak will be running onhttp://localhost:8080

Setting up the clients

  1. Create a new realm, not recommended to use master realm

  2. Setup the clients

Each service uses a client

  • Backend:
    1. Create a client for the back-end
    2. Set your access type toconfidential
    3. Standard Flow Enabled: On
    4. Service Account Enabled: On
    5. Service Account Roles --> Client Roles --> realm-management (user related roles)
  • Frontend:
    1. Create a client for the front-end
    2. Access Type: public
    3. Standard Flow Enabled: on
    4. Direct Access Grants Enabled: On

Environment Variables

OIDC_RP_CLIENT_ID andOIDC_RP_CLIENT_SECRET refers to backend client credentials

<KEYCLOAK-SERVER-URL> could behttps://<your-keycloak-host>/ orhttps://your-keycloak-host/auth/ depending on the keycloak version

You can get theOIDC_RP_* variables at:https://your-keycloak-host/realms/<realm-name>/.well-known/openid-configuration

Ex for keycloak 16.1:http://127.0.0.1:8080/auth/realms/engine_realm/.well-known/openid-configuration

engine_realm as realm name

Required environment variables

SECRET_KEY=<SECRET_KEY>OIDC_RP_REALM_NAME=<KEYCLOAK-REALM-NAME>OIDC_RP_CLIENT_ID=<KEYCLOAK-CLIENT-ID>OIDC_RP_CLIENT_SECRET=<KEYCLOAK-CLIENT-SECRET>OIDC_OP_LOGOUT_ENDPOINT=<KEYCLOAK-SERVER-URL>/realms/<KEYCLOAK-REALM-NAME>/protocol/openid-connect/logoutOIDC_OP_TOKEN_ENDPOINT=<KEYCLOAK-SERVER-URL>/auth/realms/<KEYCLOAK-REALM-NAME>/protocol/openid-connect/tokenOIDC_RP_SCOPES=email profile openid offline_accessOIDC_OP_AUTHORIZATION_ENDPOINT=<KEYCLOAK-SERVER-URL>/realms/<KEYCLOAK-REALM-NAME>/protocol/openid-connect/authOIDC_RP_SIGN_ALGO= Sets the algorithm the IdP uses to sign ID tokens.OIDC_RP_SERVER_URL=<KEYCLOAK-SERVER-URL>OIDC_OP_USER_ENDPOINT=<KEYCLOAK-SERVER-URL>/auth/realms/<KEYCLOAK-REALM-NAME>/protocol/openid-connect/userinfoOIDC_OP_JWKS_ENDPOINT=<KEYCLOAK-SERVER-URL>/auth/realms/<KEYCLOAK-REALM-NAME>/protocol/openid-connect/certs

Environment Variables List

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_URLstringhttps://api.weni.aiURL Base Weni Engine Backend.
WEBAPP_BASE_URLstringhttps://dash.weni.aiURL Base Weni Webapp.
ALLOWED_HOSTSstring*A list of strings representing the host/domain names that this Django site can serve.
DEFAULT_DATABASEstringsqlite:///db.sqlite3Readdjango-environ to configure the database connection.
LANGUAGE_CODEstringen-usA string representing the language code for this installation.This should be in standardlanguage ID format.
TIME_ZONEstringUTCA string representing the time zone for this installation. See thelist of time zones.
STATIC_URLstring/static/URL to use when referring to static files located inSTATIC_ROOT.
CSRF_COOKIE_DOMAINstringNoneThe domain to be used when setting the CSRF cookie.
CSRF_COOKIE_SECUREbooleanFalseWhether to use a secure cookie for the CSRF cookie.
OIDC_RP_SERVER_URLstringNoneOpen ID Connect Server URL, example:https://accounts.weni.ai/auth/.
OIDC_RP_REALM_NAMEstringNoneOpen ID Connect Realm Name.
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_BACKENDstringweni.oidc_authentication.WeniOIDCAuthenticationBackendDefine the authentication middleware for the django rest framework.
AWS_ACCESS_KEY_IDstringNoneSpecify Access Key ID S3.
AWS_SECRET_ACCESS_KEYstringNoneSpecify Secret Access Key ID S3.
AWS_STORAGE_BUCKET_NAMEstringNoneSpecify Bucket Name S3.
AWS_S3_REGION_NAMEstringNoneSpecify the Bucket S3 region.
EMAIL_HOSTstringNoneThe host to use for sending email. When setted toNone or empty string, theEMAIL_BACKEND setting is setted todjango.core.mail.backends.console.EmailBackend
EMAIL_PORTint25Port to use for the SMTP server defined inEMAIL_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 toADMINS andMANAGERS.
EMAIL_HOST_USERstring''Username to use for the SMTP server defined inEMAIL_HOST.
EMAIL_HOST_PASSWORDstring''Password to use for the SMTP server defined inEMAIL_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.
SEND_EMAILSbooleanTrueSend emails flag.
INTELIGENCE_URLstringhttps://bothub.it/Specify the URL of the intelligence service.
FLOWS_URLstringhttps://new.push.al/Specify the URL of the flows service.
INTEGRATIONS_URLstringNoneSpecify the URL of the integration service.
USE_SENTRYboolFalseEnable Support Sentry
SENTRY_URLstringNoneURL Sentry
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
FLOW_GRPC_ENDPOINTstring'localhost:8002'gRPC Endpoint URL
INTELIGENCE_GRPC_ENDPOINTstring'localhost:8003'gRPC Endpoint URL
INTEGRATIONS_GRPC_ENDPOINTstring'localhost:8004'gRPC Endpoint URL
SYNC_ORGANIZATION_INTELIGENCEboolFalseEnable or Disable sync organization inteligences service
INTELIGENCE_CERTIFICATE_GRPC_CRTstringNoneAbsolute certificate path for secure grpc communication
FLOW_CERTIFICATE_GRPC_CRTstringNoneAbsolute certificate path for secure grpc communication
INTEGRATIONS_CERTIFICATE_GRPC_CRTstringNoneAbsolute certificate path for secure grpc communication
SEND_REQUEST_FLOWbooleanFalseEnables or disables sending user information to flows
FLOW_MARKETING_UUIDstringNoneUUID Flow
TOKEN_AUTHORIZATION_FLOW_MARKETINGstringNoneToken Authorization API Flow
BILLING_TEST_MODEbooleanFalseConfigure Test mode Billing
BILLING_SETTINGSjson{}Set configuration for gateways payment billing
BILLING_COST_PER_WHATSAPPfloatNoneSet cost for extra whatsapp
TOKEN_EXTERNAL_AUTHENTICATIONstringNoneToken External Authorization API
ENVIRONMENTstringproductionSpecify the environment you are going to run, it is also used for sentry

License

Distributed under the MPL-2.0 License. SeeLICENSE for more information.

Running

Install docker

Create an .env file in the project root and add the above environment variables

For authentication, we use Keycloak, you need to run it locally:

Executedocker-compose build to build application

Executedocker-compose up to up the server

Very good, your application is running 🚀

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make aregreatly 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

To see more go to theWeni Platform central repository.


[8]ページ先頭

©2009-2025 Movatter.jp